From 7f699302a48e11eab8b2e1f60647546ec83a9938 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 21 May 2025 18:11:51 -0700 Subject: [PATCH] Trying out the XSS-safe approach for `puter.print` --- src/puter-js/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/puter-js/src/index.js b/src/puter-js/src/index.js index 5e77f0749..86f52dc29 100644 --- a/src/puter-js/src/index.js +++ b/src/puter-js/src/index.js @@ -524,7 +524,8 @@ export default window.puter = (function() { print = function(...args){ for(let arg of args){ - document.body.innerHTML += arg; + const textNode = document.createTextNode(arg); + document.body.appendChild(textNode); } } }