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/myextension@my.domain)
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.
Best Answer
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
"active": true
and"userDisabled": false
are the keys to activate extension silentlyThe 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\\\\CoolAddon@jetpack.xpi\",\"multiprocessCompatible\":false}}");
Be aware of weird quotes escaping.