Allow custom handling of DNS failures
I like to be able to type search keywords straight into the location bar. Without a proxy, Firefox's "keyword.URL" feature[1] lets me do this. If there's just a single word and it's potentially a hostname, Firefox will first try to treat it as one, almost always getting a DNS failure before submitting it using keyword.URL. When there's a proxy configured it doesn't make sense for Firefox to attempt to detect DNS "host not found" errors -- it might have no access -- so it just hands a request for http://foobar/ to the proxy and returns what the proxy does.
Unlike Privoxy, Polipo doesn't provide a way to customise handling of DNS errors[2,3]. Such a feature has been discussed for Polipo[4] but never implemented as far as I can tell. I'm attaching a patch with an extremely simple workaround that does what I want, in a very similar way to Privoxy's: include some JavaScript in the response page so that the user can do whatever they like with the error, including redirection to FWSE[5] if they so choose. As Polipo has no templating system and hard-coding a keyword URL is unpalatable, the JavaScript is transcluded from Polipo's own webserver. I've also attached the JavaScript I use in case it's useful to someone.
I'd like you to consider including this patch.
Thanks,
zkw
[1] http://kb.mozillazine.org/Keyword.URL
[2] http://www.privoxy.org/user-manual/templates.html
[3] http://www.macosxhints.com/article.php?story=2005070411304373
[4] http://www.mail-archive.com/polipo-users@lists.sourceforge.net/msg00469.html
[5] http://en.wikipedia.org/wiki/FWSE
Trac:
Username: zkw