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 e56b6bd commit c197005Copy full SHA for c197005
src/pat/inject/inject.js
@@ -818,9 +818,23 @@ const inject = {
818
elementbefore: "before",
819
}[cfg.action];
820
821
- // Inject the content HERE!
822
target[method](...source_nodes);
823
+ if (! cfg.removeTags?.includes("script")) {
824
+ // Find and execute scripts
825
+ for (const node of source_nodes) {
826
+ const scripts = node.querySelectorAll?.("script") || [];
827
+ for (const script of scripts) {
828
+ const new_script = document.createElement("script");
829
+ for (const attr of [...script.attributes]) {
830
+ new_script.setAttribute(attr.name, attr.value)
831
+ }
832
+ new_script.textContent = script.textContent;
833
+ script.replaceWith(new_script);
834
835
836
837
+
838
return true;
839
},
840
0 commit comments