Follow us on Twitter!
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill
Wednesday, April 16, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 20
Guests Online: 18
Members Online: 2

Registered Members: 82807
Newest Member: Black Hawk
Latest Articles

FireFox custom search engines

Arrow Image Tutorial on how to create your own searchplugin for FireFox



If you haven't already noticed there's a search engine quickbar next to the urlbar in FireFox 2
This can be used to search quickly for ex. Google or Wikipedia.

Sometimes when you go to a site the searchplugin list button may turn blue. This means you can add some of that site's functions to the quickbar.

"But how does FireFox know that there is a searchplugin available?"
Well, it's done with simple code in the HTML head:

<head>
<link rel="search" type="application/opensearchdescription+xml" href="Searchplugin XML file url" title="Searchplugin title" />
</head>

"How do I make a searchplugin then?"
For this you need to write an XML file that contains the instructions for FireFox, so that it knows what to search and where. Here's an example of my own XML file:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>My own searchplugin</os:ShortName>
<os:Description>My own searchplugin</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJkAAIAA/xwAN7dv/////yH5BAEAAAMALAAAAAAQABAAAAIynA2px6O/WAoCUnCmuPoiQHHgVjmjdqbpxYmuW6ETrIiQalulrGNmjsqogpJbpGF6NAoAOw==</os:Image>
<os:Url type="text/html" method="POST" template="http://www.someexamplesite.com/index.php">
<os:Param name="search" value="{searchTerms}"/>
<os:Param name="page" value="1"/>
</os:Url>
</SearchPlugin>

And broken down:

<os:ShortName>My own searchplugin</os:ShortName>
<os:Description>My own searchplugin</os:Description>
Your searchplugin's name and description. If I remember it right the name will show up in the searchplugin list and description shows up in the search field if it's blank.

<os:InputEncoding>UTF-8</os:InputEncoding>
The encoding. You'll probably keep it this way, but if you use some special characters you have to change it.

<os:Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJkAAIAA/xwAN7dv/////yH5BAEAAAMALAAAAAAQABAAAAIynA2px6O/WAoCUnCmuPoiQHHgVjmjdqbpxYmuW6ETrIiQalulrGNmjsqogpJbpGF6NAoAOw==</os:Image>
This is the fun one :D you get to draw your own icon for your searchplugin! I assume that it should be a 16x16 .ico file. If you are not familiar with how to create icons this may be a bit more difficult. Anyways the icon is encrypted with base64 so it always goes with the XML file. You can encrypt your icon with this:
http://www.motobit.com/util/base64-decoder-encoder.asp
and when you're done with it just put the code between "base64," and "<".

<os:Url type="text/html" method="POST" template="http://www.someexamplesite.com/index.php">
This one is the page that you want to post your search in. You may have to change POST to GET on some sites.

<os:Param name="search" value="{searchTerms}"/>
<os:Param name="page" value="1"/>
These are the inputs for the search form. This is probably the most annoying part. You have to go to that site defined above and find and write all form fields that are necessary for the search in here. The form field that has the search term is going to have {searchTerms} as value.

Now you can add your searchplugin to FireFox the way I mentioned first or manually by putting the XML file directly into FireFox "searchplugins" folder which is located in FF profile folder.

"What's the use? I don't know any site I could use this on"
Well this could be useful with ex. yellowpipe or maybe even HBH search functions.


- Mouzi

Comments

Mouzion March 22 2007 - 19:13:43
Nooo! I left a typo there. "..they I..." pfft. Grin well first article so lets blame that.
Mouzion March 22 2007 - 19:30:49
Hmm. Edit link. -.- (first article.. I'll blame that again)
ChioDoSon March 24 2007 - 01:32:18
This article sucks ass
Scavixon March 24 2007 - 03:21:38
Some sites need you to use GET instead of POST Other than that, good article. I just added UrbanDictionary.com Smile
Mouzion March 24 2007 - 16:02:02
Ok thanks. I'll add that.
richohealeyon May 24 2007 - 13:30:39
awesome. i liked it. adding wikipedia now
Post Comment

Sorry.

You must have completed the challenge Basic 1 and have 100 points or more, to be able to post.