From 42c52584eb23edd01182e28123c58ba1a0e95522 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 30 Oct 2023 11:51:22 +0100 Subject: [PATCH] HTML cell output: respect all atributed of script element --- frontend/components/CellOutput.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/components/CellOutput.js b/frontend/components/CellOutput.js index aec811e078..5fe2304202 100644 --- a/frontend/components/CellOutput.js +++ b/frontend/components/CellOutput.js @@ -331,9 +331,14 @@ const execute_scripttags = async ({ root_node, script_nodes, previous_results_ma if (script_el == undefined) { script_el = document.createElement("script") + script_el.referrerPolicy = node.referrerPolicy + script_el.crossOrigin = node.crossOrigin script_el.integrity = node.integrity + script_el.noModule = node.noModule + script_el.nonce = node.nonce + script_el.type = node.type script_el.src = node.src - script_el.type = node.type === "module" ? "module" : "text/javascript" + // Not copying defer or async because this script is not included in the initial HTML document, so it has no effect. // @ts-ignore script_el.pluto_is_loading_me = true }