Proposal: Declarative cross-origin communication in iframe and popup tags via Shared Worker #6555
Labels
addition/proposal
New features or enhancements
needs implementer interest
Moving the issue forward requires implementers to express interest
Context
Web developers need the ability to easily and securely communicate between different origins such as between their website and an iframe, or between their website and a new popup window, for example in the case of federated sign-in flows. However,
cross-origin-policy
makes those use cases very difficult to tackle with (#6364).Proposal
In #6553, one suggested a declarative mechanism of network isolation for insecure HTML tags, which would be more in line with the HTML specification and easier to use and to reason about for web developers.
Building up on that declarative mechanism, we could very easily declare cross-origin communication flows, such as the ones generally needed by web developers, by leveraging the
Shared Worker
technology.Examples
Website-Iframe Communication
For top and bottom level communication between the embedded
siteB.com
and the embeddersiteA.com
, we could declaratively make use of a shared worker from within theiframe
tag.From the main document at
siteA.com
:Meaning here that :
siteB.com
can not access anysiteA.com
resources (!https://siteA.com
),siteA.com
(https://siteA.com/sharedWorker.js
)*
)This way,
siteB.com
could pass information tositeA.com
(and vice versa) viasharedWorker.js
.Website-Popup communication
For popups, we should be able to do the exact same thing, by introducing a new
popup
HTML tag such as, from the main document atsiteA.com
we would have:The text was updated successfully, but these errors were encountered: