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

Fix supportsImportMaps feature detection on null origins #131

Merged
merged 1 commit into from Jun 10, 2021
Merged

Fix supportsImportMaps feature detection on null origins #131

merged 1 commit into from Jun 10, 2021

Conversation

heypiotr
Copy link
Contributor

@heypiotr heypiotr commented Jun 9, 2021

Fixes #127.

In Safari (and Chrome*), import maps feature detection via a blob: iframe fails on null origins (such as file:, but I guess it might also fail e.g. in sandboxed iframes) — parent._$s(v) fails with a CORS error.

* This of course is not really a problem in Chrome, since they support import maps natively anyway. Interestingly enough, it doesn't fail in Firefox, so it looks like Firefox has more lax null origin restrictions?

This PR proposes to use srcdoc instead of src="blob:... for the iframe, which seems to work.

@guybedford guybedford merged commit d6a4943 into guybedford:main Jun 10, 2021
@guybedford
Copy link
Owner

Looks great, thank you for the fix. Published in 0.10.7.

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.

Feature detection hangs in Safari on file://
2 participants