From 0ceb62b819de5482217c69a7d41d4a985a4673c7 Mon Sep 17 00:00:00 2001 From: tfl Date: Thu, 7 Jul 2022 21:04:34 +0200 Subject: [PATCH] Fixed an issue where setTimeout('functionName()', time) would be blocked by CSP --- js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index ef97bbf..6458126 100644 --- a/js/main.js +++ b/js/main.js @@ -307,7 +307,9 @@ function newShootingStar() { // let nextIn = 10; let nextIn = 7000 + Math.floor(Math.random() * 5000); if (areStarsShooting) { - setTimeout('newShootingStar()', nextIn); + setTimeout(() => { + newShootingStar(); + }, nextIn); } }, duration); // setTimeout('newShootingStar()', duration + nextIn);