http phones file
Wednesday, 31. December 2008, 02:51:34
Hi to everyone!
As some of you might have experienced, Opera blocks access from http: pages to file: or http: in the internet to http: in the intranet.
This however, causes an unfortunate situation where you can't use Opera, for instance, at work if you have intranet web apps that point to network shares with content.
However, this because just an annoyance which is workaroundable.
The trick is simple: set the file: protocol to be handled by an external application, and you should be done. That external application can be Opera again, and in this case, it'll open the network path in a new tab, just like if you clicked an http link normally.
You can also use either of the following depending on your OS/desktop environment:
But, unfortunately, we're not over. Opera has two bugs which make this solution not that straightforward (yes both are reported).
First, some UNC paths are misresolved, for instance:
For instance, if you add a url like \\server\share in MediaWiki, it'll convert it to file:\\server\share
Second, despite being set to open with an external application, Opera still blocks http: to file:.
Solution:
fix-file-protocol.js
Second, choose one of the following scripts according to your operating system
Third, go to Tools>Preferences>Advanced>Programs and add a new protocol "file-opera" to be handled by the script you just saved. These scripts open the url in Opera. If you want them to open another program then you're free to edit them yourselves.
And that should do it.
Have fun
As some of you might have experienced, Opera blocks access from http: pages to file: or http: in the internet to http: in the intranet.
This however, causes an unfortunate situation where you can't use Opera, for instance, at work if you have intranet web apps that point to network shares with content.
However, this because just an annoyance which is workaroundable.
The trick is simple: set the file: protocol to be handled by an external application, and you should be done. That external application can be Opera again, and in this case, it'll open the network path in a new tab, just like if you clicked an http link normally.
You can also use either of the following depending on your OS/desktop environment:
- "explorer" on windows - beware, html files will be opened in IE

- "kfmclient" on linux with KDE desktop
- "gnome-open" on linux with Gnome desktop
- "open" on Mac OSX
But, unfortunately, we're not over. Opera has two bugs which make this solution not that straightforward (yes both are reported).
First, some UNC paths are misresolved, for instance:
<a href="\\server\share"> <a href="file:\\server\share">Although these paths are not valid URIs, some tools generate then, as I've seen.
For instance, if you add a url like \\server\share in MediaWiki, it'll convert it to file:\\server\share
Second, despite being set to open with an external application, Opera still blocks http: to file:.
Solution:
- to overcome the misresolved links,obviously we'll use an user script
- to overcome the http: to file: block you need to rename file: to something else and tell Opera to open it, so we'll use an user script for this as well.
fix-file-protocol.js
Second, choose one of the following scripts according to your operating system
-
Windows, place the file in the Opera installation directory
-
Linux, place it where ever you like
- Mac OSX, place it where ever you like
Third, go to Tools>Preferences>Advanced>Programs and add a new protocol "file-opera" to be handled by the script you just saved. These scripts open the url in Opera. If you want them to open another program then you're free to edit them yourselves.
And that should do it.
Have fun



