I am trying to access data from a website in my Chrome extension background page. However, I keep getting an error.
I packed the extension and installed it by drag-n-drop into chrome://extensions. It does ask me for permission to view all websites.
Manifest:
"permissions": ["webNavigation", "tabs", "*://*/*", "http://www.google.com/"],
Background.js:
chrome.browserAction.onClicked.addListener(function(tab) {
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://www.google.com", true);
xhr.send();
}
Errors
Refused to connect to 'http://www.google.com/' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
Error in event handler for browserAction.onClicked: SecurityError: Failed to execute 'open' on 'XMLHttpRequest': Refused to connect to 'http://www.google.com/' because it violates the document's Content Security Policy.