-
Notifications
You must be signed in to change notification settings - Fork 285
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
Inline scripts break Content Security Policy #145
Labels
enhancement
New feature or request
Milestone
Comments
This is basically beyond my knowledge 😅. But I prefer the 4th solution too. |
I've set CSP to |
palant
added a commit
that referenced
this issue
May 22, 2020
… scripts for the theme switcher (fixes #145)
palant
added a commit
that referenced
this issue
May 26, 2020
* fix: Move loading JavaScript to the top of the page, don't use inline scripts for the theme switcher (fixes #145) * fix: Do not use an inline script for HTTPS redirect * chore: Actually remove the inline script from page head * chore: Use scratch again (a private one) and fix lunr search * fix: Move third-party scripts back to the bottom of the page BREAKING CHANGE: custom.js is loaded at the top of the page now, before the page elements are available
ulmefors
pushed a commit
to ulmefors/hugo-theme-meme
that referenced
this issue
Nov 22, 2020
* fix: Move loading JavaScript to the top of the page, don't use inline scripts for the theme switcher (fixes reuixiy#145) * fix: Do not use an inline script for HTTPS redirect * chore: Actually remove the inline script from page head * chore: Use scratch again (a private one) and fix lunr search * fix: Move third-party scripts back to the bottom of the page BREAKING CHANGE: custom.js is loaded at the top of the page now, before the page elements are available
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For security reasons, it's a good idea to have a Content Security Policy saying something like
script-src: 'self'
- only scripts from this website allowed, and no inline scripts. This offers a good protection layer against Cross-Site Scripting attacks.Now this doesn't quite work with MemE, two scripts are potentially defined inline: theme switcher and HTTPS switcher. It seems that the possible solutions are:
What do you think?
The text was updated successfully, but these errors were encountered: