6

How do I get Firefox to run active content such as JavaScript locally? Once upon a time I could find a setting in the about:config but the new versions don't seem to have the same feature, or if it's there I don't know what it is. The closest thing I could find is to setup a local testing environment. I don't want that option.

All users should be able to open the website from a local source and have it work. It works fine in other browsers so long as something equivalent to MSIE's "Allow active content to run in files on My Computer" is selected in the relevant browser options. Where is this option in Firefox? Does it even have it anymore? Been searching all over the place for an answer. This is my last resort before dumping Firefox as an option for local testing.

2
  • 1
    What do you mean by "local source"? Are you accessing your HTML directly from Firefox with something like file:///path/to/html/file.html? Commented Sep 23, 2019 at 17:43
  • Search for what I said about the MSIE "Allow active content to run in files on My Computer" setting. That explains it all. <HEAD> <SCRIPT src="Content/Control/JS1_Home.js"></SCRIPT> </HEAD> FireFox used to have a setting in its about:config file, but it's been so long since I used it, I don't remember it, and the browser has been updated so many times, and the about:config, expanded so much, I don't know if it's still there, or if it's been changed.
    – IconMatrix
    Commented Sep 24, 2019 at 19:30

4 Answers 4

9

I was confused following the above answers - it seems the privacy.file_unique_origin option is now security.fileuri.strict_origin_policy.

0
1

Enable JavaScript in local files:

  1. In Firefox, open up a new tab. Type or paste about:config in the address bar and press Enter.
  2. A button appears asking if you accept the risk to change advanced settings. Click that you accept the risk.
  3. Type unique in the search box, which will filter the list for words containing this word.
  4. Double click the privacy.file_unique_origin preference to switch the value from true to false
0
1

Open about:config and set privacy.file_unique_origin to false

-1

There is a flag which is checked when loading data from file://. If true, then those files are not going to be trusted. For JavaScript, this means the script is ignored.

plugins.http_https_only

From the about:config, search for that flag and make sure it's false.

Note that once done with your development, you may want to restore that flag value because otherwise a website could execute code on your computer. This flag is true by default for fairly obvious security reasons.

3
  • 1
    Thanks. Unfortunately that didn't solve the problem. Still looking.
    – IconMatrix
    Commented Sep 25, 2019 at 21:53
  • In 2023, that setting isn't in about:config any more. I didn't try what happens if I create it, though.
    – Binarus
    Commented Sep 22, 2023 at 7:46
  • @Binarus Yeah, it looks like security.fileuri.strict_origin_policy is the newer flag that you have to use for this purpose. Commented Sep 24, 2023 at 15:07

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