mirror of https://github.com/dessant/buster
parent
39cf3c02ef
commit
d34f5fa8b7
@ -0,0 +1,27 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
|
||||
const message = 'Add navigateWithKeyboard';
|
||||
|
||||
const revision = 'Lj3MYlSr4L';
|
||||
const downRevision = 'DlgF14Chrh';
|
||||
|
||||
const storage = browser.storage.local;
|
||||
|
||||
async function upgrade() {
|
||||
const changes = {
|
||||
navigateWithKeyboard: false
|
||||
};
|
||||
|
||||
changes.storageVersion = revision;
|
||||
return storage.set(changes);
|
||||
}
|
||||
|
||||
async function downgrade() {
|
||||
const changes = {};
|
||||
await storage.remove('navigateWithKeyboard');
|
||||
|
||||
changes.storageVersion = downRevision;
|
||||
return storage.set(changes);
|
||||
}
|
||||
|
||||
export {message, revision, upgrade, downgrade};
|
@ -0,0 +1,27 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
|
||||
const message = 'Add navigateWithKeyboard';
|
||||
|
||||
const revision = 'Lj3MYlSr4L';
|
||||
const downRevision = 'DlgF14Chrh';
|
||||
|
||||
const storage = browser.storage.sync;
|
||||
|
||||
async function upgrade() {
|
||||
const changes = {
|
||||
navigateWithKeyboard: false
|
||||
};
|
||||
|
||||
changes.storageVersion = revision;
|
||||
return storage.set(changes);
|
||||
}
|
||||
|
||||
async function downgrade() {
|
||||
const changes = {};
|
||||
await storage.remove('navigateWithKeyboard');
|
||||
|
||||
changes.storageVersion = downRevision;
|
||||
return storage.set(changes);
|
||||
}
|
||||
|
||||
export {message, revision, upgrade, downgrade};
|
Loading…
Reference in New Issue