How to check the status and/or wait until a successful connection of a window.open()
? (Or suggest better alternatives)
var url = 'https://www.google.com';
var newWindow = window.open(url, 'main');
if(newWindow == 'success'){ //url was successfully opened
...
}
else { //url returned 404
...
}