Add-ons in the Distribution Directory

Recently in response to this post about integrating add-ons into Firefox, I was asked why some add-ons don't work properly in the distribution/bundles directory. That's a great question and it deserves its own post.

The answer is that add-ons in the distribution/bundles directory are not loaded like normal add-ons. All that happens is that their chrome.manifest file is loaded and read. They are never integrated into Firefox's add-on manager. That means that if the add-on uses tries to use the AddonManager API, it will fail. It also means that restartless (bootstrapped add-ons) will not work either. Even though they have a chrome.manifest, it's not used to integrate the add-on.

So if you search through the add-on and see that it depends on APIs like getResourceURI and hasResource, it will probably not work in the distribution/bundles directory. Keep in mind, though, that just because you see a reference to these APIs doesn't mean that the add-on will break; the CCK uses this API, but has code around it just in case it fails.

If you find an add-on that doesn't work in the distribution/bundles directory, the best course of action is to put it in the extensions directory where the executable is located. Those are loaded like normal add-ons.

As a side note, I'm going to try to use this post to kick off a Q&A series to try to encourage me to blog. If you have ANY questions about customizing Firefox, send them my way.

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 *

21 thoughts on “Add-ons in the Distribution Directory

  1. Hello Mike,

    I am stumbling over your web page again and again, looking for a solution to customize Firefox (ESR) ... but it seems, that there is still no way to disable the installation of extensions by normal users?! If you have any news/ideas about that issue, I (and a lot of other sysadmins) would really appreciate to read about!

    Greetings from Germany,
    Lasse

  2. Hi Mike

    Where do i add my custm cck xpi for a global add on. I used to put it in the distribution drectory but now since 17.0.2 ESR this doesnt work.

    All of Mozillas documentation is out of date :(

  3. I am new to working with add-ons in firefox. Do you have any idea how I can load the add-ons in a global vmware enviornment? From what I have read and understand it appears Mozilla disabled this capability.

  4. Hi Mike,

    firstly, thank you for a great ressource about the beloved Firefox browser. I successfully managed to do a fully unattended customized installation thanks to this blog and there's just one hitch I consider annoying:

    I favour your scenario 3 to provide (configured) add-ons with Firefox 19. A few of them keep opening tabs when Firefox is launched the first time (Adblocker Plus, Greasemonkey, Stylish), I'd like to override this behaviour globally (no simple prefs.js entries to change).

    Do you have an idea how to do this?

    • So in order to stop this, you need to find the preference that these various add-ons are using to display their first run pages and then set those preferences yourself.

      My suggestion would be that you create a new profile and then go to about:config and sort based on "Status". See which preferences are user set. Then install the add-on and you'll see which preferences it changes. Experiment with turning them on and off to see what makes the startup page reappear.

  5. bookmarks created with cck wizard do not take effect if put in the distribution folder of the app bundle!

  6. I have tried to put the add-on from the link in both C:\Program Files\Mozilla Firefox 17 esr\distribution\bundles\ and C:\Program Files\Mozilla Firefox 17 esr\extensions\, both packed or unpacked, but it doesn't do the trick. It works when you install it normally in Firefox 17 esr.
    Are there any other tricks?
    I am trying to build some kind of kiosk mode to discourage browsing and I don't like the kiosk add-ons while it hides the whole screen.
    TIA

  7. I manage Firefox installs in a managed environment. I'm trying to move beyond simple prefs.js-style configuration to using full CCK-style customization. Love the CCK wizard but I can't find a way to install the resulting add-on in a silent manner. If users have existing profiles (so, all current users) the add-on manager prompts the user to install the CCK-built add-on and I can't find any way to suppress this. I've found plenty of suggestions but I can't get any of them to work on FF 17.0.4 ESR (and yes, I know this is not the current release -- I want to get customization working before pushing out 17.0.5 to all OSX users).

    This is on OSX with FF installed via Munki.

    Any thoughts? Anybody? :)

    Thanks!

    -Josh

  8. Okay - I think I've figured it out. I think I wasn't adding the scope properly. Here's what I did and it seems to work (but I've only testing on one machine... will test more later).

    1) create defaults/pref/local.js and point it to a local config file:
    pref("general.config.obscure_value", 0);
    pref("general.config.filename", "firefox_local.cfg");

    2) Put the scopes config, etc. into the .cfg file and *NOT* in the .js file:
    pref("extensions.enabledScopes", 15);
    pref("extensions.autoDisableScopes", 0);

    3) Install the CCK-made add-on into the system-wide extensions directory
    (On OSX this is /Library/Application Support/Mozilla/Extensions )

    In my case, the add-on was active in Firefox without prompting the user.

  9. Hello Mike,

    Have you ever studied the firefox mobile(android)? Now I want to make a custom browser integrated my own add-ons based on the firefox. Could you give me some help?.

    Thank you very much!

  10. Whenever I override the extension code, it still load old extension code. Is it possible to tell Firefox to update the code? How?

    • I assume you mean you load an extension and it still uses the one in distribuion? Where in distribution are you installing it?

      • I'm copying my extension into /Applications/Firefox.app/Contents/MacOS/distribution/bundles. but even after I replace code from there, it still loads old code. Is it possible to load updated one?

      • thanks for replay sir ... and this's what i want to do
        i want to make some public users access an account i have , every one at the same time so i think of making portable browser with prefigured setting the most important of them is the proxy and the session cookies
        so i search over Google and found some good add-ones to secure the browser from missing with the browser because some users do mistakes
        so i installed these addons with description why i did
        1.public fox "to luck all menus with password
        2.addblock plug + Element Hiding Helper for abp "to hide some buttons in the page of the account i want to share it like logout button and delete files
        3.menu editor II "to hide right click menu and keep only what i want them to use"
        4.customizable-shortcuts " to change all shortcuts in firefox so they wont access it like print and option and addones page"
        5.App button remove 1.0 "to remove firefox orange button on top left"
        ----------------------
        so now i tested this portable browser and gave it to users and within 10 minutes users complain about login message in the acount i provided the cookie for !!! so i know hwo did it and ask him how ????
        he answer that " i go in profile folder and remove all addones and start the browser again without any security and changed the proxy and log-out"
        so until now i asked alot of experts about how to secure the profile folder and give permission only to the firefox or is there any way to hide these addones??? or can the changes made by public fox be mandatory so in case of plugin removed the setting still working ?
        or can i make all the browser only 1 file ??? so no one will find files to delete only 1 executable app launch the browser without even using temp folder ???
        i really appreciate if you help me with this because i need it .