Add "warning/confirmation" dialog when closing a window w/ multiple tabs
See original GitHub issueDescription
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:
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:
Designs
Add the preference to warn when closing multiple tabs to the Help tips
section in brave://settings
. This is off by default.
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.
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:
- Created 3 years ago
- Reactions:52
- Comments:59 (10 by maintainers)
Top GitHub Comments
@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
Verification
PASSED
usingFiled #https://github.com/brave/brave-browser/issues/23090
OFF
by defaultCase 2: Basic Test- Show `Close all tabs` warning dialog upon closing multiple tabs, when the pref is `enabled` - PASSED
Continue where you left off in brave://settings/getStarted
Close all tabs
dialog is not launched since pref isOFF
by defaultWarn me before closing window with multiple tabs
in Help tips section of brave://settingsClose all tabs
dialog displayed with correct textCancel
buttonClose all
button in the Warning dialogCase 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
Continue where you left off in brave://settings/getStarted
Warn me before closing window with multiple tabs
pref in Help tips section of brave://settingsClose all tabs
dialog not displayedDon’t ask me again
Close all
buttonWarn me before closing window with multiple tabs
pref is disabledCase 4: Test with `onbeforeunload` handler -PASSED
Click here to go to w3schools.com
and checkbeforeunload
dialog is launched. Then, dismiss it.Close all
and checkbeforeunload
dialog is launchedbeforeunload
dialogClose all tabs
is shown againbeforeunload
dialog and check window is closedCase 5: Test with download in-progress handler -PASSED
Fresh Install
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
beforeunload
dialog is launched after selectingClose All
dialogCase 7:Test with reboot/restart - PASSED</summary- Launch Browser and set option is enabled
- Create window and create more than one NTP tabs
- Load
- Repeat step 1,2 and load
- Verified
Ex1
Ex2
Ex3
brave://restart
and check window closing dialog is not launchedbrave://quit
and check window closing dialog is not launchedClose all
warning dialog is not launched for bothrestart
andquit
Case 8: Test with update - PASSED
Close all
warning dialog is not launched upon updateCase 9: Test with profile deletion -PASSED
Close all
warning dialog is not launchedCase 10: Windows/Linux specific test - PASSED
Close all
warning dialog is launched for both windowsAdditional scenarios
Close all tabs
warning dialog works as expected withOpen the New Tab Page
selection in brave://settings/getStartedClose all tabs
warning dialog works as expected withOpen a specific page or set of pages
selection in brave://settings/getStartedClose all tabs
warning dialog works as expected with TOR windowClose all tabs
warning dialog works as expected with Private windowTest Case II Upgrade:
Upgrade Test - PASSED</summary- Install 1.39.x
- Create window with than one tab
- Help tips section in brave://settings do not have
- Load brave://settings/help and wait for updates to complete
- Click to Relaunch the browser
- Verified
Ex1
Ex2
Ex3
Ex4
Warn me before closing window with multiple tabs
prefWarn me before closing window with multiple tabs
pref is available and set toOFF
as a default