From b04e192e49ec75a8bdc17ae648c5c161818affc7 Mon Sep 17 00:00:00 2001 From: Ladislav Hano <524934@fi.muni.cz> Date: Fri, 17 Feb 2023 12:29:09 +0100 Subject: [PATCH] No longer changing inner html --- content.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/content.js b/content.js index 91bfc49..7c9338f 100644 --- a/content.js +++ b/content.js @@ -47,18 +47,13 @@ let app_css = ` } #app_menu.empty { background-color: transparent }`; -let style = document.getElementsByTagName("style"); -if (style.length == 0) { - document.head.innerHTML += ""; +let style = document.createElement("style"); +let main_page = document.getElementsByClassName("motiv-titulka"); +if (main_page.length == 0) { + style.innerText = app_css + other_css; } else { - let main_page = document.getElementsByClassName("motiv-titulka"); - if (main_page.length == 0) { - style[0].innerHTML += app_css + other_css; - } - else { - style[0].innerHTML += main_menu_css + other_css; - } + style.innerText = main_menu_css + other_css; } - +document.head.appendChild(style) \ No newline at end of file