From 476f0e8b7e3f98db85a0d6906f5c2a94b47b9080 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Fri, 22 Mar 2024 22:47:16 +0800 Subject: [PATCH] add installation trigger --- scripts/fc.js | 36 ++++++++++++++++++++++++++++++++++++ scripts/shopAI.js | 5 +++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 scripts/fc.js diff --git a/scripts/fc.js b/scripts/fc.js new file mode 100644 index 0000000..df66013 --- /dev/null +++ b/scripts/fc.js @@ -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(); + } +} diff --git a/scripts/shopAI.js b/scripts/shopAI.js index 697df9b..b0abef5 100644 --- a/scripts/shopAI.js +++ b/scripts/shopAI.js @@ -1,4 +1,5 @@ -/* ShopAI -Shop wisely with AI! +/* ShopAI +Shop wisely with AI! */ +importScripts('fc.js');