Skip to content

Open URLs that start with "chrome://" in Chrome on MacOS.

Published at  at 12:27 PM

What’s the problem?

If you try to open a URL like “chrome://history” or “chrome-extension://xxx” through another app such as Alfred or Raycast, you’ll get this error: “There is no application set to open the URL chrome://history”.

There is no application set to open the URL chrome://history

And when you click the “Choose Application…” button, you will find the “Google Chrome” was unselectable:

Choose an application to open the document "chrome://history"

A temporary solution

Click the “Show Options” button in the bottom left corner, then select “All Applications” instead of “Recommended Applications.”

Choose an application to open the document "chrome://history"

You will see that Chrome has opened its history page. But you must do these steps every time, it’s not convenient.

A solution once and for all

First of all, we should link the “chrome://” and “chrome-extension://” schema to Chrome. This can be done by modify /Applications/Google Chrome.app/Contents/Info.plist(don’t do it right now):

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLName</key>
			<string>Web site URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>http</string>
				<string>https</string>
+				<string>chrome</string>
+				<string>chrome-extension</string>
			</array>
		</dict>
		<dict>
			<key>CFBundleURLName</key>
			<string>Local file URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>file</string>
			</array>
		</dict>
	</array>

However, this will break Chrome and is not user-friendly when there is an update. So, we can make a new Application to link the two url schemas:

Open /Applications/Utilities/Script Editor.app and paste the following code into it:

on open location this_URL
	tell application "Google Chrome"
		open location this_URL
		activate
	end tell
end open location

Click “File” and select “Export.” Set the file format to “Application,” name the application (e.g., ChromeProtocol.app), and save it.

Save the script as an Application

Open /Applications/ChromeProtocol.app/Contents/Info.plist and add the following config:

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLName</key>
			<string>Chrome Internal URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>chrome</string>
				<string>chrome-extension</string>
			</array>
		</dict>
	</array>

Save and exit you editor.

And open “chrome://history” through other app, for example, Raycast. And select the new Application “ChromeProtocol.app” we just created to open this URL just like we did above:

Select the new Application

And you will find everythings works. 🎉🎉🎉 If not, try rebooting the system.

Share on: