Browse by type
http://safarikeywordsearch.aurlien.net
Safari Keyword Search is a simple extension for Safari on macOS and iOS that lets you change the default search engine and search using any search engine using keywords in the address bar. For example, you can search Wikipedia for information on monkeys by typing w monkeys in the address bar.
The following searches are included in the default set:
You can also add your own searches in the extension settings, which live inside Safari.
Your searches and settings sync between your devices through iCloud. Changes made on different devices are merged, so adding searches on two devices keeps both. Devices still running an older version of the app keep syncing too.
Requires Safari 17 or later (iOS 17, macOS 12 or later).
Safari asks for permission before the extension can see your searches. Keyword Search only needs access to the search engine Safari uses (e.g. google.com), not to the sites it sends you to. If you switch search engines, either allow access on every website or allow the new search engine too.
If you want to contribute a PR, feel free. Let me warn you, the source code is a lot like a garbage fire at a spaghetti factory.
There is a bug in Safari on macOS where extensions sometimes disappear. To fix it, follow these steps:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f -R /Applications/Safari.app
Thanks to Jeff Johnson for figuring that out and @porg for helping clarify these instructions.
This is how the extension works:
client=safari for Google)Parsing the URL to get the search string is not optimal, but it’s the only way with the current APIs. These edge cases/bugs can occur:
Redirecting with declarativeNetRequest instead would avoid loading the search engine at all, but in Safari 27 it makes Safari regularly reload the page with “This webpage was reloaded because of a problem”, so it’s not used.
The previous previous Safari Extension API had a beforeSearch event that was a lot more convenient. To any Safari developers who might be reading this: hello!
The extension’s JavaScript lives in Shared (Extension)/Resources/src. Xcode builds it with esbuild (npm run build) into popup.js and background.js before each build, using node from fnm or Homebrew. Tests run with npm test in Shared (Extension)/Resources.
search.js: recognizing search URLs and expanding keywordsdata.js: the data format, defaults and upgrades from older formatssync.js: merging data between devices and with older versions of the appbackground.js: listens for navigation and talks to the native sideEditor.jsx, popup.jsx: the settings popupThe native side (Shared (Extension)/Data.swift) only stores the data, locally and in iCloud key-value storage.
—
$ claude mcp add SafariKeywordSearch \
-- python -m otcore.mcp_server <graph>