Missing script.realmCreated event for new browsing contexts
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox147 fixed)
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: hbenl, Assigned: Sasha)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m18][wptsync upstream][webdriver:relnote])
Attachments
(2 files)
Some Playwright tests (like this one) recently regressed because Firefox is no longer sending the script.realmCreated event for all new BrowsingContexts (I haven't yet figured out the exact circumstances when this happens). Due to that, evaluations for those BrowsingContexts hang in Playwright and console messages from them are ignored.
Since the regression started on 2025-11-25, I suspect Bug 543435 to be the cause.
Comment 1•1 month ago
|
||
Do we not run any of those tests in CI? If not, could we?
| Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
I've created the wdspec test to illustrate the issue.
It looks like the problem is that DOMWindowCreated event now gets dispatched for window.open very early, and this event leads to an attempt to send script.realmCreated event. But when we try to send the event, we can not do it because the browser element is not attached yet to the browsing context, and we need it to get the browsing context id. And because we can not get the browsing context id, we can not send the event.
So shortly, DOMWindowCreated event is sent before browser element gets attached to browsing context and that's an issue for us at the moment.
Comment 4•1 month ago
|
||
So we probably should wait until the browsing context has been created. Also we need to keep in mind that we should first send browsingContext.contextCreated before script.realmCreated because a realm cannot exist without a browsing context (window).
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Reporter | ||
Comment 5•1 month ago
•
|
||
FWIW I just noticed (looking at this passing Playwright test) that Firefox sends the script.realmCreated event if the BrowsingContext was opened using window.open(url, null, 'noopener') but not when it was opened with window.open(url).
Likewise, clicking <a target=_blank rel=noopener href="..."> will send that event but clicking <a target=_blank rel=opener href="..."> won't.
| Assignee | ||
Comment 6•1 month ago
|
||
Comment 8•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7c2b2271280c
https://hg.mozilla.org/mozilla-central/rev/f1daec7ab2cd
Updated•1 month ago
|
Updated•9 days ago
|
Description
•