fix: update sitewide.js loading order using PageLoad()
This commit is contained in:
parent
14250d1add
commit
8c249ad624
1 changed files with 40 additions and 40 deletions
|
|
@ -45,35 +45,6 @@ let Theme = ``;
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (document.readyState === 'complete') {
|
||||
PageLoad()
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', PageLoad);
|
||||
}
|
||||
|
||||
// Apply Theme
|
||||
LoadTheme();
|
||||
|
||||
const combination = "reload";
|
||||
let currentCombination = "";
|
||||
document.addEventListener("keypress", function (e) {
|
||||
currentCombination += e.key;
|
||||
if (currentCombination === combination && document.activeElement.tagName !== "INPUT" && document.activeElement.tagName !== "TEXTAREA") {
|
||||
try {
|
||||
console.log("Reloading Poly+...");
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
} catch(error) {
|
||||
console.log("Reloading Poly+...");
|
||||
window.location.reload()
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
}
|
||||
} else if (!combination.startsWith(currentCombination)) {
|
||||
currentCombination = "";
|
||||
}
|
||||
});
|
||||
|
||||
if (Settings.HideUserAds && Settings.HideUserAds.Enabled === true) {
|
||||
if (Settings.HideUserAds.Banners && Settings.HideUserAds.Banners === true) {
|
||||
|
|
@ -114,6 +85,35 @@ let Theme = ``;
|
|||
const ThemeBlob = new Blob([Theme], { type: 'text/css' });
|
||||
const ThemeURL = URL.createObjectURL(ThemeBlob);
|
||||
document.head.innerHTML += `<link href="${ThemeURL}" rel="stylesheet" type="text/css">`;
|
||||
}
|
||||
if (document.readyState === 'complete') {
|
||||
PageLoad()
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', PageLoad);
|
||||
}
|
||||
|
||||
// Apply Theme
|
||||
LoadTheme();
|
||||
|
||||
const combination = "reload";
|
||||
let currentCombination = "";
|
||||
document.addEventListener("keypress", function (e) {
|
||||
currentCombination += e.key;
|
||||
if (currentCombination === combination && document.activeElement.tagName !== "INPUT" && document.activeElement.tagName !== "TEXTAREA") {
|
||||
try {
|
||||
console.log("Reloading Poly+...");
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
} catch(error) {
|
||||
console.log("Reloading Poly+...");
|
||||
window.location.reload()
|
||||
chrome.runtime.sendMessage({ action: "reload" });
|
||||
window.location.reload();
|
||||
}
|
||||
} else if (!combination.startsWith(currentCombination)) {
|
||||
currentCombination = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
|
|
|
|||
Reference in a new issue