/**
* Hachette main background script
*
* Copyright (C) 2021 Wojtek Kosior
* Redistribution terms are gathered in the `copyright' file.
*/
/*
* IMPORTS_START
* IMPORT TYPE_PREFIX
* IMPORT get_storage
* IMPORT start_storage_server
* IMPORT start_page_actions_server
* IMPORT start_policy_injector
* IMPORT start_page_info_server
* IMPORT browser
* IMPORTS_END
*/
start_storage_server();
start_page_actions_server();
start_policy_injector();
start_page_info_server();
async function init_ext(install_details)
{
console.log("details:", install_details);
if (install_details.reason != "install")
return;
let storage = await get_storage();
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`
) {
let [key, value] = Object.entries(setting)[0];
storage.set(key[0], key.substring(1), value);
}
}
browser.runtime.onInstalled.addListener(init_ext);
console.log("hello, hachette");
ummaryrefslogtreecommitdiff
|