Hi, On Fri, Jan 04, 2008 at 06:03:31PM +0000, Beartooth wrote:
On Thu, 03 Jan 2008 21:30:32 +0000, Jeremy Henty wrote:
On Thu, Jan 03, 2008 at 04:29:39PM +0000, Beartooth wrote:
With other browsers, if I copy a URL that begins with www (i.e., no http://), I will get to the site; with some, I don't even need the www -- I can type simply "loc.gov" for instance, to be taken to the Library of Congress.
Doesn't Dillo already do this? If I create a new Dillo window, type imdb.com into the URL field and hit <Enter>, Dillo takes me to http://imdb.com . The same works for starurchin.org (my personal domain) and loc.gov too. These also work if I copy and paste the URL instead of typing it.
Can you give a specific example where Dillo does not work as you would like? Which version are you using?
I mis-spoke. Instead of "copy," I meant "click on." I have my newsreader and my mailers (even the remote one) set so that if I click on a URL in a message, they launch Dillo.
If a message contains, for instance, "www.loc.gov," Dillo will launch and will show that in the URL field; but it won't open the site.
I'm running 0.8.6 under Fedora 8.
You can try the patch below, but beware that it opens a security hole because if a file is not found it will ask the filename with the HTTP protocol. Now AFAIS this is not a huge risk because the queries are going to different machines, and the local DNS will only get the first segment of the filename. Now, if an evil DNS tells you that the "server" exists and sends you a prepared IP, the server on that IP will get all the information. Anyway, if you don't mind someone may get your filenames, you can use the patch. Or compile a special dillo to hook to the MUA, and friends, and take care to read the URL before launching it! :-) diff -pru dillo2/src/html.cc dillo2-cur/src/html.cc --- dillo2/src/html.cc 2008-01-08 09:07:18.000000000 -0300 +++ dillo2-cur/src/html.cc 2008-01-08 10:22:08.000000000 -0300 @@ -3000,7 +3000,13 @@ static void Html_tag_open_a(DilloHtml *h url = Html_url_new(html, attrbuf, NULL, 0, 0, 0, 0); dReturn_if_fail ( url != NULL ); - + if (strcmp(URL_SCHEME(url), "file") == 0 && + access(URL_PATH(url), F_OK) != 0) { + char *http_try = dStrconcat("http://", attrbuf, NULL); + a_Url_free(url); + url = Html_url_new(html, http_try, NULL, 0, 0, 0, 0); + dFree(http_try); + } old_style = S_TOP(html)->style; style_attrs = *old_style; -- Cheers Jorge.-