From c23ec8ddbd340e3c3d74c1029de653d4b807297d Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Wed, 20 Mar 2024 23:36:14 +0800 Subject: [PATCH] added primary content script function --- scripts/watchman.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/watchman.js diff --git a/scripts/watchman.js b/scripts/watchman.js new file mode 100644 index 0000000..23efced --- /dev/null +++ b/scripts/watchman.js @@ -0,0 +1,34 @@ +/* Watchman.js +Be sensitive to changes and update the state. +*/ + +(async () => { + // Import modules. + let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js")); + let reader = await import(chrome.runtime.getURL("scripts/reader.js")); + + class watchman { + static observe(URL = window.location.href) { + /* Check the current URL. + + Parameters: + URL: the page URL; default value is the current webpage + Returns: (boolean) status + */ + + // Create the variable to determine the corresponding key. + let key; + + secretariat.rules(URL); + + return (key); + }; + + static act() { + // TODO + }; + }; + + watchman.observe(); + watchman.act(); +})();