-
Notifications
You must be signed in to change notification settings - Fork 259
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
Issue with cross-origin isolation #952
Comments
This is an interesting problem @swissspidy! And it goes deep. So first, Gutenberg uses a blob as a source for that iframe. Unfortunately, This means there's a network request involved, and so there is also a HTTP response where specific cross-origin headers may be required. My last attempt to use these Cross-Origin headers broke YouTube embeds, though. I just tried making the editor iframe I'm not sure if there's a good solution here, given how easily Service Workers give up. Could you perhaps disable the Cross-Origin isolation when the plugin is running in Playground? Here's some related resources: |
What I just tried now though is disabling the editor iframing in Gutenberg by registering a fake block with an old API version. See swissspidy/media-experiments@91b983d That now makes the post editor at least work again, but turns out Unfortunately the majority of the plugin's features, such as using wasm-vips to compress images, require I'll try to see whether I can turn off those features to have at least a very trimmed down version working in playground. Can't hurt to add some hardening for such cases in my plugin. |
Surfacing an in-person chat on CloudFest: The only solution seems to be adding an on/off switch to Playground to enable/disable the CORP headers. Both modes have value:
There doesn't seem to be a middle-ground where we can get both at the same time. |
Related: swissspidy/media-experiments#384 |
I’m not 100% sure whether this issue I’m having needs fixing in playground or Gutenberg.
I’m trying to get my Media Experiments plugin running in playground. To try it: https://playground.wordpress.net/?mode=seamless&blueprint-url=https://raw.githubusercontent.com/swissspidy/media-experiments/main/blueprints/playground.json
The plugin sets
Cross-Origin-Opener-Policy: same-origin
andCross-Origin-Embedder-Policy: require-corp
HTTP headers on the post editor page to force cross-origin isolation.The block editor is iframed. The Iframe component tries to access
node.contentDocument
but because the iframe seems to be on a different origin, that property is null and the editor crashes.Do you have any idea how this issue could be resolved? I’d really love folks to be able to test my plugin in playground.
The text was updated successfully, but these errors were encountered: