Apple does not allow users to add a new search engine to Safari. If users want to use Safari or Spotlight to search from web, they have no choice but to use whatever search engine provided by Apple.
To use any search engine as the default search engine on macOS, iOS or ipadOS globally. Startpage is used here as an example. This means apple device owners can:
- Use Startpage as the default search engine in Safari address bar.
- Use Startpage as the default search engine in Spotlight.
- Override
Search with Google
in macOS Context Menu. - Override
Search Web
in iOS and iPadOS Context Menu.
- Apple does not allow users to add a new search engine in Safari. But the search url can be redirected to any search engine.
- Install a Safari extension called Redirect Web for Safari.
- If you use a different browser on macOS, such as Firefox or Chrome, an addon called Redirector is required.
It is a free Safari extension. It is not required to pay for premium features as the free functionalities are good enough to get the job done. Having said that, purchasing premium features is a good way to support its developer.
- Set
Google
as the default search engine in Safari. - Save code below to a file with an extension of
redirectweb
, e.g.dummmy.redirectweb
. Then click theRedirect Web for Safari
icon in Safari Toolbar and import the rule. - In Safari settings, allow
Redirect Web for Safari
to read all websites you visit.
{
"appVersion" : "4.5.0",
"bundleID" : "io.github.mshibanami.RedirectWebForSafari",
"createdAt" : "2023-03-07T00:40:04.501Z",
"kind" : "RedirectList",
"redirects" : [
{
"appOpenerPostActions" : [
],
"captureGroupProcesses" : [
],
"comments" : "",
"destinationURLPattern" : "https:\/\/www.startpage.com\/do\/dsearch?query=$2",
"exampleURLs" : [
"https:\/\/www.google.co.uk\/search?q=what+is+my+ip+address&ie=UTF-8&oe=UTF-8&hl=en-gb&client=safari",
"https:\/\/www.google.com\/search?client=safari&rls=en&q=what+is+my+ip+address&ie=UTF-8&oe=UTF-8&safe=active",
"https:\/\/www.google.co.uk\/search?q=what+is+my+ip+address&ie=UTF-8&oe=UTF-8&hl=en-gb&client=safari&safe=active"
],
"excludeURLPatterns" : [
],
"isEnabled" : true,
"kind" : "Redirect",
"sourceURLPattern" : {
"type" : "regularExpression",
"value" : "^(?:https?:\\\/\\\/)(?:www.)google\\.(?:com|au|de|co.uk)\\\/search\\?(.+&)?q=([^&]+)(&.*)?"
},
"title" : "Redirect google search to startpage"
}
]
}
This step is required only if the default browser on macOS is not Safari. It is worth mentioning that Search with Google
launches Safari regardless of the default browser setting.
- Install Redirector addon in your browser.
- Save code below to a json file and import it to Redirector.
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2023-03-07T18:02:29.643Z",
"redirects": [
{
"description": "Redirect spotlight google search to startpage",
"exampleUrl": "https://www.google.com/search?client=safari&rls=en&q=what+is+my+ip+address&ie=UTF-8&oe=UTF-8&safe=active",
"exampleResult": "https://www.startpage.com/do/dsearch?query=what+is+my+ip+address",
"error": null,
"includePattern": "^(?:https?:\\/\\/)(?:www.)google\\.(?:com|au|de|co.uk)\\/search\\?(.+&)?q=([^&]+)(&.*)?",
"excludePattern": "",
"patternDesc": "Any word inside the q parameter goes to startpage search engine.",
"redirectUrl": "https://www.startpage.com/do/dsearch?query=$2",
"patternType": "R",
"processMatches": "noProcessing",
"disabled": false,
"grouped": false,
"appliesTo": [
"main_frame"
]
}
]
}
- A huge thank you for
Redirect Web for Safari
developer's help to create the redirect rule. - A huge thank you for the open source project
Redirector
.