Only inform one time about supported site

This commit is contained in:
buzz-lightsnack-2007 2024-05-05 23:23:00 +08:00
parent e92baff49b
commit 45b3388851

View file

@ -20,9 +20,6 @@ export default class watch {
@param {dictionary} filter the filter to work with
*/
static async process(filter) {
// Let user know that the website is supported, if ever they have opened the console.
new logging((new texts(`message_external_supported`)).localized);
document.onreadystatechange = async () => {
if (document.readyState == 'complete' && await global.read([`settings`, `behavior`, `autoRun`])) {
new logging((new texts(`scrape_msg_ready`)).localized);
@ -34,14 +31,14 @@ export default class watch {
static main() {
(check.platform()).then((FILTER_RESULT) => {
if (FILTER_RESULT && Object.keys(FILTER_RESULT).length > 0) {
// Let user know that the website is supported, if ever they have opened the console.
new logging((new texts(`message_external_supported`)).localized);
watch.process(FILTER_RESULT);
watch.callGUI();
// Create a listener for messages indicating re-processing.
chrome.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
// Get the tabId where this content script is running.
(((typeof message).includes(`obj`) && !Array.isArray(message)) ? message[`refresh`] : false) ? watch.process(FILTER_RESULT) : false;
});
}