atombender / keywurl

Keywurl only supports Safari 4.x and earlier and is therefore deprecated.
Other
86 stars 9 forks source link

A better way to check if the entered URL is a Keywurl query #10

Open hac opened 14 years ago

hac commented 14 years ago

If Keywurl is going to turn everything with a space or without a period into a search, this should be something that the user can disable. This is because there may be URLs like the following:

localhost about:blank javascript:alert("hello")

Some websites also have links with unencoded spaces, which cause unexpected redirects to the default search engine.

I think it would be better to simply look for a keyword as the first word of the URL, like I do in this modified version of KeywurlBrowserWindowController: http://gist.github.com/278925

pmarschik commented 14 years ago

I like the default search, maybe a more comprehensive algorithm to check if the thing entered is a search or not would be better eg check /etc/hosts, check for different starting keywords like protocols/javascript:, check for bonjour/smb share names … if all of these fail do a default search

hac commented 14 years ago

Another way to do this would be to intercept the input at another level, after the browser has already tried to parse it out. If the browser fails to load the URL and there are no periods in the input string, redirect the user to a search page.