diff --git a/background.js b/background.js index 594d83b..ca924ee 100644 --- a/background.js +++ b/background.js @@ -24,6 +24,12 @@ const addSlogan = document.getElementById("add"); const customBanWord = document.getElementById("customBanWord"); const set = document.getElementById("set"); +const parseWiki = document.getElementById("parseWiki"); + +parseWiki.onchange = () => { + chrome.storage.sync.set({ parseWiki: parseWiki.checked }, function() {}); +}; + chrome.storage.sync.get("customBanWord", function(items) { customBanWord.placeholder = "Current: " + items.customBanWord; }); diff --git a/content.js b/content.js index eb0844b..3df0a03 100644 --- a/content.js +++ b/content.js @@ -1,13 +1,21 @@ const body = document.body; let bannedWord = "*Banned by StopSlogan*"; +let parseWiki = true; -chrome.storage.sync.get("customBanWord", function(items) { - bannedWord = items.customBanWord; - console.log(items, bannedWord); - startScan(); +chrome.storage.sync.get("parseWiki", function(items) { + console.log(items); + parseWiki = items.parseWiki; + next(); }); +function next() { + chrome.storage.sync.get("customBanWord", function(items) { + bannedWord = items.customBanWord; + startScan(); + }); +} + function startScan() { const slogans = {}; let slogansKeys = [];