Skip to content
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

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Add cross-origin isolation flag #20

merged 1 commit into from
Jul 2, 2024

Conversation

SamVerschueren
Copy link
Contributor

This PR adds a new crossOriginIsolated flag which in turn will set the corp=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.

"arrowParens": "always",
"bracketSpacing": true,
"trailingComma": "es5"
"printWidth": 100,
Copy link
Contributor Author

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>
Copy link
Contributor Author

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
Copy link
Contributor Author

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()) ?? [];
Copy link
Contributor Author

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.

Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🎉

CHANGELOG.md Show resolved Hide resolved
@SamVerschueren SamVerschueren merged commit 008665a into main Jul 2, 2024
2 checks passed
@SamVerschueren SamVerschueren deleted the feat/corp branch July 2, 2024 14:15
diegohaz referenced this pull request in ariakit/ariakit Jul 6, 2024
[![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://github.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 (@&#8203;stackblitz/sdk)</summary>

###
[`v1.11.0`](https://github.com/stackblitz/sdk/blob/HEAD/CHANGELOG.md#v1110-2024-07-02)

[Compare
Source](https://github.com/stackblitz/sdk/compare/cd886120d50b49c72c95bbb8093d25e18edf1a45...614e61fe8f50c419ed8414024899e37e69b1f999)

- Add cross-origin isolation flag
([https://github.com/stackblitz/sdk/pull/20](https://github.com/stackblitz/sdk/pull/20))
- Fix and test format
([https://github.com/stackblitz/sdk/pull/21](https://github.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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants