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:
Some preferences have to be in a different section:
[/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:
[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.