1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
* Fixed: FFZ no longer working correctly for Safari users owing to poor regex support. Safari users will be unable to use the Emoji Joiner Workaround introduced in 4.32.0.
This commit is contained in:
SirStendec 2022-02-11 16:35:06 -05:00
parent 969ed29668
commit 6a7ac8c194
2 changed files with 34 additions and 16 deletions

View file

@ -1,7 +1,7 @@
{
"name": "frankerfacez",
"author": "Dan Salvato LLC",
"version": "4.32.0",
"version": "4.32.1",
"description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true,
"license": "Apache-2.0",

View file

@ -48,7 +48,17 @@ export const SKIN_TONES = {
5: '1f3ff'
};
export const JOINER_REPLACEMENT = /(?<!\u{E0002})\u{E0002}/gu;
let enable_replace_joiner = true;
let joiner;
try {
joiner = new RegExp('(?<!\\u{E0002})\\u{E0002}', 'gu');
} catch(err) {
enable_replace_joiner = false;
joiner = null;
}
export const JOINER_REPLACEMENT = joiner; // /(?<!\u{E0002})\u{E0002}/gu;
export const ZWD_REPLACEMENT = /\u{200D}/gu;
export const EMOJI_JOINER = '\u{E0002}';
@ -80,20 +90,28 @@ export default class Emoji extends Module {
this.inject('..emotes');
this.inject('settings');
this.settings.add('chat.emoji.replace-joiner', {
default: 2,
ui: {
path: 'Chat > Behavior >> Emoji',
title: 'Emoji Joiner Workaround',
description: 'This feature is intended to allow the use of combined emoji in supported clients. This is required due to a bug in TMI that strips ZWJ characters from chat messages. [Visit the original issue](https://github.com/FrankerFaceZ/FrankerFaceZ/issues/1147) for more details.',
component: 'setting-select-box',
data: [
{value: 0, title: 'Disabled'},
{value: 1, title: 'Display Only'},
{value: 2, title: 'Display and Send'}
]
}
});
if (enable_replace_joiner)
this.settings.add('chat.emoji.replace-joiner', {
default: 2,
ui: {
path: 'Chat > Behavior >> Emoji',
title: 'Emoji Joiner Workaround',
description: 'This feature is intended to allow the use of combined emoji in supported clients. This is required due to a bug in TMI that strips ZWJ characters from chat messages. [Visit the original issue](https://github.com/FrankerFaceZ/FrankerFaceZ/issues/1147) for more details.',
component: 'setting-select-box',
data: [
{value: 0, title: 'Disabled'},
{value: 1, title: 'Display Only'},
{value: 2, title: 'Display and Send'}
]
}
});
else {
this.log.warn('This browser does not support regexp lookbehind. The "Emoji Joiner Workaround" feature will be disabled.');
this.settings.add('chat.emoji.replace-joiner', {
process() { return 0 }
});
}
this.settings.add('chat.emoji.style', {
default: 'twitter',