mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-31 06:58:30 +00:00
4.20.72
* Added: Setting to change the height of chat actions. * Added: Profiles can now be toggled via hotkey. * Added: Profiles can now be imported from URL as well as File. * Added: Profiles with update URLs can have automatic updates disabled. * Fixed: Support for the `clips.twitch.tv` domain. * Fixed: Badges that make use of foreground text are no longer white in light themes. * Fixed: Mod Icons appearing smaller than normal. * Changed: Allow several types of actions, unrelated to moderation, to be used on a person's own chat messages. * Changed: Better warn users in the Control Center when the current profile is set to automatically update. * Changed: Make the FFZ Control Center remember which profile is selected when re-opening / refreshing. * API Added: Add-ons can now target specific supported flavors. Choices thus far are `main` and `clips`. * API Added: The `site.menu_button` now has `addToast(...)` and can display multiple toasts. Toasts can also time out. * API Fixed: `openFile(...)` never resolving if the user closes the dialog without selecting a file.
This commit is contained in:
parent
0d433c3ebd
commit
9086230686
61 changed files with 2267 additions and 222 deletions
|
@ -27,6 +27,8 @@ export default class AddonManager extends Module {
|
|||
|
||||
this.load_requires = ['settings'];
|
||||
|
||||
this.target = this.parent.flavor || 'unknown';
|
||||
|
||||
this.has_dev = false;
|
||||
this.reload_required = false;
|
||||
this.addons = {};
|
||||
|
@ -50,6 +52,7 @@ export default class AddonManager extends Module {
|
|||
getAddons: () => Object.values(this.addons),
|
||||
hasAddon: id => this.hasAddon(id),
|
||||
getVersion: id => this.getVersion(id),
|
||||
doesAddonTarget: id => this.doesAddonTarget(id),
|
||||
isAddonEnabled: id => this.isAddonEnabled(id),
|
||||
isAddonExternal: id => this.isAddonExternal(id),
|
||||
enableAddon: id => this.enableAddon(id),
|
||||
|
@ -81,13 +84,27 @@ export default class AddonManager extends Module {
|
|||
// We do not await enabling add-ons because that would delay the
|
||||
// main script's execution.
|
||||
for(const id of this.enabled_addons)
|
||||
if ( this.hasAddon(id) )
|
||||
if ( this.hasAddon(id) && this.doesAddonTarget(id) )
|
||||
this._enableAddon(id);
|
||||
|
||||
this.emit(':ready');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
doesAddonTarget(id) {
|
||||
const data = this.addons[id];
|
||||
if ( ! data )
|
||||
return false;
|
||||
|
||||
const targets = data.targets ?? ['main'];
|
||||
if ( ! Array.isArray(targets) )
|
||||
return false;
|
||||
|
||||
return targets.includes(this.target);
|
||||
}
|
||||
|
||||
|
||||
generateLog() {
|
||||
const out = ['Known'];
|
||||
for(const [id, addon] of Object.entries(this.addons))
|
||||
|
@ -323,7 +340,8 @@ export default class AddonManager extends Module {
|
|||
this.settings.provider.set('addons.enabled', this.enabled_addons);
|
||||
|
||||
// Actually load it.
|
||||
this._enableAddon(id);
|
||||
if ( this.doesAddonTarget(id) )
|
||||
this._enableAddon(id);
|
||||
}
|
||||
|
||||
async disableAddon(id, save = true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue