Bug 1381032 Ignore keypress events in about:addons when focus is in an embedded options browser r=kmag
authorAndrew Swan <aswan@mozilla.com>
Mon, 24 Jul 2017 15:09:13 -0700
changeset 419941 088f78b64f4a28a7909079d6e3d1be7e885a43ba
parent 419940 9ea98e47b68272fc83b7f5078a19633d31f19a2f
child 419942 f29c950fa2262e1bbae4072f3056a4662648727a
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1381032
milestone56.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 1381032 Ignore keypress events in about:addons when focus is in an embedded options browser r=kmag MozReview-Commit-ID: D3KqkYfXbri
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -158,16 +158,23 @@ function initialize(event) {
   });
   addonPage.addEventListener("dragover", function(event) {
     gDragDrop.onDragOver(event);
   });
   addonPage.addEventListener("drop", function(event) {
     gDragDrop.onDrop(event);
   });
   addonPage.addEventListener("keypress", function(event) {
+    // If there is an embedded preferences <browser> running in a remote
+    // process, we will see the event here first before it gets a chance
+    // to bubble up through the embedded page.  To avoid stealing focus,
+    // we just ignore events when focus is in an options browser.
+    if (event.target.classList.contains("inline-options-browser")) {
+      return;
+    }
     gHeader.onKeyPress(event);
   });
 
   if (!isDiscoverEnabled()) {
     gViewDefault = "addons://list/extension";
   }
 
   gViewController.initialize();