Add some utilities to the options page to dump the settings and backup data.
This commit is contained in:
parent
f00b4161c3
commit
d20a98c0a4
|
@ -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.6",
|
"version": "0.1.7",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"contextMenus",
|
"contextMenus",
|
||||||
"storage",
|
"storage",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {html, render} from 'htm/preact';
|
import {html, render} from 'htm/preact';
|
||||||
import {
|
import {
|
||||||
initializeBackgroundMessageHandler,
|
initializeBackgroundMessageHandler,
|
||||||
|
log,
|
||||||
getManifest,
|
getManifest,
|
||||||
getSettings,
|
getSettings,
|
||||||
PageFooter,
|
PageFooter,
|
||||||
|
@ -12,6 +13,15 @@ import {
|
||||||
(async () => {
|
(async () => {
|
||||||
initializeBackgroundMessageHandler();
|
initializeBackgroundMessageHandler();
|
||||||
|
|
||||||
|
window.HollloQueue = {
|
||||||
|
dumpBackup: async () => {
|
||||||
|
log(JSON.stringify(await browser.storage.local.get(), null, 2));
|
||||||
|
},
|
||||||
|
dumpSettings: async () => {
|
||||||
|
log(JSON.stringify(await getSettings(), null, 2));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const manifest = getManifest();
|
const manifest = getManifest();
|
||||||
const settings = await getSettings();
|
const settings = await getSettings();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// TypeScript fix to make it see this file as a module.
|
||||||
|
export {};
|
||||||
|
|
||||||
|
type HollloQueue = {
|
||||||
|
dumpBackup: () => Promise<void>;
|
||||||
|
dumpSettings: () => Promise<void>;
|
||||||
|
};
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
HollloQueue: HollloQueue;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue