How can I configure Firefox to open links to local files?
OK got it to work.
Put this in user.js
:
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://permitteddomain.com");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
Related videos on Youtube
Pankaj
Updated on September 18, 2022Comments
-
Pankaj almost 2 years
I'm trying to get Firefox 16.0.1 on Windows 7 to open links that have this form...
<a href="file:///g:/PATH/to/some_file.doc">some_file.doc</a>
I found this discussion about security policies in the Mozilla docs...
http://kb.mozillazine.org/Firefox_:Issues:_Links_to_Local_Pages_Don%27t_Work
So I understand that this is an issue with Firefox's default security configuration.
And I tried these steps...
- Went to about:config in address bar.
- Right-click in white space, New -> String.
- Name 1st string default.checkloaduri.enabled with value allAccess.
- Add another string called localfilelinks.checkloaduri.enabled with value allAccess.
- Add another string called localfilelinks.sites with value "localhost".
I think the problem may be that I don't understand what the correct value should be for localfilelinks.sites.
For context, this is an internal website that I have created. The users need to be able to click on links in the site and directly open Word, Excel, and PDF files from within their browser. I'm serving them Web pages with links in them in the form above. I've verified that the URIs are valid by copying them into the location bar.
Here's what's confusing me: all the documentation I've found seems to assume that the target files are on some remote Web server, so you put the domain for that server as a value for localfilelinks.sites and it works.
But in this case, from the users' point of view, it's just another drive attached to their computer, so I don't know how to express that in the config as a domain. My best guess is "localhost".
Any help would be greatly appreciated.
-
Joe Flynn over 9 yearsThe line with
capability.policy.localfilelinks.sites
can have multiple websites separated by spaces. -
PeterCo over 8 yearsIs this still valid for FireFox > 30? The notes on the first linked page are not that clear for me.
-
ederag about 8 years@PeterCo Yes
-
Hans Ginzel over 7 yearsHow to specify "capability.policy.localfilelinks.sites" for localy direct accessed html files? "file://localhost"?
-
Rich M about 5 yearsThis does not work in latest editions of Firefox (Quantum). Tested on 67.0.1