Closed Bug 1328624 Opened 7 years ago Closed 7 years ago

about:addons' "Install Add-on From File…" should support WebExtensions by default.

Categories

(Toolkit :: Add-ons Manager, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: bwinton, Assigned: jakehm)

Details

(Keywords: good-first-bug, Whiteboard: [qx:link:spec], triaged)

Attachments

(1 file)

I'm currently writing a WebExtension that does some things on browser start, which means that I can't use `web-ext run`, since that doesn't carry data across runs.  So I use `web-ext build` to build the add-on, and then go to `about:addons` and choose `Install Add-on From File…` to install it, but the just-built add-on doesn't show up because the file filter is only looking for `*.xpi;*.jar`, and not the `*.zip` that gets built.

It would be nice if we could add `*.zip` to https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.js?q=%22%2A.xpi%3B%2A.jar%22&redirect_type=single#1341 to make it easier for people developing WebExtensions to test them…  :)

Thanks!
Whiteboard: [qx:link:spec]
How about having web-ext build create an xpi?
There should also be a "Format" menu in the open file dialog (appearance is slightly different from platform to platform) where you can choose "all files"
whoops meant to ni? kumar for the first question in the previous comment
Flags: needinfo?(kumar.mcmillan)
(In reply to Andrew Swan [:aswan] from comment #1)
> How about having web-ext build create an xpi?
> There should also be a "Format" menu in the open file dialog (appearance is
> slightly different from platform to platform) where you can choose "all
> files"

I had a PR where I was working on this which bitrotted and I haven't had a change to fix it up yet:
https://github.com/mozilla/web-ext/pull/392
(In reply to Andrew Swan [:aswan] from comment #1)
> How about having web-ext build create an xpi?
> There should also be a "Format" menu in the open file dialog (appearance is
> slightly different from platform to platform) where you can choose "all
> files"

I just tried and this does work for zip files, at least on Mac.

Blake does that help in the meantime ^?
Flags: needinfo?(bwinton)
Andrew: I would be happy with web-ext building an XPI, if that's easier, but we've got code to load zip files in Firefox, so it might be easier to take advantage of that.

Rob: I am currently working around the problem by moving my mouse down to the tiny dropdown box and changing the format _every_ time I try to load the extension.  It's gotten tedious enough that I filed a bug, and would happily write the patch to make the change I suggested, if that gives you any indication how good of a workaround it is…  
Flags: needinfo?(bwinton)
I don't object to adding .zip to the list of extensions but I worry that it would create some confusion as lots of zip files are not valid extensions.  (Though I acknowledge that that concern is undermined by the fact that .jar is in the default list ... wtf?)  Anyway, distinguishing non-extension zips from extensions is the point of using the .xpi extension.  So ... is it deliberate that web-ext uses the .zip extension and if so, why?
It already does. WebExtensions should have a .xpi extension. This is a web-ext bug.
(In reply to Andrew Swan [:aswan] from comment #6)
> I don't object to adding .zip to the list of extensions but I worry that it
> would create some confusion as lots of zip files are not valid extensions. 
> (Though I acknowledge that that concern is undermined by the fact that .jar
> is in the default list ... wtf?)  Anyway, distinguishing non-extension zips
> from extensions is the point of using the .xpi extension.  So ... is it
> deliberate that web-ext uses the .zip extension and if so, why?

IIRC .zip is uploadable to both Chrome Store and AMO.

I think allowing .zip is totally fine, especially if we already allow .jar ...
(In reply to Kris Maglione [:kmag] from comment #7)
> It already does. WebExtensions should have a .xpi extension. This is a
> web-ext bug.

This is fine too - I had a working patch (comment 3) but a bunch of web-ext changes landed in the meantime, so it'd need to be rewritten.

Blake - another option in the meantime (which is a bit annoying to set up, but just the first time) is to use proxy files: https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file
Can we please just allow .zip in the file picker? It looks like the way forward (and it's already supported anyway!) https://browserext.github.io/browserext/#packaging

Web-ext chose .zip because it was compatible with both Firefox (besides this bug) and Chrome. If we change it to .xpi by default then we lose Chrome support. However, this really only applies to Chrome store submissions.

I'd like to discourage web-ext developers from making extensions that only work in Firefox as much as possible.
Flags: needinfo?(kumar.mcmillan)
Component: WebExtensions: Untriaged → Add-ons Manager
Keywords: good-first-bug
Priority: -- → P5
Whiteboard: [qx:link:spec] → [qx:link:spec], triaged
Assign to me please.
Thanks for taking it on Jacob, please let us know if you need help on it.
Assignee: nobody → jacob.harrowmortelliti
Attachment #8837887 - Flags: review?(amckay)
Attachment #8837887 - Flags: review?(amckay) → review?(rhelmer)
(I'm not an official reviewer, but for what it's worth this looks great to me! 
Comment on attachment 8837887 [details]
Bug 1328624 - Added .zip to default extensions when installing an add-on from file.

https://reviewboard.mozilla.org/r/112880/#review115624
Attachment #8837887 - Flags: review?(rhelmer) → review+
Comment on attachment 8837887 [details]
Bug 1328624 - Added .zip to default extensions when installing an add-on from file.

https://reviewboard.mozilla.org/r/112880/#review116940
So no further action is required by me?
Sorry, now you have an r+ you just need to set checkin-needed as keyword and the sheriffs will come along and check it in for you. I've done that for you.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f2c4369cac4f
Added .zip to default extensions when installing an add-on from file. r=rhelmer
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f2c4369cac4f
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.