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


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: 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 | # ]