From efd6d2fa4288692e4c84f58b564dd39748b3f040 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Sat, 19 Oct 2024 13:13:01 -0400 Subject: [PATCH] 4.75.3 * Changed: Use `cdn2` for loading the script, rather than `cdn` to put the script files on a separate domain from other content. * Fixed: Bug with the audio compressor that would cause it to enter a broken state for users (mostly on Firefox). * Experiments: Set the EMQX PubSub experiment to 50%. --- package.json | 2 +- src/entry.js | 2 +- src/experiments.json | 4 ++-- src/i18n.js | 2 +- src/sites/shared/player.jsx | 8 ++++---- src/utilities/constants.ts | 2 +- styles/chat.scss | 2 +- webpack.config.js | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 4d6f5a11..d9465fed 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.75.2", + "version": "4.75.3", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/entry.js b/src/entry.js index 54455c03..3f08c848 100644 --- a/src/entry.js +++ b/src/entry.js @@ -10,7 +10,7 @@ const DEBUG = localStorage.ffzDebugMode == 'true' && document.body.classList.contains('ffz-dev'), HOST = location.hostname, - SERVER = DEBUG ? '//localhost:8000' : '//cdn.frankerfacez.com', + SERVER = DEBUG ? '//localhost:8000' : '//cdn2.frankerfacez.com', script = document.createElement('script'); let FLAVOR = diff --git a/src/experiments.json b/src/experiments.json index 6b588b2e..d1e3c436 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -20,8 +20,8 @@ "name": "EMQX MQTT-Based PubSub", "description": "An experimental pubsub system running on an EMQX cluster, to see how that performs.", "groups": [ - {"value": true, "weight": 20}, - {"value": false, "weight": 80} + {"value": true, "weight": 50}, + {"value": false, "weight": 50} ] }, "cf_pubsub": { diff --git a/src/i18n.js b/src/i18n.js index 7df36a00..da625c59 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -686,7 +686,7 @@ export default class TranslationManager extends Module { if (! hash) continue; - promises.push(fetchJSON(`https://cdn.frankerfacez.com/static/locale/${id}/${chnk}.${hash}.json`)); + promises.push(fetchJSON(`https://cdn2.frankerfacez.com/static/locale/${id}/${chnk}.${hash}.json`)); } const chunks = await Promise.all(promises); diff --git a/src/sites/shared/player.jsx b/src/sites/shared/player.jsx index 1e6da86e..e2ef91da 100644 --- a/src/sites/shared/player.jsx +++ b/src/sites/shared/player.jsx @@ -1698,14 +1698,14 @@ export default class PlayerBase extends Module { return true; } - createCompressor(inst, video, _cmp) { + createCompressor(inst, video, ctx) { if ( ! this.canCompress(inst) ) return; let comp = video._ffz_compressor; if ( ! comp ) { - const ctx = _cmp || new AudioContext(); - if ( ! IS_FIREFOX && ctx.state === 'suspended' ) { + ctx = ctx || new AudioContext(); + if ( ctx.state === 'suspended' ) { let timer; const evt = () => { clearTimeout(timer); @@ -1715,7 +1715,7 @@ export default class PlayerBase extends Module { return; } - this.createCompressor(inst, video, comp); + this.createCompressor(inst, video, ctx); } this.log.debug('Attempting to resume suspended AudioContext.'); diff --git a/src/utilities/constants.ts b/src/utilities/constants.ts index 3f10dee5..91dc1565 100644 --- a/src/utilities/constants.ts +++ b/src/utilities/constants.ts @@ -9,7 +9,7 @@ export const DEBUG = localStorage.ffzDebugMode === 'true' && document.body.class export const EXTENSION = !!__extension__; /** The base URL of the FrankerFaceZ CDN. */ -export const SERVER = DEBUG ? 'https://localhost:8000' : 'https://cdn.frankerfacez.com'; +export const SERVER = DEBUG ? 'https://localhost:8000' : 'https://cdn2.frankerfacez.com'; let path = `${SERVER}/script`; diff --git a/styles/chat.scss b/styles/chat.scss index 38d8c2b0..7e396fe1 100644 --- a/styles/chat.scss +++ b/styles/chat.scss @@ -358,7 +358,7 @@ .ffz--twitter-badge { height: 1.2rem; width: 1.2rem; - background: url('//cdn.frankerfacez.com/static/twitter_sprites.png'); + background: url('//cdn2.frankerfacez.com/static/twitter_sprites.png'); display: inline-block; margin: 2px 0 -1px 0.5rem; diff --git a/webpack.config.js b/webpack.config.js index afcb6d5b..f8bd8063 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,7 +26,7 @@ const FILE_PATH = DEV_SERVER ? 'https://localhost:8000/script/' : FOR_EXTENSION ? '' - : 'https://cdn.frankerfacez.com/static/'; + : 'https://cdn2.frankerfacez.com/static/'; console.log('NODE_ENV:', process.env.NODE_ENV); @@ -340,7 +340,7 @@ if ( DEV_SERVER ) proxy: { '**': { - target: 'https://cdn.frankerfacez.com/', + target: 'https://cdn2.frankerfacez.com/', changeOrigin: true } },