Closed Bug 1461248 Opened 3 years ago Closed 3 years ago
Only load Context
Menu .jsm when a contextmenu event occurs
59 bytes, text/x-review-board-request
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 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+
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
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/43757e7a227f Only load ContextMenu.jsm when a contextmenu event occurs. r=mconley
You need to log in before you can comment on or make changes to this bug.