file://localhost/ issues

Opera's goofy. It uses "file://localhost/" instead of "file:///" to represent paths to local files on your hard drive. All other browsers use "file:///".

"file://localhost/" is bad because barely anything supports it, which causes major compatibility problems for Opera.

For example, when a plug-in on a local web page reads document.location (for determining the base URI of a page, or the path to a file when you load a file directly and a plug-in is set to handle that file type), the plug-in will get a URI with "file://localhost/" in it, which will break the loading of the file because the code that plug-ins use to convert a file: path to a native path doesn't take "localhost" into account.

Also, for most programs, if the progam is passed a file URI on the command line, the program will convert it to a native path so that the file loads. But, again, this will fail if the file URI comes from Opera as it'll have "file://localhost/" in it.

Opera works around this issue for some popular plug-ins. But, it doesn't work around this for all plug-ins.

Another area that Opera doesn't work around this is with the "open with other application" "pass web address directly to application" option. If you click a link to a local mp3 for example that's set to pass directly to foobar2000.exe, the file won't play because foobar will generate an incorrect native path because the file URI has "file://localhost" in it.

To work around that issue, don't use "pass web address directly to application". Or, use a program/script as a command proxy that converts "file://localhost/" to "file:///". An example of such a program for vlc.exe (videolan) is located at <>. The source is easily editable so that you can adapt it for use with other exes. To compile it, use <>.

For Videolan, it has code that handles both "file:///" and "file://localhost/". But, the "file://localhost/" handling it has only works for Mac paths. There's a fix for this in video 1.2 to make this work on windows too, hopefully.

wmplayer.exe will load the correct file when passed a file URI with "file://localhost/" in it. But, the path in the properties of that entry in the playlist will be corrupted.

As for Opera fixing this problem, it's bug CORE-40495. People have been trying to get Opera to use "file:///" for years, but Opera hasn't fixed this. Add your support in the comments and the forums if you want this fixed.

Comments [Hide comments/form]

Nothing I could say would give you undue crdiet for this story. (2012-01-02 05:30:10)

Mvzmbo Scribbler, give me a student's record-book!)))) (2012-02-11 13:24:26)

n02cIK Not bad post, but a lot of extra !!.... (2012-02-12 04:06:28)

zUr0T0 I do`t see a feedback or the other coordinates from the blog administration!.... (2012-02-12 12:03:20)

Not bad post, leave it at my bookmarks!.... (2012-02-13 08:14:32)

Yeah, it is clear now !... From the very beginning I did not understand where was the connection with the title !!.... (2012-02-13 08:37:17)

Last a few years has been to Ibiza, so met a person there whose style of presentation is very similar to yours. But, unfortunately, that person is too far from the Internet!.... (2012-02-13 08:59:59)

The material is on the five plus. But there is a minus! My internet speed 56kb/sek. The page was loading for about 40 seconds!.... (2012-02-13 09:22:37)

Scribbler, give me a student's record-book!)))) (2012-02-13 09:45:11)

As usual, the webmaster posted correctly..! (2012-02-24 07:05:52)

As usual, the webmaster posted correctly..! (2012-02-24 07:17:43)

Cool:) I would say say it exploded my brain..! (2012-02-24 07:29:53)

I am getting married on the 15th of November. Congratulate me! Then will be here rarely!... (2012-02-24 07:41:51)

However, the author created a cool thing..! (2012-02-24 07:54:19)

Author, Shoot yourself a knee..! (2012-02-24 08:06:56)

XlNvng? Im obliged for the blog post.Really thank you! Fantastic. (2013-09-06 08:04:45)

hRGyZd Great, thanks for sharing this article post. Really Cool. (2013-09-06 10:16:19)

pc9eBf Wow, great article.Really looking forward to read more. Want more. (2013-09-11 16:54:42)

GXL5m7 Great blog.Really looking forward to read more. Cool. (2013-09-13 05:34:52)

TnUr4s? This is one awesome post.Really looking forward to read more. Fantastic. (2013-09-13 05:52:19)

Add a comment to this page (use wiki formatting if needed, no HTML/BBCode please). Only registered users can submit links, your comment will be deleted otherwise: