Bug 1542843 - Don't special case XUL documents in webExtensionTargetPrototype._shouldAddNewGlobalAsDebuggee;r=rpl
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 08 Apr 2019 19:26:23 +0000
changeset 469008 24125453aa81e67164fd1219a0b36767d8fb42e3
parent 469007 3d4960bdee5fabd18b34cccbfd6c5deda3a88a3e
child 469009 da3353f475f63ae929522fef23623c19871e48c1
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl
bugs1542843
milestone68.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 1542843 - Don't special case XUL documents in webExtensionTargetPrototype._shouldAddNewGlobalAsDebuggee;r=rpl As we convert more chrome documents away from XUL we end up running through two different paths in this function. These are going to be filtered out in later checks anyway, so this change removes the early return. Differential Revision: https://phabricator.services.mozilla.com/D26574
devtools/server/actors/targets/webextension.js
--- a/devtools/server/actors/targets/webextension.js
+++ b/devtools/server/actors/targets/webextension.js
@@ -20,17 +20,16 @@ const {
   ParentProcessTargetActor,
   parentProcessTargetPrototype,
 } = require("devtools/server/actors/targets/parent-process");
 const makeDebugger = require("devtools/server/actors/utils/make-debugger");
 const { ActorClassWithSpec } = require("devtools/shared/protocol");
 const { webExtensionTargetSpec } = require("devtools/shared/specs/targets/webextension");
 
 loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/thread", true);
-loader.lazyRequireGetter(this, "ChromeUtils");
 const FALLBACK_DOC_MESSAGE = "Your addon does not have any document opened yet.";
 
 /**
  * Protocol.js expects only the prototype object, and does not maintain the prototype
  * chain when it constructs the ActorClass. For this reason we are using `extend` to
  * maintain the properties of BrowsingContextTargetActor.prototype
  */
 const webExtensionTargetPrototype = extend({}, parentProcessTargetPrototype);
@@ -342,21 +341,16 @@ webExtensionTargetPrototype._shouldAddNe
     } catch (e) {
       // The global might be a sandbox with a window object in its proto chain. If the
       // window navigated away since the sandbox was created, it can throw a security
       // exception during this property check as the sandbox no longer has access to
       // its own proto.
       return false;
     }
 
-    // Filter out any global which contains a XUL document.
-    if (ChromeUtils.getClassName(global.document) == "XULDocument") {
-      return false;
-    }
-
     // Change top level document as a simulated frame switching.
     if (global.document.ownerGlobal && this.isExtensionWindow(global)) {
       this._onNewExtensionWindow(global.document.ownerGlobal);
     }
 
     return global.document.ownerGlobal &&
            this.isExtensionWindowDescendent(global.document.ownerGlobal);
   }