windows 7 - How can I configure Firefox to open links to local files?

11
2013-09
  • Ethan

    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.

  • Answers
  • Ethan

    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 Question

    security - Firefox makes links non-clickable
  • Mehper C. Palavuzlar

    I am using some online reporting pages from my company's web site. After logging in the related pages, I cannot click on the links that produce the reports. The links seem just as plain texts, and non-clickable. When I open the same pages in IE8, there is no problem. The links work and reports are generated. I've looked at the security settings from options menu, but found nothing. How can I make Firefox trust this site and work properly?

    Note: The web pages are in asp format, and the links are supposed to open the reports in Crystal Report Viewer. There are also some Flash graphs in some pages, and they don't work either.

    Source code of one frame:

    &lt;SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"&gt;
        function go_there(url)
        {
            window.open(url + '&prompt0=1&prompt1=' +  [..]);
        }
    &lt;/SCRIPT&gt;
    
    [..]
    
    &lt;td style="cursor:hand; [..]"
        onclick="go_there('/webreports/[..]/dpp_zmo_bayi_dd.rpt?apsuser=[..]');">
      &lt;img [..] src="[..]">&amp;nbsp;&amp;nbsp;Envanter inceleme linki (zmo_bayi_dd)
    &lt;/td&gt;
    

    After logging into the site, Error Console displays the following errors:

    Err1

    Err2

    Err3

    After opening the problematic page, the following errors are displayed:

    Err4

    Err5

    Finally, when I click on the links (although they don't look like links), these error messages are created:

    Err6


  • Related Answers
  • Arjan
    style="cursor:hand; [..]"

    The standards for CSS cursor do not define "hand", and hence that value is only understood by some browsers (like Internet Explorer, and in Safari if no strict DOCTYPE is set). Firefox doesn't support it.

    So: bad design by the creators of the site. However, the CSS only defines how things are shown; clicking in your source code sample should still work, even though the mouse pointer might not indicate something is clickable!

    function go_there(url)
    {
        window.open(url
          + '&prompt0=1&prompt1='
          + parent.detail.ust.form1.donem.value, [..]
        );
    }
    Error: parent.detail.ust.form1 is undefined  
    Error: parent.ust.form1 is undefined

    Too bad, this is caused by the way the web site tries to get information from the other frames. Maybe the things named "detail" and "ust" just don't exist and Internet Explorer ignores that. Or maybe this is just non-standard, IE-only. Bad implementation.

    (I'm sure someone could create a Greasemonkey script to replace the CSS hand on the fly, as a workaround. Some script might also fix the bad JavaScript, but as IE works I guess that's a bit too much.)

  • Phoshi

    Take a look at the Source (Right click -> View Source)

    Search for the text of one of the links, and see if it has <a href='url'>The text goes here</a> sort of tagging. If it doesn't, firefox is not the problem here.

  • Rich Bradshaw

    I'd guess that the built in popup blocker is being fired. This is a pretty weird way to make a link, and I wouldn't be surprised if it's blocked.

    Fx should show a message saying that the popup has been blocked, but you may have clicked a "never show this again" type message at some point... Check the settings to see if you can reset warnings.

  • ChrisAD

    Im guessing this is a caching problem? How does the URL look like when your at a page where links doesnt work? Firefox will automatically turn the URL into wyciwyg://yourUrlHere.com

    You can read more about What You Cache Is What You Get and find out how it may affect you.