Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCross-origin Iframe postMessage question #23689
Comments
|
Ok so I can confirm the origin of the window and the iframe are: window: http://web-platform.test:8000 Are we treating this a cross-origin internally, or actually running those on the same event-loop? Getting the However, I can transfer ports using Could it be that the |
|
Ok so the test ends-up using the And looking at how we share event-loops, I'm pretty sure So I'm wondering, since that test(and a lot of others) have "cross-origin" in their description yet rely on this From my perspective "cross-origin" always implied different event-loops, and any access to a "cross-origin" window would be via this For example: these two tests are meant to test the same thing but in either same- or cross-origin contexts:
Yet currently, in Servo, both will be using Maybe this was expected to others, but I'm surprised. For example, there doesn't seem to a single webmessaging test that would hit cc @asajeffrey @jdm |
|
Ok so I think what we do is basically compliant with the concept of same-agent-window-objects, but, there is a spectre angle. |
As part of #23637, I noticed something strange when running this test: https://github.com/servo/servo/blob/f4ff9e2eeb254a81f7b4ec9a43fe01fed2777b1a/tests/wpt/web-platform-tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm
Basically, I ran it at a commit before actually adding the
transferargument to:servo/components/script/dom/dissimilaroriginwindow.rs
Line 138 in f4ff9e2
Yet, from adding a few console.log, I could see that the ports were actually transferred to the iframe(leading me to proclaim cross-origin was working).
Yet, how can this have happened since
DissimilarOriginWindow.PostMessagedidn't support thetransferargument at that time?Either the test is not really cross-origin, or somehow we ended-up using a local windowproxy instead of a cross-origin one?
I intend to look into this further, yet I wonder if anyone can see something obvious I might be missing...