| } | } | ||||
| }); | }); | ||||
| console.log("Commencing vigilance for stickies!"); | |||||
| observer.observe(document.querySelector("html"), { | observer.observe(document.querySelector("html"), { | ||||
| attributes: true, | attributes: true, | ||||
| childList: true, | childList: true, | ||||
| /******************/ | /******************/ | ||||
| function initialize() { | function initialize() { | ||||
| chrome.storage.sync.get([ "matchingPatterns", "exclusionPatterns", "mode" ], | |||||
| (result) => { | |||||
| chrome.storage.sync.get([ "matchingPatterns", "exclusionPatterns", "mode" ], (result) => { | |||||
| let shouldKillSticky = checkForShouldKillSticky(result); | let shouldKillSticky = checkForShouldKillSticky(result); | ||||
| updateIcon(shouldKillSticky); | updateIcon(shouldKillSticky); | ||||
| if (shouldKillSticky) { | if (shouldKillSticky) { | ||||
| startConstantVigilance(); | startConstantVigilance(); | ||||
| window.onload = () => { | |||||
| if (document.readyState == "loading") { | |||||
| document.addEventListener("DOMContentLoaded", () => { | |||||
| killSticky(); | |||||
| }); | |||||
| } else { | |||||
| killSticky(); | killSticky(); | ||||
| } | } | ||||
| } | } |