Media: Stop injecting crossorigin attributes under Document-Isolation-Policy - #13446
Media: Stop injecting crossorigin attributes under Document-Isolation-Policy#13446adamsilverstein wants to merge 1 commit into
Conversation
…-Policy. `isolate-and-credentialless` loads cross-origin subresources without credentials instead of blocking them, so scripts, styles, images, audio, and video from other origins work without a `crossorigin` attribute. Forcing `crossorigin="anonymous"` turns each load into a CORS request, which fails for any host that does not send `Access-Control-Allow-Origin`, such as media offloaded to a CDN. The injection dates from the `require-corp` era of the Gutenberg experiment, where it was needed for anything cross-origin to load. It was carried over unchanged when the editor switched to DIP, and has since caused two regressions (IMG previews, #65673) and a white screen from the tag processor running inside an output buffer display handler (#65930). Send the header directly, deprecate the output buffer helper and the attribute injector, and drop the matching injection from the media templates. Props khokansardar, b0b3k, ianmjones, westonruter, andrewserong. Fixes #65930. See #65673, #64766.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Please note the RC for 7.1.1 is September 10th if we want it included in that version. Otherwise it is fine to punt to 7.1.2. |
Trac ticket: https://core.trac.wordpress.org/ticket/65930
I spent some time testing what
isolate-and-credentiallessactually blocks before deciding how to fix the bookmark bug in #13221, and it turns out thecrossorigininjection is not doing anything useful under DIP. So this removes it rather than patching it. Companion Gutenberg PR: WordPress/gutenberg#82614. Safari keeps its injection through the Client-Side Media Everywhere plugin: adamsilverstein/client-side-media-everywhere#63.Claude ran the browser tests and wrote up the change, here is the summary:
AI Use
Code and description both written with 🤖 Claude Code. I will review and test.