Repository navigation
fix(contexts): look up an iframe's parent among pages and iframes only (#640) - #643
Merged
Merged
Conversation
#640) A connected worker passed the lookup, so Ferrum built a Page on the worker's session and Page.enable raised in the Target.targetCreated handler. That killed the event thread on 0.18.0 and left the iframe unregistered with its parent.
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.
Fixes #640.
When an iframe target is created,
Contextslooks for the page that owns its frame. The lookup accepted any connected target, including dedicated workers, so it calledtarget.pageon a worker, which sentPage.enableto the worker session and raisedBrowserError: 'Page.enable' wasn't foundinside theTarget.targetCreatedhandler:mainthe subscriber survives (fix(client): keep Ferrum's threads from taking the host process down #632), but the handler still aborts and leaves a half-builtPagesubscribed on the worker session.A worker is reached whenever no earlier target owns the frame. As the reporter found, the common trigger is Chrome's built-in PDF viewer: an embedded PDF creates out-of-process iframe targets even with site isolation disabled, and the PDF frame nested in the viewer is unknown to the page, so the lookup falls through to the workers. A page with a web worker that embeds a PDF reproduces it with Ferrum's default flags; site isolation (e.g. a remote Chrome launched without Ferrum's flags) is another trigger.
The lookup now only considers page and iframe targets, so
Pageis never built for a worker. Iframes without an owner are still registered through auto-attach.No spec is included. Verified manually by embedding a PDF in a page with web workers on Ferrum's default flags:
mainwarns with the error above, this branch doesn't.