How to set global/system Firefox prefs for new users?

John Hupp edubuntu at prpcompany.com
Tue Jan 13 01:26:44 UTC 2015


On 1/12/2015 1:38 PM, John Hupp wrote:
> On 1/12/2015 10:45 AM, Matt Johnson wrote:
>>
>>> ________________________________
>>> From: John Hupp <edubuntu at prpcompany.com>
>>> To: edubuntu-users at lists.ubuntu.com
>>> Sent: Monday, 12 January 2015, 15:19
>>> Subject: How to set global/system Firefox prefs for new users?
>>>
>>>
>>> For Firefox in newly added user profiles, I have a few modest
>>> preconfiguration goals: 1) Customize the toolbar to add Print, History,
>>> and Tab Groups.  2) Set new tabs to display a blank page.
>>>
>>> I would think that #1 might be accomplished either by setting
>>>      pref("browser.uiCustomization.state", "{long string copied from my
>>> user profile pref}");
>>>
>>> or else by copying my initial user's xulstore.json to
>>> /usr/lib/firefox/browser/defaults/profile or
>>> /usr/lib/firefox/defaults/profile.  (Or by doing setting the pref AND
>>> copying xulstore.json.)
>>>
>>> But to zero in on setting the prefs: I failed first with what I took to
>>> be the standard Firefox methods.
>>>
>>> Then I found
>>> https://help.ubuntu.com/community/UbuntuLTSP/FirefoxOptimize, and 
>>> though
>>> it was written for *buntu 12.04, I'm assuming that it's probably still
>>> valid for 14.04.  (I'm running Lubuntu 14.04.1 32-bit.)  And it
>>> indicates that global/system prefs should be placed in
>>> /etc/xul-ext/ubufox.js.  But my prefs seem to be either ignored or
>>> subsequently overridden/overwritten.
>>>
>>> (And yes, xul-ext-ubufox is indeed installed.)
>>>
>>> How do you successfully do these things in 14.04?
>>>
>>
>> John,
>>
>> I hope this isn't just noise but it of use. Below are my notes but 
>> they do apply 12.04 I'm afraid. Also, it's not for ltsp-pnp, it's for 
>> old-style ltsp with a chroot (which is why there are additional notes 
>> about copyiong the files to the chroot at the end).
>>
>> -- 
>> Matt
>>
>> ============================
>> Firefox config (including setting homepage and proxy)
>>
>> Configure proxy
>> sudo nano /etc/firefox/syspref.js
>> lockPref("network.proxy.http","address.of.proxy");
>> lockPref("network.proxy.http_port",80);
>> lockPref("network.proxy.ssl","address.of.proxy");
>> lockPref("network.proxy.ssl_port",80);
>> lockPref("network.proxy.type",1);
>> lockPref("network.proxy.share_proxy_settings", true)
>>
>> Configure homepage
>> sudo nano /etc/xul-ext/ubufox.js
>> Uncomment homepage line...
>> pref("browser.startup.homepage", 
>> "file:/usr/share/doc/xul-ext-ubufox/example-homepage.properties");
>>
>> sudo nano /usr/share/doc/xul-ext-ubufox/example-homepage.properties
>> Change to:
>> browser.startup.homepage=http://www.ourhomepage.com
>>
>> Copy all three files to chroot and rebuild image
>> sudo cp /etc/firefox/syspref.js /opt/ltsp/i386/etc/firefox/syspref.js
>> sudo cp /etc/xul-ext/ubufox.js /opt/ltsp/i386/etc/xul-ext/ubufox.js
>> sudo cp /usr/share/doc/xul-ext-ubufox/example-homepage.properties 
>> /opt/ltsp/i386/usr/share/doc/xul-ext-ubufox/example-homepage.properties
>>
>> Reimage and restart services
>> sudo ltsp-update-image; sudo ltsp-update-sshkeys; sudo service 
>> nbd-server restart; sudo service tftpd-hpa restart; sudo service 
>> isc-dhcp-server restart
>
> It's interesting that your recipe uses a standard Firefox 
> configuration location for the network proxy stuff and only uses the 
> ubufox provision for homepage.  This bolsters a thought that it is 
> only selected prefs that ubufox aims to govern (whatever exactly those 
> are) which must be configured via ubufox.js.
>
> Looking at the installed files for the xul-ext-ubufox package, I find 
> 3 .js files at /usr/share/xul-ext/ubufox/defaults/preferences:
> ubufox.js
> ubuntu-mods.js
> 000system.js (but that is just a symlink to /etc/xul-ext/ubufox.js)
>
> And I don't see any prefs in any of those files that would seem to 
> bear adversely on what I want to do.
>
> Following your recipe I tried putting my prefs in 
> /etc/firefox/syspref.js, but they too were either ignored or overridden.


There is a lot of conflicting and obsolete info out there, including the 
locations of the Default Preferences Files given in 
http://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences

But that article is correct in what it says about Changing Defaults, 
option #1.  And following that I created 
/usr/lib/firefox/browser/defaults/preferences/all-nameofyourchoice.js 
with content (make sure to terminate with an end-of-line e.g. hit Return):

pref("browser.newtabpage.enabled", false);

This has the same effect as clicking the gear tool on a new tab and 
choosing Blank rather than Enhanced or Classic.

So now I know how to propogate extensions and default preferences to new 
users.  The only thing I have not been able to accomplish is adding 
Print, History and Tab Groups to the default Firefox toolbar.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/edubuntu-users/attachments/20150112/6815452d/attachment-0001.html>


More information about the edubuntu-users mailing list