The listener overrides
This commit is contained in:
		
							parent
							
								
									a1d5f1f315
								
							
						
					
					
						commit
						9ccc8717bc
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		
							
								
								
									
										13
									
								
								scripts/external/watch.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								scripts/external/watch.js
									
										
									
									
										vendored
									
									
								
							|  | @ -17,15 +17,16 @@ export default class watch { | ||||||
| 
 | 
 | ||||||
| 	/* Act on the page. | 	/* Act on the page. | ||||||
| 
 | 
 | ||||||
| 	@param {dictionary} filter the filter to work with | 	@param {object} filter the filter to work with | ||||||
|  | 	@param {object} options the options | ||||||
| 	*/ | 	*/ | ||||||
| 	static async process(filter) { | 	static async process(filter, options = {}) { | ||||||
| 		document.onreadystatechange = async () => { | 		document.onreadystatechange = async () => { | ||||||
| 			if (document.readyState == 'complete' && await global.read([`settings`, `behavior`, `autoRun`])) { | 			if (document.readyState == 'complete' && (await global.read([`settings`, `behavior`, `autoRun`]) || ((typeof options).includes(`object`) && options) ? options[`override`] : false)) { | ||||||
| 				new logging((new texts(`scrape_msg_ready`)).localized); | 				new logging((new texts(`scrape_msg_ready`)).localized); | ||||||
| 				let PROC = new processor(filter); | 				this.processed = (((options && typeof options == `object`) ? options[`override`] : false) || this.processed == null) ? new processor(filter) : this.processed; | ||||||
| 			} | 			} | ||||||
| 		}; | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	static main() { | 	static main() { | ||||||
|  | @ -39,7 +40,7 @@ export default class watch { | ||||||
| 				 | 				 | ||||||
| 				// Create a listener for messages indicating re-processing. 
 | 				// Create a listener for messages indicating re-processing. 
 | ||||||
| 				chrome.runtime.onMessage.addListener(async (message, sender, sendResponse) => { | 				chrome.runtime.onMessage.addListener(async (message, sender, sendResponse) => { | ||||||
| 					(((typeof message).includes(`obj`) && !Array.isArray(message)) ? message[`refresh`] : false) ? watch.process(FILTER_RESULT) : false; | 					(((typeof message).includes(`obj`) && !Array.isArray(message)) ? message[`refresh`] : false) ? watch.process(FILTER_RESULT, {"override": true}) : false; | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue