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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -