We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d5c231 commit ff541e8Copy full SHA for ff541e8
src/pat/inject/inject.js
@@ -819,9 +819,23 @@ const inject = {
819
elementbefore: "before",
820
}[cfg.action];
821
822
- // Inject the content HERE!
823
target[method](...source_nodes);
824
+ if (! cfg.removeTags?.includes("script")) {
825
+ // Find and execute scripts
826
+ for (const node of source_nodes) {
827
+ const scripts = node.querySelectorAll?.("script") || [];
828
+ for (const script of scripts) {
829
+ const new_script = document.createElement("script");
830
+ for (const attr of [...script.attributes]) {
831
+ new_script.setAttribute(attr.name, attr.value)
832
+ }
833
+ new_script.textContent = script.textContent;
834
+ script.replaceWith(new_script);
835
836
837
838
+
839
return true;
840
},
841
0 commit comments