diff --git a/webextension/scripts/checkalts.js b/webextension/scripts/checkalts.js index eb8d34bf..dd204a10 100644 --- a/webextension/scripts/checkalts.js +++ b/webextension/scripts/checkalts.js @@ -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"); diff --git a/webextension/scripts/textspacing.js b/webextension/scripts/textspacing.js index fb3a9477..89991e1f 100644 --- a/webextension/scripts/textspacing.js +++ b/webextension/scripts/textspacing.js @@ -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(