Adding Enterprise specific customizations to Firefox
In this installment, we're going to talk about customizing Firefox for deployment in your enterprise/organization.
Use the CCK Wizard.
Wow, that was easy. OK, maybe a little too easy. Let's go into some detail about what the CCK is, where it came from, and what it does now. (Note that this history is simplified quite a bit.)
In the 4.x days, there were two tools from Netscape for customizing the browser, one called Mission Control Desktop and one called the Client Customization Kit. The Mission Control Desktop was intended for enterprise customization and deployment of Netscape Navigator/Communicator, while the Client Customization Kit was more intended for ISPs and OEMs to customize Netscape Navigator/Communicator for their customers. Both of these tools were written in Java and actually produced full installers when they were finished. (For more information about the differences between Mission Control Desktop and the Client Customization Kit, you can checkout the Netscape Everywhere Custom Browser Distribution Program Frequently Asked Questions.)
When Netscape 6 was released, Netscape again provided a Client Customization Kit. This CCK was more focused on a customized install rather than enterprise features. This customized install included things like customizing the home page, help menu, bundling XPIs into the install, etc. It produced a full install package and could also produce a CD installer. Note that Netscape 7 also used a similar CCK.
While the source code for the Netscape 6/7 CCK is in the Mozilla source tree, it is Windows only and tailored towards a suite type distribution, so I decided to write a new CCK from scratch that produced an extension that could be installed into Firefox to provide the necessary customizations. And so the CCK Wizard was born.
The CCK Wizard is an extension for Firefox that walks you through a set of page to customize Firefox and then generates an extension that can be installed into Firefox to enable your customizations. Let's take a tour of the CCK Wizard.
After installing the CCK Wizard extension, select Tools->CCK Wizard to open the CCK Wizard. You'll see a welcome page that is mainly there to remind you that before you begin the CCK, you might need to collect some stuff. I mainly put this page here because the old Netscape CCKs did it this way. Click on Next and you will see the Extension Configurations page.
This page is where you can manage multiple CCK configurations. When you click "New", you'll be presented with a dialog that allows you to specify the name of a configuration as well as where it is located. You can also copy or delete configurations. Make sure that you specify the path to zip.exe NOT 7z.exe or any other archiver. If you are using the MozillaBuild tools we installed in the previous step, zip.exe is in C:\mozilla-build\info-zip\zip.exe. After you have created at least one configuration and selected it, click Next to go to the Customize Extension page.
This page is where you will specify details about your extension. Unique ID is used to uniquely identify your extension. Name, Version and Description are self explanatory. Creator is you or it could be the name of your company. Homepage URL is a link that be used when some selects Visit Home Page for your extension. Update URL is the location of an RDF file that can be used to provide updates for your extension. If you need to know how that works, let me know and I'll post about it. Icon can be used if you want to change the default icon for your extension. Filename allows you to change the name of the file that the CCK Wizard creates. In addition, there are some options you can set for your extension. These include hiding your extension from the Add-Ons/Extension Manager UI, preventing the uninstall of your extension, and removing access to about:config. Note that the following fields are required: Unique ID, Name and Version. After you have customized your extension, click Next to go to the Customize the Browser - Part One page.
With this page, we begin the actual customization of the browser. First up is the Company Identifer. The Company Identifier is 10 characters to identify your CCK. It is actually added to the User Agent as (CK-ID) where ID is whatever you have specified. Note that this is mandatory. I have lots of people complain about this, but the reason I did this is because that's what the Netscape CCK did originally. In the Home Pages fields you can specify a Home Page and an Override Home Page. Note that there are cases where the override home page doesn't work right in Firefox 2. I'm still investigating this. You can also specify the Browser Window's Title Bar Text. For instance, inside IBM, our Firefox title bar says "Mozilla Firefox: IBM Edition." Note that if you want your title bar to continue to say Mozilla Firefox, you must include it in the string. The title bar text is not appended to the default browser title bar text. Once you finished with this page, click Next to continue to Customize the Browser - Part Two page.
This page is all about the Animated Logo or "throbber" as it is sometimes called. You can bring back the Firefox 1.5 feature where clicking on the animated logo takes you to a web page. You can also change the text that appears when you hover over the animated logo with the mouse. Finally, you can create GIFs to actual change the animated logo. Once you have customized the animated logo, click Next to continue to Customize the Browser - Part Three page.
This page allows you do add a custom menuitem to the Firefox Help Menu. You might use this if you wanted to have a link to a custom support page within your organization, for instance. Click Next to continue to Customize the Browser - Part Four page.
By default, Firefox blocks popups and software installations for most sites. Within your organization, you might want to allow popups and software installations. You can use the two entry fields in Allowed Sites to do this. Enter the domains for which you want to allow popups or software installations separated by a comma. Note that if you want to allow all popups for foo.com regardless of the subdomain, enter foo.com, NOT *.foo.com. Click Next to continue to Customize Browser Plug-Ins page.
This page confuses people and I have no idea why. I guess people confuse the terms "plug-ins" and "extensions." This page is about putting Browser-Plugins in your CCK. That is to say old style Netscape plugins that look like NP*.DLL and go in the plugins directory. If you have plug-ins you want to preload, click the New to select the plug-in and specify the platform for which the plug-in is written. Click Next to continue to Customize Search Engines page.
This page allows you to add your own search engines to the default search engine list. It support Sherlock search engines as well as OpenSearch search engines. You can also change the default search engine. Note that the Default Search Engine field is editable, so for instance if you wanted eBay to be the default search engine, you could type eBay into that field. The text in that field has to match the text of an existing search engine exactly. The next page is Customize Extensions/Themes page.
This page allows you to bundle other extensions with your CCK. Although these extensions are downloaded as one XPI, when they are installed in Firefox, they each show up as their own entry in Add-Ons/Extension Manager. You can get more information about this at the Mozilla Developer Center. If you are going to install your CCK as part of a Firefox installer, do NOT use this method to add additional extensions for delivery. We'll do that as part of the installer. Clicking Next we go to the Customize Bookmarks/Toolbar pages.
The next four pages are basically the same from a user interface perspective. They allow you to specify default bookmarks and folders of bookmarks that appear in either the bookmarks toolbar or the bookmarks folder. You can also specify whether you want the bookmarks to appear at the beginning or the end. Note there is one caveat with adding bookmarks in your CCK. These bookmarks are only ever added once. If you add additional bookmarks in a new update for your CCK and people install it, they will not get the new bookmarks. This is because I couldn't find a clever way to keep track of the bookmarks that were added and prevent duplication of the bookmarks. If you'd like to help work on this problem, checkout this bug. Clicking Next takes us to Customize Preferences.
This page is probably the most useful one. It allows you to set the default value for any preferences, as well as to lock them. To set a preference, click the New button. As you start typing the name of a preference, it will autocomplete so you don't have to remember the names of long preferences. It will also attempt to autodetect the type of the preference so that you won't make a mistake selecting the value of the preference. The next page is our only Windows specific page, Customize Registry.
This page allows you to specify entries to be placed in the Windows Registry. It was added because we (IBM) needed to add some custom entries related to Java. I'm not sure if it is useful for other people, but it was certainly useful for us. Only two more to go! On to Customize Certificates.
Some companies have a need to deploy their own certificate authorities. This page allows for that. The CAs must be in the PEM format. You can also specify what the CA should be used to trust. If you use this feature to add certificate authorities to Firefox, you CANNOT ship your browser outside of your company or institution. Clicking Next we come to our last page for customization, Customize Proxy Configurations.
While all of the proxy configurations could be set individually as preferences on the Customize Preferences page, it's much more useful to have them all in one place. This page maps very closely to the Connections Settings dialog in Firefox. The one additional option is Store proxy configuration file in the CCK. This option allows you to create a proxy autoconfig file that is packaged with the CCK instead of placed on a server which is the normal location. Once you have completed customizing your proxy settings, click Next.
At this point you can click Finish to create your extension.
After you have created your extension, it is available in the directory you specified as either CCK.XPI or the custom filename you specified. You can immediately test this extension by installing in Firefox.
Now that we have customized Firefox, we have a few ways to get it installed in Firefox. For instance, we can simply make the XPI available to our users and encourage them to install it. Or we can use the Firefox Release Repackager to add our CCK to an existing Firefox installer. Or we can make them a part of our custom Firefox deployment.
In our next installment, we'll cover taking the CCK extension we just created (and any other extensions we want) and adding them to the Firefox build we created in Part 1.