Skip to content

Commit

Permalink
stop processing detached elements
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Jun 23, 2024
1 parent b7ba85b commit 8514f7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main_world/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ document.documentElement.addEventListener('xkitinjectionrequest', async event =>
moduleCache[path] ??= await import(path);
const func = moduleCache[path].default;

if (target instanceof Node && target.isConnected === false) return;

const result = await func.apply(target, args);
target.dispatchEvent(
new CustomEvent('xkitinjectionresponse', { detail: JSON.stringify({ id, result }) })
Expand Down

0 comments on commit 8514f7e

Please sign in to comment.