question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "warning/confirmation" dialog when closing a window w/ multiple tabs

See original GitHub issue

Description

Several users have requested the option to confirm whether or not they want to close a window when multiple tabs are open in it. This functionality would be similar to what is already implemented in other browsers like Firefox and IE:

image

This functionality would prevent users from inadvertently closing a browser window. Also note that this functionality exists when attempting to Quit the application process and even has an option to opt out of the Press to hold function:

image

Designs

Add the preference to warn when closing multiple tabs to the Help tips section in brave://settings. This is off by default.

image

Move Show warning before quitting with ⌘Q out of the Appearance section and to the Help Tips section too.

When toggled on, show a warning dialog when the user when closing multiple tabs.

Screen Shot 2022-05-25 at 9 48 26 AM

Assets

Figma: https://www.figma.com/file/pVwKlNQJU9wTVOa9tImKpo/?node-id=318%3A9788

Miscellaneous Information:

Several users responding to this feature request – will add additional request threads as I find them: https://community.brave.com/t/five-years-and-no-progress-warn-before-closing-multiple-tabs/86525/7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:52
  • Comments:59 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
bscliftoncommented, Dec 7, 2020

@9codes it might be a bit late, but you can use a shortcut Ctrl + Shift + T (on macOS: Cmd + Shift + T) to restore your last closed tab / window. You can use this multiple times and you should be able to restore it. This works in Chromium and other browsers too

3reactions
MadhaviSeelamcommented, May 26, 2022

Verification PASSED using

Brave | 1.40.74 Chromium: 102.0.5005.61 (Official Build) beta (64-bit)
-- | --
Revision | 0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}
OS | Windows 11 Version 21H2 (Build 22000.675)

Filed #https://github.com/brave/brave-browser/issues/23090

Case 1: `Warn me before closing window with multiple tab` preference is added in brave://settings/HelpTips and is `disabled` as a default - PASSED
  1. Install 1.40.x
  2. Launch brave
  3. Open brave://settings>>click Additional settings>>click Help tips
  4. Verified `Warn me before closing window with multiple tab’ pref is available
  5. The toggle is OFF by default
dark light
darkimage lightimage
Case 2: Basic Test- Show `Close all tabs` warning dialog upon closing multiple tabs, when the pref is `enabled` - PASSED
  1. New profile
  2. Launch brave
  3. Create new window with multiple tabs
  4. Leave the default selection for Continue where you left off in brave://settings/getStarted
  5. Close the browser window (‘x’ or alt+f4)
  6. Verified warning Close all tabs dialog is not launched since pref is OFF by default
  7. Enable Warn me before closing window with multiple tabs in Help tips section of brave://settings
  8. Close the browser window (‘x’ or alt+f4)
  9. Verified Close all tabs dialog displayed with correct text
  10. UI matched to figma
  11. Click Cancel button
  12. Warning dialog is dismissed
  13. Close the browser window again (‘x’ or alt+f4)
  14. Click Close all button in the Warning dialog
  15. Relaunch the browser
  16. All of the tabs are preserved
Step 3&4 Step 7 Step 9 Step 16
image1 image2 image3 image3
Case 3: Do not show `Close all tabs` warning dialog when the pref is `disabled` again OR `Don’t ask me again` check box is checked - PASSED
  1. Continue from Case 2 (Pref is enabled)
  2. Open multiple tabs
  3. Leave the default selection for Continue where you left off in brave://settings/getStarted
  4. Disable Warn me before closing window with multiple tabs pref in Help tips section of brave://settings
  5. Close the browser window
  6. Verified Close all tabs dialog not displayed
  7. Relaunch the browser
  8. All of the tabs are preserved
  9. Enable the pref in the Help tips section of brave://settings
  10. Close the browser window
  11. Check the check box for Don’t ask me again
  12. Click Close all button
  13. Relaunch the browser
  14. All tabs are preserved
  15. Navigate to Help tips section of brave://settings
  16. Verified Warn me before closing window with multiple tabs pref is disabled
Step2&3 Step4 Step11 Step14
image1 image1 image4 image3
Case 4: Test with `onbeforeunload` handler -PASSED
  1. Launch Browser and set option is enabled
  2. Create window and create more than one NTP tabs
  3. Load https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload in one NTP and click Click here to go to w3schools.com and check beforeunload dialog is launched. Then, dismiss it.
  4. Try to close window by clicking close button or window closing shortcut (alt + f4, or cmd+shift+w on macOS)
  5. Select Close all and check beforeunload dialog is launched
  6. Cancel beforeunload dialog
  7. Repeat step 4 and check window Close all tabs is shown again
  8. Select Close all and also Leave from beforeunload dialog and check window is closed
Step 1 Step2 Step3 Step4 Step5 Step7 Step8
image1 image2 image3 image4 image5 image4 image4
Case 5: Test with download in-progress handler -PASSED

Fresh Install

  1. Launch Browser and set option is enabled
  2. Create window and create more than one NTP tabs
  3. Load https://ubuntu.com/download/desktop/thank-you?version=22.04&architecture=amd64 and start download 3a. Tested with Acrobat reader download https://get.adobe.com/reader/?promoid=TTGWL47M as this can be tested with any download
  4. Try to close window by clicking close button or window closing shortcut (alt + f4, or cmd+shift+w on macOS)
  5. Select Close all from window closing dialog and check Download in-progress warning dialog is launched
  6. Select Continue downloading
  7. Repeat step 4 and check window closing dialog is launched again
  8. Select Close all from window closing dialog and select Exit from Download in-progress warning dialog
  9. Check window is closed.
Ex1 Ex2 Ex3
image1 image2 image3
Case 6: Test with onbeforeunload and download in-progress handler - PASSED (Note: On macOS, download warning dialog is not shown on normal profile. Private window will have same behavior on macOS with other platform's normal window)

Fresh Install

  1. Launch Browser and set option is enabled
  2. Create window and create more than one NTP tabs
  3. Load https://ubuntu.com/download/desktop/thank-you?version=22.04&architecture=amd64 and start download
  4. Load https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload in one NTP and click Click here to go to w3schools.com and check beforeunload dialog is launched. Then, dismiss it.
  5. Try to close window by clicking close button or window closing shortcut (alt + f4, or cmd+shift+w on macOS)
  6. Check download warning or beforeunload dialog is launched one by one after selecting Close all from window closing dialog
  7. Verified beforeunload dialog is launched after selecting Close All dialog
Ex1 Ex2 Ex3 Ex4 Ex5
image image2 Screenshot 2022-05-26 110023 image image
Case 7:Test with reboot/restart - PASSED</summary
  1. Launch Browser and set option is enabled
  2. Create window and create more than one NTP tabs
  3. Load brave://restart and check window closing dialog is not launched
  4. Repeat step 1,2 and load brave://quitand check window closing dialog is not launched
  5. Verified Close all warning dialog is not launched for both restart and quit
Ex1 Ex2 Ex3
image2 image2 image2
Case 8: Test with update - PASSED
  1. Launch Browser and set option is enabled
  2. Create window and more than one tab
  3. Load brave://settings/help and waiting relaunch is ready after downloading new update
  4. Click relaunch button and check window closing dialog is not launched
  5. Verified Close all warning dialog is not launched upon update
Step1 Step3 Update
image1 image2 image3
Case 9: Test with profile deletion -PASSED
  1. Launch Browser and set option is enabled
  2. Create window with more than one tabs
  3. Delete active profile and check window closing confirm dialog is not launched.
  4. Verified Close all warning dialog is not launched
Ex1 Ex2 Ex3
image image image
Case 10: Windows/Linux specific test - PASSED
  1. Launch Browser and set option is enabled
  2. Create window and create more than one NTP tabs
  3. Repeat step 2 to recreate another window with multiple tabs
  4. Do closing all windows from app icon’s context menu at Dock(linux) or at Taskbar(Windows)
  5. Check each Windows’ closing is done separately like above
  6. Verified Close all warning dialog is launched for both windows
window1 window2
Window1 Window2
Additional scenarios
  • Verified the Close all tabs warning dialog works as expected with Open the New Tab Page selection in brave://settings/getStarted
  • Verified the Close all tabs warning dialog works as expected with Open a specific page or set of pages selection in brave://settings/getStarted
  • Verified Close all tabs warning dialog works as expected with TOR window
  • Verified Close all tabs warning dialog works as expected with Private window

Test Case II Upgrade:

Upgrade Test - PASSED</summary
  1. Install 1.39.x
  2. Create window with than one tab
  3. Help tips section in brave://settings do not have Warn me before closing window with multiple tabs pref
  4. Load brave://settings/help and wait for updates to complete
  5. Click to Relaunch the browser
  6. Verified Warn me before closing window with multiple tabs pref is available and set to OFF as a default
Ex1 Ex2 Ex3 Ex4
image1 image2 image3 image4
Read more comments on GitHub >

github_iconTop Results From Across the Web

Confirm before closing multiple tabs in Chrome, Edge, Firefox
In the General tab of the Settings page, tickmark the Confirm before closing multiple tabs option. Ask before closing all tabs in Chrome....
Read more >
Enable Warning Prompt On Closing Multiple Tabs In Microsoft ...
This AskBeforeCloseEnabled policy lets you configure whether users see a confirmation dialog before closing a browser window with multiple tabs.
Read more >
[Tip] Enable Confirmation on Closing Microsoft Edge ... - AskVG
This feature shows a warning message or confirmation dialog box if the user tries to close the browser with multiple tabs opened.
Read more >
Chrome is adding a confirmation dialog to make sure you ...
If you're using the Canary channel right now, just head over to chrome://flags and look for "Close all tabs modal dialog," then enable...
Read more >
Get Confirmation Dialog from Chrome Before Closing All Tabs
Firefox and IE browsers has this feature, warns user when closing multiple tabs, this can be useful if you accidently click the close...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found