handle the processing in another module

This commit is contained in:
buzz-lightsnack-2007 2024-04-14 23:23:14 +08:00
parent f0cb206a89
commit 08b10746b5

View file

@ -0,0 +1,22 @@
/* processor.js
Process the information on the website and display it on screen.
*/
// const inject = ((await import(chrome.runtime.getURL("scripts/outside/inject.js"))).default);
const scraper = (await import(chrome.runtime.getURL("scripts/outside/scraper.js"))).default;
export default class processor {
#filter;
async scrape (fields) {
this.data = new scraper ((fields) ? fields : this.targets);
console.log(this.data);
}
constructor (filter) {
this.#filter = filter;
this.targets = this.#filter[`data`];
this.scrape();
}
}