1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Block Exit Popup

Discussion in 'HTML & JavaScript' started by sviedinys, Aug 16, 2012.

  1. sviedinys

    sviedinys Jr. VIP Jr. VIP

    Joined:
    Apr 18, 2010
    Messages:
    503
    Likes Received:
    69
    Hello,

    Is there any way to block these "leave page" exit popups? I am searching for solution on google already few hours, no working solution yet. I found something about javascript in mozilla to block, but not sure how it should work. I dont want to disable javascript at all.
     
  2. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
  3. SonicSam

    SonicSam Registered Member

    Joined:
    Aug 21, 2012
    Messages:
    57
    Likes Received:
    5
    Location:
    X
    The link skrode posted should work for any Greasemonkey compatible browser, which also includes Chrome and Opera.

    As for it being something that'll work, that code seems to "override" the original onbeforeunload, that should not be necessary. Simply calling

    Code:
    window.onbeforeunload=null;
    Should be enough to override the initial one.

    The greasemonkey script also assumes the script is innerhtml, it does not take into account a url linked javascript file.