Bug 1300385 - Do not set button if undefined. draft
authorRob Wu <rob@robwu.nl>
Sun, 04 Sep 2016 05:53:25 -0700
changeset 411293 721ba00e885ff80e556a53a7a47e5bde4a90d1f4
parent 411292 e872ccce801005bf8a34efbda67bf55189d9c2b7
child 530713 fba344b29569c75e38f5f735f283ac664c6b73d5
push id28877
push userbmo:rob@robwu.nl
push dateWed, 07 Sep 2016 22:13:39 +0000
bugs1300385
milestone51.0a1
Bug 1300385 - Do not set button if undefined. MozReview-Commit-ID: 9QhsP5Woac0
browser/base/content/contentSearchUI.js
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -269,19 +269,21 @@ ContentSearchUIController.prototype = {
       searchString: searchTerms,
       healthReportKey: this._healthReportKey,
       searchPurpose: this._searchPurpose,
       originalEvent: {
         shiftKey: aEvent.shiftKey,
         ctrlKey: aEvent.ctrlKey,
         metaKey: aEvent.metaKey,
         altKey: aEvent.altKey,
-        button: aEvent.button,
       },
     };
+    if ("button" in aEvent) {
+      eventData.originalEvent.button = aEvent.button;
+    }
 
     if (this.suggestionAtIndex(this.selectedIndex)) {
       eventData.selection = {
         index: this.selectedIndex,
         kind: undefined,
       };
       if (aEvent instanceof MouseEvent) {
         eventData.selection.kind = "mouse";