Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firefox open local link to directory with explorer

On a Website for our internal use i show links to local files and folders. the links are like this:

href="file://C:/example/"
href="file://C:/example/test.odt"

The Problem is now that the link to the directory does open in firefox itself with a useless directory listing. Useless because you can just see the files or open them but not copy, insert, delete... The link to the file work normal and the file is opend by OpenOffice. By changing the configuration of firefox and setting the following key to false I can open the directory in with explorer.exe but for the file I have to choose the right application.

network.protocol-handler.expose.file

Does someone know a way to get both to work like i want? Means that the Directory is shown by explorer.exe and all files are opened by the right application. This can be by configuring Firefox or windows, changing the links, or even by writing a small program which opens all the file protocol correctly and will be used as protocol handler for the file protocol in firefox.

Thanks Raffael

like image 290
raffael Avatar asked Nov 26 '09 16:11

raffael


3 Answers

I did the above with small changes in Firefox 14.0.1, which works for me:

  1. Create new boolean value network.protocol-handler.expose.file and set it to false
  2. Create new boolean value network.protocol-handler.external.file and set it to true
  3. Click on a link to a local folder.
  4. In the following prompt, link to the explorer.exe in: C:\Windows\explorer.exe

Files are now open with the default application, folders are open with the Windows Explorer!

like image 98
RangerJo Avatar answered Oct 02 '22 13:10

RangerJo


I know this is not quite what you want, but you might take a look at the "launchy" addon for firefox:

https://addons.mozilla.org/en-US/firefox/addon/81/

Using this addon you can right click on a file link, go to "launchy" sub-menu, and tell it to open in explorer. This will browse directly to the folder as you want.

I want the same feature you want, however this "works" for now. I have asked the author of launchy to allow it to override the left-click behavior for certain protocols (so it would launch explorer with one click), but I don't have a response yet.

edit: Years later, I will post the solution I started using instead of Launchy:

https://addons.mozilla.org/en-us/firefox/addon/local-filesystem-links/

https://github.com/feinstaub/firefox_addon_local_filesystem_links

This scans for file:// links and makes them clickable. It does inject some HTML which can mess with formatting if you aren't careful, but it does the job.

like image 40
Dan Avatar answered Oct 02 '22 15:10

Dan


In about:config You need to add a boolean value with the name network.protocol-handler.expose.file and set it to false and also create a string value with the name capability.policy.default.checkloaduri.enabled and set it to allAccess.

Now you will be able to choose C:\Windows\explorer.exe to open file links.

Tested in FF 19.0.2 in Windows 7.

like image 36
Björn Tantau Avatar answered Oct 02 '22 14:10

Björn Tantau