Friday, May 6, 2016

Force Mozilla Firefox to "Always Activate" Java


Scenario

You have installed the most recent version of Java, but when you check the Add-on Manager in Mozilla Firefox, you see that the Java Plugin defaults to "Ask to Activate".  Typically you should probably leave it at "Ask to Activate" for security reasons, but if you want it to default to "Always Activate" you can do this either per user or per machine.


Per User

Your per user plugin activation settings are found in your profile.

C:\Users\<username>\AppData\Roaming\Mozilla\Firefox\Profiles\fgyh2ogh.default\prefs.js

If you edit the .js file and scroll to the bottom, you will see something like this:


Notice the user_pref entries end with the number 1.  If we tell one of these to "Always Activate" it will add a new entry and or use the value 2.  To modify the prefs.js file, let's go to Firefox itself and change things in the GUI.

Open Firefox and then go to Tools > Add-ons (or Ctrl + Shift + A).

Here you will see a list of plugins.  For Java(TM) Platform SE 8 U73, select the drop down menu and choose "Always Activate".


After you select this, close out the browser and then open up the prefs.js file again.  You will notice the following entry that wasn't there before:


If you wanted to change this in other profiles, you would need to add this entry to other prefs.js files in other profiles.

Per Machine

Typically you would want to make a configuration change like this for all users on the machine.  To do that, you modify the mozilla.cfg file.  You can find the mozilla.cfg file in the following location:

C:\Program Files (x86)\Mozilla Firefox\mozilla.cfg

You can add this - or other entries - in the mozilla.cfg file and Mozilla Firefox will accept this change across all users.  The entry would look something like this:


Notice that the entry in the config file is slightly different than the entry in the prefs.js file.  I modified it from "user_pref" to "pref".  This is because we are changing the preferences for the machine, not the user.
pref
sets the preference as if a user had set it, every time you start the browser. So users can make changes, but they will be erased on restart. If you set a particular preference this way, it shows up in about:config as "user set". 
You can see more details on this at the following URL: https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment

No comments:

Post a Comment