Using the Squid Proxy Error Messages as Google Search Extension …

I always loved the following feature of KDE’s browser konqueror: With a simple configuration of a search engine as “standard search engine”, you could simply mark up a word in a text with the left mouse button, and by clicking the middle mouse button after that, e.g. the google search for that term was performed. Nothing faster than this, and you save some hundreds of clicks and cut’n’pastes when you are doing research work.

Unfortunately, neither Firefox nor IE can provide similar features. Well, I don’t care much about IE, but I have to use Mozilla sometimes, especially for multimedia content and more. Thus I’ve been looking for some way to speed up the search process, and now I found the first step. It’s not perfect, but it works. The Squid Proxy’s error messages are an easy hack for that.
If you change the ERR_DNS_FAIL file in /usr/share/squid/errors/English/, and add one line containing a redirection and a placeholder, then you are pointed to e.g. google at once.

This is an example that works for me – I added the meta http-equiv=”refresh” – line later, because at first I was satisfied to have the link href=http://www.google.de/search?hl=de&q=%U in a Paragraph of the error message. That gives the user a simple link to google whenever he enters a string/word/term in the URL-bar that is not resolvable – and if it is pasted by a middle-mouse-click!

Far from perfect, but for me it works. Please update me with any ideas on that – i don’t like that the http:// appears in the google search, but according to the Linux-FAQ, there is no better placeholder available than %U.
Another cool feature of that is: mistyping an URL will lead to Google’s “Did you mean…”-Feature. I like that!🙂

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: