CSP prevents scriptlets and extCSS rules from working #304
Labels
Bug
Something isn't working
Medium
P3: Medium
Medium priority
Priority: P3
Resolution: Won't Fix
Status: Closed
Version: Safari v1.8
Wontfix
This will not be worked on
Milestone
Issue Details
Expected Behavior
Setting a CSP that does not include 'unsafe-inline' for "script-src", I expect any inline scripts on a page I navigate to not to run (and trigger an error in the console).
Otherwise, I should see no difference in documents that comply with the policy.
Actual Behavior
Pages (even those without any script whatsoever) trigger an error,
in the console, referring to
<URL>:0
– yes, line zero (!) – which contains only the codeand the error message
Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.
Screenshots
Screenshot:
Additional Information
I'm getting a Content Security Policy error on the first line of the document on pages that disable script-src 'unsafe-inline', for some reason.
Seems to only be the case when CSP is set via HTTP-response headers, as opposed to meta-tags in the HTML document. This only happens in Safari.
I made a POC here (should be served with apache2).
Can be reproduced on the following pages:
https://www.eivindarvesen.com/blog/2019/07/19/introducing-cleave
https://github.com/EivindArvesen/prm
The text was updated successfully, but these errors were encountered: