Closed
Bug 1377510
Opened 7 years ago
Closed 7 years ago
Add the ability to install extensions using the WebExtension API via mozprofile
Categories
(Testing :: Mozbase, enhancement)
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: tarek, Assigned: tarek)
References
Details
Attachments
(1 file, 3 obsolete files)
Currently, Mozprofile will let you install addons but won't work with web extensions because it will look for an 'install.rdf' file in the xpi.
We should extend the API so it can install web extensions as well.
I'll dig into this by looking how marionette does it, but happy to get extra guidance :)
Comment 1•7 years ago
|
||
(In reply to Tarek Ziadé (:tarek) from comment #0)
> I'll dig into this by looking how marionette does it, but happy to
> get extra guidance :)
The remote protocol (Marionette) has an addon service that exposes
two commands for installing and uninstalling addons:
Addon:Install
Takes a JSON Object with |path| (string) and |temporary|
(optional boolean) fields, which tells it where to find the full
path to the .xpi file and whether the addon should be installed
temporarily (cleaned when the Firefox session ends).
Returns the string ID of the installed addon.
Addon:Uninstall
Takes a JSON Object with |id| (string) that identifies the addon
to be uninstalled.
The code we use to do this is located in
https://searchfox.org/mozilla-central/source/testing/marionette/addon.js
and is run in chrome space.
It uses the AddonManager.jsm module which you can find in
https://searchfox.org/mozilla-central/source/toolkit/mozapps/extensions/AddonManager.jsm.
Please let me know if there is anything specific you’re looking
for. I don’t know mozprofile intimately, but I can help out with
the remote protocol.
Comment 2•7 years ago
|
||
Andreas, this bug is about mozprofile and not marionette. Anything left for Marionette (like installing from a remote URL) should be handled on a different bug.
I discussed this problem with Tarek during the workweek, and as such the bug has been filed.
Comment 3•7 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [partly available 07/10 -07/14] from comment #2)
> Andreas, this bug is about mozprofile and not marionette. Anything left for
> Marionette (like installing from a remote URL) should be handled on a
> different bug.
I know this is about mozprofile, but Tarek asked about pointers to how
Marionette deals with addon installation in comment #0.
Assignee | ||
Comment 4•7 years ago
|
||
Thanks for the pointers Andreas! I am back from leave today and will be working on this this week
Assignee | ||
Comment 5•7 years ago
|
||
This is a first attempt at adding a feature. It works but not a final version by all means.
One question:
- do we want to implement the feature as a special case in the existing code like I started to do, or treat webextension separately from add ons ?
Stuff I am digging into:
- the web extension id is optional, the addon-id is mandatory. I have added that id for the test, but I am not sure what should be the proper install behavior when there's no id in the webextensions.
- not sure how to treat unpack as well
- signature verification
If you think of other things let me know!
Flags: needinfo?(hskupin)
Assignee | ||
Comment 6•7 years ago
|
||
Digs:
1/ for the id, I am thinking about duplicating the behavior found in generateTemporaryInstallID() at https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIInstall.jsm#757-769
2/ unpack is false for webextensions - https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIInstall.jsm#358
Assignee | ||
Comment 7•7 years ago
|
||
Attachment #8889344 -
Attachment is obsolete: true
Assignee | ||
Comment 8•7 years ago
|
||
Attachment #8889456 -
Attachment is obsolete: true
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8889460 -
Attachment is obsolete: true
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8889566 [details]
Bug 1377510 - Add the ability to install webextensions with mozprofile
https://reviewboard.mozilla.org/r/160580/#review166262
Attachment #8889566 -
Flags: review?(dburns) → review+
Assignee | ||
Comment 11•7 years ago
|
||
Moved the needinfo to Andrew. I guess the patch I have on reviewboard is good enough to make it work for webextensions, but maybe that's not the way you would like to see this feature added? let me know
Flags: needinfo?(hskupin) → needinfo?(ahalberstadt)
Comment 12•7 years ago
|
||
If that's all it takes, I think your patch is good enough!
Mozprofile has been in maintenance mode for many years now, you'll probably have trouble finding anyone who cares overly much about its architecture. As long as it doesn't break anything and isn't horrible is usually good enough for me.
Flags: needinfo?(ahalberstadt)
Comment 13•7 years ago
|
||
Pushed by tziade@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7b98f21c8b79
Add the ability to install webextensions with mozprofile r=automatedtester
Comment 14•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Comment 15•7 years ago
|
||
Sorry for the late reply but I was on PTO all last week...
(In reply to Tarek Ziadé (:tarek) from comment #5)
> - do we want to implement the feature as a special case in the existing code
> like I started to do, or treat webextension separately from add ons ?
Extensions using the Webextension API are add-ons which are the ones which we ONLY support from Firefox 57 onward. It means legacy extensions are no longer supported, and as such the code path to install those should have as best gotten the `else` part in your patch. But it's vise versa right now. It's nothing we have to change now, but once we remove the old code it means a bit more changes.
> - the web extension id is optional, the addon-id is mandatory. I have added
> that id for the test, but I am not sure what should be the proper install
> behavior when there's no id in the webextensions.
> - not sure how to treat unpack as well
> - signature verification
If there is no ID specified the extension can only be installed temporarily, but not permanently. If that is a need we would still have to add this, right?
Flags: needinfo?(tarek)
Updated•7 years ago
|
Summary: Add the ability to install webextensions in mozprofile → Add the ability to install extensions using the WebExtension API via mozprofile
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(tarek)
You need to log in
before you can comment on or make changes to this bug.
Description
•