1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 11:25:31 +02:00

feat: Fixed disable all mods not working, b=no-bug, c=mods

This commit is contained in:
mr. m 2025-07-02 10:46:39 +02:00
parent f6da5047c2
commit 3b8202f207
No known key found for this signature in database
GPG key ID: 928E01ED4C97749F
2 changed files with 19 additions and 18 deletions

View file

@ -64,32 +64,33 @@
}
async #rebuildModsStylesheet() {
const shouldBeEnabled = !Services.prefs.getBoolPref('zen.themes.disable-all', false);
if (shouldBeEnabled) {
const mods = await this.#getEnabledMods();
const mods = await this.#getEnabledMods();
await this.#writeStylesheet(mods);
await this.#writeStylesheet(mods);
const modsWithPreferences = await Promise.all(
mods.map(async (mod) => {
const preferences = await this.getModPreferences(mod);
const modsWithPreferences = await Promise.all(
mods.map(async (mod) => {
const preferences = await this.getModPreferences(mod);
return {
name: mod.name,
enabled: mod.enabled,
preferences,
};
})
);
return {
name: mod.name,
enabled: mod.enabled,
preferences,
};
})
);
this.#setDefaults(modsWithPreferences);
this.#writeToDom(modsWithPreferences);
}
this.#setDefaults(modsWithPreferences);
this.#writeToDom(modsWithPreferences);
await this.#insertStylesheet();
}
async #getEnabledMods() {
if (Services.prefs.getBoolPref('zen.themes.disable-all', false)) {
console.log('[ZenMods]: Mods are disabled by user preference.');
return [];
}
const modsObject = await this.getMods();
const mods = Object.values(modsObject).filter(
(mod) => mod.enabled === undefined || mod.enabled

View file

@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.14.1b",
"displayVersion": "1.14.2b",
"github": {
"repo": "zen-browser/desktop"
},