+ Post New Thread
Results 1 to 8 of 8
Web Development Thread, File:// links in Firefox and Safari in Coding and Web Development; On our intranet we have a page that generates links to server shares and puts them on a web page ...
  1. #1
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,381
    Thank Post
    125
    Thanked 97 Times in 66 Posts
    Rep Power
    31

    File:// links in Firefox and Safari

    On our intranet we have a page that generates links to server shares and puts them on a web page as a link in the following format:

    file:///SERVER/FOLDER/FOLDER - clicking the link in IE opens the folder

    In Firefox this does nothing - and the same in Safari

    Firefox does seem to change the link to:

    file://///SERVER/FOLDER/FOLDER

    I know its classed as a security problem for Firefox but even when I set a security policy preference to allow it the link still does nothing - and Safari gives no help at all

    Has anyone got this working, or its there an easy way around this that will work in various browsers? I want to open the folder in a window, not a specific file.

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,401
    Thank Post
    242
    Thanked 2,824 Times in 2,083 Posts
    Rep Power
    814
    Quote Originally Posted by Sheridan View Post
    even when I set a security policy preference to allow it the link still does nothing
    Which preferences did you change in Firefox? Did you add them to your mozilla.cfg or user.js file?

    The policies below are taken from here.

    Code:
    lockPref("capability.policy.policynames", "localfilelinks");
    lockPref("capability.policy.localfilelinks.sites", "http://intranet http://internal");
    lockPref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
    Another option could be to try an add-on called LocalLink.

  3. Thanks to Arthur from:

    Sheridan (3rd February 2012)

  4. #3
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,381
    Thank Post
    125
    Thanked 97 Times in 66 Posts
    Rep Power
    31
    Yes, those are the policies I used as well - I think from the same site.

    I put them in the user.js file but it didn't seem to make any difference. I did have a quick look at the locallink but I was hoping to find a way around this without using 3rd party software/plugins etc!

  5. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,898
    Thank Post
    3,423
    Thanked 1,081 Times in 997 Posts
    Rep Power
    369
    Have you got a code snippet so I can see if you are literally just using file:///server/folder/file.ext or are you using some asp code to execute this or make it a link or what exactly ?

    Local Link extension as above or look here :

    http://kb.mozillazine.org/Links_to_local_pages_don't_work

    UNC Paths

    If you're linking to a file in a UNC path (e.g., \\servername\share\file.ext), you will need to specify the path thusly:


    file://///servername/share/file.ext


    Also note that you cannot link to file://///servername to get a listing of shares at that hostname due to a bug.
    Not finding much on Safari but worth trying the link as per above for Safari to see if that helps or makes any difference
    Last edited by mac_shinobi; 3rd February 2012 at 08:45 PM.

  6. #5
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,381
    Thank Post
    125
    Thanked 97 Times in 66 Posts
    Rep Power
    31
    Its just a one line bit if code that put the link down as an <href> exactly as this:

    file:///SERVER/FOLDER/FOLDER

    Its works fine in IE - not in Firefox (which sounds like it can be worked around) and not in Safari (which sounds like there's no way around it)

  7. #6
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,381
    Thank Post
    125
    Thanked 97 Times in 66 Posts
    Rep Power
    31
    Well I've been tinkering with this on and off for weeks now and can only come to the conclusion it can't be done in Firefox without 3rd party plugins. Which renders firefox useless for us on the network.

    I've put the prefs in every damn prefs file I can find: all.js,user.js,prefs.js,whydontyouflippingwellwork .js and anything else I could think of!

    Code:
    user_pref("capability.policy.policynames", "localfilelinks");
    user_pref("capability.policy.localfilelinks.sites", "http://server");
    user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
    The links come up correctly and work fine in IE, but do nothing in Firefox. I notice none of the above preferences appear when you look through the list in about:config either.

    Good old IE - the faithful old dog stays as our standard browser!
    Last edited by Sheridan; 15th March 2012 at 01:55 PM.

  8. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,898
    Thank Post
    3,423
    Thanked 1,081 Times in 997 Posts
    Rep Power
    369
    Quote Originally Posted by Sheridan View Post
    Well I've been tinkering with this on and off for weeks now and can only come to the conclusion it can't be done in Firefox without 3rd party plugins. Which renders firefox useless for us on the network.

    I've put the prefs in every damn prefs file I can find: all.js,user.js,prefs.js,whydontyouflippingwellwork .js and anything else I could think of!

    Code:
    user_pref("capability.policy.policynames", "localfilelinks");
    user_pref("capability.policy.localfilelinks.sites", "http://server");
    user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
    The links come up correctly and work fine in IE, but do nothing in Firefox.

    Good old IE - the faithful old dog stays as our standard browser!
    As long as your AV solution doesn't hinder chrome useless, what about using Chrome ( you also get GPO from google chrome ) to lock it down etc ??

  9. #8
    Sheridan's Avatar
    Join Date
    Oct 2010
    Posts
    1,381
    Thank Post
    125
    Thanked 97 Times in 66 Posts
    Rep Power
    31
    Its mainly because I (and a a lot of staff) use firefox at home as well so I was hoping to offer a choice of browser. With the intranet rendered useless by firefox I guess I'll have to rethink!

    It amazes me how many people slag off IE - but in my experience it works more reliably than any of the others.

    And P.S. Mozilla, if you're going to allow preferences, then provide some documentation that makes sense and doesn't contradict itself!

    Edit: Chrome does the same thing as firefox. FFS what do these guys have aginst people opening files on their intranet!
    Last edited by Sheridan; 15th March 2012 at 03:05 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Moodle site opens in Firefox/Chrome/Safari but not Internet Explorer
    By HMCTech in forum Virtual Learning Platforms
    Replies: 12
    Last Post: 4th June 2010, 12:57 PM
  2. Help needed with new website - link not working in FireFox
    By mitchell1981 in forum Web Development
    Replies: 13
    Last Post: 4th March 2010, 06:22 AM
  3. Replies: 2
    Last Post: 12th May 2009, 11:11 AM
  4. Firefox and Safari difference
    By jkmoch in forum EduGeek Joomla 1.0 Package
    Replies: 1
    Last Post: 16th April 2008, 08:19 PM
  5. Replies: 1
    Last Post: 21st January 2007, 02:51 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •