Hello again and welcome to my first post of the year.
As you may have guessed, I’ve recently been working with another education deployment and so have been a little bit busy! However, off the back of that project, I have found out some information I thought I’d share.
As part of the deployment, I had to prep Firefox 17 for use. This included a custom homepage, removing any ‘first run’ screens and wizards and finally, disabling any auto updating. Each time I’ve had to do this in the past, I have had to reinvent the wheel so this time I have fully documented it.
Initially, this information was published internally here at Amsys but it seemed too good to keep to ourselves! I have presented it here with only minor modifications so that it makes sense outside of internal contexts.
Right, lets get to it.
Please Note:
The below steps have been fully tested with versions 18.0.2 and 19.0.0 of FireFox and in both versions still work as described.
Introduction
Firefox Version: 17.0.1
Date: 12/12/12
Current as of today there is no real method to ‘manage’ Firefox. No Managed Preferences (MCXs), no Profiles, no nothing.
The only way we can control the behaviour is by directly modifying the Firefox.app bundle and repackaging the final result. To make it more difficult, the ‘correct’ way to do this seems to change with each new version.
Here I’ll go through the steps required to configure a Firefox app for deployment in a typical school.
The finished product should:
- Not show any popups or ‘congratulations on updating’ messages
- Not ask to import bookmarks
- Not ask to be the default browser
- Not automatically update itself.
Phase 1: Acquisition and preparation
1. Download a copy of Firefox, I’d recommend dragging it to your desktop and temporarily renaming it something like ‘Firefox-build.app’ to prevent any confusion.
2. Right click the new application and select ‘Show Package Contents’. Navigate to ./Firefox.app/Contents/MacOS. This is where all the work will be carried out.
3. First step, fire up Fraise.app, TextEdit.app or your other favourite scripting program. Please note, Mountain Lion has been known to have issues editing in TextEdit unless ‘open new documents as plain text’ is enabled BEFORE opening these files.
Phase 2: Override.ini
4. Force-open the ‘application.ini’ file. Copy the contents into a new file called ‘override.ini’ and save this new file into the same place (“./Firefox.app/Contents/MacOS/”).
5. Close the ‘application.ini’ file and switch to the ‘override.ini’ file to do some editing.
6. Change the “EnableProfileMigrator=” to false (“EnableProfileMigrator=false”).
This will prevent the ‘Import bookmarks’ wizard from running.
7. Change the “EnableExtensionManager=” to false (“EnableExtensionManager=false”).
This will prevent the addition or removal of Extensions.
8. Change the “Enabled=” Under “[Crash Reporter]” to 0 (“Enabled=0”).
This will prevent the Crash Reporter from running from running.
9. This completes the editing of the ‘override.ini’ file.
Phase 3: channel-prefs.js
10. The next step is to navigate into the ‘defaults’ directory (“./Firefox.app/Contents/MacOS/defaults/”). This is the default settings that a new user running Firefox is given.
11. You will find a folder called ‘pref’ in here. Rename this to ‘preferences’ (this is a new step for Firefox 17 and is not documented but is required)
12. There is a file called ‘channel-prefs.js’ in here. Again, open this in your favourite scripting program.
13. Enter the following lines, each on a new line, underneath the already present ‘app.update.channel’ line:
a. pref(“browser.shell.checkDefaultBrowser”, false);
This will stop Firefox checking if it is the default browser at launch.
b. pref(“browser.rights.3.shown”, true);
This will stop the ‘know your rights’ banner from showing when launching Firefox.
c. pref(“app.update.showInstalledUI”, false);
This will stop the ‘Thanks for installing Firefox’ from showing when first launching Firefox.
d. pref(“browser.startup.homepage_override.mstone”, “ignore”);
This will stop another ‘Congratulations on installing Firefox’ screen when launching Firefox.
e. pref(“toolkit.telemetry.prompted”, 2);
This and 13f will stop diagnostic and survey data from being requested when launching Firefox.
f. pref(“toolkit.telemetry.rejected”, true);
This and 13e will stop diagnostic and survey data from being sent when launching Firefox.
g. pref(“app.update.enabled”, false);
This will disable the Firefox built in updater
h. pref(“app.update.autoUpdateEnabled”, false);
This will disable the autoupdater in Firefox
i. pref(“extensions.update.enabled”, false);
This will disable the Extensions updater
j. pref(“extensions.update.autoUpdate”, false);
This will disable the autoupdater for Extensions
k. pref(“general.config.obscure_value”, 0);
This enables the use of another file to set other settings (such as homepage)
l. pref(“general.config.filename”, “mozilla.cfg”);
This is the name of the other file mentioned in 13k. In this case ours will be called “mozilla.cfg”
14. This completes the configuration of the channel-prefs file.
Phase 4: mozilla.cfg
15. Navigate back up to our main working directory (“./Firefox.app/Contents/MacOS/”).
16. Create a new plain text file called “mozilla.cfg” and save it here (“./Firefox.app/Contents/MacOS/”).
17. Open the file in your script editor of choice and add the following line to set the home page:
pref(“browser.startup.homepage”,”http://www.google.co.uk”);
18. There must be at least one free line above this line, so write this onto line 2 or 3. Change this URL to change the default homepage you desire.
19. This completes the configuration of the cfg file.
Phase 5: Complete
20. The setup should now be complete. This should now be tested, any application prompts (such as quarantine) removed before packaging and distributing. To ‘reset’ a user to continually test the use of Firefox as a new user, just remove these two directories:
~/Library/Application Support/Mozilla
~/Library/Application Support/Firefox
Summary
There you have it. I hope that helps a least some people out. Worst case it’ll provide an easy place to find the information the next time I am onsite!
As always, if you have any questions, queries or comments, let us know below and I’ll try to respond to and delve into as many as I can.
Disclaimer
While the author has taken care to provide our readers with accurate information, please use your discretion before acting upon information based on the blog post. Amsys will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.