diff --git a/devtools/server/actors/inspector/node-picker.js b/devtools/server/actors/inspector/node-picker.js index 008ac6704225..1d27bdf66828 100644 --- a/devtools/server/actors/inspector/node-picker.js +++ b/devtools/server/actors/inspector/node-picker.js @@ -50,12 +50,6 @@ class NodePicker { * @return {Boolean} */ _isEventAllowed({ target, view }) { - // Allow "non multiprocess" browser toolbox to inspect documents loaded in the parent - // process (e.g. about:robots) - if (view instanceof Ci.nsIDOMChromeWindow) { - return true; - } - // If the picked node is a remote browser element, then we need to let the event through, // since there's a highlighter actor in that sub-frame also picking. // ⚠️ This means we will not handle events made on the padding area of the @@ -67,6 +61,12 @@ class NodePicker { return false; } + // Allow "non multiprocess" browser toolbox to inspect documents loaded in the parent + // process (e.g. about:robots) + if (view instanceof Ci.nsIDOMChromeWindow) { + return true; + } + return this._targetActor.windows.includes(view); }