Вот код, который я использую:
function sendLoginToThirdParty(){
this.windowHandle =
this.window.open('https://console-sandbox.ThirdParty/authorize?client_id=90166b44-f4de-491a-XXXX&state=XXXXX',
'ThirdParty Integration', 'width=800,height=800,left=50,top=50');
this.intervalId = this.window.setInterval(() => {
let href;
try {
href = this.windowHandle.location.href;
console.log("href = " + href)
} catch (e) {
console.log('Error:', e);
}
if (href != null) {
if (href.match('staging-api')) {
console.log('got it')
console.log(this.windowHandle)
window.clearInterval(this.intervalId);
this.windowHandle.close();
}
}
}, this.intervalLength);
}
Я получаю
DOMException: Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame.