Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox: find location of specific add-on/extension?

I'm using Firefox 5, and I already know that extensions are situated in the extensions subfolder of the Profile folder... However, I need to find where is a particular extension (say, CoLT) located; the problem is that most of the extension folders are named by guid, e.g.

extensions$ ls
{232ac1d3-4d70-4919-8338-48c3d3f98afc}
{29c4afe1-db19-4298-8785-fcc94d1d6c1d}
{2bfc8624-5b8a-4060-b86a-e78ccbc38509}
{33f141c0-3703-4a4c-b459-cec618a7dafd}
...

Then again: "Starting in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) , XPI files are no longer unpacked when extensions are installed. Instead, the XPI itself is placed in the extensions directory, and files are loaded directly out of the package." (Extension Packaging - MDN Docs)...

And since XPI is basically a ZIP archive, grepping through the extensions folder looking for, say, the extension name:

extensions$ grep -ri 'colt' . 

... will return nothing.

So, does anyone know of a method (or an extension) to tell me exactly which XPI (or unpacked folder) is a particular extension located in/loaded from?

like image 312
sdaau Avatar asked Jul 05 '11 06:07

sdaau


2 Answers

Type about:support#extensions-tbody into your location bar - this will list (among other things) all your installed extensions along with their IDs. The extension ID determines the folder/file name in the extensions directory. Note that extensions aren't always installed in your profile - if in doubt, contents of extensions.ini in your Firefox profile should clear things up.

If you want to have it more "comfortable" you can paste the following code into the Browser Console:

var {AddonManager} = Components.utils.import("resource://gre/modules/AddonManager.jsm", null);
AddonManager.getAllAddons().then(addons => {
    for (let addon of addons.filter(addon => addon.type == "extension"))
        console.log(addon.name, addon.getResourceURI().spec);
});

This will use add-on manager API to display the names and install locations of all your add-ons.

like image 179
Wladimir Palant Avatar answered Nov 03 '22 07:11

Wladimir Palant


Ah well, here's at least something, so I don't get tumbleweed again :)

extensions$ for ix in *.xpi; do echo $ix; unzip -c $ix | grep -aoi ........colt.........; done
...
{e4a8a97b-f2ed-450b-b12d-ee082ba24781}.xpi
{e6c4c3ef-3d4d-42d6-8283-8da73c53a283}.xpi
content colt jar:chro
hrome://colt/content/
:chrome/colt.jar!/loc
...

... which should clearly point out that {e6c4c3ef-3d4d-42d6-8283-8da73c53a283}.xpi is the container of the CoLT extension..

Note that unzip -c unzips to terminal/stdout, with -a we force grep to do binary search, but as that may dump huge lines on terminal, we limit that with -o for "matching only", and then add dots with the meaning of "match any character" around the search term so we can see what's going on in the vicinity of the match.

Not amazingly user friendly, but at least it works :) Still hoping to hear a more straightforward method for this..

Cheers!

like image 1
sdaau Avatar answered Nov 03 '22 07:11

sdaau