Console error when right-clicking on a browserAction with no context menus defined

RESOLVED FIXED in Firefox 55

Status

()

Toolkit
WebExtensions: General
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: bsilverberg, Assigned: zombie)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [browserAction], triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

6 months ago
I noticed this when doing some work on browserAction telemetry. If you right-click on a browserAction, and there are no extensions loaded that use the contextmenus API, you get the following error in the console:

TypeError: global.actionContextMenu is not a function  -  ext-browserAction.js:310:11

If there are any extensions loaded that use the contextmenus API then this message does not appear. Discussing this with Luca, we believe this has to do with the lazy loading of the contextmenus API.

This doesn’t break anything, so perhaps it is something that can just be ignored, I’m not sure how critical it is to fix this.
(Assignee)

Comment 1

6 months ago
it should be easy to avoid
Assignee: nobody → tomica
Comment hidden (mozreview-request)
(Reporter)

Comment 3

6 months ago
mozreview-review
Comment on attachment 8865233 [details]
Bug 1362445 - Fix _action context menus when module is not loaded

https://reviewboard.mozilla.org/r/136900/#review140062

This looks good, thanks zombie.  I just want to confirm, there is never a case where this code could run and want to force the loading of the menus module, correct?
Attachment #8865233 - Flags: review?(bob.silverberg) → review+
(Assignee)

Comment 4

6 months ago
> I just want to confirm, there is never a case where this code could 
> run and want to force the loading of the menus module, correct?

Correct, at least not now.  Chrome adds some items to browserAction's context menu even when the extension doesn't, and we were talking about doing something similar (can't find the bug), or when we implement menu-buttons (bug 1253419), but for now, if no extension has used the browser.contextMenus, we don't need to do anything here.
(Assignee)

Updated

6 months ago
Keywords: checkin-needed

Updated

6 months ago
Whiteboard: [browserAction] → [browserAction], triaged
(Assignee)

Updated

6 months ago
Keywords: checkin-needed
(Assignee)

Updated

6 months ago
Attachment #8865233 - Flags: review?(mixedpuppy)

Comment 5

6 months ago
mozreview-review
Comment on attachment 8865233 [details]
Bug 1362445 - Fix _action context menus when module is not loaded

https://reviewboard.mozilla.org/r/136900/#review140200
Attachment #8865233 - Flags: review?(mixedpuppy) → review+
Keywords: checkin-needed

Comment 6

6 months ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2c8fe990d360
Fix _action context menus when module is not loaded r=bsilverberg,mixedpuppy
Keywords: checkin-needed

Comment 7

6 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2c8fe990d360
Status: NEW → RESOLVED
Last Resolved: 6 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
(Assignee)

Updated

5 months ago
Duplicate of this bug: 1370716
You need to log in before you can comment on or make changes to this bug.