mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-02 09:08:32 +00:00
4.2.0
This is a fairly hefty update, behind the scenes. We've rewritten all code that deals with chat scrolling in order to integrate with Twitch's last batch of changes that made chat pausing accessible for moderators. This update also enables the Add-Ons System for all users. * Added: Setting to allow you to pause chat with a hot key, even when the mouse isn't hovering over chat. * Added: Setting to control how long chat remains paused due to move movement. * Fixed: Chat row backgrounds changing when messages are removed from chat. * Changed: Integrate with Twitch's own chat pausing code, where it makes sense. * Changed: Remove the experiment locking down access to the Add-Ons Loader. * Changed: When using the current time as a cache buster, truncate it to the nearest 5 second interval.
This commit is contained in:
parent
535192d931
commit
cebb1c0140
11 changed files with 699 additions and 432 deletions
|
@ -8,6 +8,7 @@ import Module from 'utilities/module';
|
|||
import { SERVER } from 'utilities/constants';
|
||||
import { createElement } from 'utilities/dom';
|
||||
import { timeout, has } from 'utilities/object';
|
||||
import { getBuster } from 'utilities/time';
|
||||
|
||||
const fetchJSON = (url, options) => {
|
||||
return fetch(url, options).then(r => r.ok ? r.json() : null).catch(() => null);
|
||||
|
@ -23,7 +24,6 @@ export default class AddonManager extends Module {
|
|||
|
||||
this.should_enable = true;
|
||||
|
||||
this.inject('experiments');
|
||||
this.inject('settings');
|
||||
this.inject('i18n');
|
||||
|
||||
|
@ -33,9 +33,6 @@ export default class AddonManager extends Module {
|
|||
}
|
||||
|
||||
async onEnable() {
|
||||
if ( ! this.experiments.getAssignment('addons') )
|
||||
return;
|
||||
|
||||
this.settings.addUI('add-ons', {
|
||||
path: 'Add-Ons @{"description": "Add-Ons are additional modules, often written by other people, that can be loaded automatically by FrankerFaceZ to add new capabilities and behaviors to the extension and Twitch."}',
|
||||
component: 'addon-list',
|
||||
|
@ -107,9 +104,9 @@ export default class AddonManager extends Module {
|
|||
|
||||
async loadAddonData() {
|
||||
const [cdn_data, local_data] = await Promise.all([
|
||||
fetchJSON(`${SERVER}/script/addons.json?_=${FrankerFaceZ.version_info}`),
|
||||
fetchJSON(`${SERVER}/script/addons.json?_=${getBuster(30)}`),
|
||||
this.settings.get('addons.dev.server') ?
|
||||
fetchJSON(`https://localhost:8001/script/addons.json?_=${Date.now()}`) : null
|
||||
fetchJSON(`https://localhost:8001/script/addons.json?_=${getBuster()}`) : null
|
||||
]);
|
||||
|
||||
if ( Array.isArray(cdn_data) )
|
||||
|
@ -251,7 +248,7 @@ export default class AddonManager extends Module {
|
|||
document.head.appendChild(createElement('script', {
|
||||
id: `ffz-loaded-addon-${addon.id}`,
|
||||
type: 'text/javascript',
|
||||
src: addon.src || `${addon.dev ? 'https://localhost:8001' : SERVER}/script/addons/${addon.id}/script.js`,
|
||||
src: addon.src || `${addon.dev ? 'https://localhost:8001' : SERVER}/script/addons/${addon.id}/script.js?_=${getBuster(30)}`,
|
||||
crossorigin: 'anonymous'
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue