Fixed bug with load event timing
This commit is contained in:
parent
ad308ab270
commit
34709c9eab
@ -70,6 +70,7 @@ function startConstantVigilance() {
|
||||
}
|
||||
});
|
||||
|
||||
console.log("Commencing vigilance for stickies!");
|
||||
observer.observe(document.querySelector("html"), {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
@ -82,13 +83,16 @@ function startConstantVigilance() {
|
||||
/******************/
|
||||
|
||||
function initialize() {
|
||||
chrome.storage.sync.get([ "matchingPatterns", "exclusionPatterns", "mode" ],
|
||||
(result) => {
|
||||
chrome.storage.sync.get([ "matchingPatterns", "exclusionPatterns", "mode" ], (result) => {
|
||||
let shouldKillSticky = checkForShouldKillSticky(result);
|
||||
updateIcon(shouldKillSticky);
|
||||
if (shouldKillSticky) {
|
||||
startConstantVigilance();
|
||||
window.onload = () => {
|
||||
if (document.readyState == "loading") {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
killSticky();
|
||||
});
|
||||
} else {
|
||||
killSticky();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user