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...


So I understand that this is an issue with Firefox's default security configuration.

And I tried these steps...

  1. Went to about:config in address bar.
  2. Right-click in white space, New -> String.
  3. Name 1st string default.checkloaduri.enabled with value allAccess.
  4. Add another string called localfilelinks.checkloaduri.enabled with value allAccess.
  5. 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.


1 Answer 1


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");
  • The line with capability.policy.localfilelinks.sites can have multiple websites separated by spaces.
    – Joe Flynn
    Jan 23, 2015 at 19:43
  • Is this still valid for FireFox > 30? The notes on the first linked page are not that clear for me.
    – PeterCo
    Oct 20, 2015 at 11:22
  • @PeterCo Yes
    – ederag
    Apr 3, 2016 at 6:22
  • How to specify "capability.policy.localfilelinks.sites" for localy direct accessed html files? "file://localhost"? Oct 20, 2016 at 11:09
  • 1
    This does not work in latest editions of Firefox (Quantum). Tested on 67.0.1
    – Rich M
    Jun 6, 2019 at 15:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.