1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-27 13:08:30 +00:00
* Fixed: Player sizing issue for Firefox users.
* Fixed: Errors rendering tool-tips for chat actions.
* Changed: Tweak parameters for automatic error reports to filter out more invalid error reports.
This commit is contained in:
SirStendec 2020-11-14 21:58:22 -05:00
parent b7a2ce3fcf
commit 32859318b2
8 changed files with 66 additions and 19 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.20.47", "version": "4.20.48",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"license": "Apache-2.0", "license": "Apache-2.0",
"scripts": { "scripts": {

View file

@ -1,5 +1,7 @@
'use strict'; 'use strict';
import {createElement} from 'utilities/dom';
// ============================================================================ // ============================================================================
// Send Reply // Send Reply

View file

@ -168,7 +168,8 @@ export default class RavenLogger extends Module {
'ChunkLoadError', 'ChunkLoadError',
'SecurityError', 'SecurityError',
'QuotaExceededError', 'QuotaExceededError',
'DataCloneError' 'DataCloneError',
'SyntaxError'
], ],
sanitizeKeys: [ sanitizeKeys: [
/Token$/ /Token$/
@ -190,6 +191,7 @@ export default class RavenLogger extends Module {
return true; return true;
}, },
shouldSendCallback: data => { shouldSendCallback: data => {
debugger;
if ( this.settings && ! this.settings.get('reports.error.enable') ) { if ( this.settings && ! this.settings.get('reports.error.enable') ) {
if ( data.tags && data.tags.example && this.__example_waiter ) { if ( data.tags && data.tags.example && this.__example_waiter ) {
this.__example_waiter(null); this.__example_waiter(null);
@ -226,6 +228,22 @@ export default class RavenLogger extends Module {
if ( data.exception && Array.isArray(data.exception.values) ) if ( data.exception && Array.isArray(data.exception.values) )
data.exception.values = this.rewriteStack(data.exception.values, data); data.exception.values = this.rewriteStack(data.exception.values, data);
if ( Array.isArray(data.stacktrace?.frames) ) {
let has_good = false;
for(const frame of data.stacktrace.frames) {
if ( frame.filename )
frame.filename = fix_url(frame.filename);
// If a stacktrace is nothing but wrapped/captured/anonymous
// then it's not very useful to us.
if ( frame.function && ! frame.function.includes('captureMessage') && ! frame.function.includes('captureException') && ! frame.function.includes('wrapped') && ! frame.function.includes('<anonymous>') )
has_good = true;
}
if ( ! has_good )
return false;
}
if ( data.culprit ) if ( data.culprit )
data.culprit = fix_url(data.culprit); data.culprit = fix_url(data.culprit);
@ -287,13 +305,16 @@ export default class RavenLogger extends Module {
} }
rewriteFrames(frames) { // eslint-disable-line class-methods-use-this
for(const frame of frames)
frame.filename = fix_url(frame.filename);
}
rewriteStack(errors) { // eslint-disable-line class-methods-use-this rewriteStack(errors) { // eslint-disable-line class-methods-use-this
for(const err of errors) { for(const err of errors) {
if ( ! err || ! err.stacktrace || ! err.stacktrace.frames ) if ( Array.isArray(err?.stacktrace?.frames) )
continue; this.rewriteFrames(err.stacktrace.frames);
for(const frame of err.stacktrace.frames)
frame.filename = fix_url(frame.filename);
} }
return errors; return errors;

View file

@ -197,7 +197,7 @@ export default class Channel extends Module {
} }
removePanelTips(inst) { // eslint-disable-line class-methods-use-this removePanelTips(inst) { // eslint-disable-line class-methods-use-this
if ( inst._ffz_tips ) { if ( inst?._ffz_tips ) {
inst._ffz_tips.destroy(); inst._ffz_tips.destroy();
inst._ffz_tips = null; inst._ffz_tips = null;
inst._ffz_tip_el = null; inst._ffz_tip_el = null;

View file

@ -1,5 +1,6 @@
'use strict'; 'use strict';
import { IS_FIREFOX } from 'src/utilities/constants';
// ============================================================================ // ============================================================================
// Layout Overrides for Twitch Twilight // Layout Overrides for Twitch Twilight
// ============================================================================ // ============================================================================
@ -268,7 +269,7 @@ export default class Layout extends Module {
if ( this._resize_timer ) if ( this._resize_timer )
return; return;
this._resize_timer = setTimeout(() => this._handleResize(), 100); this._resize_timer = setTimeout(() => this._handleResize(), IS_FIREFOX ? 500 : 100);
} }
_handleResize() { _handleResize() {
@ -277,10 +278,13 @@ export default class Layout extends Module {
if ( ! this.ResizeDetector.instances.size ) if ( ! this.ResizeDetector.instances.size )
this._needs_resize = true; this._needs_resize = true;
else else {
for(const inst of this.ResizeDetector.instances) { for(const inst of this.ResizeDetector.instances) {
inst?.props?.onResize?.(); inst?.props?.onResize?.();
} }
this.emit('site.player:fix-player');
}
} }
get is_minimal() { get is_minimal() {

View file

@ -516,6 +516,22 @@ export default class Player extends Module {
}); });
} }
repositionPlayer() {
if ( ! this._mover ) {
const el = document.querySelector('.channel-root__player');
this._mover = this.fine.searchNode(
el,
n => n.memoizedProps?.triggerPlayerReposition,
50
);
}
if ( this._mover )
this._mover.memoizedProps.triggerPlayerReposition();
}
onEnable() { onEnable() {
this.css_tweaks.toggle('player-volume', this.settings.get('player.volume-always-shown')); this.css_tweaks.toggle('player-volume', this.settings.get('player.volume-always-shown'));
this.css_tweaks.toggle('player-ext-mouse', !this.settings.get('player.ext-interaction')); this.css_tweaks.toggle('player-ext-mouse', !this.settings.get('player.ext-interaction'));
@ -530,7 +546,7 @@ export default class Player extends Module {
this.installVisibilityHook(); this.installVisibilityHook();
this.on(':reset', this.resetAllPlayers, this); this.on(':reset', this.resetAllPlayers, this);
//this.on(':fix-player', () => this.PersistentPlayer.forceUpdate(), this); this.on(':fix-player', this.repositionPlayer, this);
const t = this; const t = this;

View file

@ -266,6 +266,9 @@ export default class Apollo extends Module {
} }
apolloPostFlight(response) { apolloPostFlight(response) {
if ( ! response.extensions )
return;
const operation = response.extensions.operationName, const operation = response.extensions.operationName,
modifiers = this.post_modifiers[operation]; modifiers = this.post_modifiers[operation];

View file

@ -69,7 +69,7 @@ export class Tooltip {
this._accessor = `_ffz_tooltip$${last_id++}`; this._accessor = `_ffz_tooltip$${last_id++}`;
this._onMouseOut = e => e.target && e.target.dataset.forceOpen !== 'true' && this._exit(e.target); this._onMouseOut = e => e.target && e.target?.dataset?.forceOpen !== 'true' && this._exit(e.target);
if ( this.options.manual ) { if ( this.options.manual ) {
// Do nothing~! // Do nothing~!
@ -164,19 +164,20 @@ export class Tooltip {
if ( ! this._shift_af ) if ( ! this._shift_af )
this._shift_af = requestAnimationFrame(() => { this._shift_af = requestAnimationFrame(() => {
this._shift_af = null; this._shift_af = null;
for(const el of this.elements) { if ( this.elements )
const tip = el[this._accessor]; for(const el of this.elements) {
if ( tip && tip.outer ) { const tip = el[this._accessor];
tip.outer.dataset.shift = this.shift_state; if ( tip && tip.outer ) {
tip.update(); tip.outer.dataset.shift = this.shift_state;
tip.update();
}
} }
}
}); });
} }
cleanup() { cleanup() {
if ( this.options.manual ) if ( this.options.manual || ! this.elements )
return; return;
for(const el of this.elements) { for(const el of this.elements) {