Add the AMO ID and use sync storage instead of local.

This commit is contained in:
Bauke 2020-11-11 18:34:59 +01:00
parent badcdb39c7
commit 5798eefb72
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 9 additions and 6 deletions

View File

@ -3,7 +3,7 @@
"manifest_version": 2,
"name": "Queue",
"description": "A WebExtension for queueing links.",
"version": "0.1.0",
"version": "0.1.1",
"permissions": [
"contextMenus",
"storage",
@ -41,5 +41,10 @@
"./content-scripts.ts"
]
}
]
],
"applications": {
"gecko": {
"id": "{c3560e6b-00e5-4ab3-b89e-8a54ee5b2c9f}"
}
}
}

View File

@ -22,8 +22,7 @@ const defaultSettings: Settings = {
* Returns the user's settings.
*/
export async function getSettings(): Promise<Settings> {
// TODO: Replace local storage with sync storage.
const syncSettings: any = await browser.storage.local.get(defaultSettings);
const syncSettings: any = await browser.storage.sync.get(defaultSettings);
const settings: Settings = {
latestVersion: syncSettings.latestVersion,
queue: syncSettings.queue
@ -37,8 +36,7 @@ export async function getSettings(): Promise<Settings> {
* @param settings The settings to save.
*/
export async function saveSettings(settings: Settings): Promise<Settings> {
// TODO: Replace local storage with sync storage.
await browser.storage.local.set(settings);
await browser.storage.sync.set(settings);
return settings;
}