diff --git a/distribution/manifest_v2.json b/distribution/manifest_v2.json index a53f296..8f6cda9 100644 --- a/distribution/manifest_v2.json +++ b/distribution/manifest_v2.json @@ -10,12 +10,17 @@ "default_popup": "popup/settings.html" }, "background": { - "scripts": ["dependencies/jquery.min.js", "lib/background.bundle.js"] + "scripts": [ + "dependencies/jquery.min.js", + "lib/background.bundle.js" + ] }, "content_scripts": [ { "run_at": "document_end", - "matches": [""], + "matches": [ + "" + ], "js": [ "dependencies/jquery.min.js", "lib/main.bundle.js", @@ -28,7 +33,10 @@ "48": "icons/auto-capitalise-sentence.png", "128": "icons/auto-capitalise-sentence.png" }, - "permissions": ["storage", "tabs"], + "permissions": [ + "storage", + "tabs" + ], "browser_specific_settings": { "gecko": { "id": "{680e06ed-65ed-4e11-a9c0-0e6f80b9a347}" diff --git a/src/background.js b/src/background.js index 5176a8a..ad2e3af 100644 --- a/src/background.js +++ b/src/background.js @@ -12,7 +12,7 @@ import { } from './plugin-constants'; import browser from 'webextension-polyfill'; -browser.storage.sync.set({ +browser.storage.local.set({ [constantsKeyVal]: constantsKeyValuePairs, [namesKeyVal]: namesKeyValuePairs, [acronymsKeyVal]: acronymsKeyValuePairs, diff --git a/src/content.js b/src/content.js index 2f9b790..0cd3262 100644 --- a/src/content.js +++ b/src/content.js @@ -19,7 +19,7 @@ import { const errorMsg = 'breaking loop'; let sitesToExclude = ['aws.amazon.com', 'whatsapp.com', 'messenger.com']; -browser.storage.sync +browser.storage.local .get([ sitesToIgnore, shouldCapitaliseI, diff --git a/src/settings.js b/src/settings.js index 5b95a86..d488cbf 100644 --- a/src/settings.js +++ b/src/settings.js @@ -10,7 +10,7 @@ import { shouldCapitaliseLocations, } from './plugin-constants'; -browser.storage.sync +browser.storage.local .get([sitesToIgnore, wordsToExclude, wordsToInclude]) .then(updateIgnoreLists, onError); @@ -47,7 +47,7 @@ $(document).on(`click.${pluginNamespace}`, '#ignoreSiteButton', function () { var sites = getExcludedSites(); sites.push(hostname); - browser.storage.sync.set({ + browser.storage.local.set({ sitesToIgnore: sites, }); @@ -60,7 +60,7 @@ $(document).on(`click.${pluginNamespace}`, '#ignoreSiteButton', function () { $(document).on(`click.${pluginNamespace}`, '#submitButton', function () { var sites = getExcludedSites(); - browser.storage.sync.set({ + browser.storage.local.set({ sitesToIgnore: sites, }); @@ -74,7 +74,7 @@ $(document).on( function () { var excludedWords = getExcludedWords(); - browser.storage.sync.set({ + browser.storage.local.set({ wordsToExclude: excludedWords, }); @@ -89,7 +89,7 @@ $(document).on( function () { var includedWords = getIncludedWords(); - browser.storage.sync.set({ + browser.storage.local.set({ wordsToInclude: includedWords, }); @@ -104,7 +104,7 @@ loadFlagValuesFromBrowserStorage(shouldCapitaliseAcronyms); loadFlagValuesFromBrowserStorage(shouldCapitaliseLocations); function loadFlagValuesFromBrowserStorage(flagName) { - browser.storage.sync.get(flagName).then((items) => { + browser.storage.local.get(flagName).then((items) => { const flagValue = items[flagName]; if (flagValue === true || flagValue === undefined) { @@ -134,7 +134,7 @@ function setupCheckboxChangeEventHandlers(flagName) { } function setShouldCapitaliseVariable(variableName, value) { - browser.storage.sync.set({ + browser.storage.local.set({ [variableName]: value, }); }