1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-01 10:50:56 +00:00
FrankerFaceZ/src/settings/clearables.js
SirStendec 264c375f13 4.20.61
This was a small update until Twitch ripped out half their CSS.

* Added: Cross-Origin Storage Bridge for settings, better synchronizing settings on sub-domains with support for binary blobs at the cost of slightly increased start-up time.
* Fixed: Rendering issues caused by missing CSS.
* Fixed: FFZ Control Center button not appearing on dashboard pages, and appearing in the incorrect place.
* Changed: Work towards splitting modules into their own JS files for a faster, more asynchronous startup.
* API Added: Methods for serializing and deserializing Blobs for transmission across postMessage.
2021-02-11 19:40:12 -05:00

71 lines
1.4 KiB
JavaScript

'use strict';
// ============================================================================
// Clearable Settings
// ============================================================================
export const Experiments = {
label: 'Experiment Overrides',
keys: [
'exp-lock',
'experiment-overrides'
]
};
export const HiddenEmotes = {
label: 'Hidden Emotes',
keys(provider) {
const keys = ['emote-menu.hidden-sets'];
for(const key of provider.keys())
if ( key.startsWith('hidden-emotes.') )
keys.push(key);
return keys;
}
};
export const FavoriteEmotes = {
label: 'Favorited Emotes',
keys(provider) {
const keys = [];
for(const key of provider.keys())
if ( key.startsWith('favorite-emotes.') )
keys.push(key);
return keys;
}
};
export const Overrides = {
label: 'Name and Color Overrides',
keys: [
'overrides.colors',
'overrides.names'
]
};
export const Profiles = {
label: 'Profiles',
clear(provider, settings) {
const keys = ['profiles'];
for(const key of provider.keys())
if ( /^p:\d+:/.test(key) )
keys.push(key);
for(const key of keys)
provider.delete(key);
settings.loadProfiles();
}
};
export const Everything = {
label: 'Absolutely Everything',
async clear(provider, settings) {
provider.clear();
if ( provider.supportsBlobs )
await provider.clearBlobs();
settings.loadProfiles();
}
};