Skip to content

Commit e409489

Browse files
committed
get iframes working
due to our cross origin headers we need to add the credentialless attribute to our iframes. Sadly it's experimental and they only work in Chrome so far.
1 parent 8aec67c commit e409489

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

apps/svelte.dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Cross-Origin-Opener-Policy: same-origin
1717

1818
Because we're doing soft navigation between pages, these headers need to be set for all responses, not just the ones from `/tutorial`.
1919

20-
The result of setting these headers is that the site can no longer embed URLs from other sites (like images from another domain) without those domains either having a `cross-origin-resource-policy: cross-origin` header (which most don't) or us adding the `crossorigin="anonymous"` attribute to the elements that load those URLs.
20+
The result of setting these headers is that the site can no longer embed URLs from other sites (like images from another domain) without those domains either having a `cross-origin-resource-policy: cross-origin` header (which most don't) or us adding the `crossorigin="anonymous"` attribute (or the experimental-only-working-in-chrome `credentialless` for iframes) to the elements that load those URLs.
2121

2222
When writing content for the tutorial, you need to be aware of the differences of loading content:
2323

apps/svelte.dev/content/blog/2023-09-20-runes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Svelte 5 changes all that with _runes_, which unlock _universal, fine-grained re
3131
<div class="max">
3232
<figure style="max-width: 960px; margin: 0 auto">
3333
<div style="aspect-ratio: 1.755; position: relative; margin: 0 auto;">
34-
<iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; margin: 0;" src="https://www.youtube-nocookie.com/embed/RVnxF3j3N8U" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
34+
<iframe credentialless style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; margin: 0;" src="https://www.youtube-nocookie.com/embed/RVnxF3j3N8U" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
3535
</div>
3636

3737
<figcaption>Introducing runes</figcaption>

apps/svelte.dev/content/blog/2024-04-30-svelte-5-release-candidate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can learn more about the new features from the [preview documentation](https
3030
<div class="max">
3131
<figure style="max-width: 960px; margin: 0 auto">
3232
<div style="aspect-ratio: 1.755; position: relative; margin: 0 auto;">
33-
<iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; margin: 0;" src="https://www.youtube-nocookie.com/embed/xCeYmdukOKI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
33+
<iframe credentialless style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; margin: 0;" src="https://www.youtube-nocookie.com/embed/xCeYmdukOKI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
3434
</div>
3535

3636
<figcaption>What You Can Do For Your Framework</figcaption>

0 commit comments

Comments
 (0)