Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Brave-Matt opened this issue Jun 23, 2020 · 59 comments · Fixed by brave/brave-core#13003
Closed
Assignees
Labels
design A design change, especially one which needs input from the design team feature/global-settings Settings at browser level independent of shields settings feature/new-metric Proposing a new metric for Privacy Preserving Product Analytics (P3A) feature-request OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Yes release-notes/include

Comments

@Brave-Matt
Copy link

Brave-Matt commented Jun 23, 2020

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

@Brave-Matt Brave-Matt added feature/global-settings Settings at browser level independent of shields settings feature-request OS/Desktop labels Jun 23, 2020
@srirambv
Copy link
Contributor

Windows/Linux specific request as this is already available in macOS

@AmbrocioIsaias2808
Copy link

AmbrocioIsaias2808 commented Jul 2, 2020

I think it would be a good feature, sometimes i have to many tabs opened in two or more windows and closing one of them by accident is not very chirfull because i lost the tabs. I know now there is an option to restore them from history, but previous 9 days ago i didn´t know about it and like me there are lots. And well other browsers have this feature like opera, ¿why not brave?, i mean, it´s simple and not intrusive.

opera

@joemamabuckeye
Copy link

I totally agree, this simple confirmation or warn dialog aka beforeunload event (like in a web page) is critical for the browser window that has multiple open tabs. I do a TON of research and go between 3 brave windows, having 10 or more tabs open on each... accidentally closing one of the browser windows instead of a tab is a real PITA. I cannot just go back to the history because some of the pages hadn't been visited recently enough...and 'recently closed' won't restore because you closed the entire window. I also use extensions like Flowbar, but I want some tabs open to jump back to in a second, not try to find the right bookmark and load the page, and my reference info. Saving everything to PDF isn't always feasible either.
I left FF because the multiple open tabs dragged my processor, but this is making me think about looking for another browser. Hoping for a solution!!!

@rebron rebron added priority/P4 Planned work. We expect to get to it "soon". design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. labels Aug 14, 2020
@rebron rebron self-assigned this Aug 14, 2020
@srirambv
Copy link
Contributor

srirambv commented Oct 2, 2020

@ksalhab89
Copy link

+1

1 similar comment
@9codes
Copy link

9codes commented Dec 6, 2020

+1

@9codes
Copy link

9codes commented Dec 6, 2020

Today I lost all of my working tabs just for not being this feature. As the progress was not saved, I lost all the hard work and time. Developers @mrobinson @marshall @bridiver @mattmcalister @pes10k should add this feature in a short time. Maybe it's a minor change for them but it's a major for me. Thanks.

@bsclifton
Copy link
Member

@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

@9codes
Copy link

9codes commented Dec 13, 2020

@bsclifton Thanks for your response Brian. I will wait (for the feature).

@murad-alm
Copy link

@brave Is there any chance we will get this simple feature anytime soon?
I really don't want to sound rude, but its literally one line of code...
if opened_tabs > 1: show_confirmation_dialog() else: exit()

@pes10k
Copy link
Contributor

pes10k commented Feb 24, 2021

I believe this is already here (inherited from upstream / Chromium). Does this do what you're asking for?
brave://settings/?search=Show+warning+before+quitting?

It isn't specific to the "more than one tab" case, but it seems to solve the "whoops i didn't mean close and loose my stuff" problem.

If that doesn't capture whats needed, can you kindly share a bit more about whats further needed? Thanks!

@murad-alm
Copy link

I believe this is already here (inherited from upstream / Chromium). Does this do what you're asking for?
brave://settings/?search=Show+warning+before+quitting?

It isn't specific to the "more than one tab" case, but it seems to solve the "whoops i didn't mean close and loose my stuff" problem.

If that doesn't capture whats needed, can you kindly share a bit more about whats further needed? Thanks!

Dear @pes10k,
I can't find this option (Version 1.20.110 ) anywhere in the settings.
This functionality should (as described by @Brave-Matt) warn the user before closing the browser whenever more than one tab are open (please check the issue description).
Thanks!

@pes10k
Copy link
Contributor

pes10k commented Feb 24, 2021

Just to make sure we're on the same page, you don't see the below in your settings?

Screen Shot 2021-02-24 at 4 38 47 PM

@murad-alm
Copy link

murad-alm commented Feb 24, 2021

Just to make sure we're on the same page, you don't see the below in your settings?

I believe this option is only available for macOS (as described by @srirambv ). Linux / Windows users DO NOT have this option.
brave_screenshot

@rebron rebron removed the design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. label Feb 24, 2021
@bridiver
Copy link
Contributor

@murad-alm if you can write this feature in one line of code I would be happy to review the PR

@brave Is there any chance we will get this simple feature anytime soon?
I really don't want to sound rude, but its literally one line of code...
if opened_tabs > 1: show_confirmation_dialog() else: exit()

@murad-alm
Copy link

@murad-alm if you can write this feature in one line of code I would be happy to review the PR

@brave Is there any chance we will get this simple feature anytime soon?
I really don't want to sound rude, but its literally one line of code...
if opened_tabs > 1: show_confirmation_dialog() else: exit()

I apologize if my bad joke offended you. Have a nice day @bridiver !

@bridiver
Copy link
Contributor

@murad-alm if you can write this feature in one line of code I would be happy to review the PR

@brave Is there any chance we will get this simple feature anytime soon?

I really don't want to sound rude, but its literally one line of code...

if opened_tabs > 1: show_confirmation_dialog() else: exit()

I apologize if my bad joke offended you. Have a nice day @bridiver !

@murad-alm we get some very interesting responses sometimes so it's not always easy to pick out the jokes ;)

@zcraber
Copy link

zcraber commented Feb 27, 2021

+1 This is a much-needed feature for me.

@JakubBarta
Copy link

+1 please implement this feature

@DutchPete
Copy link

General automation moved this from In progress to Completed 3 days ago

This is for Windows. What about Linux ???

@simonhong
Copy link
Member

@DutchPete The fix for this issue (brave/brave-core#13003) is for all platforms.

@MadhaviSeelam
Copy link

MadhaviSeelam commented May 25, 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 ##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
  • Launch Browser and set option is enabled
  • Create window and create more than one NTP tabs
  • Load brave://restart and check window closing dialog is not launched
  • Repeat step 1,2 and load brave://quitand check window closing dialog is not launched
  • 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
  • Install 1.39.x
  • Create window with than one tab
  • Help tips section in brave://settings do not have Warn me before closing window with multiple tabs pref
  • Load brave://settings/help and wait for updates to complete
  • Click to Relaunch the browser
  • 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

    @DutchPete
    Copy link

    @MadhaviSeelam how about for Linux? Simon Hong mentioned on 16 May it would be done for Brave 1.40.

    @MadhaviSeelam
    Copy link

    @DutchPete Linux will be tested as well in 1.40.x

    @stephendonner stephendonner added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Jun 1, 2022
    @stephendonner
    Copy link

    stephendonner commented Jun 1, 2022

    Verification PASSED using

    Brave 1.40.82 Chromium: 102.0.5005.78 (Official Build) beta (x86_64)
    Revision df6dbb5a9fd82af3f567198af2eb5fb4876ef99c-refs/branch-heads/5005_59@{#3}
    OS macOS Version 11.6.6 (Build 20G624)
    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
    Screen Shot 2022-06-01 at 11 19 16 AM Screen Shot 2022-06-01 at 11 19 26 AM
    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
    Screen Shot 2022-06-01 at 11 49 25 AM Screen Shot 2022-06-01 at 11 50 28 AM Screen Shot 2022-06-01 at 11 50 47 AM Screen Shot 2022-06-01 at 11 51 17 AM
    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
    Screen Shot 2022-06-01 at 12 14 22 PM Screen Shot 2022-06-01 at 12 16 19 PM Screen Shot 2022-06-01 at 12 19 03 PM Screen Shot 2022-06-01 at 12 19 56 PM
    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
    Screen Shot 2022-06-01 at 1 05 29 PM Screen Shot 2022-06-01 at 1 05 58 PM Screen Shot 2022-06-01 at 1 12 38 PM Screen Shot 2022-06-01 at 1 06 40 PM Screen Shot 2022-06-01 at 1 08 21 PM Screen Shot 2022-06-01 at 1 06 40 PM Screen Shot 2022-06-01 at 1 08 21 PM
    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
    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
    Screen Shot 2022-06-01 at 1 26 23 PM Screen Shot 2022-06-01 at 1 27 16 PM Screen Shot 2022-06-01 at 1 28 33 PM
    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 as 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
    Screen Shot 2022-06-01 at 1 44 20 PM Screen Shot 2022-06-01 at 1 49 26 PM Screen Shot 2022-06-01 at 1 49 35 PM Screen Shot 2022-06-01 at 1 46 29 PM Screen Shot 2022-06-01 at 1 47 02 PM
    Case 7: Test with reboot/restart - PASSED
  • Launch Browser and set option as enabled
  • Create window and create more than one NTP tabs
  • Load brave://restart and check-window closing dialog is not launched
  • Repeat step 1,2 and load brave://quitand check window-closing dialog is not launched
  • Verified Close all warning dialog is not launched for both restart and quit
  • Ex1 Ex2 Ex3
    Screen Shot 2022-06-01 at 2 20 36 PM Screen Shot 2022-06-01 at 2 21 17 PM Screen Shot 2022-06-01 at 2 27 19 PM
    Case 8: Test with update - PASSED
    1. Launch Browser and set option as enabled
    2. Create window and more than one tab
    3. Load brave://settings/help and wait until 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
    Screen Shot 2022-06-01 at 2 41 07 PM Screen Shot 2022-06-01 at 2 42 09 PM Screen Shot 2022-06-01 at 2 43 14 PM
    Case 9: Test with profile deletion - PASSED
    1. Launch Browser and set option as 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 Ex4
    Screen Shot 2022-06-01 at 2 52 32 PM Screen Shot 2022-06-01 at 2 53 05 PM Screen Shot 2022-06-01 at 2 53 08 PM Screen Shot 2022-06-01 at 2 53 56 PM
    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 Private Browsing with Tor window
    • Verified Close all tabs warning dialog works as expected with Private window

    Test Case II Upgrade:

    Upgrade Test - PASSED
  • Install 1.39.x
  • Create window with than one tab
  • Help tips section in brave://settings do not have Warn me before closing window with multiple tabs pref
  • Load brave://settings/help and wait for updates to complete
  • Click to Relaunch the browser
  • Verified Warn me before closing window with multiple tabs pref is available and set to OFF as a default
  • Also confirmed successful upgrade to 1.40.80
  • Ex1 Ex2 Ex3 Ex4 Ex5
    Screen Shot 2022-06-01 at 4 05 30 PM Screen Shot 2022-06-01 at 4 06 26 PM Screen Shot 2022-06-01 at 4 07 35 PM Screen Shot 2022-06-01 at 4 10 33 PM Screen Shot 2022-06-01 at 4 10 43 PM

    Verification passed on

    Brave 1.40.87 Chromium: 102.0.5005.78 (Official Build) beta (64-bit)
    Revision df6dbb5a9fd82af3f567198af2eb5fb4876ef99c-refs/branch-heads/5005_59@{#3}
    OS Ubuntu 18.04 LTS
    Case 1: `Warn me before closing window with multiple tab` preference is added in brave://settings/braveHelpTips 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

    image
    image

    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

    image
    image

    image

    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

    image
    image
    image

    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

    image
    image
    image

    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
    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.

    image
    image

    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 as 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

    image
    image
    image

    Case 7: Test with reboot/restart - PASSED
  • Launch Browser and set option as enabled
  • Create window and create more than one NTP tabs
  • Load brave://restart and check-window closing dialog is not launched
  • Repeat step 1,2 and load brave://quitand check window-closing dialog is not launched
  • Verified Close all warning dialog is not launched for both restart and quit
  • Case 8: Test with update - PASSED
    1. Launch Browser and set option as enabled
    2. Create window and more than one tab
    3. Load brave://settings/help and wait until 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
    Case 9: Test with profile deletion - PASSED
    1. Launch Browser and set option as 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
    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 Private Browsing with Tor window
    • Verified Close all tabs warning dialog works as expected with Private window

    Test Case II Upgrade:

    Upgrade Test - PASSED
  • Install 1.39.x
  • Create window with than one tab
  • Help tips section in brave://settings do not have Warn me before closing window with multiple tabs pref
  • Load brave://settings/help and wait for updates to complete
  • Click to Relaunch the browser
  • Verified Warn me before closing window with multiple tabs pref is available and set to OFF as a default
  • Also confirmed successful upgrade to 1.40.80
  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    design A design change, especially one which needs input from the design team feature/global-settings Settings at browser level independent of shields settings feature/new-metric Proposing a new metric for Privacy Preserving Product Analytics (P3A) feature-request OS/Desktop priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Test-All-Platforms QA/Yes release-notes/include
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.