This document describes how to improve Opera's default search queries by using a hex editor (KHexEdit). We will patch (hexedit) Opera and replace each query by one of our favorite search engines.
Opera introduced an easier way to change the search engines by using a search.ini file. So this document is outdated for most parts. But since you can't change Opera for Linux' encyclopedia and dictionary queries using search.ini, you would still have to directly patch Opera using the following description.
Disclaimer: You are doing everything at your own risk. Use your brains. Make backups. Don't screw up your system.Our goal is to change Opera's default queries to our personal favorites. I will use some German domains instead of Opera's defaults.
Before you start, please create a backup of the opera binary. I will demonstrate the changes with Opera for Linux TP2 (Build 083). You will probably find the binary at /usr/lib/opera/6.0-20011129.1/opera.
All you'll need to make the changes is a hex editor. You can use KHexEdit (khexedit).
In the end, we will have changed four web shortcuts and the resulting URLs: Google.de instead of Google.com; Amazon.de instead of Amazon.com; Heise's Softlink instead of Price Comparison; and eBay.de instead of Domain Name search. Moreover, we will change the Dictionary and Encyclopedia Hotclick queries.
Shortcuts before editing |
Shortcuts after editing |
We will replace the default Google search query with the German version.
g Opera for Linux
http://www.google.de/search?q=Opera%20for%20Linux&ie=utf-8&oe=utf-8
Open the opera binary in your favorite hex editor, for example khexedit and search for «google.com». Note: You will find it at more than one location. Right now, all we care about is the third location -- the one after the search string entry.
We will just replace the highlighted part with our own query. Since our query is a lot shorter, we will just pad the rest with 00h.
Warning: You must not change the total file size and you can only replace strings. Do not overwrite program code. And check if you made a backup of the file you will be editing.
The strings we will change look like this: Name of the shortcut in the user interface. Shortcut. URL. %1 is the search string that will get passed. %2 is the default number of results that will get passed.
We will replace the default Amazon search query with the German version.
z Harry Potter
http://www.amazon.de/exec/obidos/external-search?index=blended&keyword=Harry%20Potter
Search for «amazon.com». Note: There will be exactly one hit. It will look like that:
We will just replace the highlighted part with our own query. Since our query is a lot shorter, we will just pad the rest with 00h.
We will replace the default Price Comparison search query with Heise's Softlink search
p 0203177
http://www.heise.de/fastbin/ct_ID?ctid=0203177
Search for «Price Comparison». Note: There will be exactly one hit. It will look like that:
We will just replace the highlighted part with our own query, again padding the rest with 00h.
We will replace the default Domain Name query with the German eBay search.
d Backgammon
http://search.ebay.de/search/search.dll?MfcISAPICommand=GetResult&query=Backgammon
Search for «Domain Name». Note: There will be exactly one hit. It will look like that:
We will just replace the highlighted part with our own query, again padding the rest with 00h.
We will replace the default Dictionary Hotclick query with the Langenscheidt search.
right-clicking a word, e.g., «authentifizieren» and selecting
«Dictionary»
http://www.langenscheidt.aol.de/cgi-bin/webquery.pl?method=soundex&key=authentifizieren
Search for «in=dictionary». Note: There will be exactly one hit. It will look like that:
We will just replace the highlighted part with our own query. We will have to overwrite some of the 00h.
We will replace the default Encyclopedia Hotclick query with the Xipolis search.
right-clicking a word, e.g., «Xanadu» and selecting
«Encyclopedia»
http://xipolis.net/suche/suche_treffer.php?such_modus=einfach&wo=1&s1=Xanadu
Search for «in=encyclopedia». Note: There will be exactly one hit. It will look like that:
We will just replace the highlighted part with our own query. We will have to overwrite some of the 00h.
Now save your changes, quit khexedit and run Opera. If it crashes, restore the original file from the backup and start over again. Good luck.
22 March 2002
Martin Schrode
<webmaster @ schrode . net>
http://www.schrode.net/opera/search/search.html