tc39 / proposal-mass-proxy-revocation

Proposal for revoking proxies en masse.
MIT License
5 stars 1 forks source link

Prior art example: iframes and the DOM they contain #21

Open ajvincent opened 1 year ago

ajvincent commented 1 year ago

@caridy You mentioned this in a SES meeting, and I'd appreciate some elaboration.

caridy commented 1 year ago

Today, the object graphs of both, the main window and a same-domain iframe can be mixed, meaning you can hold references to objects from another realm, additionally, the iframe has access to various DOM APIs. Once the iframe is removed (we call it detach) from the DOM, all those DOM APIs associated to the iframe, and accessible to the functions in memory are automatically placed in a state that will throw if those APIs get called because the iframe does not have an origin anymore. That's not the same behavior for language features, since those do not require access to the host behavior. In essence, a detached iframe revokes a bunch of internal stuff that when invoked, should throw errors.