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

build: fix SvelteKit CSP 'stric-dynamic' issue in Firefox #1451

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Oct 13, 2022

Motivation

Using a CSP 'strict-dynamic' with SvelteKit breaks in Firefox.

Solution

Extracting the script content that gets injected by SvelteKit in index.html into a separate JS script that gets appended with a script loader.

Exact same "script loader" as the one we use to use for Rollup.

Issue

Changes

  • update build.csp.mjs to extract script
  • add script loader to app.html

Screenshot

Capture d’écran 2022-10-13 à 17 50 46

Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

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

I few comments to better explain what's going on and to avoid us to remove some of these in the future.

But already approving.

@peterpeterparker peterpeterparker enabled auto-merge (squash) October 13, 2022 16:11
@peterpeterparker peterpeterparker merged commit 74f0b70 into main Oct 13, 2022
@peterpeterparker peterpeterparker deleted the build/fix-sveltekit-csp-firefox branch October 13, 2022 16:28
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