I have this problem, I can’t get the url of a window I open.
If I use
window.location
I get the result, but when I execute
window.location.origin
or others, nothing comes back to me, what can I do?
I see the error in catch and its a message :
domexception: permission denied to access property "document" on cross-origin object
I work in local with xampp, maybe It this the problem… Can u Help me pls
var win = window.open(popupurl, "authwindow", 'width=800, height=600');
var pollTimer = window.setInterval(function () {
try {
if (win.document.URL.indexOf(CLIENT_REDIRECT) != -1) {
window.clearInterval(pollTimer);
deffer.resolve(CODE);
win.close();
}
} catch (e) { }
}, 500);