keywurl
keywurl copied to clipboard
A better way to check if the entered URL is a Keywurl query
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
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
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.