Why are some Firefox extensions fully extracted in install directory and others not? [closed]

StackOverflow https://stackoverflow.com/questions/9861950

  •  26-05-2021
  •  | 
  •  

Question

Looking in the Firefox extensions directory (See location of Firefox installed extensions), I see that some have .xpi files alone, but others have directories:

c:/Users/CENSORED/AppData/Roaming/Mozilla/Firefox/Profiles/CENSORED.default/extensions:
total used in directory 5241 available 56453112
drwxrwxrwx  1 CENSORED None       0 03-25 07:49 .
drwxrwxrwx  1 CENSORED None       0 03-25 09:32 ..
-rw-rw-rw-  1 CENSORED None  164722 03-04 09:37 compatibility@addons.mozilla.org.xpi
-rw-rw-rw-  1 CENSORED None    8359 03-10 12:38 copy-pure-text@kashiif-gmail.com.xpi
-rw-rw-rw-  1 CENSORED None   75035 03-04 09:37 extensionlistdumper@sogame.cat.xpi
-rw-rw-rw-  1 CENSORED None 1331409 03-04 09:37 firebug@software.joehewitt.com.xpi
drwxrwxrwx  1 CENSORED None       0 03-22 17:57 inspector@mozilla.org
-rw-rw-rw-  1 CENSORED None   37714 03-04 09:37 lockthetext@lockthetext.sourceforge.net.xpi
drwxrwxrwx  1 CENSORED None       0 03-04 09:31 sharing@addons.mozilla.org
-rw-rw-rw-  1 CENSORED None   97169 03-04 09:37 {3d7eb24f-2740-49df-8937-200b1cc08f8a}.xpi
-rw-rw-rw-  1 CENSORED None  258567 03-04 09:37 {46551EC9-40F0-4e47-8E18-8E5CF550CFB8}.xpi
-rw-rw-rw-  1 CENSORED None  220407 03-04 09:37 {73c39a20-8768-4a82-8b43-fc9535715c5c}.xpi
-rw-rw-rw-  1 CENSORED None  516216 03-04 09:37 {7f57cf46-4467-4c2d-adfa-0cba7c507e54}.xpi
drwxrwxrwx  1 CENSORED None       0 03-04 09:37 {81BF1D23-5F17-408D-AC6B-BD6DF7CAF670}
-rw-rw-rw-  1 CENSORED None   89442 03-04 09:37 {B17C1C5A-04B1-11DB-9804-B622A1EF5492}.xpi
-rw-rw-rw-  1 CENSORED None  709293 03-04 09:37 {DDC359D1-844A-42a7-9AA1-88A850A938A8}.xpi
-rw-rw-rw-  1 CENSORED None   27409 03-04 09:36 {E6175356-15A3-11DF-AFEE-C56455D89593}.xpi
-rw-rw-rw-  1 CENSORED None     876 03-25 07:49 {F78DC607-BB30-4e13-9E47-2C2E162E9094}.xpi
-rw-rw-rw-  1 CENSORED None   52880 03-04 09:37 {a0faa0a4-f1a7-4098-9a74-21efc3a92372}.xpi
-rw-rw-rw-  1 CENSORED None  413408 03-04 09:37 {c45c406e-ab73-11d8-be73-000a95be3b12}.xpi
-rw-rw-rw-  1 CENSORED None  634964 03-04 09:37 {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi
-rw-rw-rw-  1 CENSORED None  686225 03-24 08:07 {dc572301-7619-498c-a57d-39143191b318}.xpi
drwxrwxrwx  1 CENSORED None       0 03-04 09:37 {e4a8a97b-f2ed-450b-b12d-ee082ba24781}
-rw-rw-rw-  1 CENSORED None   41715 03-24 08:55 {e6c4c3ef-3d4d-42d6-8283-8da73c53a283}.xpi
drwxrwxrwx  1 CENSORED None       0 03-10 12:38 {fc2b8f80-d9a5-4f51-8076-7c7ce3c67ee3}

For instance, {e6c4c3ef-3d4d-42d6-8283-8da73c53a283}.xpi is a file, while {e4a8a97b-f2ed-450b-b12d-ee082ba24781} is a directory of files.

Why are some extracted fully and others not?

Was it helpful?

Solution

Before Firefox 4 all extensions were extracted when installed. This behavior changed, the new default is to keep the extension as packed .xpi file for performance reasons.

Extensions can still opt into the old behavior by specifying <em:unpack> flag. I've seen some extensions use this flag for no good reason whatsoever, others do it because they rely on a particular way to access their files (especially all add-ons created with the Add-on SDK before Add-on SDK 1.5).

In some cases it is really unavoidable that the extension is installed unpacked, most commonly for extensions containing binary XPCOM components or plugins - the operating system needs an actual file to load the dynamic library, it cannot be loaded from inside an archive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top