Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix URL autocomplete when using Privoxy Web Browsers
I was hunting through my drive for things to delete and I came across an old instll of Privoxy. I decided to upgrade to 3.03 and fire it up, and was immediately reminded of why I loved it -- no flashing banners or popups I was also reminded of why I turned it off -- it kills the autocomplete feature of Safari.

Some people have noticed this behavior and commented on it here, but as far as I know, there is no solution posted. A little googling turned up this hint, which I just tried and it works great. Read the rest if you'd like the step-by-step instructions...

In the Terminal, cd to /Library/Privoxy/templates and type this:
sudo cp no-such-domain no-such-domain.old
Enter your administrator password. Then, type open ., and a Finder window will open for this folder. Drag the file called no-such-domain to the text editor of your choice, and just below these lines (the DOCTYPE line has been split for a narrower display):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html> 
add the following text:
<!-- Privoxy Autocomplete workaround (begin) -->
<script type="text/javascript">;
var host="@host@"
var pos=host.indexOf("www")
if (pos==-1)
{
window.location="http://www.@host@.com"
}
</script>;
<!-- Privoxy Autocomplete workaround (end) -->;
Save the file, and quit. Your browser should now add the www. and .com to any domain you type into the browser.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[7,046 views]  

Fix URL autocomplete when using Privoxy | 5 comments | Create New Account
Click here to return to the 'Fix URL autocomplete when using Privoxy' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix URL autocomplete when using Privoxy
Authored by: gpl on Jul 14, '05 09:17:48AM
Juste a little improvement: you can change the line:
window.location="http://www.@host@.com"
to:
window.location="http://www.@host@.com/@path@"
in order to enable for example apple/fr to go to www.apple.com/fr as Safari does by default.

Another minor thing: you can delete the ";" after and .

[ Reply to This | # ]

Fix URL autocomplete when using Privoxy
Authored by: olivesoft on Jul 14, '05 11:13:31PM
I like this code better.

<!-- Privoxy Autocomplete workaround (begin) -->
<script type="text/javascript">
var host = "@host@"
if (host.match("\.com$"))
{
	if (host.match("^[^(www\.)]"))
	{
		window.location = "http://www.@host@@path@"
	}
}
else
{
	window.location = "http://@host@.com@path@"
}
</script>
<!-- Privoxy Autocomplete workaround (end) -->
What it does is to check to see if the host ends in ".com". If it doesn't, it adds it and tries again. If it does, it checks to see if the host starts with "www.". If not, it adds it and tries again. This way, if you enter, say "foobar", it will first try "http://foobar.com". If that fails, it will try "http://www.foobar.com". If that fails, you will get the Privoxy 404 page.

---
-Bob
---------------------
I tend to think of [Mac] OS X as Linux with QA and Taste.
-James Gosling, Java Architect

[ Reply to This | # ]

Fix URL autocomplete when using Privoxy
Authored by: lrosenstein on Jul 14, '05 08:10:57PM

Nice idea. I had patched the privoxy source code to do this, but modifying the error page is easier.



[ Reply to This | # ]
Fix URL autocomplete when using Privoxy
Authored by: Tiny Clanger on Jul 15, '05 03:16:19AM
I'm the other way round - I'm not using Privoxy (it's PithHelmet for me) and I find that autocomplete insanely annoying, especially when I type the name of a machine on the local network and get bounced to some .com just because my local machine was down.

Anybody know how I can disable it? Thanks...

[ Reply to This | # ]

Fix URL autocomplete when using Privoxy
Authored by: matsur on Jul 15, '05 12:28:01PM
Even better thanthe current function IMO is what Firefox does. It takes you the the result of Google's "I'm Feeling Lucky" when you enter an ambiguous term in the location bar. to accomplish this with the script, I'm pretty sure all you have to do is use this code block instead of the one above:

<!-- Privoxy Autocomplete workaround (begin) -->
<script type="text/javascript">;
var host="@host@"
var pos=host.indexOf("www")
if (pos==-1)
{
window.location="http://www.google.com/search?q=@host@&btnI=I'm+Feeling+Lucky"
}
</script>;
<!-- Privoxy Autocomplete workaround (end) -->;


[ Reply to This | # ]