Fix storage issue causing popup to be blank

main
Elbert Alias 2 years ago
parent 4f001516d3
commit deadefbcc9

@ -5,13 +5,6 @@
// Manifest v2 polyfill
if (chrome.runtime.getManifest().manifest_version === 2) {
chrome.action = chrome.browserAction
chrome.storage.sync = {
get: (...args) =>
new Promise((resolve) => chrome.storage.local.get(...args, resolve)),
set: (...args) =>
new Promise((resolve) => chrome.storage.local.set(...args, resolve)),
}
}
// eslint-disable-next-line no-unused-vars
@ -56,7 +49,7 @@ const Utils = {
*/
async getOption(name, defaultValue = null) {
try {
const option = await chrome.storage.sync.get(name)
const option = await chrome.storage.local.get(name)
if (option[name] !== undefined) {
return option[name]
@ -76,7 +69,7 @@ const Utils = {
*/
async setOption(name, value) {
try {
await chrome.storage.sync.set({
await chrome.storage.local.set({
[name]: value,
})
} catch (error) {

Loading…
Cancel
Save