In background page:
var w = window.open(URL,'Example','width=675,height=350');
temp.page=setInterval(function(){
if (w.location.href!=URL) {
clearInterval(temp.page);
alert(w.location.href); //undefined
w.close();
}
},1000);
So, why w.location.href is undefined and why I can’t access to do any scripts in w (w.document.write('qweqwe');//document==undefined)?
I need to:
1. Open page with URL.
2. Detect redirect.
3. Get URL whereto page have redirected me.
4. Do something with the second URL.
I added domain name of site in permissions, in manifest, and now I’m able to make AJAX requests to this domain.
Also permission “tabs” was helpful.