| @@ -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(); | |||
| } | |||
| } | |||