4 Handy Ways to Prevent Google Chrome From Closing Accidently

Living on a browser has become a standard among people nowadays. Most of the work we do revolve around online services resulting in us having endless tabs open throughout the day. Sometimes, however, you accidentally hit the close button and before you know it, all your opened tabs are trashed. Hence, we bring you a couple of nifty ways to prevent that from happening again.

#.Prevent Chrome from Accidentally closing using a Website.


Probably the easiest way to prevent Chrome from closing accidentally is to keep a warning website open along with your other tabs. As soon as you tap the close button, Chrome will pop a warning window about terminating the browser, you can either continue or stay by clicking the respective options.


Pro Tip: Pin this website, so that every time you fire up the Chrome browser, it will automatically start loading.

#.Disable the close button temporarily on Windows.

By following a couple of steps, you can as per your demands disable the close button of any application on Windows. To do so,


  1. Head over to this website and download the “NoClose.exe” file.
  2. Place it inside your startup folder.
  3. Run the “Noclose.exe” executable.
  4. You’re done. Now whenever you’re in Chrome or any other Desktop software, press “Ctrl+1” together to disable the “X” button. To enable, press the combination again. This works in most of all any other windows software out there.


#. Make use of Chrome’s own “Continue where you left off” setting.


Google offers a useful setting in Chrome itself that reopens all the tabs you had while you terminated the browser. To activate it, head over to Settings and click the “Continue where you left off” radio button. Now every time, you restart Chrome, you’ll have all the last session’s tabs load up automatically. Though, we won’t recommend this if you’ve a slow system or connection.

#. Insert a custom JavaScript code to get a warning from individual tabs on Chrome.

If you want a warning from each individual tab, a JavaScript code will need to be implemented on your browser. Don’t worry, it’s not that intimidating. First of all, download this free extension. Next up, hit that new icon on the top right corner and now fill the fields as shown below.


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; });

Hit “Save” and you’re done! Now, you’ll get a confirmation message from each tab when you click the close button. However, this can be frustrating if you’ve a lot of tabs open.

So, those were some of the ways you can make use of to prevent Chrome from closing accidentally, hope it helped. Let us know if we missed something or you’re stuck somewhere in the comments section down below.

Did you find this article useful -

Filed under Google Chrome Tricks. Posted by Shubham and last updated on March 26, 2016.

Leave a Comment:

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


Get Google Updates

Every Sunday, we send out "Google This Week" newsletter which covers all the latest and important updates from Google. First, we curate information from authentic and verified sources and then write the newsletter in an easy to understand format with images and summary for each update. View Sample ›

Join 9000+ subscribers following their favorite company in a simpler and easier way. Join Now ›