Trying to download a page in a popup code but it returns status of zero.
console.log("Req");
var req = new XMLHttpRequest();
req.open(
"GET",
"http://www.google.com",
true);
req.onload = function() {
console.log("DONE!!!");
console.log(req.responseText);
}
req.send(null);
I did set this in my manifest:
"permissions": [
"http://www.google.com"
]
Whats wrong? Why the response is zero?
Google.com is not the best page for testing. I bet when you open it in a browser it redirects you to your localized google page (it redirects me to
http://www.google.cafor example). So you would need to add that redirected url to the permissions as well.Another problem is that your permission domain does not end with
/: