From c6845a798c99e96aa0e2f6daece0684a8ac50681 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 19 Nov 2023 16:21:29 +0100 Subject: wip --- storage.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 storage.js (limited to 'storage.js') diff --git a/storage.js b/storage.js new file mode 100644 index 0000000..d8964bf --- /dev/null +++ b/storage.js @@ -0,0 +1,12 @@ +async function StorageGetDomains() { + const data = await browser.storage.sync.get('domains'); + if (data.domains.length === 0) { + StorageUpdateDomainList(["https://gitlab.com"]); + return StorageGetDomains(); + } + return data.domains; +}; + +async function StorageUpdateDomainList(domains) { + return browser.storage.sync.set({ 'domains': domains }); +} -- cgit v1.2.3