Bug 1120389 - 'search.xml, line 500: TypeError: aEvent is undefined' when using the 'Paste & Search' context menu item, r=felipe.
authorFlorian Quèze <florian@queze.net>
Fri, 16 Jan 2015 22:20:24 +0100
changeset 224338 dceee642eec766ba05739f85d61e1c9b895282cb
parent 224337 e41cbd7c6973080b316cf4b536c5b4958848b5d4
child 224339 03d7a18981e416258e23c046908d174e06efa0ac
push id54190
push userkwierso@gmail.com
push dateSat, 17 Jan 2015 02:06:29 +0000
treeherdermozilla-inbound@369a8f14ccf8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1120389
milestone38.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 1120389 - 'search.xml, line 500: TypeError: aEvent is undefined' when using the 'Paste & Search' context menu item, r=felipe.
browser/components/search/content/search.xml
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -500,25 +500,25 @@
 #endif
               where = "tab-background";
           }
 
           let selection = this.telemetrySearchDetails;
           this.doSearch(textValue, where, aEngine);
 
           if (!selection || (selection.index == -1)) {
-            let target = aEvent.originalTarget;
             let source = "unknown";
             let type = "unknown";
             if (aEvent instanceof KeyboardEvent) {
               type = "key";
               if (this._textbox.getSelectedOneOff()) {
                 source = "oneoff";
               }
             } else if (aEvent instanceof MouseEvent) {
+              let target = aEvent.originalTarget;
               type = "mouse";
               if (target.classList.contains("searchbar-engine-one-off-item")) {
                 source = "oneoff";
               } else if (target.classList.contains("search-panel-header") ||
                          target.parentNode.classList.contains("search-panel-header")) {
                 source = "header";
               }
             }