javascript - In a browser extension, how do I click a specific button of an alert? -
so...
i need click [stay on page]
automatically in such prompt:
confirm navigation: [leave page] [stay on page]
the code invokes
$(window).bind('beforeunload', function() { return 'leave page?'; //click prompt code goes here. $(window).unbind(); });
if take away return 'leave page?';
iframed page overrides top frame , user struck unknown site, maybe there's way this?
actually hook onbeforeunload
event:
$(window).bind('beforeunload', function() { return 'leave page?'; });
Comments
Post a Comment