-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add cross-origin isolation flag #20
Conversation
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"trailingComma": "es5" | ||
"printWidth": 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran prettier and it fixed some stuff.
@@ -19,7 +19,8 @@ | |||
<body> | |||
<h1>StackBlitz SDK Examples</h1> | |||
<ul> | |||
<li><a href="/examples/open-embed-project-id/">Open and embed a StackBlitz project</a></li> | |||
<li><a href="/examples/open-embed-project-id/">Open and embed a StackBlitz EngineBlock project</a></li> | |||
<li><a href="/examples/open-embed-webcontainer/">Open and embed a StackBlitz WebContainer project</a></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new example to test loading WebContainer projects with and without the CORP headers.
<h1>Open and embed a StackBlitz WebContainer project</h1> | ||
<div> | ||
<label> | ||
<input type="checkbox" name="corp" /> Cross-Origin Isolation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking and unchecking this checkbox will load the page either with or without the CORP headers making it possible to test how embeds behave in different scenario's.
frame: HTMLIFrameElement, | ||
options: EmbedOptions = {} | ||
) { | ||
const allowList = target.allow?.split(';')?.map((key) => key.trim()) ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We copy the allow list which is already part of the iframe, and add cross-origin-isolated
if it's not yet there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🎉
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@stackblitz/sdk](https://togithub.com/stackblitz/sdk) | [`1.10.0` -> `1.11.0`](https://renovatebot.com/diffs/npm/@stackblitz%2fsdk/1.10.0/1.11.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@stackblitz%2fsdk/1.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@stackblitz%2fsdk/1.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@stackblitz%2fsdk/1.10.0/1.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@stackblitz%2fsdk/1.10.0/1.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>stackblitz/sdk (@​stackblitz/sdk)</summary> ### [`v1.11.0`](https://togithub.com/stackblitz/sdk/blob/HEAD/CHANGELOG.md#v1110-2024-07-02) [Compare Source](https://togithub.com/stackblitz/sdk/compare/cd886120d50b49c72c95bbb8093d25e18edf1a45...614e61fe8f50c419ed8414024899e37e69b1f999) - Add cross-origin isolation flag ([https://github.com/stackblitz/sdk/pull/20](https://togithub.com/stackblitz/sdk/pull/20)) - Fix and test format ([https://github.com/stackblitz/sdk/pull/21](https://togithub.com/stackblitz/sdk/pull/21)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ariakit/ariakit). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR adds a new
crossOriginIsolated
flag which in turn will set thecorp=1
query param when loading the embedded project.It will also add the
cross-origin-isolated
flag to the allow list of the iframe if it's not yet there.