WICG / fenced-frame

Proposal for a strong boundary between a page and its embedded content
https://wicg.github.io/fenced-frame/
Other
120 stars 29 forks source link

Spec cross-origin reportEvent() support #152

Closed blu25 closed 2 months ago

blu25 commented 3 months ago

Reporting beacons can now be sent with window.fence.reportEvent() from documents that are cross origin to a fenced frame config's mapped URL. To do this, there must be opt-in from both the document created with the FencedFrameConfig as well as the cross-origin document that wants to send the beacon. The document created with the FencedFrameConfig opts in with a new "Allow-Cross-Origin-Event-Reporting=true" response header. The cross-origin document opts in by calling reportEvent() with the crossOriginExposed=true parameter.

This PR updates the spec to match that behavior. More specifically:


Preview | Diff

domfarolino commented 2 months ago

window.fence.reportEvent() will now support being sent from documents

Methods cannot be sent. Do you mean exposed? Or am I missing something?

domfarolino commented 2 months ago

The same-origin document opts in with a new "Allow-Cross-Origin-Event-Reporting=true" response header. The cross-origin document opts in by calling reportEvent() with the crossOriginExposed=true parameter.

~Can you link to the rationale for why these are different?~

Edit: I think I misunderstood. Is "the same-origin document" just the fenced frame document? That is, the document created by the FencedFrameConfig, i.e., the top-level document in a <fencedframe> element?

blu25 commented 2 months ago

window.fence.reportEvent() will now support being sent from documents

Methods cannot be sent. Do you mean exposed? Or am I missing something?

I mean exposed. The wording should be "Beacons can be sent with window.fence.reportEvent() from documents that are cross-origin..."

The same-origin document opts in with a new "Allow-Cross-Origin-Event-Reporting=true" response header. The cross-origin document opts in by calling reportEvent() with the crossOriginExposed=true parameter.

~Can you link to the rationale for why these are different?~

Edit: I think I misunderstood. Is "the same-origin document" just the fenced frame document? That is, the document created by the FencedFrameConfig, i.e., the top-level document in a <fencedframe> element?

Yes. Same-origin iframes embedded in fenced frames have no control over the opt-in process. I'll update the wording to match that.