brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.8k stars 2.33k forks source link

Brave should have a setting that causes it to quit automatically when it is not the frontmost application AND it has no open windows. #21492

Open mclow opened 2 years ago

mclow commented 2 years ago

Description

Brave should have a setting that causes it to quit when it is put into the background with no windows open.

Steps to Reproduce

  1. Launch Brave
  2. Open a windows
  3. Close the window.
  4. Switch to another application.

Actual result:

Nothing happens. Brave is still running.

Desired result:

Brave should quit; because there are no windows open. (Not everyone will want this behavior, so it needs to be controlled by a setting).

I have Brave set up to clear all browsing data on exit, and so I'd like it to quit for me when there's nothing to do.

Reproduces how often:

Always.

Brave version (brave://version info)

Brave 1.36.109 Chromium: 99.0.4844.51 (Official Build) (x86_64)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS macOS Version 10.15.7 (Build 19H1715)
JavaScript V8 9.9.115.8
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Command Line /Applications/Brave Browser.app/Contents/MacOS/Brave Browser --disable-client-side-phishing-detection --disable-domain-reliability --enable-dom-distiller --no-pings --component-updater=url-source=https://go-updater.brave.com/extensions --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= --sync-url=https://sync-v2.brave.com/v2 --lso-url=https://no-thanks.invalid --variations-server-url=https://variations.brave.com/seed --variations-insecure-server-url=https://variations.brave.com/seed --flag-switches-begin --flag-switches-end
Executable Path /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
Profile Path /Users/marshall/Library/Application Support/BraveSoftware/Brave-Browser/Default
Linker lld
Variations AdRewardsStudy:NextPaymentDayAdServingStudy:MaximumAdNotificationsPerDay=100/MaximumInlineContentAdsPerHour=8/MaximumInlineContentAdsPerDay=40AdvertiserSplitTestStudy:GroupBBraveAds.FrequencyCappingStudy:ExcludeAdIfWithinTimeWindow=0hBraveAds.UserActivityStudy:Triggers=EMPTY/Threshold=0.0/IdleTimeThreshold=5BraveDebounceStudy:EnabledConversionsStudy:NewDefaultPatternDefault1pBlockingStudy:DisabledEphemeralStorageStudy:EnabledExtendedVariationsSafeMode4:Default4ForceDisableBlinkFeatures:EnabledMacCoreLocationBackendStudy:EnabledNativeCosmeticFilteringStudy:EnabledNavigationThreadingOptimizationsCompat:DisabledPartitionBlinkMemoryCacheStudy:EnabledPartitionConnectionsByNetworkIsolationKeyStudy:EnabledPermissionLifetimeReleaseStudy:EnabledRequestAdsEnabledApiStudy:EnabledSpeedreaderReleaseStudy:Enabled

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

sangwoo108 commented 2 years ago

With all due respect, as this is a general behavior of all applications on macOS, I’m on the fence. Usually not following OS-wide policy or behavior could make user confused, but if we provide an opt-in for this, it could be okay.

mclow commented 2 years ago

"Quitting when you are put into the background with no documents/windows open" is a general behavior for many applications (TextEdit, Preview, Calendars, etc) on Mac OS, but not for the browsers that I tried (Safari, Chrome, Brave). I wish that it was.

I can emulate this feature with AppleScript (if Brave is not the frontmost app, and the window list is empty, quit), but running that every N seconds seems like a hack.