diff --git a/scripts/external/entries/manager.js b/scripts/external/entries/manager.js index 0a47dbc..bc7815d 100644 --- a/scripts/external/entries/manager.js +++ b/scripts/external/entries/manager.js @@ -5,20 +5,20 @@ import Tabs from "/scripts/GUI/tabs.js"; import MenuEntry from "./menu.js"; import ManagedSidebar from "./sidebar.js"; import IconIndicator from "./icons.js"; -import filters from '../../filters.js'; +import check from "/scripts/external/check.js"; export default class EntryManager { constructor () { this.instances = {}; this.instances.menu = new MenuEntry(); - Tabs.addActionListener(`onActivated`, (data) => {this.check()}); + Tabs.addActionListener(`onActivated`, (data) => {this.onRefresh()}); } - async check() { + async onRefresh() { const DATA = await Tabs.query(null, 0) if (DATA.url) { - (!!await ((new filters).select(DATA.url))) + (!!await check.platform(DATA.url)) ? (this.enable()) : (this.disable()) }; diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 7fee19e..fb55bd4 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -2,25 +2,13 @@ Be sensitive to changes and update the state. */ -import filters from "/scripts/filters.js"; +import check from "/scripts/external/check.js"; import processor from "/scripts/external/processor.js"; import logging from "/scripts/logging.js"; import texts from "/scripts/mapping/read.js"; export default class watchman { - /* Check the current URL. - - @param {string} URL the page URL; default value is the current webpage - @return {dictionary} the filter to follow - */ - static async observe(URL = window.location.href) { - // Create the variable to determine the corresponding key. - let activity = await (new filters).select(URL); - - return activity; - } - /* Act on the page. @param {dictionary} filters the filter to work with @@ -48,10 +36,11 @@ export default class watchman { // Set the icon to indicate that it's not active. } - static async job() { + static job() { /* The main action. */ - (watchman.observe()).then((RULES) => { + (check.platform()).then((RULES) => { + console.log(RULES); if (RULES && Object.keys(RULES).length !== 0) { watchman.act(RULES); } else {