From 9ccc8717bcb294e167d8d501a87b37f9753e02fb Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 09:11:13 +0800 Subject: [PATCH 01/14] The listener overrides --- scripts/external/watch.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 6b91ba6..eb97e36 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -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) ? options[`override`] : false)) { 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() { @@ -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; }); } }); From 3a6f26e2bc7217e41f104220d01583c9c9abf702 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 10:49:37 +0800 Subject: [PATCH 02/14] The content script shouldn't call the popup anymore --- scripts/external/watch.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index eb97e36..259262f 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -9,12 +9,6 @@ import texts from "/scripts/mapping/read.js"; import {global} from "/scripts/secretariat.js"; export default class watch { - /* Open relevant graphical user interfaces. - */ - static callGUI() { - - } - /* Act on the page. @param {object} filter the filter to work with @@ -36,7 +30,6 @@ export default class watch { 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) => { From 52796cb5ddfbda5b60f69ca29ac5ace27febcc45 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 10:55:39 +0800 Subject: [PATCH 03/14] The update completion messages are standalone --- _locales/en/messages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index e20aea1..248fd1e 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -118,7 +118,7 @@ "message": "Update" }, "settings_filters_update_status": { - "message": "Updating the filter at $filter_url$…", + "message": "Updating…", "placeholders": { "filter_url": { "content": "$1" @@ -126,7 +126,7 @@ } }, "settings_filters_update_status_complete": { - "message": "Updated the filter at $filter_url$.", + "message": "Update complete.", "placeholders": { "filter_url": { "content": "$1" From d586ef8115af684a5466e97fcfd93a33cc36d86d Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 11:48:54 +0800 Subject: [PATCH 04/14] add error symbol --- media/config.symbols.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/config.symbols.json b/media/config.symbols.json index 6e36d7a..cabf712 100644 --- a/media/config.symbols.json +++ b/media/config.symbols.json @@ -1,4 +1,7 @@ { + "extensionIcon_product_error": { + "symbol": "⚠" + }, "extensionIcon_product_bad": { "symbol": "👎" }, @@ -15,6 +18,6 @@ "symbol": "✕" }, "extensionIcon_website_loading": { - "symbol": "..." + "symbol": "…" } } \ No newline at end of file From 1f7661ff121311aa1998bb4d94b312f6754d62f2 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 11:51:24 +0800 Subject: [PATCH 05/14] Unpackage an error object --- scripts/logging.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/logging.js b/scripts/logging.js index 70087d3..57a7ccb 100644 --- a/scripts/logging.js +++ b/scripts/logging.js @@ -71,6 +71,13 @@ export default class logging { @param {boolean} critical the critical nature */ static async error(ERROR_CODE, ERROR_MESSAGE, ERROR_STACK, critical = true) { + // Depackage the shortcut method of sending the error message. + (!ERROR_MESSAGE && !ERROR_STACK && (typeof ERROR_CODE).includes(`obj`)) ? ( + ERROR_MESSAGE = ERROR_CODE.message, + ERROR_STACK = ERROR_CODE.stack, + ERROR_CODE = ERROR_CODE.name + ) : false; + // Display the error message. console.error('%c%s%c%s%c%s%c\n%s%c', `font-weight: bold;`, ERROR_CODE, ``, `: `, ``, ERROR_MESSAGE, `font-family: monospace;`, ERROR_STACK, ``); From 61af4d11437271ad8d62629497dd586fba365c9e Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 11:52:03 +0800 Subject: [PATCH 06/14] Use the logging to display the error message --- scripts/mapping/read.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/mapping/read.js b/scripts/mapping/read.js index 6d33616..eb1d210 100644 --- a/scripts/mapping/read.js +++ b/scripts/mapping/read.js @@ -1,6 +1,8 @@ /* read_universal Read a file stored in the universal strings. */ +import logging from "/scripts/logging.js"; + export default class texts { /* This reads the message from its source. This is a fallback for the content scripts, who doesn't appear to read classes. @@ -54,7 +56,7 @@ export default class texts { return (SYMBOL); }) .catch((error) => { - console.error(error); + logging.error(error.name, null, null, false); })); }; } From ec7e085aeec1ffc3f1967a3d53e81761eaed0b90 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 11:57:46 +0800 Subject: [PATCH 07/14] rename the error symbol It's not really under the product information. --- media/config.symbols.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/config.symbols.json b/media/config.symbols.json index cabf712..1ac23fe 100644 --- a/media/config.symbols.json +++ b/media/config.symbols.json @@ -1,11 +1,11 @@ { - "extensionIcon_product_error": { + "extensionIcon_error": { "symbol": "⚠" }, "extensionIcon_product_bad": { "symbol": "👎" }, - "extensionIcon_product_OK": { + "extensionIcon_product_ok": { "symbol": "🆗" }, "extensionIcon_product_good": { From 0498c62339459f80b38f2f89239e3047bdcd753a Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 12:07:48 +0800 Subject: [PATCH 08/14] add error icon color --- styles/colors/icon.JSON | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/styles/colors/icon.JSON b/styles/colors/icon.JSON index 00c06ea..589d37e 100644 --- a/styles/colors/icon.JSON +++ b/styles/colors/icon.JSON @@ -1 +1,9 @@ -{ "loading": "rgb(255, 134, 57)", "N/A": "rgb(127, 127, 127)", "product_bad": "rgba(255, 0, 0)", "product_OK": "rgba(255, 255, 0)", "product_good": "rgb(0, 255, 0)", "product_trusted": "rgb(0, 255, 0)" } \ No newline at end of file +{ + "loading": "rgb(255, 134, 57)", + "N/A": "rgb(127, 127, 127)", + "error": "rgb(255, 0, 0)", + "product_bad": "rgba(255, 0, 0)", + "product_OK": "rgba(255, 255, 0)", + "product_good": "rgb(0, 255, 0)", + "product_trusted": "rgb(0, 255, 0)" +} \ No newline at end of file From b21fa1438dca87b540bae82818217e7e3867fc61 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 12:13:54 +0800 Subject: [PATCH 09/14] enable icon changes when necessary and add the onclick event Onclick event currently not yet linked --- scripts/GUI/entrypoints/iconindicator.js | 90 ++++++++++++++++++++---- 1 file changed, 78 insertions(+), 12 deletions(-) diff --git a/scripts/GUI/entrypoints/iconindicator.js b/scripts/GUI/entrypoints/iconindicator.js index bb9c240..1086519 100644 --- a/scripts/GUI/entrypoints/iconindicator.js +++ b/scripts/GUI/entrypoints/iconindicator.js @@ -1,8 +1,7 @@ import BrowserIcon from '/scripts/GUI/browsericon.js'; -import Image from '/scripts/mapping/image.js'; import Tabs from '/scripts/GUI/tabs.js'; import texts from "/scripts/mapping/read.js"; -import {session} from '/scripts/secretariat.js'; +import {global, observe} from "/scripts/secretariat.js"; const CONFIG = chrome.runtime.getURL("styles/colors/icon.json"); @@ -12,12 +11,60 @@ class IconIndicator { */ static enable() { BrowserIcon.enable(); - (Tabs.query(null, 0)).then(async (TAB) => { - BrowserIcon.set({ - "BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol, - "BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`loading`]);}) - }, {"tabId": TAB.id}); + + // Enable icon changes if enabled within the settings. + global.read([`settings`, `behavior`, `showApplicable`]).then(async (PREFERENCE) => {(PREFERENCE) + ? fetch(CONFIG).then((response) => response.json()).then((jsonData) => { + const ICON_COLORS = jsonData; + + /* + Show an iconified summary of the results. + + @param {string} location the URL of the page + @param {string} ID the tab's ID + */ + function showDetails(location, ID) { + let LOCATION = location; + // If the tab data is ready, change the icon to reflect the results. + global.read([`sites`, LOCATION, `status`]).then(async (STATUS) => { + if (STATUS) { + (STATUS[`error`]) ? BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_error`)).symbol, + "BadgeBackgroundColor": ICON_COLORS[`error`] + }, {"tabId": ID}) : false; + + if (STATUS[`done`]) { + global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { + ((typeof RESULTS).includes(`str`)) ? RESULTS.trim() : false; + (RESULTS) ? BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, + "BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] + }, {"tabId": ID}) : false; + }) + }; + }; + }); + } + + + (Tabs.query(null, 0)).then(async (TAB) => { + // Get the URL of the tab. + let LOCATION = TAB.url; + + BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol, + "BadgeBackgroundColor": ICON_COLORS[`loading`] + }, {"tabId": TAB.id}); + + showDetails(LOCATION, TAB.id); + observe((changes) => { + showDetails(LOCATION, TAB.id); + }) + }); + }) + : false; }) + } /* @@ -25,11 +72,15 @@ class IconIndicator { */ static disable() { BrowserIcon.disable(); - (Tabs.query(null, 0)).then(async (TAB) => { - BrowserIcon.set({ - "BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, - "BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);}) - }, {"tabId": TAB.id}); + + // Enable icon changes if enabled within the settings. + global.read([`settings`, `behavior`, `showApplicable`]).then((PREFERENCE) => { + (Tabs.query(null, 0)).then(async (TAB) => { + BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, + "BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);}) + }, {"tabId": TAB.id}); + }) }) } @@ -41,6 +92,21 @@ class IconIndicator { static set(callback) { BrowserIcon.addActionListener("onClicked", callback); } + + /* + The action when the icon is clicked. + */ + static onclick() { + // Check if autorunning is not enabled. + (global.read([`settings`, `behavior`, `autoRun`])).then((result) => { + if (!result) { + (Tabs.query(null, 0)).then((TAB) => { + // Tell the content script to begin scraping the page. + chrome.tabs.sendMessage(TAB.id, {"refresh": true}); + }); + } + }); + } } export {IconIndicator as default}; \ No newline at end of file From 4d1958d13f8e19f4c2be097c74844036d6891e3e Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 13:03:18 +0800 Subject: [PATCH 10/14] Merge the strings update from 'storage' --- _locales/en/messages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 266a8c0..6f59544 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -118,7 +118,7 @@ "message": "Update" }, "settings_filters_update_status": { - "message": "Updating the filter at $filter_url$…", + "message": "Updating…", "placeholders": { "filter_url": { "content": "$1" @@ -126,7 +126,7 @@ } }, "settings_filters_update_status_complete": { - "message": "Updated the filter at $filter_url$.", + "message": "Update complete.", "placeholders": { "filter_url": { "content": "$1" From a723791d1bccbe602e3a6aef26d4b7b65c54b4a2 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 13:03:35 +0800 Subject: [PATCH 11/14] rename the source preference for icon display --- scripts/GUI/entrypoints/iconindicator.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/GUI/entrypoints/iconindicator.js b/scripts/GUI/entrypoints/iconindicator.js index 1086519..4fda646 100644 --- a/scripts/GUI/entrypoints/iconindicator.js +++ b/scripts/GUI/entrypoints/iconindicator.js @@ -10,10 +10,10 @@ class IconIndicator { Indicate that the website is supported through icon change. */ static enable() { - BrowserIcon.enable(); + BrowserIcon.enable(); // Enable icon changes if enabled within the settings. - global.read([`settings`, `behavior`, `showApplicable`]).then(async (PREFERENCE) => {(PREFERENCE) + global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => {(PREFERENCE) ? fetch(CONFIG).then((response) => response.json()).then((jsonData) => { const ICON_COLORS = jsonData; @@ -35,7 +35,6 @@ class IconIndicator { if (STATUS[`done`]) { global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { - ((typeof RESULTS).includes(`str`)) ? RESULTS.trim() : false; (RESULTS) ? BrowserIcon.set({ "BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, "BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] @@ -74,7 +73,7 @@ class IconIndicator { BrowserIcon.disable(); // Enable icon changes if enabled within the settings. - global.read([`settings`, `behavior`, `showApplicable`]).then((PREFERENCE) => { + global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => { (Tabs.query(null, 0)).then(async (TAB) => { BrowserIcon.set({ "BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, From fa97743fc8fd76a06e10a9955d91c42476a7612b Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 13:41:07 +0800 Subject: [PATCH 12/14] Improve icon display --- scripts/GUI/entrypoints/iconindicator.js | 82 ++++++++++++------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/scripts/GUI/entrypoints/iconindicator.js b/scripts/GUI/entrypoints/iconindicator.js index 4fda646..1f1e419 100644 --- a/scripts/GUI/entrypoints/iconindicator.js +++ b/scripts/GUI/entrypoints/iconindicator.js @@ -13,43 +13,42 @@ class IconIndicator { BrowserIcon.enable(); // Enable icon changes if enabled within the settings. - global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => {(PREFERENCE) - ? fetch(CONFIG).then((response) => response.json()).then((jsonData) => { - const ICON_COLORS = jsonData; + (Tabs.query(null, 0)).then((TAB) => { + // Get the URL of the tab. + const LOCATION = TAB.url; - /* - Show an iconified summary of the results. + global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => {(PREFERENCE) + ? fetch(CONFIG).then((response) => response.json()).then(async (jsonData) => { + const ICON_COLORS = jsonData; - @param {string} location the URL of the page - @param {string} ID the tab's ID - */ - function showDetails(location, ID) { - let LOCATION = location; - // If the tab data is ready, change the icon to reflect the results. - global.read([`sites`, LOCATION, `status`]).then(async (STATUS) => { - if (STATUS) { - (STATUS[`error`]) ? BrowserIcon.set({ - "BadgeText": await (new texts(`extensionIcon_error`)).symbol, - "BadgeBackgroundColor": ICON_COLORS[`error`] - }, {"tabId": ID}) : false; - - if (STATUS[`done`]) { - global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { - (RESULTS) ? BrowserIcon.set({ - "BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, - "BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] - }, {"tabId": ID}) : false; - }) - }; - }; - }); - } - - - (Tabs.query(null, 0)).then(async (TAB) => { - // Get the URL of the tab. - let LOCATION = TAB.url; + /* + Show an iconified summary of the results. + @param {string} location the URL of the page + @param {string} ID the tab's ID + */ + function showDetails(location, ID) { + let LOCATION = location; + // If the tab data is ready, change the icon to reflect the results. + global.read([`sites`, LOCATION, `status`]).then(async (STATUS) => { + if (STATUS) { + (STATUS[`error`]) ? BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_error`)).symbol, + "BadgeBackgroundColor": ICON_COLORS[`error`] + }, {"tabId": ID}) : false; + + if (STATUS[`done`]) { + global.read([`sites`, LOCATION, `analysis`, `Rating`, `Trust`]).then(async (RESULTS) => { + (RESULTS) ? BrowserIcon.set({ + "BadgeText": await (new texts(`extensionIcon_product_`.concat(RESULTS))).symbol, + "BadgeBackgroundColor": ICON_COLORS[`product_`.concat(RESULTS)] + }, {"tabId": ID}) : false; + }) + }; + }; + }); + } + BrowserIcon.set({ "BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol, "BadgeBackgroundColor": ICON_COLORS[`loading`] @@ -58,12 +57,11 @@ class IconIndicator { showDetails(LOCATION, TAB.id); observe((changes) => { showDetails(LOCATION, TAB.id); - }) - }); + }); + }) + : false; }) - : false; }) - } /* @@ -75,10 +73,12 @@ class IconIndicator { // Enable icon changes if enabled within the settings. global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => { (Tabs.query(null, 0)).then(async (TAB) => { - BrowserIcon.set({ + (PREFERENCE) + ? BrowserIcon.set({ "BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, - "BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);}) - }, {"tabId": TAB.id}); + "BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);})}, + {"tabId": TAB.id}) + : false; }) }) } From 04bf5e2ba72e693843f81cbb0290b9676e879059 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 14:18:10 +0800 Subject: [PATCH 13/14] call for analysis if autorunning disabled --- scripts/GUI/entrypoints/iconindicator.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/GUI/entrypoints/iconindicator.js b/scripts/GUI/entrypoints/iconindicator.js index 1f1e419..f5b4a79 100644 --- a/scripts/GUI/entrypoints/iconindicator.js +++ b/scripts/GUI/entrypoints/iconindicator.js @@ -10,7 +10,8 @@ class IconIndicator { Indicate that the website is supported through icon change. */ static enable() { - BrowserIcon.enable(); + BrowserIcon.enable(); + BrowserIcon.addActionListener("onClicked", () => {BrowserIcon.onclick();}); // Enable icon changes if enabled within the settings. (Tabs.query(null, 0)).then((TAB) => { @@ -69,6 +70,7 @@ class IconIndicator { */ static disable() { BrowserIcon.disable(); + BrowserIcon.removeActionListener("onClicked", () => {BrowserIcon.onclick();}); // Enable icon changes if enabled within the settings. global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => { @@ -82,15 +84,6 @@ class IconIndicator { }) }) } - - /* - Set the function. - - @param {function} callback the function to run. - */ - static set(callback) { - BrowserIcon.addActionListener("onClicked", callback); - } /* The action when the icon is clicked. From 95aedb9542dc216dc553434981979ca2ce260785 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 6 May 2024 14:18:49 +0800 Subject: [PATCH 14/14] override states aren't undefined --- scripts/external/watch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 259262f..beccb21 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -16,7 +16,7 @@ export default class watch { */ static async process(filter, options = {}) { document.onreadystatechange = async () => { - if (document.readyState == 'complete' && (await global.read([`settings`, `behavior`, `autoRun`]) || ((typeof options).includes(`object`) && options) ? options[`override`] : false)) { + if (document.readyState == 'complete' && (await global.read([`settings`, `behavior`, `autoRun`]) || ((((typeof options).includes(`object`) && options) ? Object.hasOwn(options, `override`) : false) ? options[`override`] : false))) { new logging((new texts(`scrape_msg_ready`)).localized); this.processed = (((options && typeof options == `object`) ? options[`override`] : false) || this.processed == null) ? new processor(filter) : this.processed; }