The listener overrides
This commit is contained in:
parent
a1d5f1f315
commit
2588b3ff30
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.
|
||||
|
||||
@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 () => {
|
||||
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 != null) ? options[`override`] : false)) {
|
||||
new logging((new texts(`scrape_msg_ready`)).localized);
|
||||
let PROC = new processor(filter);
|
||||
this.processed = (override || this.processed == null) ? new processor(filter) : this.processed;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static main() {
|
||||
|
@ -39,7 +40,7 @@ export default class watch {
|
|||
|
||||
// Create a listener for messages indicating re-processing.
|
||||
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