From ed2077119491bcc198ae84df5b1b1ed6f13f78f1 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 18 Mar 2024 00:45:41 +0100 Subject: Enable trusted-types This commit adds a policy, and make use of it in the Content-Security-Policy. I've tested it the best I could, both on a modern browser supporting trusted-types (Chrome) and on one that doesn't (firefox). Thanks to @lweichselbaum for giving me a hand to wrap this up! --- internal/ui/static/js/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/ui/static/js/bootstrap.js') diff --git a/internal/ui/static/js/bootstrap.js b/internal/ui/static/js/bootstrap.js index c83704c3..44d6e716 100644 --- a/internal/ui/static/js/bootstrap.js +++ b/internal/ui/static/js/bootstrap.js @@ -129,7 +129,7 @@ document.addEventListener("DOMContentLoaded", () => { if ("serviceWorker" in navigator) { const scriptElement = document.getElementById("service-worker-script"); if (scriptElement) { - navigator.serviceWorker.register(scriptElement.src); + navigator.serviceWorker.register(ttpolicy.createScriptURL(scriptElement.src)); } } -- cgit v1.2.3