I noticed that GitHub and Facebook are both implementing this policy now, which restricts third party scripts from being run within their experience/site.
Is there a way to detect whether a document is running against CSP using JavaScript? I'm writing a bookmarklet, and want to give the user a message if they're on a site that doesn't support embedding a script tag.
<script>var test=true;</script>into the document and then check if the variable is set. If CSP is enforced (and your script is not allowed) this code block will not be executed at all.scriptonerror event, and see if that can get me anywhere.