call for analysis if autorunning disabled

This commit is contained in:
buzz-lightsnack-2007 2024-05-06 14:18:10 +08:00
parent 95c80173db
commit 04bf5e2ba7

View file

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