Skip to content

Commit 7dba310

Browse files
committed
Ensure event hooking does not break window-level listeners.
1 parent 0d1fa22 commit 7dba310

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/content/eventsHook.main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (location.protocol == "file:") {
2525

2626
function modifyWindow(scope, {port, xray}) {
2727
const { window } = xray;
28-
const { Proxy, document } = window;
28+
const { Proxy, document, Node } = window;
2929

3030
const { Reflect } = globalThis;
3131

@@ -46,7 +46,7 @@ if (location.protocol == "file:") {
4646
const call = (func, obj, ...args) => Reflect.apply(func, obj, args || NO_ARGS);
4747

4848
const watch = watching => {
49-
if (!watchList.has(watching)) {
49+
if (watching instanceof Node && !watchList.has(watching)) {
5050
const ownerDocument = call(nodeProps.ownerDocument, watching);
5151
const crossDoc = ownerDocument != document;
5252
const parentNode = call(nodeProps.parentNode, watching);
@@ -125,4 +125,4 @@ if (location.protocol == "file:") {
125125
onMessage: m => {
126126
},
127127
});
128-
}
128+
}

0 commit comments

Comments
 (0)