handle the processing in another module
This commit is contained in:
		
							parent
							
								
									f0cb206a89
								
							
						
					
					
						commit
						08b10746b5
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		
							
								
								
									
										22
									
								
								scripts/outside/processor.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								scripts/outside/processor.js
									
										
									
									
									
										Normal 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(); | ||||
|      } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue