attempt: make main function async to make refresh function available anytime
This commit is contained in:
parent
c0e2152806
commit
b935ab7dc9
1 changed files with 14 additions and 13 deletions
11
scripts/external/watch.js
vendored
11
scripts/external/watch.js
vendored
|
@ -23,8 +23,9 @@ export default class watch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static main() {
|
static async main() {
|
||||||
(check.platform()).then((FILTER_RESULT) => {
|
let FILTER_RESULT = await check.platform();
|
||||||
|
|
||||||
if (FILTER_RESULT && Object.keys(FILTER_RESULT).length > 0) {
|
if (FILTER_RESULT && Object.keys(FILTER_RESULT).length > 0) {
|
||||||
// Let user know that the website is supported, if ever they have opened the console.
|
// Let user know that the website is supported, if ever they have opened the console.
|
||||||
new logging((new texts(`message_external_supported`)).localized);
|
new logging((new texts(`message_external_supported`)).localized);
|
||||||
|
@ -33,10 +34,10 @@ 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, {"override": true}) : 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