Preserve inert control scripts during client navigation
Quality / quality (ubuntu-latest) (push) Canceled after 0s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-10-01 20:33:24 +05:30
1 parent 41383960f8
commit c3818f0041
4 files changed
+14 -4

No files matched your search

+4 -1
View File
@@ -576,7 +576,10 @@ export const NAV_RUNTIME = String.raw`
document.querySelectorAll('script[data-wrn-controls]').forEach(function (node) { node.remove(); });
doc.querySelectorAll('script[data-wrn-controls]').forEach(function (node) {
document.body.appendChild(document.importNode(node, true));
// Preserve parser-created inert JSON nodes. Deep cloning script text
// makes Chrome recheck it as a modified script under Trusted Types.
if (node.getAttribute("type") !== "application/json") return;
document.body.appendChild(document.adoptNode(node));
});
var importedNodes = [];