URL-like

When text is entered at the url prompt, Conkeror needs to decide whether the text should be treated as an url, a webjump, or passed to the read-url handlers. Deciding what counts as an url is not as trivial as it might appear at first, because if Mozilla is given a string which is not a well-formed url, it will still attempt to resolve it by prepending http://, append .com, and so on. The default behavior of read-url is to consider any string as url-like if it does not have any inner spaces before the first '/'. This behavior can be changed by overriding the function possibly_valid_url in your rc.

1. possibly_valid_url

Here is an alternative version which requires the string to contain either a dot, a slash, or a colon to be considered url-like. This version works better when you have configured a default webjump because it means a single bare word will not be considered url-like: it allows your default webjump to be called instead.

function possibly_valid_url (str) {
    return /^\s*[^\/\s]*(\/|\s*$)/.test(str)
        && /[:\/\.]/.test(str);
}