Google Chrome and Microsoft Edge don’t Confirm or Warn Before Closing Multiple Tabs

NOTE: The information given in this article also applies to Microsoft Edge and Opera web browsers as both browsers are also based on Chromium engine, the same browsing engine used by Google Chrome. So their functionality is similar to Chrome. Microsoft Edge and Opera also lack “Warn on Close” feature similar to Chrome.

SUMMARY: In this article, we’ll discuss about an annoying issue present in Google Chrome web browser i.e. it doesn’t warn or confirm before closing multiple tabs. This feature is called “Warn on Close” (also known as “Warn on Quit” or “Warn on Exit“) which is not present in Google Chrome. We’ll discuss why does Chrome not ask the user before closing the browser with many tabs open, how to prevent Chrome from accidentally closing multiple tabs and can we force Chrome to warn or confirm before quit/exit?

If you are using Google Chrome web browser, you might be aware of this issue very well. Some people say it’s a feature by design and some say it’s a bug.

Advertisement

Google Chrome doesn’t Confirm or Warn on Closing Multiple Tabs

If you have opened multiple tabs in Google Chrome and you click on Close (x) button present in Chrome’s titlebar or press Alt+F4, Ctrl+Shift+Q (has been disabled in Chrome 70 and later) or other hotkeys to close browser window, it immediately closes the browser. It never asks you whether you want to close multiple tabs or not. The expected behavior is, Chrome should show a warning/confirmation dialog box asking for user’s choice/permission to close or not close the browser. Many times users accidentally click on close button and since Chrome doesn’t show any notification alert message, it results in data loss. You may lose your all opened tabs and any data entered into online form fields.

Google_Chrome_Accidentally_Closes_Multiple_Tabs.png

Many popular browsers such as Mozilla Firefox, Internet Explorer and Microsoft Edge show the “Warn on Close” notification prompt upon exit. So if a user accidentally closes browser window with multiple tabs open, the browser will first ask for confirmation. If the user confirms the quit action, the browser closes. If the user cancels the quit action, the browser keeps running.

Unfortunately Google Chrome lacks this essential feature. It doesn’t ask or confirm before closing multiple tabs.

Why does Google Chrome NOT Warn Before Closing Multiple Tabs?

You might be wondering Google Chrome is a very popular web browser, then why doesn’t it show any confirmation dialog box before closing multiple tabs? Why doesn’t it warn on accidentally closing the window while running more than one tab?

Actually there are many Chrome users who have been requesting to implement this feature in Google Chrome since many years but this feature is still missing in the web browser.

So why the “Warn on close” feature is still missing? The answer is due to Chrome’s design philosophy. Google Chrome developer team always tries to keep the browser simple and fast. They always try to avoid unnecessary confirmation alerts, prompts, dialog box, notification messages, etc which may interrupt the end-user with annoying questions.

Advertisement

“Warn on close” is one such feature which might matter to some users but for many other users it may become irritating. That’s why this functionality has not been implemented in Google Chrome.

So what about users who keep accidentally closing Chrome with multiple tabs open? They can restore the closed tabs next time using Ctrl+Shift+T keyboard shortcut.

So Is There No Way to Prevent Google Chrome from Accidentally Closing Multiple Tabs?

There used to be many extensions on Chrome Web Store which helped users in bringing this missing feature to Chrome. They forced Google Chrome to confirm or warn before closing multiple tabs.

I can still remember some extensions names such as Window Close Protector, Close…NOT!, Lock It, etc. But many of these extensions are either removed/no longer available or not supported by newer versions of Google Chrome.

In fact, Google also released an official extension with the name “Chrome Toolbox” which provided an option “Confirm before closing multiple tabs” in its Settings to fix this annoying issue. Unfortunately this extensions is no longer supported by newer Chrome versions as most features of this extension were made in NPAPI and NPAPI is no longer supported in Chrome newer versions. If you install this extension in Google Chrome using Web Store, it installs successfully but immediately disappears from the browser. So you can’t use it any more.

There was also a JavaScript solution to force Google Chrome to warn on close. The method utilized “window.onbeforeunload” event to show a confirmation message before closing Google chrome window. We just needed to create an HTML file containing the required JavaScript code and set the HTML file as Chrome’s homepage so that the HTML file is always opened in Chrome. As soon as the user clicked on Close button, the JavaScript embedded in the HTML file showed the confirmation message to the user. Unfortunately, this method now requires an extra step. Due to a change in the API of Chrome, you need to click inside the HTML page to make the script working every time you open Google Chrome. So the JavaScript method is also not very useful now.

For interested people following is the required JavaScript code:

<script>window.onbeforeunload = function() { return “Are you sure you want to close multiple tabs?”; }</script>

So basically all previous or old solutions which used to fix this annoying issue in Google Chrome, have stopped working now.

So How to Force Google Chrome to Warn or Confirm Before Closing Multiple Tabs?

If you are using Mac, you are lucky. Google Chrome provides a built-in option to Mac users to force Chrome to show confirmation alert before closing multiple tabs.

Mac users just need to enable “Warn Before Quitting” option from Chrome menu.

Now you may ask why Chrome provides the option to Mac users only? Why does it not provide the same option to Windows users?

According to Chrome team, Mac users often mistakenly press “Command+Q” shortcut key instead of “Command+W” which is used to close tab. That’s why, this confirm on quit option is provided to Mac users only.

So Windows users are out of luck. Remember the Ctrl+Shift+T hotkey to restore your all lost tabs if you accidentally close Google Chrome with multiple tabs open.

[Tip] What To Do When You Accidentally Close Google Chrome, Microsoft Edge or Opera With Multiple Tabs Open

There is also a workaround in my mind which can be used to overcome this issue. There are many 3rd party software programs which can disable or lock “Close” button in selected programs. You can download and install such program and then set it to disable/lock Chrome’s Close button present in titlebar. It’ll prevent accidental close of Google Chrome window using Close button.

You can also search on Chrome Web Store for extensions to activate this missing feature in Chrome. We hope Google Chrome team will implement this feature in future versions of Chrome soon.

UPDATE:

New versions of Opera and Microsoft Edge browsers now come with this much awaited feature. Both browsers can now be set to show a confirmation dialog box asking users whether they want to close the window or not.

Warn_Confirm_On_Closing_Multiple_Tabs_Message_Prompt_Microsoft_Edge.png

Check out following tutorials for details:

[Opera Tip] How to Enable/Disable Warning on Closing Multiple Tabs

[Tip] Enable Warning Message on Closing Multiple Tabs in Microsoft Edge

NOTE: If you are using any other web browser and want to enable or disable “Warn on Close” feature, following tutorial will help you:

[Tip] Enable / Disable Warning on Closing Multiple Tabs in All Web Browsers

Published in: Google Chrome, Microsoft Edge

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. Finally, an article on this subject that adds something and doesn’t just parrot the invalid/out-of-date Toolbox/maki-chan advice of every other site.
    As you say, maki-chan still works if you remember to click in the page on opening a new session. Thank-you for the information, very helpful.

  2. This is why I don’t use Chrome. When I tried Chrome (twice), I burned myself twice a day for several days. Then I found the help page that says that “We Chrome engineers know better than you. We don’t care about your problem. We’ve got billions of CPU cycles per second, and we can’t afford to waste 100 or so when you click that red X. pfffttth to you.”

    In every other engineering discipline, a recurring invited user error is treated as a bug. In the Chrome group, it’s treated as a point of superiority.

    I don’t need to use software that’s got that design philosophy.

  3. It just shows to go how less El Goog actually cares about user opinion.
    It wouldn’t kill them to add an option in settings to ask before closing tabs.
    The setting can just be disabled by default and can be enabled by power users if they require it.
    Not gonna take more than a few mins to get this rigged up.

    For a normal company.

    For Chrome, this extra feature would mean an extra 2 Gigs of ram are used!
    NO EL GOOG! YOU NO ADD THIS THING! I ALREADY HAS 192 GB RAM AND CHROME LAGGING LAGGING LAGGING LAAGGGGGGGGGGGGGGGGGGGGGGGG

  4. This should be an option that users can turn on or off. Google! I only use Chrome now if I absolutely have to

  5. Quote “some people say it’s a feature by design and some say it’s a bug.”

    Has anyone at google ever heard of the word *option*.

    Why the omission of an option for this.

    Let the user decide.

    Utter arrogance from the managers at google.

    And – it’s astounding the lack of outrage with people just putting up with “workarounds.”

Leave a Comment

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

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.