Changing Safari’s Search Engine

Safari doesn’t allow you to change the search provider without resorting to hacks. If you’d like to use something other than Google or have additional search providers available in Safari, try my bookmarklet tip.

A bookmarklet is a special bookmark that uses JavaScript to add functionality. When you click on a bookmarklet from your Bookmarks Bar, a prompt will appear. Type your search, hit return, and the search results will be loaded in the browser window. If your Bookmarks Bar is not visible, go to View > Show Bookmarks Bar in Safari.

Other Useful Search Engines

I made some bookmarklets of popular searches. Simply drag the links below to your Bookmarks Bar to use.

  • Bing
  • Wikipedia
  • eBay
  • Amazon

    Note: the above bookmarklet includes my Amazon Associates referral code that gives me a small kickback if you use it and purchase something.

Quick Keyboard Access

Bookmarks in Safari’s Bookmarks Bar can be accessed through a keyboard shortcut. Press command (⌘) and 1 to load the first bookmark in the Bookmarks Bar. Press 2 for the second, 3 for the third and so on.

Create Your Own

Here’s the base JavaScript for the bookmarklet:

var q = prompt('Search for','');
if (q != null) { 
	window.location = 'http://example.com/search?query=' + q;
}

When merged to a single line and URL escaped, it looks like:

javascript:var%20q=prompt('Search%20for','');if(q!=null){window.location='http://example.com/search?query='+q;}

To create your own, replace http://example.com/search?query= with the actual search provider’s query URI. Copy the URL escaped single line of JavaScript with the javascript: prefix. Open a blank Safari window and paste the line. Drag the site icon (the blue sphere in the Address Bar) to your Bookmarks Bar to save.

This is an easy and flexible way to have different and multiple search providers in Safari.

One Comment

  1. Posted 2010/08/31 at 22:25 | Permalink

    For Blekko, use:

    javascript:var%20q=prompt('Search%20for','');if(q!=null){window.location='http://beta.blekko.com/ws/'+q;}