Closed Bug 1867667 Opened 3 months ago Closed 3 months ago

Serialization of WindowProxy fails for out-of-process iframes

Categories

(Remote Protocol :: WebDriver BiDi, defect, P1)

defect
Points:
2

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: whimboo, Assigned: Sasha)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m9][webdriver:relnote])

Attachments

(2 files)

As seen on https://github.com/w3c/webdriver-bidi/issues/418 we currently fail to correctly serialize the .contentWindow property of an OOP iframe. Due to that we return a plain object but not a WindowProxy remote value.

As example you can use that page to create an iframe with a cross-origin URL:
https://mathiasbynens.github.io/css-dbg-stories/iframe-navigations.html

When trying to serialize window.frames[0] an object is returned because we only check the class name. But given that this is a magic object this fails. Instead we need to run a check with Window.isInstance(value) to properly run this check here:

https://searchfox.org/mozilla-central/rev/d84469b005106c5ab0f65e283f71c1415ce76c54/remote/webdriver-bidi/RemoteValue.sys.mjs#922

Sasha, would you mind to take that? It's needed so that we can get rid of the Fission related preferences from Puppeteer for BiDi.

Assignee: nobody → aborovova
Status: NEW → ASSIGNED
Pushed by aborovova@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f716db0179c3
[bidi] Use correct check to identify WindowProxy in the serialization. r=webdriver-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/ee79c48e48ea
[wdspec] Add test cases for serialization of cross-origin iframes. r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43477 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Upstream PR merged by moz-wptsync-bot
Points: --- → 2
Priority: -- → P1
Whiteboard: [webdriver:m9]
Whiteboard: [webdriver:m9] → [webdriver:m9][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.