Get reference to window previously blocked by pop-up blocker?

126 views Asked by At

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.");
   }
0

There are 0 answers