Skip navigation.

web:config

tips and tricks for the interwebs

http phones file

, , , ,

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:
  • "explorer" on windows - beware, html files will be opened in IE :yuck:
  • "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.
So, install the following user script, which fixes the links and converts file: to file-opera:.
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 :smile:

We only know what indexOf isthe interwebs accesses your system !

Comments

remcolanting 31. December 2008, 12:13

Uhm, wow?

* Remco bookmarks

mabdul 2. January 2009, 15:13

yeah! wow. thats need a test o.O

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

Download Opera, the fastest and most secure browser