auto-updated syntax formatting

This commit is contained in:
buzz-lightsnack-2007 2024-03-28 11:17:26 +08:00
parent 481ef03576
commit 5b06c3f967

View file

@ -3,57 +3,60 @@ Be sensitive to changes and update the state.
*/ */
(async () => { (async () => {
// Import modules. // Import modules.
let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js")); let secretariat = await import(
let reader = await import(chrome.runtime.getURL("scripts/reader.js")); chrome.runtime.getURL("scripts/secretariat.js")
);
let filters = await import(chrome.runtime.getURL("scripts/filters.js"));
let reader = await import(chrome.runtime.getURL("scripts/reader.js"));
class watchman { class watchman {
/* Check the current URL. /* Check the current URL.
@param {string} URL the page URL; default value is the current webpage @param {string} URL the page URL; default value is the current webpage
@return {dictionary} the filter to follow @return {dictionary} the filter to follow
*/ */
static observe(URL = window.location.href) { static observe(URL = window.location.href) {
// Create the variable to determine the corresponding key.
let activity = false;
// let filters = secretariat.specifics(`filters`, URL);
// Create the variable to determine the corresponding key. // Check if the filters exist.
let activity = false; activity = filters;
let filters = secretariat.specifics(`filters`, URL);
// Check if the filters exist. return activity;
activity = (filters); }
return (activity); /* Act on the page.
};
/* Act on the page.
@param {dictionary} filters the filter to work with @param {dictionary} filters the filter to work with
@return {boolean} the state @return {boolean} the state
*/ */
static act(filters) { static act(filters) {
console.log(
console.log("ShopAI works here! Click on the button in the toolbar or website to start."); "ShopAI works here! Click on the button in the toolbar or website to start.",
// TODO );
} // TODO
/* Set the program to standby utnil next load.
*/
static standby() {
console.log("ShopAI doesn't work here (yet). Expecting something? Try checking your filters. If you know what you're doing, feel free to create a filter yourself.");
}
static job() {
/* The main action. */
let job_task = watchman.observe();
if (job_task) {
watchman.act(job_task);
} else {
watchman.standby();
}
}
} }
watchman.job(); /* Set the program to standby utnil next load.
*/
static standby() {
console.log(
"ShopAI doesn't work here (yet). Expecting something? Try checking your filters. If you know what you're doing, feel free to create a filter yourself.",
);
}
static job() {
/* The main action. */
let job_task = watchman.observe();
if (job_task) {
watchman.act(job_task);
} else {
watchman.standby();
}
}
}
watchman.job();
})(); })();