From 0da3393abb391a7a77209282fd73ba0dea199907 Mon Sep 17 00:00:00 2001 From: Mendel Douek <91295776+mdouek@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:20:00 -0800 Subject: [PATCH] Fix for loop bug which breaks favicon replacement (#171) * create static array from htmlcollection --- src/main/webapp/simple-theme.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/simple-theme.js b/src/main/webapp/simple-theme.js index 440ca5b..0190ec9 100644 --- a/src/main/webapp/simple-theme.js +++ b/src/main/webapp/simple-theme.js @@ -2,7 +2,7 @@ "use strict"; function removeAll() { - var links = document.getElementsByTagName('link'), + var links = Array.from(document.getElementsByTagName('link')), link, i; for (i = 0; i < links.length; i++) { @@ -30,4 +30,4 @@ global['org.jenkinsci.plugins.simpletheme'] = { replaceFavicon: replaceFavicon }; -})(this, document); +})(this, document); \ No newline at end of file