Customizing Firefox - distribution.ini

In many of my previous posts about installing add-ons into Firefox, I have mentioned the distribution directory. While I've primarily indicated that it is a place for installing add-ons, it's actually useful for more than that. Files in the distribution directory are what allow for custom Firefox distributions like Firefox with Twitter or anything produced by build your own browser. Besides installing add-ons with a distribution, there are two other things you can do: install search engines and customize preferences and bookmarks with a file called distribution.ini.

First let's talk about search engines. Typically when someone includes a search engine with an add-on, they put it in the add-ons searchplugins directory. If, however, you're installing your add-on by placing it in the bundles directory (see this post), the searchplugin will not appear. You must put your search engine in the file searchplugins/common under the distribution directory. I you have locale specific search engines, instead of putting them in a directory called common, you should put them in a directory that is named the same as the locale.

The distribution.ini file is where we can do more interesting things with our distribution. This file is placed at the top level in the distribution directory. The most basic distribution.ini file looks like this:

[Global]
id=someidentifier
version=1.0
about=Text that appears in About

The interesting things you can do with distribution.ini is to add preferences and to add bookmarks.

To add preferences, you would add a section like this:

[Preferences]
browser.startup.homepage="http://www.yahoo.com"

These preferences become default preferences (not user preferences). It's also worth noting that this method will allow you to set the browser.startup.homepage (unlike some other methods). In addition, these prefs can be locale specific. You can get more information here.

To add bookmarks to the toolbar, you would add a section like this:

[BookmarksToolbar]
item.1.title=Mike's Blog
item.1.link=http://mike.kaply.com
item.1.description=Lots of cool stuff

You can also add subfolders and place items in the bookmarks menu. You can get more information here.

The distribution.ini file is useful if all you want to do is add a few bookmarks and customize some preferences. It doesn't support anything advanced like locking of preferences.

3 Responses to “Customizing Firefox - distribution.ini”

  1. SteveE April 11, 2012 at 6:34 am #

    I love what you're doing in this whole series. Thanks for the demystification.

  2. IsaacV July 16, 2012 at 2:25 pm #

    I am attempting to use a distribution.ini to customize an installation of Firefox, using your previously mentioned method of using 7-zip to unpack, edit, and repack the installer.

    However, even with core\distribution\distribution.ini created, upon installation my preferences are not being set. I have cut it down to just attempting to set the homepage in the .ini to http://housing.unl.edu, but to no avail.

    I am using Firefox 10.0.2 as the platform. Is distribution.ini still supported in 10?

    • Mike Kaply July 18, 2012 at 3:49 pm #

      Which section are you setting that preference in?

      distribution.ini has regular prefs and locale specific prefs.

      homepage has to be in the locale specific prefs.

Leave a Reply:

Gravatar Image