Skip to content

Commit e635e95

Browse files
committed
fix(pat-inject): Do not clone nodes, as this will destroy pattern initialization.
1 parent 3c65c7f commit e635e95

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/pat/inject/inject.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,11 @@ const inject = {
819819
elementbefore: "before",
820820
}[cfg.action];
821821

822-
// Clone nodes to avoid modifying the original
823-
const nodes = [...source_nodes].map(node => node.cloneNode(true));
824-
target[method](...nodes);
822+
target[method](...source_nodes);
825823

826824
if (! cfg.removeTags?.includes("script")) {
827825
// Find and execute scripts
828-
for (const node of nodes) {
826+
for (const node of source_nodes) {
829827
const scripts = node.querySelectorAll?.("script") || [];
830828
for (const script of scripts) {
831829
const new_script = document.createElement("script");

0 commit comments

Comments
 (0)