Browser-laptop: Warn Before Quitting feature

Created on 30 Apr 2016  Â·  10Comments  Â·  Source: brave/browser-laptop

Sometimes my fingers are careless and hit Cmd+Q when I wanted to hit Cmd+W, and then instead of one tab going away, they all go away. Since tabs reopen automatically, this isn't a catastrophic exit, but it's still a nuisance since I rarely ever actually want to exit my browser.

Chrome has a lovely setting for avoiding this called "Warn Before Quitting". It's enabled here:

When you hit Cmd+Q with it enabled, you get this little overlay message telling you to hold Cmd+Q down for a second if you really mean it:

A similar option in Brave would be wonderful; it's almost the only thing I miss about Chrome.

I've not worked with Electron before, but I know my way around Node and the codebase looks pretty friendly - a couple quick searches already found most of the relevant pieces to this feature - so I'd be happy to try a PR with some guidance.

I'm specifically unsure about two things:

  • whether there are other places in Brave already using this kind of overlay message which this feature should follow, and if not, how a pattern for that might be established.
  • whether to put the toggle in the main menu like Chrome, or in the preferences menu instead
fixed-with-brave-core suggestion wontfix

Most helpful comment

@bsclifton @bbondy Could this be moved back to 1.0? This is a must have feature.

All 10 comments

Hi Lewis!

whether there are other places in Brave already using this kind of overlay message which this feature should follow, and if not, how a pattern for that might be established.

We are not using overlay messages yet. You could either add a new React component that is absolute-positioned in the middle of the window (something like js/components/overlayMessage.js) and have it appear when cmd+Q is pressed, or use an existing component. js/components/notificationBar.js might be suitable. Or a standard HTML desktop notification: https://developer.mozilla.org/en-US/docs/Web/API/notification

whether to put the toggle in the main menu like Chrome, or in the preferences menu instead

Note that the $APP_NAME menu doesn't exist on non-OSX systems, so it would probably go in the File menu for Linux / Windows. I feel like preferences is better but lack a strong opinion.

Happy to help with any further questions.

+1 from support

@bsclifton @bbondy Could this be moved back to 1.0? This is a must have feature.

A work around for now is to reconfigure the keyboard shortcut for quitting Brave.

screen shot 2018-06-15 at 3 44 27 pm

@LewisJEllis — Did you implement this feature?

I verified this feature is present in Brave Core; closing this issue as wontfix (with regards to fixing it in browser-laptop/Muon)
screen shot 2018-07-24 at 11 48 58 pm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

octohedron picture octohedron  Â·  3Comments

eljuno picture eljuno  Â·  3Comments

stevespringett picture stevespringett  Â·  3Comments

lukemulks picture lukemulks  Â·  3Comments

bsclifton picture bsclifton  Â·  3Comments