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] 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.