最佳答案
I was trying to include JQuery on an existing website using console this way:
var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.11.1.min.js';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
Then I got this error:
Content Security Policy: The page's settings blocked the loading of a resource at http://code.jquery.com/jquery-1.11.1.min.js ..
During development I might want to include external Javascript. I might not want to copy paste the entire JQuery code since it does not look neat. How to override the content security policy for development purposes?
This would be really useful for quick testing. I might want to convert the script I am writing to a browser extension later on.
Note (update): I am writing the script over an existing website and do not have control over setting the Content-Security-Policy header.