nolegs
nolegs

Reputation: 608

Enable/Disable Firefox Addons From an External Application

Is is possible to enable/disable firefox addons from an external application, preferably without using any XPCOM components? My first thought was to use a console app that modified [profile dir]/extensions.sqlite directly, but this doesn't quite seem to work. Is this possible?

Upvotes: 1

Views: 1685

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57651

So you want to manipulate user-installed add-ons? Manipulating profile data in an unsupported way is generally a bad idea - you have to make lots of assumptions about the format and risk breaking things if that format changes (or something else happens that you didn't expect). The closest thing to a supported manipulation would be adding/removing extensions in the <profile>/extensions directory. As of Firefox 4 the extensions there will either be directories (directory name is the extension ID) or packed XPI files (file name is <extensionID>.xpi). If an extension is removed from this directory all the necessary uninstall actions will happen automatically. If an extension is added it used to be installed automatically. As of Firefox 8 the user will be asked whether the installation of the add-on should be allowed - and the user needs to confirm it.

Of course all these manipulations assume that Firefox isn't running. Manipulating the profile while Firefox is running is dangerous because some files might be locked, others might be required later in the browsing session and cause breakage if they are missing/changed.

Upvotes: 1

Related Questions