grab the data by querying the tab

Tab switching events aren't enough nor universal.
This commit is contained in:
buzz-lightsnack-2007 2024-04-24 17:11:25 +08:00
parent fc8983c646
commit b4ea93911e

View file

@ -11,16 +11,17 @@ export default class EntryManager {
constructor () { constructor () {
this.instances = {}; this.instances = {};
this.instances.menu = new MenuEntry(); this.instances.menu = new MenuEntry();
Tabs.addActionListener(`onActivated`, (data) => {this.check(data)}); Tabs.addActionListener(`onActivated`, (data) => {this.check()});
} }
async check(data) { async check() {
console.error(JSON.stringify(data)); const DATA = await Tabs.query(null, 0)
((data != null && (typeof data).includes(`obj`)) ? ((data.tab) ? data.tab.url : false) : false)
? (!!await ((new filters).select(data.tab.url))) if (DATA.url) {
(!!await ((new filters).select(DATA.url)))
? (this.enable()) ? (this.enable())
: (this.disable()) : (this.disable())
: false; };
} }
/* /*