-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain the differences between sandboxed frames #38
Comments
IIUC the question is about why we haven't used unique origin for fenced frames similar to !allow-same-origin. There were a few considerations:
The other difference with sandbox iframes is that even if they have a unique opaque origin they can still have communication with the top-level frame via window.top, window.parent, joint history, post message (I think) etc. and fenced frames do not have any of those. |
Right so the core differences as I see them:
Are there any other parts I'm missing? Could this be instead handled by:
|
Note that fenced frames don't have nonce in the origin but in the storage partitioning and cookie partitioning keys. And storage partitioning key also partitions broadcastChannel thus restricting any same-origin communication between 2 different fenced frame trees.
Since the origin doesn't contain the nonce as mentioned in the above point, any same-origin iframes withing the fenced frame tree will continue to stay same-origin. Note that the storage partitioning key's nonce is the same for all iframes in the same fenced frame tree.
Yes, because of the same reason as mentioned in (i)
do you mean the urn:uuid? There is nothing stopping the embedder to create two fenced frames with the same urn:uuid but they will both have different storage key nonce and so cannot communicate with each other.
right.
There are also other side channels that can be used as communication channels between the fenced frame and the embedding frame, and are therefore restricted. e.g. no joint history (see here), no permission policy and cspee delegation (see here), no programmatic focus switch between fenced frames and embedding frame, no resizing allowed, intersection observer to be changed (we are working on the specifics there) etc. (more of these side channels are listed in this document)
As discussed above, there are multiple channels that need to be mitigated for fenced frames which makes them different from iframes. Spec-wise in many ways they behave like top-level browsing contexts (window.top/parent etc.) so if the API was iframe it would still require spec and implementation changes for them to behave like top-level browsing contexts. Iframes already have a combination of flags e.g. sandbox, allow, cspee etc. and having a new flag that governs a bunch of behavioral characteristics would be a hard to follow in how it interacts with the other flags. Infact there are discussions ongoing about considering multiple fenced frame elements for its different modes (issue). |
Given that there are no outstanding action items or questions on this issue, I'll go ahead and close this. Thanks. |
I think the explainer would benefit from a document/section that explains the core differences to sandboxed iframes like the following:
Sandboxed frames are treated as a top level origin if they're opaque (!allow-same-origin).
I'm quite interested if the existing primitives of the web can be used rather than these new ones.
The text was updated successfully, but these errors were encountered: