diff --git a/a11ycss-webextension-chrome.zip b/a11ycss-webextension-chrome.zip index 60bdb833..b2401e11 100644 Binary files a/a11ycss-webextension-chrome.zip and b/a11ycss-webextension-chrome.zip differ diff --git a/a11ycss-webextension-firefox.zip b/a11ycss-webextension-firefox.zip index 644d89e5..072aa1b9 100644 Binary files a/a11ycss-webextension-firefox.zip and b/a11ycss-webextension-firefox.zip differ diff --git a/webextension/scripts/a11ycss.js b/webextension/scripts/a11ycss.js index 2f5c65f8..4f290e5a 100644 --- a/webextension/scripts/a11ycss.js +++ b/webextension/scripts/a11ycss.js @@ -7,25 +7,25 @@ let button = document.getElementById("a11ycssBtnApply"); * @param {String} strLevel */ function storeA11ycss(strLevel) { - // Get a11y.css stored levels - let getLevel = browser.storage.local.get("a11ycssLevel"); - getLevel.then( - // when we got something - (item) => { - if (item && item.a11ycssLevel) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + let a11ycssLevel = []; + // Get a11y.css stored levels + let getLevel = browser.storage.local.get("a11ycssLevel"); + getLevel.then( + // when we got something + (item) => { + if (item && item.a11ycssLevel) { let a11ycssLevel = item.a11ycssLevel; - // Add or replace current tab's value - a11ycssLevel[tabs[0].id] = {"level": strLevel}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ a11ycssLevel }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + a11ycssLevel[tabs[0].id] = {"level": strLevel}; + // And set it back to the storage + let setting = browser.storage.local.set({ a11ycssLevel }); + setting.then(null, onError); // just in case + }); } // store choice when one radio button is chosen @@ -67,25 +67,25 @@ function removeA11ycss() { } function storeStatus(strStatus) { - // Get a11y.css stored levels - let getStatus = browser.storage.local.get("a11ycssStatus"); - getStatus.then( - // when we got something - (item) => { - if (item && item.a11ycssStatus) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + let a11ycssStatus = []; + // Get a11y.css stored levels + let getStatus = browser.storage.local.get("a11ycssStatus"); + getStatus.then( + // when we got something + (item) => { + if (item && item.a11ycssStatus) { let a11ycssStatus = item.a11ycssStatus; - // Add or replace current tab's value - a11ycssStatus[tabs[0].id] = {"status": strStatus}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ a11ycssStatus }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + a11ycssStatus[tabs[0].id] = {"status": strStatus}; + // And set it back to the storage + let setting = browser.storage.local.set({ a11ycssStatus }); + setting.then(null, onError); // just in case + }); } button.addEventListener('click', function () { @@ -107,7 +107,7 @@ function a11ycssOnload() { let getLevel = browser.storage.local.get("a11ycssLevel"); getLevel.then( // when we got something - function (item) { + (item) => { if (item && item.a11ycssLevel) { // Get current tab ID browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { @@ -132,7 +132,7 @@ function a11ycssOnload() { let getStatus = browser.storage.local.get("a11ycssStatus"); getStatus.then( // when we got something - function (item) { + (item) => { if (item && item.a11ycssStatus) { browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { // If a setting is found for this tab diff --git a/webextension/scripts/checkalts.js b/webextension/scripts/checkalts.js index dd204a10..62c8a168 100644 --- a/webextension/scripts/checkalts.js +++ b/webextension/scripts/checkalts.js @@ -1,25 +1,25 @@ let btnCheckalts = document.getElementById('btnCheckalts'); function storeCheckAltsStatus(strStatus) { - // Get a11y.css stored levels - let getStatus = browser.storage.local.get("checkAltsStatus"); - getStatus.then( - // when we got something - (item) => { - if (item && item.checkAltsStatus) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + let checkAltsStatus = []; + // Get a11y.css stored status + let getStatus = browser.storage.local.get("checkAltsStatus"); + getStatus.then( + // when we got something + (item) => { + if (item && item.checkAltsStatus) { let checkAltsStatus = item.checkAltsStatus; - // Add or replace current tab's value - checkAltsStatus[tabs[0].id] = {"status": strStatus}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ checkAltsStatus }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + checkAltsStatus[tabs[0].id] = {"status": strStatus}; + // And set it back to the storage + let setting = browser.storage.local.set({ checkAltsStatus }); + setting.then(null, onError); // just in case + }); } btnCheckalts.addEventListener('click', function () { @@ -52,7 +52,7 @@ function checkAltsOnload() { let getStatus = browser.storage.local.get("checkAltsStatus"); getStatus.then( // when we got something - function (item) { + (item) => { if (item && item.checkAltsStatus) { browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { // If a setting is found for this tab diff --git a/webextension/scripts/outline.js b/webextension/scripts/outline.js index 648767f4..d6d1bd79 100644 --- a/webextension/scripts/outline.js +++ b/webextension/scripts/outline.js @@ -22,25 +22,25 @@ function removeOutline() { } function storeOutlineStatus(strStatus) { - // Get a11y.css stored levels - let getStatus = browser.storage.local.get("outlineStatus"); - getStatus.then( - // when we got something - (item) => { - if (item && item.outlineStatus) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + let outlineStatus = []; + // Get a11y.css stored status + let getStatus = browser.storage.local.get("outlineStatus"); + getStatus.then( + // when we got something + (item) => { + if (item && item.outlineStatus) { let outlineStatus = item.outlineStatus; - // Add or replace current tab's value - outlineStatus[tabs[0].id] = {"status": strStatus}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ outlineStatus }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + outlineStatus[tabs[0].id] = {"status": strStatus}; + // And set it back to the storage + let setting = browser.storage.local.set({ outlineStatus }); + setting.then(null, onError); // just in case + }); } btnOutline.addEventListener('click', function() { @@ -58,7 +58,7 @@ function outlineOnload() { let getStatus = browser.storage.local.get("outlineStatus"); getStatus.then( // when we got something - function (item) { + (item) => { if (item && item.outlineStatus) { browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { // If a setting is found for this tab diff --git a/webextension/scripts/showlangattribute.js b/webextension/scripts/showlangattribute.js index a3b32faa..e60b1df7 100644 --- a/webextension/scripts/showlangattribute.js +++ b/webextension/scripts/showlangattribute.js @@ -1,25 +1,25 @@ let btnShowLangAttribute = document.getElementById('btnShowLangAttribute'); function storeShowLangStatus(strStatus) { - // Get a11y.css stored levels - let getStatus = browser.storage.local.get("showLangStatus"); - getStatus.then( - // when we got something - (item) => { - if (item && item.showLangStatus) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + let showLangStatus = []; + // Get a11y.css stored status + let getStatus = browser.storage.local.get("showLangStatus"); + getStatus.then( + // when we got something + (item) => { + if (item && item.showLangStatus) { let showLangStatus = item.showLangStatus; - // Add or replace current tab's value - showLangStatus[tabs[0].id] = {"status": strStatus}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ showLangStatus }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + showLangStatus[tabs[0].id] = {"status": strStatus}; + // And set it back to the storage + let setting = browser.storage.local.set({ showLangStatus }); + setting.then(null, onError); // just in case + }); } function showLangAttribute() { diff --git a/webextension/scripts/textspacing.js b/webextension/scripts/textspacing.js index 89991e1f..89a2a96b 100644 --- a/webextension/scripts/textspacing.js +++ b/webextension/scripts/textspacing.js @@ -1,25 +1,26 @@ let btnTextspacing = document.getElementById('btnTextspacing'); +let textSpacingStatus = []; function storeTextSpacingStatus(strStatus) { - // Get a11y.css stored levels - let getStatus = browser.storage.local.get("textSpacingStatus"); - getStatus.then( - // when we got something - (item) => { - if (item && item.textSpacingStatus) { - // Get current tab ID - browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - // Get current stored value + // Get current tab ID + browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { + // Get a11y.css stored status + let getStatus = browser.storage.local.get("textSpacingStatus"); + getStatus.then( + // when we got something + (item) => { + if (item && item.textSpacingStatus) { let textSpacingStatus = item.textSpacingStatus; - // Add or replace current tab's value - textSpacingStatus[tabs[0].id] = {"status": strStatus}; - // Abnd set it back to the storage - let setting = browser.storage.local.set({ textSpacingStatus }); - setting.then(null, onError); // just in case - }); + } } - } - ); + ); + // Add or replace current tab's value + textSpacingStatus[tabs[0].id] = {"status": strStatus}; + console.log(textSpacingStatus); + // And set it back to the storage + let setting = browser.storage.local.set({ textSpacingStatus }); + setting.then(null, onError); // just in case + }); } btnTextspacing.addEventListener('click', function () { @@ -41,8 +42,9 @@ function textSpacingOnload() { let getStatus = browser.storage.local.get("textSpacingStatus"); getStatus.then( // when we got something - function (item) { + (item) => { if (item && item.textSpacingStatus) { + console.log(item.textSpacingStatus); browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { // If a setting is found for this tab if (item.textSpacingStatus[tabs[0].id]) {