Implement Page.createIsolatedWorld
Categories
(Remote Protocol :: CDP, enhancement, P1)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: impossibus, Assigned: impossibus)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [puppeteer-alpha])
Attachments
(6 files)
Creates an isolated world for the given frame and returns an execution context for it.
Example:
puppeteer:protocol SEND ► {"sessionId":"x","method":"Page.createIsolatedWorld","params":{"frameId":"dddddd","grantUniveralAccess":true,"worldName":"__puppeteer_utility_world__"},"id":14}
puppeteer:protocol ◀ RECV {"method":"Runtime.executionContextCreated","params":{"context":{"id":2,"origin":"","name":"__puppeteer_utility_world__","auxData":{"isDefault":false,"type":"isolated","frameId":"dddddd"}}},"sessionId":"x"}
puppeteer:protocol ◀ RECV {"id":14,"result":{"executionContextId":2},"sessionId":"x"}
Assignee | ||
Comment 1•5 years ago
|
||
This is why gutenberg tests hang in test setup at Puppeteer methods like Page.focus
and Page.click
. Every Puppeteer Frame has two DOMWorlds, "main" and "secondary". The secondary is created in FrameManager._ensureIsolatedWorld
as mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1587452#c1
Since we don't implement Page.createIsolatedWorld yet, we never create an execution context for the secondary world and so Puppeteer hangs waiting for that execution context. Puppeteer Page methods like click, focus, select, hover, tap all rely on the secondary world.
Comment 2•5 years ago
|
||
It looks like it was added in https://github.com/GoogleChrome/puppeteer/issues/2671
There is an empty function in https://searchfox.org/mozilla-central/source/remote/domains/content/Page.jsm#120
Speaking to Andreas there is an example in Runtime.jsm https://searchfox.org/mozilla-central/source/remote/domains/content/Runtime.jsm
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
According to the CDP viewer, the type of FrameId is string.
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D55165
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D55166
Assignee | ||
Comment 6•5 years ago
|
||
Dismantle the assumption that there is one ExecutionContext per
inner window and generate a fresh id for each ExecutionContext
rather than reusing the inner window id.
As a bonus, also emit Runtime.executionContextsCleared.
Depends on D55167
Assignee | ||
Comment 7•5 years ago
|
||
This does not support the grantUniversalAccess parameter.
It just creates a new execution context.
Depends on D55168
Assignee | ||
Comment 8•5 years ago
|
||
As noted in Bug 1602083, the CDP viewer implies that execution context management
is independent of the Runtime domain, which makes sense with the behaviour of methods
like Page.createIsolatedWorld.
This is a first step in that direction.
Depends on D55168
Depends on D55168
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f2d4096ee285
https://hg.mozilla.org/mozilla-central/rev/4a9491dbf5b1
https://hg.mozilla.org/mozilla-central/rev/ca7c88a4a9e3
https://hg.mozilla.org/mozilla-central/rev/c6be67f53106
https://hg.mozilla.org/mozilla-central/rev/8e0ad3f91d48
https://hg.mozilla.org/mozilla-central/rev/2bf39a9a1a78
Updated•4 years ago
|
Description
•