1

Can I auto close popunder window generated from third party javascript (eg:ads popunder) on my webpage.

I'm trying to open and auto close window easily.

window.addEventListener( 'click', function() {
    var win = window.open ( 'http://www.google.com/', 'MyWindow', 'width='+screen.width+', height='+screen.height );
    if(win) {
        win.blur();
        window.focus();
    }
    setTimeout( function() {
        win.close()
    }, 10000 );
}, false );

But how if javascript from third party?

DnSF
  • 11
  • 2

1 Answers1

0

AFAIK, if you don't have the reference to the open window, you cannot close it (there is no global index of open window references).

See: Get list of opened popup windows

Community
  • 1
  • 1
hon2a
  • 7,006
  • 5
  • 41
  • 55