Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
blackstormx committed Jul 29, 2020
1 parent 5e496ce commit a3a5394
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,28 @@ const url =

function chromeStorage(sKey) {
return new Promise(function(resolve, reject) {
chrome.storage.local.get(sKey, function(items) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
reject(chrome.runtime.lastError.message);
} else {
resolve(items[sKey]);
}
chrome.storage.sync.get(sKey, function(items) {
console.log(items, sKey);
resolve(items[sKey]);
});
});
}

chromeStorage("parseWiki")
.then(result => {
parseWiki = result;
return "customBanWord";
return chromeStorage("customBanWord");
})
.then(result => {
bannedWord = result;
return "savedCustomSlogans";
return chromeStorage("savedCustomSlogans");
})
.then(result => {
result.forEach(slogan => {
slogansKeys.push(slogan);
slogans[slogan] = true;
});
startScan();
});

// chrome.storage.sync.get("parseWiki", function(items) {
Expand All @@ -52,13 +49,12 @@ chromeStorage("parseWiki")
// bannedWord = items.customBanWord;
// });

chrome.storage.sync.get("savedCustomSlogans", function(items) {
console.log(items);
items.savedCustomSlogans.forEach(slogan => {
slogansKeys.push(slogan);
slogans[slogan] = true;
});
});
// chrome.storage.sync.get("savedCustomSlogans", function(items) {
// items.savedCustomSlogans.forEach(slogan => {
// slogansKeys.push(slogan);
// slogans[slogan] = true;
// });
// });

// const url = "https://en.wikipedia.org/wiki/List_of_political_slogans";

Expand Down

0 comments on commit a3a5394

Please sign in to comment.