Closed Bug 1300304 Opened 8 years ago Closed 8 years ago

inclusion of update-url in add-on manifest breaks chrome.contextMenus

Categories

(WebExtensions :: Untriaged, defect)

48 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1285314

People

(Reporter: destinyplus, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36

Steps to reproduce:

I had a WebExtensions addon that would work fine loaded from locally, adds context menus using chrome.contextMenus.create.

As this would be an unlisted Add-on, I was following steps to provide the update-url from 

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

so I added the following to the manifest file (this is in the signed xpi provided)

  "applications": {
    "gecko": {
      "update_url": "https://troysecure.com/dlbcaddy/dlbcaddy.updates.json"
    }
  },






Actual results:

With the 'applications' block added, the console shows an error in background.js at the first reference to the object 'chrome' and consequently the content menus don't load. 


Expected results:

Without the applications block, the context menus get added as expected.
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Whiteboard: should add, this is loading the addon via the about:debugging#addons page as I have yet to successfully load it from a url.
Component: Untriaged → WebExtensions
Product: Firefox → Toolkit
This works as expected for me. What version of Firefox does this happen with? Can you reproduce with a clean profile?
I just tried on FF48.0.2 with a clean profile and get the same problem - which is that background.js stalls on the first reference to the object 'chrome'

I tried it by installing from file and by a proper install link on a page.

Here is a screenshot of the browser console output (started blank) after I do a reload on the debug addons page: about:debugging#addons  : http://screencast.com/t/HjnHaMse
And just to clarify, the resulting issue is there's no context menu for the addon, and this only occurs when the update-url is included in the manifest. I don't want to start getting people to install the addon until I can be sure the update mechanism is working.

And if I install a previous version, the update mechanism does seem to work, so that part of the manifest seems correct, it's just that it causes this error.
Ah, I see. The problem is that you include an "applications" object, but no ID. This is fixed in Firefox 49, but you can work around it in 48 by just adding an ID to the `applications.gecko` object.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Whiteboard: should add, this is loading the addon via the about:debugging#addons page as I have yet to successfully load it from a url.
FYI OK, this helped. Just a note that the regex that's used to check applications.gecko.id is for an email address, whereas my id needs to be {05aaac00-ad0f-4a40-8c37-1ce76d95aea8}. This might only be when loaded as temporary.

Now I uploaded to AMO and got a new signed version, and installed conventionally, it's no longer complaining about it. 

Thanks for all the help with this :-)
(In reply to destinyplus from comment #5)
> FYI OK, this helped. Just a note that the regex that's used to check
> applications.gecko.id is for an email address, whereas my id needs to be
> {05aaac00-ad0f-4a40-8c37-1ce76d95aea8}.

Both formats are supported:

http://searchfox.org/mozilla-central/rev/95b0ecf4b59a01e0524ca02f6c96ecaabe38f4d5/toolkit/components/extensions/schemas/manifest.json#211-220

but the error reporting doesn't make that clear in older 
versions (see bug 1271785).
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: