Closed Bug 247735 Opened 20 years ago Closed 20 years ago

non-jar chrome (inside the XPI) doesn't install

Categories

(Toolkit :: Add-ons Manager, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 247156

People

(Reporter: avih, Assigned: bugs)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040414 Firefox/0.8.0+ (MozJF/SVG)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9

Usually extension XPI contains a jar of the chrome. However, when the XPI
contains plain directories inside, and not a jar, the EM hangs after restarting
Firefox (with a message saying that it may take some time to finalize the
installation). The 1st stage of the installation before the restart seems ok.
When installing exactly the same extension that was packaged as a jar inside the
XPI, it's working well.

Reproducible: Always
Steps to Reproduce:
1. install an extension that doesn't have jar inside the xpi
2. FX asks to restart. do that.
3. run FX again to finalize the installation

here's a link to my extension, packed as a non-jar inside the xpi (may take a
while till the mirrors get updated):
http://downloads.mozdev.org/smoothwheel/unsupported/smoothwheel~0.401-EM-non-jar.xpi

Actual Results:  
firefox hangs, with a small window that says it may take a while to finish. (the
browser window doesn't show)

Expected Results:  
firefox should start, and the newly installed extension should be usable.

after investigating the issue, i saw that
<install-dir>/components/nsExtensionManager.js should theoretically handle such
jar-less extensions (_registerChrome(...) distinguishes between the 2 forms).
after talking on irc with bsmedberg, he noticed that _getProviderNames(...)
always assume it's a jar, and sent me a patch (which had some issues). I further
improved the patch, and now it seems to properly install both jarred extensions
and non-jar extensions.

Further related issues at the time of writing:
1. it doesn't UNinstall properly.
2. it should be applied to Thunderbird as well.
Attachment #151244 - Attachment description: patches nsExtensionManager.xpi in firefox 0.9 to allow installations of non-jar chrome inside the XPI → patches nsExtensionManager.js in firefox 0.9 to allow installations of non-jar chrome inside the XPI
isn't this something that's specifically not supposed to be used?  extensions
were supposed to be a single .jar only.
(In reply to comment #2)
> isn't this something that's specifically not supposed to be used?  extensions
> were supposed to be a single .jar only.

well, extensions are a single zip (XPI) that's installed. the XPI may contain a
jar of files (hence, packed twice: once for the jar, and once for the xpi), or
just files (packed once for the XPI).

i don't see a specific reason for not supporting extensions which are
non-jarred. they still go to a specific directory (<profile>/extensions/<GUID>).
when u install any program on your computer, do u expect it to be installed as a
single file? or would you rather allow it to accomodate a directory with more
than one file? why should extensions be different? it's more flexible to allow
non-jar as well. it might be needed by some authors, and the
nsExtensionManager.js DOES consider this specific case, and distinguishes
between the 2 forms. but appearantly, was tested only for jarred install, since
that's the vast majority of the extensions out there.

to summary:
1. on the philosophical level: it's still in a single dir, and there's no reason
for NOT allowing it.
2. on the pratical level: it's programmed already, but was not actually tested
to work. that looks like a bug to me.

avih

There seems to be two bugs for this feature both with patches, see Bug 247156
for the other one.
Bug 247156 has more information included.

*** This bug has been marked as a duplicate of 247156 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: