How can I configure Firefox to open links to local files?

9,081

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");
Share:
9,081

Related videos on Youtube

Pankaj
Author by

Pankaj

Updated on September 18, 2022

Comments

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

    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.

  • Joe Flynn
    Joe Flynn over 9 years
    The line with capability.policy.localfilelinks.sites can have multiple websites separated by spaces.
  • PeterCo
    PeterCo over 8 years
    Is this still valid for FireFox > 30? The notes on the first linked page are not that clear for me.
  • ederag
    ederag about 8 years
    @PeterCo Yes
  • Hans Ginzel
    Hans Ginzel over 7 years
    How to specify "capability.policy.localfilelinks.sites" for localy direct accessed html files? "file://localhost"?
  • Rich M
    Rich M about 5 years
    This does not work in latest editions of Firefox (Quantum). Tested on 67.0.1