add installation trigger

This commit is contained in:
buzzcode2007 2024-03-22 22:47:16 +08:00
parent b6ffdc674e
commit 476f0e8b7e
2 changed files with 39 additions and 2 deletions

36
scripts/fc.js Normal file
View file

@ -0,0 +1,36 @@
/* fc.js
This does not stand for "FamiCom" but instead on Finalization and Completion. This script provides installation run scripts.
*/
class fc {
static hello() {
chrome.tabs.create({ url: `https://codeberg.org/buzzcode2007/ShopAI/wiki` }, function (tab) {});
};
static setup() {
/* Initialize the set-up.
Returns: the initialization result
*/
}
static trigger() {
chrome.runtime.onInstalled.addListener(function (object) {
if (object.reason == chrome.runtime.OnInstalledReason.INSTALL) {
fc.hello();
fc.setup();
}
});
}
static run() {
/* main function */
fc.trigger();
}
}

View file

@ -2,3 +2,4 @@
Shop wisely with AI! Shop wisely with AI!
*/ */
importScripts('fc.js');