WebExtensions - update_url in manifest.json Exception

I was testing the update mechanism for WebExtensions.

https://developer.mozilla.org/en-US/Add-ons/Updates

The documentation says: If your add-on is not hosted on AMO, you must specify the location of your update manifest in your add-on. For WebExtensions, add the following to your manifest:

"applications": {
  "gecko": {
    "update_url": "https://example.com/updates.json"
  }
}

However, after adding an “update_url” I can’t install the XPI any more. I tested it with FF Nightly 49.0a1 (2016-06-06). My jsconsole says:

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.hostPort]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/PopupNotifications.jsm :: PopupNotifications_refreshPanel/< :: line 667"  data: no]
PopupNotifications_refreshPanel/<()PopupNotifications.jsm:667
forEach()self-hosted
PopupNotifications_refreshPanel()PopupNotifications.jsm:616
PopupNotifications_showPanel()PopupNotifications.jsm:728
PopupNotifications_update()PopupNotifications.jsm:844
PopupNotifications_show()PopupNotifications.jsm:394
gXPInstallObserver.observe()browser-addons.js:365
notifyObservers()amWebInstallListener.js:51
Installer.prototype.checkAllDownloaded()amWebInstallListener.js:151
Installer()amWebInstallListener.js:81
extWebInstallListener.prototype.onWebInstallRequested()amWebInstallListener.js:335
buildNextInstall()extensions.js:1276
gViewController.commands.cmd_installFromFile.doCommand/buildNextInstall/<()extensions.js:1286
safeCall()AddonManager.jsm:179
AddonManagerInternal.getInstallForFile/<.nextObject/<()AddonManager.jsm:1955
this.XPIProvider.getInstallForFile/<()XPIProvider.jsm:3877
makeSafe/<()XPIProvider.jsm:1986
AddonInstall.prototype.initLocalInstall/</<()XPIProvider.jsm:5302
makeSafe/<()XPIProviderUtils.js:168
getRepositoryAddon()XPIProviderUtils.js:149
this.XPIDatabase.getAddon/<()XPIProviderUtils.js:1119
Handler.prototype.process()Promise-backend.js:937
this.PromiseWalker.walkerLoop()Promise-backend.js:816
bound walkerLoop()self-hosted
bound bound walkerLoop()self-hosted

You can try this with any WebExtension. Download Bookmark-It, add “update_url” to the manifest.json, zip the files, rename it to .xpi and try to install it.

Any ideas on that?

1 Like

Have you disabled signature checking? You can’t modify an add-on package without breaking the signature, and the add-on won’t install unless you disable it.

I thought, there is no signature for WebExtensions any more. Do you mean something similar to the updateKey in the install.rdf? Maybe I misunderstood something. I didn’t disabled anything in the nightly browser.

I just checked about:config and xpinstall.signatures.required is false

Today I upgraded to Nightly 50.0a1 (2016-06-10). What I found out is, the XPI can only get installed through about:debugging. If I open about:addons or drag and drop the XPI from the filesystem into the browser, an error appears, that the XPI is not compatible with 50.0a1.

Only if I remove “update_url” from the manifest.json, I can drag and drop the XPI and install it successfully.

I noticed the same issue. This is not related to the signed status as I had my extension signed with the gecko update_url specified and there was no warning about it. I had to remove the key and get it resigned for it to work. I posted a question concerning this and another issue yesterday. https://groups.google.com/forum/#!topic/mozilla.dev.extensions/hNEzZ4jVqYU

Through by bug I found out that a non-https update_url is not supported. Is that maybe your issue too?

My update_url is also https. I decided to move back to the High-Level SDK. The WebExtensions implementation in FF seems to be broken.