From faeffc41e6c6af8c5c850d5db8d81f1b8143b8a5 Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Fri, 22 Nov 2019 16:16:18 +0100 Subject: [PATCH] Fixed SOMtonight not working after login --- content/js/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/js/index.js b/content/js/index.js index 1e9b76e..69c942e 100644 --- a/content/js/index.js +++ b/content/js/index.js @@ -7,6 +7,14 @@ function changeSlogan(message) } else { tonight = message[0]; slogans = message[1]; + + // Set theme + console.log(tonight); + if (tonight) { + var cssUrl = browser.runtime.getURL("content/css/index.css"); + var cssTag = ``; + document.head.innerHTML += cssTag; + } // Select random slogan console.log(`Loaded ${slogans.length} slogans`); @@ -44,14 +52,6 @@ function changeSlogan(message) // Add a little credit document.querySelectorAll('footer > span')[0].innerHTML = "Somtodayn't is een add-on door McArn."; - - // Set theme - console.log(tonight); - if (tonight) { - var cssUrl = browser.runtime.getURL("content/css/index.css"); - var cssTag = ``; - document.body.innerHTML += cssTag; - } } }