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 35884ca433
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, "manifest_version": 2,
"name": "Queue", "name": "Queue",
"description": "A WebExtension for queueing links.", "description": "A WebExtension for queueing links.",
"version": "0.1.0", "version": "0.1.1",
"permissions": [ "permissions": [
"contextMenus", "contextMenus",
"storage", "storage",
@ -41,5 +41,10 @@
"./content-scripts.ts" "./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. * Returns the user's settings.
*/ */
export async function getSettings(): Promise<Settings> { export async function getSettings(): Promise<Settings> {
// TODO: Replace local storage with sync storage. const syncSettings: any = await browser.storage.sync.get(defaultSettings);
const syncSettings: any = await browser.storage.local.get(defaultSettings);
const settings: Settings = { const settings: Settings = {
latestVersion: syncSettings.latestVersion, latestVersion: syncSettings.latestVersion,
queue: syncSettings.queue queue: syncSettings.queue
@ -37,8 +36,7 @@ export async function getSettings(): Promise<Settings> {
* @param settings The settings to save. * @param settings The settings to save.
*/ */
export async function saveSettings(settings: Settings): Promise<Settings> { export async function saveSettings(settings: Settings): Promise<Settings> {
// TODO: Replace local storage with sync storage. await browser.storage.sync.set(settings);
await browser.storage.local.set(settings);
return settings; return settings;
} }