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",
"author": "Dan Salvato LLC",
"version": "4.20.47",
"version": "4.20.48",
"description": "FrankerFaceZ is a Twitch enhancement suite.",
"license": "Apache-2.0",
"scripts": {

View file

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

View file

@ -168,7 +168,8 @@ export default class RavenLogger extends Module {
'ChunkLoadError',
'SecurityError',
'QuotaExceededError',
'DataCloneError'
'DataCloneError',
'SyntaxError'
],
sanitizeKeys: [
/Token$/
@ -190,6 +191,7 @@ export default class RavenLogger extends Module {
return true;
},
shouldSendCallback: data => {
debugger;
if ( this.settings && ! this.settings.get('reports.error.enable') ) {
if ( data.tags && data.tags.example && this.__example_waiter ) {
this.__example_waiter(null);
@ -226,6 +228,22 @@ export default class RavenLogger extends Module {
if ( data.exception && Array.isArray(data.exception.values) )
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 )
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
for(const err of errors) {
if ( ! err || ! err.stacktrace || ! err.stacktrace.frames )
continue;
for(const frame of err.stacktrace.frames)
frame.filename = fix_url(frame.filename);
if ( Array.isArray(err?.stacktrace?.frames) )
this.rewriteFrames(err.stacktrace.frames);
}
return errors;

View file

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

View file

@ -1,5 +1,6 @@
'use strict';
import { IS_FIREFOX } from 'src/utilities/constants';
// ============================================================================
// Layout Overrides for Twitch Twilight
// ============================================================================
@ -268,7 +269,7 @@ export default class Layout extends Module {
if ( this._resize_timer )
return;
this._resize_timer = setTimeout(() => this._handleResize(), 100);
this._resize_timer = setTimeout(() => this._handleResize(), IS_FIREFOX ? 500 : 100);
}
_handleResize() {
@ -277,10 +278,13 @@ export default class Layout extends Module {
if ( ! this.ResizeDetector.instances.size )
this._needs_resize = true;
else
else {
for(const inst of this.ResizeDetector.instances) {
inst?.props?.onResize?.();
}
this.emit('site.player:fix-player');
}
}
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() {
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'));
@ -530,7 +546,7 @@ export default class Player extends Module {
this.installVisibilityHook();
this.on(':reset', this.resetAllPlayers, this);
//this.on(':fix-player', () => this.PersistentPlayer.forceUpdate(), this);
this.on(':fix-player', this.repositionPlayer, this);
const t = this;

View file

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

View file

@ -69,7 +69,7 @@ export class Tooltip {
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 ) {
// Do nothing~!
@ -164,6 +164,7 @@ export class Tooltip {
if ( ! this._shift_af )
this._shift_af = requestAnimationFrame(() => {
this._shift_af = null;
if ( this.elements )
for(const el of this.elements) {
const tip = el[this._accessor];
if ( tip && tip.outer ) {
@ -176,7 +177,7 @@ export class Tooltip {
cleanup() {
if ( this.options.manual )
if ( this.options.manual || ! this.elements )
return;
for(const el of this.elements) {