Google Chrome is without doubt my favorite browser, but its recent update (v. 68.0.3440.75 to be exact) fixed a bug that was a feature to me and many others. Prior to the update, any external link outside of Chrome would be opened as a new tab in the last active window of Chrome, meaning that if you were using the Incognito mode, Chrome would open the URLs you click in Mail, Notes, or your PDF viewer in a new tab under that same Incognito window.

This has been a rather convenience feature, especially if you want to keep your browsing history clean. By clean I mean I want my browsing history to be filled with websites that are worth coming back to, not some unnecessary junk, like the links to “unsubscribe” from newletters you never mean to subscribe.

The solution turns out to be much simpler than I expected: just create an AppleScript, save it as an Application, register it as a handler of http and https schemes, set the default web browser in System Preferences as the application, and voila!

Here is the AppleScript I wrote:

on run theURL
	tell application "Google Chrome"
		if application "Google Chrome" is not running then
			close window 1
		end if
		make new window with properties {mode:"incognito"}
		tell its window 1
			set URL of tab 1 to theURL
		end tell
	end tell
end run

If you don’t really want to deal with all this, that’s fine. Just download this zipped, unzip and drag the to your /Applications/ folder, and set it as the default web browser. Oh and btw, you might need to run:

sudo spctl --master-disable

to disable the Gatekeeper for macOS Sierra or later.

Hey, kudos for making it this far! Wanted to let you know that if you liked this, you might also like tmux Cheatsheet and Shortcuts.


I'm Bobby Yan, a programmer, music lover, researcher, and a third-year undergraduate student at UC Berkeley majoring in Electrical Engineering and Computer Science. I am currently doing research on robotics, planning, and systems for machine learning at RISELab. In the past, I built IB Notes, a website with useful and concise study guides and notes for IB, and Spanish Vocab Builder, an iOS app to help Spanish learners. See my résumé for more details.

If you enjoyed this article, you should follow me on Twitter or sign up to get an email whenever I write something new:

Share this article with your friends: