I have a script that adds members to a Facebook group, but I have a problem that the script is long, so I want to shorten it, so that’s why I use a code that call it through a source file uploaded to server; the code is this:
javascript:(function(){document.body.appendChild(document.createElement('script')).src='URL';})();
But the code is not working; it says:
Refused to load the script ‘My Script URL’ because it violates the
following Content Security Policy directive: “script-src
https://.facebook.com http://.facebook.com https://.fbcdn.net
http://.fbcdn.net *.facebook.net *.google-analytics.com
*.virtualearth.net .google.com 127.0.0.1: *.spotilocal.com:* chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl ‘unsafe-inline’
‘unsafe-eval’ https://.akamaihd.net http://.akamaihd.net”.
What do I have to do to fix this?
Don’t load the script from a server. Add it as a resource to your extension, and it should work fine.