The code below catches when pop-up blockers are enabled.
In our code, pop-ups get blocked because this code gets called a few seconds after a user click, long enough to trigger pop-up protection.
When the pop-up gets blocked, newWindow is null.
When the user allows the blocked window, is there a way to get a reference to the previously blocked window?
var newWindow = window.open("/foobar", "test");
// Pop-ups blocked? If yes, show warning message.
if(!newWindow || newWindow.closed || typeof newWindow.closed == "undefined") {
alert("To download designs, please allow browser pop-ups from foobar.ai.");
}