Preserve inert control scripts during client navigation
This commit is contained in:
1 parent
41383960f8
commit
c3818f0041
4 files changed
+14
-4
No files matched your search
@@ -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 = [];
|
||||
|
||||
Reference in new issue
Block a user