Only load ContextMenu.jsm when a contextmenu event occurs

RESOLVED FIXED in Firefox 62

Status

()

enhancement
P1
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: Felipe, Assigned: Felipe)

Tracking

(Blocks 1 bug)

Trunk
Firefox 62
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox62 fixed)

Details

(Whiteboard: [fxperf:p1])

Attachments

(1 attachment)

An instance of the ContextMenu object is created for every tab (in content.js) only to add its event listener for the "contextmenu" event.

We can add this observer in content.js and only load the .jsm when that happens.

This patch uses the helper being added in bug 1457988

Comment 2

a year ago
mozreview-review
Comment on attachment 8975391 [details]
Bug 1461248 - Only load ContextMenu.jsm when a contextmenu event occurs.

https://reviewboard.mozilla.org/r/243698/#review249640

defineLazyProxy looks awesome! Thanks, felipe!
Attachment #8975391 - Flags: review?(mconley) → review+

Updated

a year ago
Priority: -- → P1
Comment hidden (mozreview-request)
Depends on: 1462400
I did some small shuffling around in content.js to make the code look cleaner: moved the `var global = this` to the top of the file, to group the XPCOMUtils stuff together. I'll carry the r+ forward since there's no functionality change.

I also removed the `var contextMenu = ` which was useless, but now I need to wait for bug 1462400 before landing this, otherwise eslint will complain

Comment 5

a year ago
Pushed by felipc@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/43757e7a227f
Only load ContextMenu.jsm when a contextmenu event occurs. r=mconley

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/43757e7a227f
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
You need to log in before you can comment on or make changes to this bug.