4 Handy Ways to Prevent Google Chrome From Closing Accidently

Related articles

8 Responses

  1. LidVan says:

    Doesn’t work. Nothing happens and tab is closing as usual.

  2. Andrey says:

    Here’s some extension I’ve designed – “Warn On Tab With Sound Closure” – it prompts the user on the tab closure if it is audible (wouldn’t guess, would ye?), you might find it useful: https://chrome.google.com/webstore/detail/warn-on-tab-with-sound-cl/jnheopnbicedafbmamohfffmafdcjelb

  3. Johannes says:

    I’ve gotten Page Modifier installed and I pasted in your script and put “*” in the “Applied to:” field, but I don’t get a pop-up. It still allows me to close tabs without confirmation. I’ve turned off all other extensions and rebooted Chrome once just to be sure, but it’s still not working.

    Any thoughts?

    • Sorry to hear Johannes that it did not work. I think the culprit are the quotes in the script. Can you please paste the script first in a notepad and then in the extension and see if that works?

  4. Johannes says:

    Changing the double quotes to single quotes seems to have fixed it. The working script looks like this:

    function PopIt() { return ‘Are you sure you want to leave?’; }
    function UnPopIt() { /* nothing to return */ }

    $(document).ready(function() {
    window.onbeforeunload = PopIt;
    $(‘a’).click(function(){ window.onbeforeunload = UnPopIt; });

  5. pino says:

    you cant restore private browsing tabs ^^ having a msg for each tab seems cumbersome and having to open a page that gives a alert takes up another tab and some ram, wierd that chrome doesnt has a alert function preventing you from closing all tabs., back to opera it is as firefox has been very chrashy of late

Leave a Reply

Your email address will not be published. Required fields are marked *