How to lock down (Address bar, Menu Bar) Firefox in an Enterprise Environment?

9/11/2016 0 Comments


At work I got task to customize Firefox 45 ESR deployment which was getting packaged. This article explains how to easily lock-down Mozilla Firefox’s settings before I deploy the applications to lots of servers.

Main purpose was to prevent people from changing the proxy settings, the homepage, the ability to save passwords, lock-down address bar etc.  It’s possible, but it’s little complicated.

Some of the customization I had in mind were as follows;

Let’s get into more details of each options.
  1. By default, when Firefox is launched, display blank page instead of my home.

  1. Removed plus icon (+) which opens new tab.


  1. Disable Reader View

  1. By Default, allow popups
5.       Always enable plugins (eg. Java)
6.       Disable prompt to save password

7.       Remove options Menu Save Pages, Print, history, Synced tab & Customization
8.       Remove Bookmark icons (start), Home icon & Pocket icon)

9. Disable Remember History & location bar

10.   Locking down address bar   - This is biggest challenge

The solutions to get the customisation as follows;
Folder Location to be familiar with:
Firefox Profile gets created on the following location C:\Users\XXXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\XXXX.default. Firefox created randomised folder name with .default. 
Firefox installation Path: C:\Program Files (x86)\Mozilla Firefox

Part 1: Deploying user.js files to all the users profile:


You will need to include the attached user.js file with the pre-customised options which gets created when user launches the Firefox application for the 1st time. Firefox created randomised folder name with .default.

The user.js file needs to go in on this folder: C:\Users\XXXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\XXXX.default


Contents of User.js file looks like (Download my version here)

Part 2:  Locking down UI


We need to create folder called Chrome with file userChrome.css (filename is case sensitive) on the path Mozilla profile path
:\Users\XXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\XXXX\.


 
Create the userChrome.css file with the following contents.


Copy paste the code into userChrome.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#main-menubar  { display: none; }
/* Locks the focus of the address where user cannot type anything */
#urlbar [focused] { display: none!important;}
#bookmarks-menu-button > .toolbarbutton-text {
  display: none !important;
}
/* Hide - Customize - in Menu Panel UI */
#PanelUI-customize { visibility: collapse !important; }
/* Hide - Sign in to sync UI */
#PanelUI-fxa-status { display: none !important }
#toolbar-context-menu,
:-moz-any(menuitem,toolbarbutton)[oncommand="safeModeRestart();"] {
display:none!important;
}

The final result of launching customized Firefox looks like this:

0 comments :