From 45b33888518b9ac47b84a0b0155f77af08ff25dc Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sun, 5 May 2024 23:23:00 +0800 Subject: [PATCH] Only inform one time about supported site --- scripts/external/watch.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 62dc21a..6b91ba6 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -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; }); }