You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
859 B
JavaScript
24 lines
859 B
JavaScript
(function() {
|
|
function injectCSS(id, file) {
|
|
if (!file) return;
|
|
window.addEventListener("DOMNodeRemoved", function() {
|
|
if (document.getElementById(id) == null) {
|
|
const head = document.getElementsByTagName("head")[0];
|
|
const link = document.createElement("link");
|
|
link.id = id;
|
|
link.rel = "stylesheet";
|
|
link.type = "text/css";
|
|
link.href = chrome.extension.getURL("css/" + file + ".css");
|
|
link.media = "all";
|
|
head.appendChild(link);
|
|
}
|
|
});
|
|
}
|
|
injectCSS("lezpluscss_main", "main");
|
|
const stylesheets = {
|
|
"/lez/tutor/review": "review",
|
|
"/lez/tutor/solution": "solution",
|
|
}
|
|
injectCSS("lezpluscss_special", stylesheets[window.location.pathname]);
|
|
})()
|