5

I need to run Firefox each time in a new profile directory with my extension enabled. What I do is the following:

  • Create temporary directory for storing profile (/tmp/profile.123)
  • Create extensions directory (/tmp/profile.123/extensions)
  • Create extension proxy as described here (/tmp/profile.123/extensions/[email protected])

My command line looks like this:

firefox -no-remote -profile /tmp/profile.123 -url http://www.google.com

The problem is that my extension starts disabled, and I'm forced to enable it manually and restart the Firefox. Is it possible to make it start enabled in first place?

Thanks!

Workaround I've found:

Create extensions.sqlite database file in the newly created profile folder. This file must contain my extension entry under the "addon" table.

3 Answers 3

2

It looks like workaround with modifying extensions.sqlite doesn't work anymore and such database doesn't exist. It was described here: http://research.zscaler.com/2012/09/how-to-install-silently-malicious.html

To enable extension automatically on first run, add following entry to the extensions.json located in newly create profile:

my example of extensions.json

{
  "schemaVersion": 16,
  "addons": [
    {
      "id": "jid1-ZS4Xlocq0DBhdg@jetpack",
      "syncGUID": "1DNxcuq4WubL",
      "location": "app-profile",
      "version": "1.0",
      "type": "extension",
      "internalName": null,
      "updateURL": null,
      "updateKey": null,
      "optionsURL": null,
      "optionsType": null,
      "aboutURL": null,
      "iconURL": null,
      "icon64URL": null,
      "defaultLocale": {
        "name": "My cool extension name",
        "description": "Description",
        "creator": "hacker_1998",
        "homepageURL": null
      },
      "visible": true,
      "active": true,
      "userDisabled": false,
      "appDisabled": false,
      "descriptor": "c:\\tmp\\firefox001\\extensions\\[email protected]",
      "installDate": 1419414549006,
      "updateDate": 1419414549006,
      "applyBackgroundUpdates": 1,
      "bootstrap": true,
      "size": 54426,
      "sourceURI": null,
      "releaseNotesURI": null,
      "softDisabled": false,
      "foreignInstall": true,
      "hasBinaryComponents": false,
      "strictCompatibility": false,
      "locales": [

      ],
      "targetApplications": [
        {
          "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
          "minVersion": "26.0",
          "maxVersion": "30.0"
        }
      ],
      "targetPlatforms": [

      ],
      "multiprocessCompatible": false
    }
  ]
}

enter image description here

"active": true and "userDisabled": false are the keys to activate extension silently

The file extensions.json doesn't exist after "-CreateProfile" command, so you should create it manually.

Be careful with different versions of Firefox.

Update

If you want to use extension immediately after first run of profile, prefs.js file should also contain something like: user_pref("extensions.bootstrappedAddons", "{\"CoolAddon@jetpack\":{\"version\":\"1.0\",\"type\":\"extension\",\"descriptor\":\"C:\\\\Users\\\\superuser\\\\AppData\\\\Roaming\\\\Mozilla\\\\Firefox\\\\Profiles\\\\7hkjishf.Default User\\\\extensions\\\\[email protected]\",\"multiprocessCompatible\":false}}");

Be aware of weird quotes escaping.

0

No way to check it now for sure, but probably you have to play with extensions.enabledAddons (and/or extensions.enabledItems) in prefs.js file in the profile folder.

Something like:

user_pref("extensions.enabledAddons", "extId1:version,extId2:version");

1
  • Already tried this, but it doesn't work. Jan 1, 2012 at 4:13
-1

You have to edit the extensions.json file, just like Gleb said, but also the "user_pref("extensions.bootstrappedAddons", "{}");" entry in prefs.js. Try compare the difference of this entry by enabling and disabling extensions, you will find out what part to edit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .