Firefox local filesystem links in quantum - firefox

We are wanting to move our intranet users from IE to Firefox but we have some places where we want to be able to open local (or network) files or directories.
I have found quite a few references in Stack Overflow and otherwise but most of them are quite old and none of the old techniques seem to work with the current version of Firefox Quantum (v68 at the time of writing).
The Local Filesystem Links extension seems to work well but I would rather not rely on an extension, particularly one that also requires installation of an addon module, if possible.
Can anybody tell me how to access the local filesystem from a webpage in Firefox by just changing settings in about: config? Or is this just not possible anymore?
I am hoping to get something like <a href="file://///networkdrive/directory"> working if possible

I posted this question on the Mozilla support pages too and got the following solution from jscher2000 which I post here in case it is useful to others
Your timing is excellent, there is now a Policy/GPO way to do this as of Firefox 68. No extension required. See:
+ LocalFileLinks policy configuration: https://github.com/mozilla/policy-templates#localfilelinks
+ Customizing Firefox Using Group Policy (Windows)
+ Customizing Firefox Using policies.json
There also is an old school method which is backwards compatible and doesn't require an extension. It involves adding some lines to an optional user.js file (in the user's current Firefox profile), but which might be more conveniently deployed through an Autoconfig file (in the program folder). Those are both files Firefox reads at startup.
// == FILE URI LINK POLICY (checkloaduri) ==
// Create policy enabling http: or https: pages to link to file:
user_pref("capability.policy.policynames", "filelinks");
user_pref("capability.policy.filelinks.checkloaduri.enabled", "allAccess");
// Sites to which the policy applies (protocol://hostname protocol://hostname)
user_pref("capability.policy.filelinks.sites", "http://example.com http://intranet");
I tried the old school method and that worked perfectly
Our IT team have now added the policy and it is working for us but I had to do the following to get the directories to open in Windows Explorer rather than in a webpage within Firefox.
In about:config I added 2 preferences
network.protocol-handler.expose.file – set this to false
network.protocol-handler.external.file – set this to true

Related

WebBrowser css not loaded

I have a complex HTML5 based user interface, which I show in my native win32 desktop application using webbrowser (Internet Explorer).
I've decided to open it from local machine instead of web server. But it did not work due to various security restrictions. So I found a workaround: setup asynchronous pluggable protocol for https protocol inside of my process and just provide data from local machine instead of Internet. I had to also implement my custom IInternetSecurityManager for the things to work (for unknown reason it was not enough to just implement IInternetSecurityManager and use file: scheme).
Now all seems to work fine except the one thing: browser completely ignores CSS files. It acts the way as if files are not there. It loads js from files, shows images, but does not "see" CSS files.
If I try to navigate to CSS file, it shows me this error message:
But if I try to access this CSS file using XMLHttpRequest - it "downloads" it fine.
Sorry for not providing a minimal reproducible example - it would be quite hard. Maybe somebody knows the reason, or can suggest me anything that I could try to resolve this issue?

Turn off built-in rss reader in Firefox 13

A couple of years ago, I designed a bunch of automatic tests for a webapplication using Molybdenum. Some of these checked the data showed in a rss feed through an xml parser. The test required the browser to show the rss as a simple xml file.
At that time I managed to turn off firefox built-in rss reader changing a parameter in the feedconverter.js file. With the major updates in Firefox (4.0 to now) this file is missing and the developers seems to have left no room for this kind of trick.
Do you know a native way to turn off the built-in rss reader?
P.S. = Solutions using the view-source: URL suffix does not work in this case, because the open command answers Failure: Access to restricted URI denied
Things that don't work:
setting "Web feed" content handler to "Preview in Firefox" (shows formatted HTML version, not plaintext XML)
setting browser.feeds.handler to "Reader" (this is an about:config alternative to above) or anything else. There's no plaintext option.
editing mimeTypes.rdf in one's profile folder - Firefox seems not to care about feed settings there
adding a new web content handler with URI view-source:%s - I think it was pretty close, but Firefox escapes the forwarded URL and refuses to open it
storeHtmlSource as it is too smart and does return the code of the formatted page, not the XML source

CSS reload on IE7

It looks like IE7 doesn't reload the latest version of my stylesheet each time I upload a new version on the server.
This is annoying as I am debugging my .css file to make it work on IE...
Tried to empty the browser cache but still not working.
Thanks for your help.
Ctrl-F5 - forcible way to reload in IE
Include your version number in the file name. myfile_v1234.css
When testing, every time you do an update you can just wite "stylesheet.css?r=98123"
As long as the query string is different, it'll be downloaded again.
If you need, you can use javascript to append Math.random(), to get the random number. Not required on production though, when updates would be stable.
2 Questions:
Does IE eventually load with the newer stylesheet?
How are you saving the changes to the server (SSH, Web Interface, etc.)?
I ask because I ran into an issue with a web-based file management system a while back where one browser would show the CSS just fine, the other wouldn't, and we noticed the issue of which browser played nicely depended on which browser we used to upload the CSS.
The reason turned out to be that IE gave the CSS file a different MIME type than Firefox. If you continue to notice the issue even when you've cleared the cache, check the MIME type of the file using Firefox by going to Tools > Page Info.
Also, if it is simply a caching issue, consider turning caching off in IE. I believe this should be an Advanced Option under Internet Options.
Also, you may want to try creating a special developer environment for IE (if it comes down to it.) Perhaps have another machine with IE7 and no caching and any other features turned off (A kiosk mode, perhaps), and then previewing the page on that machine.
Thanks to you all!
I did manage to solve my problem with the "stupid" Ctrl+F5, and by changing the Internet Parameters of Windows to reload content every new visit.

Browser add-on to find a download's origin

Back in the earlier days of the internet I remember that in certain browsers, every time you downloaded an image or a file, the URL of where that file was downloaded from would be written into that file's properties (I guess the summary tab?). I think Netscape v2 did this if I remember correctly.
I really miss that kind of functionality as every once in a while I'll run into a neat little program stored somewhere in the depths of my hard drive and wonder where I got it from originally.
I googled around but I'm not quite sure what terms to use to describe what I'm looking for. So I'm wondering if anyone knows of a Firefox plug-in or something similar that would do this?
If you use the DownThemAll! extension for Firefox, you can tell it to prepend the URL of the site to the downloaded file name...
thus you end up with files like:
download.com_utils_compression_ABCD32.exe
It also works really well when you want to download/queue a bunch of files.
You download http://example.com/foo to ~/Desktop/foo, and you want to see the originating URL in the properties of the local file foo?
Back when I used OS X, I remember Safari used to record the original URL in the resource fork of the downloaded file. Can't remember what the named fork is, well, named, but it'll show up in the properties panel from Finder. Since it's there, Spotlight will probably index it, too, but I haven't used OS X since 10.3.
If you use Opera, and haven't cleared the file out from your download manager, select the download and it'll show the original URL that the file is from in the properties pane.
Is this what you want? If so... well, I don't know of a similar Firefox extension, but it'll clarify the question.
For the IE Browser I use the hell out of Fidler to look at all traffic going across the wire.
For FireFox, you can use the FireBug plugin. There is a "Net" tab that will show you request information that is going across the wire.
Most of the time you can use one of these tools to see what URL was requested in order to start a download. You can also view all the get and post information that might need to be sent in order to have your request succeed.
Fidler is here: http://www.fiddlertool.com/fiddler/
FireBug is here: https://addons.mozilla.org/en-US/firefox/addon/1843
Best of Luck!

Firefox Links to local or network pages do not work

I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created file names are stored in a database table. When a query is launched from the web page a link to the file is created. When clicked the image should be displayed.
This functionality works 100% in Internet Explorer. No such luck in Firefox (and I have some Firefox users). The created hyperlink looks like this file://Server/Scanner/XYZ.pdf
The Firefox helps suggest the reason is this:
Links to local or network pages do not work. As a security precaution, Firefox forbids sites on the Internet to link to files that are stored in your local computing environment. These files may include files on your computer, mapped network drives, and UNC network paths
None of the suggestions for a workaround seem to work (or I am not understanding the steps to create the image display)
Any Suggestions?
This is the default Firefox behavior designed for security .The assumption is probably that most web sites don't know what and where are you local files (including UNC paths).
This could be turned off in firefox:
type "about:config" in the address bar and accept "i'll be careful"
find "security.checkloaduri" in older versions or "security.fileuri.strict_origin_policy" in newer versions of firefox and change the value to "false"
restart firefox
That should do it for you. You have more information here:
http://kb.mozillazine.org/Security.fileuri.strict_origin_policy
http://kb.mozillazine.org/Security.fileuri.origin_policy
Firefox >= 68.0.1
I'm able to preview in Firefox both images and PDF files with local file links using the settings mentioned here: https://bugzilla.mozilla.org/show_bug.cgi?id=1303727
I have used links with local file: test
and added in user.js the mentioned settings (with adjusted sites list):
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://my.intranet");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
Also, when setting Firefox to "Always ask" for PDF files, I was able to "Open with" the PDF in Adobe Acrobat Reader DC, which reported the expected local folder when accessing "File -> Properties".
Firefox >= 1.5.x < 20 (ish)
Search for the Firefox profile folder on your hard drive, e.g. (12345678 stands for eight random digits and letters):
Windows: "C:\Documents and Settings\Username\Application Data\Mozilla\Firefox\Profiles12345678.default\"
Linux: "/home/username/.mozilla/firefox/12345678.default/"
OS X: /Username/Library/Application Support/Firefox/Profiles/12345678.default/
In this folder create a text file with the name user.js. Write the following line into that text file:
user_pref("capability.policy.default.checkloaduri.enabled", "allAccess");
Works on my PC (Firefox 3.0.3 and 19.0 beta) with the following references:
<img src="file://///server/share/image.png" />
<img src="file://\\\server\share\image.png" />
<img src="file://d:\image.png" />
<img src="file:///d:\image.png" />
<img src="file://d:/image.png" />
<img src="file:///d:/image.png" />
<img src="file://localhost/d:/image.png" />
Also, if you are using the NoScript add-on, check the Advanced \ Trusted \ Allow local links option.
Reading at the solution given here, I followed the link Links to local pages do not work and for me, only this worked well (I am using wordpress for a personal FAQ on a local wamp installation):
Go to your "%Your Documents & Settings%\Application Data\Mozilla\Firefox\Profiles\%your profile%\"
edit the file "prefs.js"
add the following lines at the end of the document:
.
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
user_pref("capability.policy.localfilelinks.sites", "http://localhost");
user_pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
You can leave the setting "security.checkloaduri" to its default value, and also the "security.fileuri.strict_origin_policy". Thanks to those 3 lines, you just make an exception for your local server.
Be careful, if you need to go back to that prefs.js file, note that Firefox will have ordered it alphabetically. So the 3 lines you will have added at the end will be somewhere at the beginning ;).
You can load the LocalLink FireFox Add-On, which allows you to right-click on a local link and select 'Open in Foreground Window'. The other 'Open...' menu items are supposed to work, but don't for me.
http://locallink.mozdev.org/
Also, you can use NoScript, like Alex suggests, which enables normal clicking of local links. Thanks Alex.
Marko's solution should work for links that are also on the local filesystem, but I don't think it should allow an http:// page to link to a file:// page.
The issue for people linking from http:// pages is discussed here:
http://kb.mozillazine.org/Links_to_local_pages_do_not_work
along with an explanation of how to circumvent it and expose yourself to risk.
You can instead read the file off the disk and then send it in the Response from your page.
See this link for an example.
Tonnes of thanks I wAs searching this solution since months,
::THis thing worked::
This could be turned off in firefox:
* type "about:config" in the address bar and accept "i'll be careful"
* find "security.checkloaduri" in older versions or "security.fileuri.strict_origin_policy" in newer versions of firefox and change the value to "false"
* restart firefox
::::
shouldn't you really store the pages in your application directory and reference them this way. http://SITENAME/Server/scanner/XYZ.pdf.
We do something similar with files stored all in one directory and just store the file name. we then create the link using the known folder name and append the file name. this works quite well.
Finally firefox is a lot more anal about the directions of the slashes in file names as well. Make sure they are all '/' rather than '\'.
Hope this helps.
beware of incompatibility with gmarks (google toolbar replacer)
both local link and policy manager worked for me; local link is a little smoother, policy manager gives you more control
file://localhost///servername/share/file.txt works for me on FF11
(from a local html file: file:///C:/index.html)

Resources