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:

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:


Some preferences have to be in a different section:
[LocalizablePreferences] browser.startup.homepage=””
[/code] 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:

item.1.title=Mike's Blog
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.

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *

13 thoughts on “Customizing Firefox – distribution.ini

  1. 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, but to no avail.

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

    • 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.

  2. Bookmarks have five attributes I can set through the bookmarks properties dialog (Name, Location, Tags, Keyword, Description). In the distribution.ini sample I can only see ways to set three of them (item1.title = Name, = Location, item1.description = Description). Is there a way to set a value for a bookmark’s tags or keyword (I’m mainly interested in setting the keyword) in distribution.ini? Thanks in advance. Excellent site.

  3. Hi,

    You can combine the file “mozilla.cfg” (preferences with lock) and file “distribution.ini” (preferences non-blocking)?

    João Mac-Cormick

    • If you use a distribution.ini, you can’t set default preferences in AutoConfig. See bug 947838. If all you are setting is preferences, you can do that through AutoConfig.

      • Hi Mike,

        Thanks for the reply. Just want to set preferences.

        And if I wanted to display a particular webpage as a bookmark, I do the AutoConfig?

        Congratulations for the work performed in CCK2.

        João Mac-Cormick

        • Are you saying you want to add a single bookmark? You can do this via AutoConfig, but it is easier via the CCK2.

          • Thank you. Since the program was in the trial version, I preferred not to use it in production.
            With the release of the final version (2-0-2) now I can perform the tests. 🙂

  4. Two questions about Searchplugins:

    Why does Mozilla still put the XML files in browser\searchplugins (ESR 38.2) if they are no longer being used? Now that just removing the default XML files doesn’t appear to do anything, is there a way to remove engines that cannot be used (due to the lack of Internet connectivity)?

    • This was a Firefox 40 only change, so Firefox 38 still have them in the old location. As far as removing engines goes, you’d have to do that via code. I’m going to add that to the CCK2.