fix(webview): route exposeFunctions callbacks to the originating frame#41919
Open
dcrousso wants to merge 1 commit into
Open
fix(webview): route exposeFunctions callbacks to the originating frame#41919dcrousso wants to merge 1 commit into
exposeFunctions callbacks to the originating frame#41919dcrousso wants to merge 1 commit into
Conversation
Member
|
Please add a test |
WebKit has no `Runtime.addBinding`, so the webview delegate has to handle bindings through `console.debug(BINDING_CALL_TAG, payload)` instead
the console message carries no execution context id, so every call was dispatched against the main frame, meaning a callback fired from a child frame (e.g. `frame.evaluate(..., { exposeFunctions: true })`) reached the wrong `BindingsController` and never resolved the calling frame's pending promise, hanging until the 30s timeout tore the page down
tag each call with an empty object created in the calling context, as an `objectId` carries the injected script id, meaning that the host can route the call to the frame it came from and release the marker afterwards
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dcrousso
force-pushed
the
fix-webview-frame-binding
branch
from
July 21, 2026 21:36
16e259c to
401d6fc
Compare
Contributor
Test results for "MCP"7792 passed, 1269 skipped Merge workflow run. |
Contributor
Test results for "tests 1"3 flaky50053 passed, 1190 skipped Merge workflow run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebKit has no
Runtime.addBinding, so the webview delegate has to handle bindings throughconsole.debug(BINDING_CALL_TAG, payload)insteadthe console message carries no execution context id, so every call was dispatched against the main frame, meaning a callback fired from a child frame (e.g.
frame.evaluate(..., { exposeFunctions: true })) reached the wrongBindingsControllerand never resolved the calling frame's pending promise, hanging until the 30s timeout tore the page downtag each call with an empty object created in the calling context, as an
objectIdcarries the injected script id, meaning that the host can route the call to the frame it came from and release the marker afterwards