Skip to content

Commit

Permalink
feat: trying to clear storage on browser startup for #292
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed May 10, 2019
1 parent 9f8526b commit 1e7e0a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Binary file modified a11ycss-webextension-chrome.zip
Binary file not shown.
Binary file modified a11ycss-webextension-firefox.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions webextension/scripts/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ function onError(error) {
console.error(`a11y.css error: ${error}`);
}

function onCleared() {
console.info("a11y.css storage.local cleared");
}

function unsetStatuses(tabId, changeInfo, tabInfo) {
if (changeInfo.url) {
let getTextSpacingStatus = browser.storage.local.get("textSpacingStatus");
Expand Down Expand Up @@ -67,3 +71,10 @@ function unsetStatuses(tabId, changeInfo, tabInfo) {
}

browser.tabs.onUpdated.addListener(unsetStatuses);

function unsetStorages() {
let clearStorage = browser.storage.local.clear();
clearStorage.then(onCleared, onError);
}

browser.runtime.onStartup.addListener(unsetStorages);

0 comments on commit 1e7e0a6

Please sign in to comment.