Closed Bug 831819 Opened 11 years ago Closed 6 years ago

Addon Provider's getInstallForUrl is never called

Categories

(Toolkit :: Add-ons Manager, defect)

18 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: arantius, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130104154748

Steps to reproduce:

Drag and drop a ".user.js" file into the Addon Manager.


Actual results:

A dialog that says "This add-on could not be installed because it appears to be corrupt"


Expected results:

Downstream bug:
https://github.com/greasemonkey/greasemonkey/issues/1663

Greasemonkey defines:
https://github.com/greasemonkey/greasemonkey/blob/0d758f7ddfb48a7b33d64ece88cb5343f6d1399e/modules/addons4.js#L39
And registers:
https://github.com/greasemonkey/greasemonkey/blob/0d758f7ddfb48a7b33d64ece88cb5343f6d1399e/modules/addons4.js#L371
an Addon Provider.


In extensions.js, gDragDrop.onDrop calls AddonManager.getInstallForURL, which does:

...
for (let provider of providers) {
  if (callProvider(provider, "supportsMimetype", false, aMimetype)) {
    callProvider(provider, "getInstallForURL", null,
...

Since my provider is registered, I'd expect to get a supportsMimetype / getInstallForURL call.  I added these methods to my provider, but neither supportsMimetype, getInstallForFile ,nor getInstallForURL is ever called.
Component: Untriaged → Add-ons Manager
Product: Firefox → Toolkit
This appears ultimately to be:
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/content/extensions.js#3294

The "application/x-xpinstall" string is hard coded, regardless of what file is being dropped.  The XPIProvider is registered early/first, supports that mime type, and grabs all dropped files regardless of type.  If the file isn't ".xpi" that mime type should not be passed.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.