This commit is contained in:
Grzesiek11 2024-09-19 02:05:36 -04:00 committed by GitHub
commit 91765dd1a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# TextEmoji
Prevents Discord from replacing emoji with images, leaving it up to the browser
to render them
![Chat with TextEmoji enabled, using the Noto Color Emoji font](https://github.com/Vendicated/Vencord/assets/33988779/464ec526-8ef7-4961-941f-a2a05642b0f7)
Allows your browser to render emoji as regular text, using the system font, such
as Noto Color Emoji or Segoe UI Emoji.

View file

@ -0,0 +1,46 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2023 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import "./styles.css";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "TextEmoji",
description: "Prevents Discord from replacing emoji with images, leaving it up to the browser to render them",
authors: [Devs.Grzesiek11],
patches: [
// Reactions
{
find: "getSrc(){",
replacement: {
match: /(if\(null!=\i\))return \i\.\i\.getURL\(\i\)/,
replace: "$1return null",
},
},
// Messages
{
find: ",findInlineEmojisFromSurrogates:",
replacement: {
match: /if\(!0!==\i&&!\i\.test\(\i\)\)/,
replace: "if(true)",
},
},
],
});

View file

@ -0,0 +1,3 @@
[class^="reaction_"] .emoji {
white-space: nowrap;
}