Skip to content

Safari, warn before quitting

New Course Coming Soon:

Get Really Good at Git

How to avoid closing Safari by mistake, using a simple trick

I’m a browser hopper.

I use a browser for too many hours a day and sometimes I just have to change browser, just to try something new.

Today it was the turn of Safari.

I like Safari, a lot. It’s light, no-frills, and very fast.

However, while opening a new tab with cmd-W I accidentally pressed cmd-Q, quitting the browser.

Chrome and Firefox provide a nice, optional confirmation dialog when trying to close them:

Safari does not have it.

So I re-mapped the cmd-Q to cmd-option-Q.

Here’s how I did it: open System Preferences, and click Keyboard:

Click Shortcuts, then App Shortcuts:

Add a new shortcut, choose Safari and call the Menu Title “Quit Safari”, and add the new shortcut:

There it is:

Since this has the same title of the existing Quit Safari menu, the shortcut will now change:

No more accidental quitting.

Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. A course that helps you feel less frustrated with Git. Launching May 21, 2024. Join the waiting list!
→ Read my DOM Tutorial on The Valley of Code
→ Read my Browser Events Tutorial on The Valley of Code
→ Read my Browser APIs Tutorials on The Valley of Code

Here is how can I help you: