Make Google Chrome Ask Before Quitting (Exit Confirmation)

Today, we will see how to make Google Chrome ask before quitting. The default behavior of this browser may be a bit annoying for the user, since it can be closed accidentally. Let's change this and make it show a warning before you close it.

Google Chrome is known for not having a confirmation option when exiting the browser under Windows. It is really strange, because under macOS, the appropriate option is available right in the app menu. But what about the Windows version? For some reason, developers haven't included it.

It is very easy to close the Chrome browser accidentally with one wrong mouse click or with the Ctrl + Q keyboard shortcut. If this happened to you, do not panic. The next time you open Chrome, press the following sequence on your keyboard: Ctrl + Shift + T. This will restore your tabs from the last browsing session.

Make Google Chrome Ask Before Quitting

To make the browser show a warning dialog before you quit it, there is a solution. A special web page, when opened, can show you a warning message via JavaScript code. You can try it yourself. Open the following web page:

Prevent Close

Now, try to close the Chrome browser. The result will be as follows:

You can add this page to your home pages so it will be loaded automatically or pin the tab with the page. The main idea is to keep this page opened in your browsing session, so you won't close the browser accidentally any more.

Behind this trick is just one line of JavaScript code, which utilizes the "window.onbeforeunload" event. It's a very simple and clever solution.

If you are not happy to pin an external web page or press hotkeys, you can do the following. It is possible to set the Chrome browser to restore previously opened tabs automatically. Here is how it can be done.

In Chrome, click the menu button with three dots. The menu will appear on the right.

Click Settings to open the Settings tab:

Under "On Startup", enable the option "Continue where you left off":

This will restore your previous tabs the next time you open Google Chrome.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

9 thoughts on “Make Google Chrome Ask Before Quitting (Exit Confirmation)

    1. Mary

      I found it rather annoying too…. until, I accidentally closed a tab in which I was working on filling out an application which had multiple steps and took a really long time… I found it more annoying to have to start all over again!!! So now I would like google to ask before, just in case to prevent this from happening again.

  1. kkk

    If you are in incognito mode and you accidentally close chrome, you are screwed.

    Google engineers are smart but it doesn’t make sense not having this simple feature.

    1. Chris

      @Mike Exactly. They’re very creative, but seem incapable of producing polished products. If putting the finishing touches on something is too boring for them, they should hire other people to finish their work.

  2. sam aoyer

    I was filling out a questionnaire for half an hour and accidentally I closed the browser, I lost all the information. Why is this feature present in all browsers, except for Google Chrome browser? There are also add-ons on the store that help, but it’s not safe, this is very annoying


Leave a Reply

Your email address will not be published.