Bug 1732966 - [devtools] Fix using node picker on content element in MBT. r=ochameau.

Differential Revision: https://phabricator.services.mozilla.com/D126908
This commit is contained in:
Nicolas Chevobbe 2021-09-29 14:45:35 +00:00
Родитель 185e3c90b0
Коммит 557777fb27
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -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 <browser>
@ -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);
}