Skip to content

Commit

Permalink
Merge pull request #350 from Lausselloic/webextension-fixchrome
Browse files Browse the repository at this point in the history
catch error when sending message looks to fix error
  • Loading branch information
ffoodd authored May 9, 2019
2 parents feba69e + 783e784 commit 52e8672
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion webextension/scripts/checkalts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ btnCheckalts.addEventListener('click', function () {
icons: icons,
strings: strings
});
});
}).catch(onError);
var checked = this.getAttribute('aria-checked') === 'true' || false;
this.setAttribute('aria-checked', !checked);
storeCheckAltsStatus(!checked);
});
function onError(error) {
console.error(`Error: ${error}`);
}

function checkAltsOnload() {
let getStatus = browser.storage.local.get("checkAltsStatus");
Expand Down
6 changes: 5 additions & 1 deletion webextension/scripts/textspacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ btnTextspacing.addEventListener('click', function () {
browser.tabs.sendMessage(tabs[0].id, {
a11ycss_action: "textspacing"
});
});
}).catch(onError);
var checked = this.getAttribute('aria-checked') === 'true' || false;
this.setAttribute('aria-checked', !checked);
storeTextSpacingStatus(!checked);
});

function onError(error) {
console.error(`Error: ${error}`);
}

function textSpacingOnload() {
let getStatus = browser.storage.local.get("textSpacingStatus");
getStatus.then(
Expand Down

0 comments on commit 52e8672

Please sign in to comment.