From 3a90084ec14a15d9b76fa4bfed9e85f15a09dad7 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 8 Dec 2021 19:01:50 +0100 Subject: facilitate initialization of IndexedDB for use by Haketilo --- background/main.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'background') diff --git a/background/main.js b/background/main.js index a4d3f0e..2809334 100644 --- a/background/main.js +++ b/background/main.js @@ -3,7 +3,8 @@ * * Function: Main background script. * - * Copyright (C) 2021 Wojtek Kosior + * Copyright (C) 2021 Wojtek Kosior + * Copyright (C) 2021 Jahoti * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +44,7 @@ /* * IMPORTS_START + * IMPORT initial_data * IMPORT TYPE_PREFIX * IMPORT get_storage * IMPORT light_storage @@ -70,13 +72,8 @@ async function init_ext(install_details) await storage.clear(); - /* - * Below we add sample settings to the extension. - */ - - for (let setting of // The next line is replaced with the contents of /default_settings.json by the build script - `DEFAULT SETTINGS` - ) { + /* Below we add sample settings to the extension. */ + for (let setting of initial_data) { let [key, value] = Object.entries(setting)[0]; storage.set(key[0], key.substring(1), value); } -- cgit v1.2.3