Redelijkheid.com as a FireFox Search Engine

Search

While the content on my website increases, it's getting (a bit) harder to find certain content. Sure, there's this search form in the top right of the website, but this means that you have to open the website first, enter the keyword and hit 'Enter'.

To speed things up I created a custom FireFox search engine. Using this I can search for content on my website directly from the browser. No matter what site I'm currently on.

The custom search engines are located in the profiles directory.

OSX: ~/Library/Application Data/Firefox/profiles/<random>/searchplugins/<searchengine>.xml

Windows: c:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\<random>\searchplugins\<searchengine>.xml

By adding the following XML file (right-click - Save As) to the directory listed above, you add the Redelijkheid.com search engine to your Firefox search engines.

You can create your own custom search engine, just by altering the data in the XML file.

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:moz="http://a9.com/-/spec/opensearch/1.1/">

<ShortName>Redelijkheid</ShortName>

<Description>Redelijkheid.com Search</Description>

<InputEncoding>UTF-8</InputEncoding>

<Image width="16" height="16">data:image/x-icon;base64,

/9j/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMgIyIoLTkwKCo2KyIjMkQyNjs9

QEBAJjBGS0U+Sjk/QD3/2wBDAQsLCw8NDx0QEB09KSMpPT09PT09PT09PT09PT09PT09PT09PT09

PT09PT09PT09PT09PT09PT09PT09PT09PT3/wAARCAAQABADASEAAhEBAxEB/8QAHwAAAQUBAQEB

AQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1Fh

ByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZ

WmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG

x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAEC

AwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHB

CSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0

dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX

2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDK8U3uv2/iJ0sIBPb7MBngUgeoLHv1

/CuN1fTnjt/t62zQIXCyxgcKT3HoP8+lcdNxjaz3PRrRlJO62O28IBNHjkg1HUd7XADRwvE8ZVu+

CwBNaGtGO602a2fa8Uq7duOR7/1rKo7PRHVCLatPc//Z

</Image>

<moz:SearchForm>/</moz:SearchForm>

<Url type="text/html" method="GET" template="/?q={searchTerms}">

</Url>

</SearchPlugin>

The only 'rocket science' here is the icon you see when selecting the search engine. The easiest way is to download the favicon image most sites have nowadays. You can download those by going to http://<website>/favicon.ico.

Save the image (on your desktop e.g.), and convert the image to a BASE64 encoded format. Copy the resulting BASE64 string in the XML file (replacing my own image, marked red), and you can save the XML file to the location mentioned earlier.

After restarting Firefox, you should be able to select the newly created custom search engine in Firefox. Very handy for website you visit a lot.

An alternative is to add the following code to the headers of your webpage:

<link rel="search" type="application/opensearchdescription+xml" title="searchTitle" href="pluginURL">

Where searchTitle is the shortname (as used in the actual XML file) of the custom search engine, and pluginURL is the location where the XML file is located.

The search engine will now show up on the Firefox search pull down menu when you visit the website.

Add it, and you're good to go.

Posted on August 13, 2009 and filed under Browsers, Internet, Personal, Website.