mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-12 10:36:23 +00:00
Add TextEmoji plugin
The plugin prevents Discord from replacing emoji with images, leaving it up to the browser to render them.
This commit is contained in:
parent
5dee2e8549
commit
a0e7398725
2 changed files with 46 additions and 0 deletions
42
src/plugins/textEmoji/index.ts
Normal file
42
src/plugins/textEmoji/index.ts
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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 { 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: [
|
||||||
|
{
|
||||||
|
find: "getSrc(){",
|
||||||
|
replacement: {
|
||||||
|
match: /(if\(null!=.{1,2}\))return .{1,2}\.default\.getURL\(.{1,2}\)/,
|
||||||
|
replace: "$1return null",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ",findInlineEmojisFromSurrogates:",
|
||||||
|
replacement: {
|
||||||
|
match: /if\(!0!==.{1,2}&&!.{1,2}\.test\(.{1,2}\)\)/,
|
||||||
|
replace: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
|
@ -399,6 +399,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
name: "maisy",
|
name: "maisy",
|
||||||
id: 257109471589957632n,
|
id: 257109471589957632n,
|
||||||
},
|
},
|
||||||
|
Grzesiek11: {
|
||||||
|
name: "Grzesiek11",
|
||||||
|
id: 368475654662127616n,
|
||||||
|
},
|
||||||
} satisfies Record<string, Dev>);
|
} satisfies Record<string, Dev>);
|
||||||
|
|
||||||
// iife so #__PURE__ works correctly
|
// iife so #__PURE__ works correctly
|
||||||
|
|
Loading…
Reference in a new issue