Repository navigation
Conversation
|
It appears some commit hook is converting all .md filed to crlf. I am checking it as lf and have no conversion enabled. |
MarshallOfSound
left a comment
There was a problem hiding this comment.
This method is deprecated in blink and will be removed in a future version. I'm against adding a dependency on a method that we know is going to be removed.
|
Is it also going to be removed? Then what's the right method to use? The deprecation comment says "Prefer requestExecuteScriptInIsolatedWorld", assuming they mean |
|
@bughit As our current implementation returns a promise we can transparently switch to using There is the current limitation on Chromium's side that that API does not allow you to pass in the main world ID, but that seems easily fix-able and we will probably do that. We can't support a synchronous version here with Chromium's intention to remove all synchronous versions of those APIs. |
@MarshallOfSound not sync execution The chrome APIs have an async (callback) interface but they can be executed synchronously and that's not going away. Please reopen this, I can at least try adding sync versions using the exiting APIs (RequestExecuteScript..). Please understand that for years these could be used synchronously without any issue, consistently, reliably, with no exceptions, despite having callback interface, and still can be. |
|
@MarshallOfSound It is definitely possible to add a sync method based on RequestExecuteScript, that returns the value delivered by the sync callback and throws if the callback was not called (it will quietly delete itself when called later). The only reason it would ever not be called sync is if the FrameLifecycleState is not kRunning, something I have never seen, I am guessing it never just happens spontaneously, but regardless, that possibility would be covered. Do object to even that? Why? |
Description of Change
Before the promisification (#17312) of
WebFrame#executeJavaScript*their interface was async (callback) but behavior was sync (callback called before the methods returned). So they could be used in sync code (or async, you could wrap them in a promise yourself). The switch from a callback to a promise interface made it impossible to use them in sync mode (#19161), which was a breaking change without a workaround.This PR exposes the sync js exec methods on WebFrame, providing a workaround for code that used the original methods synchronously. In general, a sync in-process js eval makes perfect sense, because it's sync under the hood.
Fixes #19161
Checklist
npm testpassesRelease Notes
Notes: add sync javascript execution methods to WebFrame