Bug 1389721 - fix page action menu to deal with not being passed an event, so the 'save link to pocket' context menu works, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 02 Oct 2017 20:34:01 +0100
changeset 384146 63c7cfadae7b24a90d956237ebb9ad5baf3e76c1
parent 384145 01b425a64b974c258d1b7628e0268f71f5af7f4a
child 384147 53c6bb81a9fc67e3553c3752f6c50521c6e52735
push id32623
push userkwierso@gmail.com
push dateTue, 03 Oct 2017 20:25:55 +0000
treeherdermozilla-central@65a5054a1f92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1389721
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1389721 - fix page action menu to deal with not being passed an event, so the 'save link to pocket' context menu works, r=jaws This also removes the now-obsolete onBeforeCommand method from the pocket code. MozReview-Commit-ID: EjrMoAIv3xw
browser/base/content/browser-pageActions.js
browser/extensions/pocket/content/Pocket.jsm
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -456,17 +456,17 @@ var BrowserPageActions = {
     let id = this._panelButtonNodeIDForActionID(action.id);
     let node = document.getElementById(id);
     if (node) {
       node.setAttribute("label", action.title);
     }
   },
 
   doCommandForAction(action, event, buttonNode) {
-    if (event.type == "click" && event.button != 0) {
+    if (event && event.type == "click" && event.button != 0) {
       return;
     }
     PageActions.logTelemetry("used", action, buttonNode);
     // If we're in the panel, open a subview inside the panel:
     // Note that we can't use this.panelNode.contains(buttonNode) here
     // because of XBL boundaries breaking ELement.contains.
     if (action.subview && buttonNode && buttonNode.closest("panel") == this.panelNode) {
       let panelViewNodeID = this._panelViewNodeIDForActionID(action.id, false);
--- a/browser/extensions/pocket/content/Pocket.jsm
+++ b/browser/extensions/pocket/content/Pocket.jsm
@@ -27,20 +27,16 @@ var Pocket = {
       where = "tab";
     }
     win.openUILinkIn(this.listURL, where);
   },
 
   /**
    * Functions related to the Pocket panel UI.
    */
-  onBeforeCommand(event) {
-    BrowserUtils.setToolbarButtonHeightProperty(event.target);
-  },
-
   onShownInPhotonPageActionPanel(panel, iframe) {
     let window = panel.ownerGlobal;
     window.pktUI.setPhotonPageActionPanelFrame(iframe);
     Pocket._initPanelView(window);
   },
 
   onPanelViewShowing(event) {
     Pocket._initPanelView(event.target.ownerGlobal);