From 93181dc8e8827a022839d22b8fd442a8956388fd Mon Sep 17 00:00:00 2001 From: SirStendec Date: Fri, 6 Dec 2024 14:43:26 -0500 Subject: [PATCH] 4.76.3 * Added: Setting to block call-outs based on type. This should stay up to date automatically whenever Twitch adds new call-out types. * Added: Setting to specifically block clip suggestion call-outs. Twitch has reversed the roll-out for now but I suspect they'll be back. * Fixed: Bug related to badges and emote sets not being tracked correctly in some situations. * Fixed: Bug where the new replacement Clip button not functioning correctly after the player state changes. --- package.json | 2 +- .../css_tweaks/player-hide-native-clip.scss | 4 +- src/sites/shared/player.jsx | 38 +- src/sites/twitch-twilight/index.js | 20 + .../twitch-twilight/modules/chat/index.js | 397 ++++++++++++------ .../twitch-twilight/modules/chat/line.js | 8 +- .../styles/player-hide-native-clip.scss | 3 +- .../modules/featured_follow.js | 245 ----------- src/utilities/object.ts | 31 +- 9 files changed, 337 insertions(+), 411 deletions(-) delete mode 100644 src/sites/twitch-twilight/modules/featured_follow.js diff --git a/package.json b/package.json index 92095ba0..e9478491 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.76.2", + "version": "4.76.3", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/sites/player/css_tweaks/player-hide-native-clip.scss b/src/sites/player/css_tweaks/player-hide-native-clip.scss index d151d0df..cb4d5906 100644 --- a/src/sites/player/css_tweaks/player-hide-native-clip.scss +++ b/src/sites/player/css_tweaks/player-hide-native-clip.scss @@ -1,3 +1,5 @@ -.player-controls__right-control-group button[aria-label*="alt+x"] { +.player-controls__right-control-group button[aria-label*="alt+x"]:not(.ffz-core-button), +.player-controls__right-control-group button[aria-disabled]:has(path[d="M8 9H6v2h2V9zm1 0h2v2H9V9zm5 0h-2v2h2V9z"]) +{ display: none !important; } diff --git a/src/sites/shared/player.jsx b/src/sites/shared/player.jsx index a3add287..d4e73bc7 100644 --- a/src/sites/shared/player.jsx +++ b/src/sites/shared/player.jsx @@ -31,6 +31,11 @@ const SCROLL_I18N = 'setting.entry.player.volume-scroll.values', {value: 8, title: 'Enabled with Ctrl + Right-Click', i18n_key: `${SCROLL_I18N}.8`} ]; +function getNativeClipButton(container) { + return container.querySelector('button[aria-label*="alt+x"]') ?? + container.querySelector('button[aria-label]:has(path[d="M8 9H6v2h2V9zm1 0h2v2H9V9zm5 0h-2v2h2V9z"]'); +} + function wantsRMB(setting) { return setting === 2 || setting === 4 || setting === 6 || setting === 8; } @@ -2023,7 +2028,6 @@ export default class PlayerBase extends Module { video.requestPictureInPicture(); } - addClipButton(inst, tries = 0) { const outer = inst.props.containerRef || this.fine.getChildNode(inst), container = outer && outer.querySelector(RIGHT_CONTROLS), @@ -2046,13 +2050,16 @@ export default class PlayerBase extends Module { return; } + if (! container.ffz_native_clip || ! container.contains(container.ffz_native_clip) ) + container.ffz_native_clip = getNativeClipButton(container); + if ( ! cont ) { // We need the native clip button, so we can dispatch a click. - const native_clip = container.querySelector('button[aria-label*="alt+x"]'); - if ( ! native_clip ) - return; - - const on_click = e => native_clip.click(); + const on_click = e => { + const native = getNativeClipButton(container); + if (native) + native.click(); + } cont = (
{btn = (