More Firefox customization

firefox icon
I’m experimenting with a new (to me) method of delivering configuration settings for Firefox.

Previously I was inserting custom configuration files into the application bundle.

While this worked, it had a significant disadvantage. In order to be able to install new versions of Firefox without deleting these inserted files, I had to repackage new Firefox releases. This is very easy and takes little time, but is still more work than zero. I wanted to see if I could make things more modular, so I could install Firefox from the Mozilla disk image without having to repackage it.

Mozilla has a tool called the “Client Customization Kit” or “CCK” which was designed to allow organizations to customize Firefox for their use. I had looked at it in the past, but for a variety of reasons had thought it would not be able to do what we needed. (And last I looked, it had not been updated for Firefox 3.x. That’s no longer an issue — it was updated for Firefox 3.6 in March.)

One big problem I saw was that the CCK creates a Firefox extension. These are usually installed in the user’s profile in their home directory, so that’s not a good fit for something you want to manage enterprise-wide. With Firefox 2.x and earlier, there is a way to install extensions “globally”, but they end up inside the application bundle on OS X, and that’s the same problem I was trying to solve.

With the release of Firefox 3.x, a new location for global extensions was added. The location varies depending on the OS — Mac OS X; Windows; Linux — but the important thing is that this new location is outside of the application bundle on OS X. This new global location is:

/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/

(I have no idea why it couldn’t be just “/Library/Application Support/Mozilla/Extensions/Firefox/”.)

So it is possible to:

  1. Use the Firefox CCK to create a Firefox extension that customizes Firefox settings for your organization, and then:
  2. Build an installer that puts this extension in the right place to be used by all Firefox users on a given machine.

Since hopefully the desired configuration for Firefox changes far less frequently than the app itself does, this is a win for the administrator, especially if your software distribution mechanism can install Firefox directly from the Mozilla disk image. (And I had to create an installer for the customizations when I was putting them inside the Firefox app bundle anyway.)

There are some other benefits/differing capabilities that arise from moving to this solution:

  1. Admin users could update Firefox themselves and still have your organization’s settings applied. Previously, if they had replaced your customized Firefox with a version downloaded from mozilla.com, the custom configuration would be erased.
  2. Some additional settings become much easier to manage; specifically the “feature” that takes you to a “What’s New” page with each new release of Firefox is easy to turn off now. I think that was possible before with manual configuration; I just never puzzled it out. Now it’s a check box in the CCK assistant.
  3. Users who really hate your custom settings or want/need to turn them off for some reason can now do so. In Firefox, select Tools->Add-ons. In the Add-ons window, select the Extensions tab, then your CCK extension, and click “Disable”. You could consider this change a net positive or net negative; the ability to disable the extension can be turned off, if you need the settings to be locked down.

More information:

Firefox Client Customization Kit:
https://addons.mozilla.org/en-US/firefox/addon/2553/

Mozilla article on installing extensions:
https://developer.mozilla.org/en/Installing_extensions

More Firefox customization

27 thoughts on “More Firefox customization

  1. nvp says:

    This is very cool!! Do you now how to lock the extension down so it can’t be disabled??

  2. In the CCK Wizard, check “Do not show this extension in the extension manager”, which appears in the first editing screen in the CCK Wizard. Since it then doesn’t appear in the Extensions manager window, the user can’t disable it.

    1. nvp says:

      Sweet!! Did a quick test and it seems the users can still change the network/proxy settings. Have you found a way of locking them down using the CCK?

      1. Yes, though it’s not surprising you didn’t discover it.

        In the CCK Wizard, when you get to the “Customize Preferences” page (which is three pages before the “Customize Proxy Configurations” page), add the relevant preferences here. In my case, I’m using an automatic proxy config URL, so it’s

        network.proxy.autoconfig_url
        network.proxy.type

        (As you type “network.proxy” you’ll see a list of all preferences that begin with those characters, so if you need to lock different proxy preferences, this can help.)

        For each of these preferences, you’ll see a message displayed in the value field:
        “You cannot set this value here, you can only lock it.:
        Check the “Lock Preference” checkbox to lock the preference.

        You can use this same technique to lock other preferences that you set elsewhere in the wizard, like the home page.

    1. Is it possible to stop having the cck extensions from asking to be installed each time Firefox is launched?

      Also I have not been able to hide the extension in the Add-ons window to prevent removal.

  3. If you copy the .xpi file to the global extensions location, you’ll get the behavior you describe. Instead, install it into your personal profile (generally by double-clicking it and following Firefox’s prompts). It will end up in your personal profile under ~/Library/Application Support/Firefox/Profiles//extensions/.

    It will be installed as a folder named after the Unique ID you gave it in the first screen of the CCK Wizard. Copy that entire folder to the global extension location:
    /Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/

    As for hiding it by checking “Do not show this extension in the extension manager” — it certainly worked for me the last time I tested it, but it’s entirely possible that more recent releases of Firefox have broken that functionality.

  4. Tim Kimpton says:

    Unfortunately in my testing this doesn’t fit all the requirements. When I package ff up and deploy it I want it to just work not prompting users to install the add in.

    This is ideal for a sys admin if the install prompt isn’t there.

    Back to manually packaging for now.

    1. It doesn’t prompt the user in my deployment. Since this seems to be a point of confusion, I guess a follow-up post is needed…

      1. Tim Kimpton says:

        I’ve tested this extensively and I did copy the xpi to the global extensions location.

        “If you copy the xpi file to the global extensions location, you’ll get the behavior you describe.”

        Its just not practical to get a user to install the xpi by clicking on it to install it to their local directory as there as so many contractors in and out all the time they are just not going to do it and cannot be enforced.

        This is why this isn’t really a good solution.

        Sorry

  5. Tim:

    Sorry this isn’t working for you, but I’ve got it working on 500+ machines, and users never have to agree to the install. I think the part you might be missing is that _you_ the admin have to double-click the xpi once to get it to expand into a directory of files. This directory ends up in the local profile, but you then as an admin copy it the global extensions location. You do not copy the xpi file to the global extensions location. Once you verify it works, you can then package up the _expanded_xpi and install it on all machines (again in the global extensions location). Like I said, I think I need a follow up post, since people seem confused, but that will have to wait until tomorrow at the soonest.

      1. Tim Kimpton says:

        I have tested this and it work but i came across one problem. We use an extension called FoxClocks. This allows the user to see instantly the time in our other office in a different country.

        One of the problems i noticed is that the default for FoxClocks shows different time zones than i wish to automatically be shown.

        I managed to change this, stop all the pop ups and i deleted my preferences and moved all the other xpi files to a different location.

        The problem is that you need to also copy the xpi files to a general location on the machine as defined in the cck wizard and push those out as well otherwise the xpi you create through the cck wizard cannot locate the xpi files to add for the user!.

        Instead i found the best way is to make the settings in the cck wizard to lock it down and then to copy all of the extensions to

        /Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/

        I then package up this to a pkg and keep the xpi file created through the cck wizard for future changes

  6. Seth says:

    I created custom settings and things worked great, so i went back and did some minor tweaks, but when i click finish, it just sat there and did not tell me it did not update the xpi file. So, i closed the cck, and checked the time stamp on the xpi file and the time stamp did not update. So, i went back and changed the name to name_v2, and it not create a new one. Is there something i’m missing as i do not want to create a new xpi file each time i want to modify something?

    Thanks!

    1. When I click “Done” in the final screen, it tell me it’s saved a new xpi file and gives me the location. Not sure what you are doing…

      1. Seth says:

        the first time though, it told me it created the xpi file with the location, but when i went back and modified it, and click finish, it just sat there like it was doing nothing. it did give me the message like the first time through so, i click finish again, and still nothing.

      2. Tim Kimpton says:

        Yes Seth that happened to me as well and I had to create a new xpi. The thing I noticed is that if you saved it to open location and then moved it later and then tried to open it again to modify it you will experience this problem.

        To get around this problem I saved it to a network share where it will always be in that location. I am then able to modify it without any further problems.

        Sorry Greg you have a lot of knowledge and experience and I respect that, but you do tend to not explain things clearly for the non technical folk out there.

  7. Tim Kimpton says:

    Hi Seth

    I have years experience of writing clear and precise user documentation and I will try and post something which will explain how to do it that anyone reading it will understand it. I probably won’t be able to do it this week but I will do it.

  8. Tim Kimpton says:

    Apologies Greg just meant to be constructive criticism. I do find your blog and articles very useful and have learnt a lot. Will not post any solutions here as I do not want to rub any one up the wrong way. Any solution I provide will be in the Mozilla archives.

  9. Dan says:

    Seth you ever figure out your problem? Happening to me if I click done it just sits there and doesn’t change the xpi.

  10. Brian says:

    Im sure You have this question all of the time But im having issues deploying firefox 8 with restriction.
    We are currently running 3.6 with updates off and proxy set to use system setting. We previously modified a file JS in the defaults folder.
    In firefox 8 that file is no where to be found.
    I have never used CCk i created a file with cck but where do i put it in firefox 8.
    I know this seems like a easy task but we have not changed the set up in a long time and im at a loss at the moment,

  11. Greg, this is probably slightly off topic, but would this same process apply for injecting custom bookmarks into Firefox? Would you happen to have a link or article for this topic in particular?

Comments are closed.