diff options
author | V <vendicated@riseup.net> | 2023-08-12 05:27:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 05:27:59 +0200 |
commit | 3e732646e5ab83f76b34ec7fdb3d9d8c68faca8d (patch) | |
tree | 7d407485fa5cfb7a4e14f5d097c1e6d259c39a7b /src | |
parent | d5b3b510502e952e7d0a6033f6c69fe1042ba3f1 (diff) | |
download | Vencord-3e732646e5ab83f76b34ec7fdb3d9d8c68faca8d.tar.gz Vencord-3e732646e5ab83f76b34ec7fdb3d9d8c68faca8d.tar.bz2 Vencord-3e732646e5ab83f76b34ec7fdb3d9d8c68faca8d.zip |
Fix plugins broken by latest canary update (#1637)
* Fix WebContextMenus
* BetterGifAltText: futureproof find
* Fix pronoundb profile patch
* Fix NoScreensharePreview
* Fix FakeNitro emote text patch
---------
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/betterGifAltText.ts | 2 | ||||
-rw-r--r-- | src/plugins/fakeNitro.ts | 2 | ||||
-rw-r--r-- | src/plugins/noScreensharePreview.ts | 6 | ||||
-rw-r--r-- | src/plugins/pronoundb/index.ts | 3 | ||||
-rw-r--r-- | src/plugins/webContextMenus.web.ts | 6 | ||||
-rw-r--r-- | src/webpack/common/utils.ts | 2 |
6 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/betterGifAltText.ts b/src/plugins/betterGifAltText.ts index dcffc02..4dd30f2 100644 --- a/src/plugins/betterGifAltText.ts +++ b/src/plugins/betterGifAltText.ts @@ -34,7 +34,7 @@ export default definePlugin({ }, }, { - find: 'preload:"none","aria', + find: ".embedGallerySide", replacement: { match: /(?<==(.{1,3})\.alt.{0,20})\?.{0,5}\.Messages\.GIF/, replace: diff --git a/src/plugins/fakeNitro.ts b/src/plugins/fakeNitro.ts index cd2dda8..d74a6c0 100644 --- a/src/plugins/fakeNitro.ts +++ b/src/plugins/fakeNitro.ts @@ -313,7 +313,7 @@ export default definePlugin({ find: ".Messages.EMOJI_POPOUT_PREMIUM_JOINED_GUILD_DESCRIPTION", predicate: () => settings.store.transformEmojis, replacement: { - match: /((\i)=\i\.node,\i=\i\.emojiSourceDiscoverableGuild)(.+?return )(.{0,450}Messages\.EMOJI_POPOUT_PREMIUM_JOINED_GUILD_DESCRIPTION.+?}\))/, + match: /((\i)=\i\.node,\i=\i\.expressionSourceGuild)(.+?return )(.{0,450}Messages\.EMOJI_POPOUT_PREMIUM_JOINED_GUILD_DESCRIPTION.+?}\))/, replace: (_, rest1, node, rest2, reactNode) => `${rest1},fakeNitroNode=${node}${rest2}$self.addFakeNotice("EMOJI",${reactNode},fakeNitroNode.fake)` } } diff --git a/src/plugins/noScreensharePreview.ts b/src/plugins/noScreensharePreview.ts index 50b2a96..df3daad 100644 --- a/src/plugins/noScreensharePreview.ts +++ b/src/plugins/noScreensharePreview.ts @@ -27,10 +27,10 @@ export default definePlugin({ { find: '("ApplicationStreamPreviewUploadManager")', replacement: [ - "\\i\\.default\\.makeChunkedRequest\\(", - "\\i\\.\\i\\.post\\({url:" + String.raw`\i\.\i\.makeChunkedRequest\(`, + String.raw`\i\.\i\.post\({url:` ].map(match => ({ - match: new RegExp(`(?=return\\[(\\d),${match}\\i\\.\\i\\.STREAM_PREVIEW.+?}\\)\\];)`), + match: new RegExp(String.raw`(?=return\[(\d),${match}\i\.\i\.STREAM_PREVIEW.+?}\)\];)`), replace: (_, code) => `return[${code},Promise.resolve({body:"",status:204})];` })) } diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index 8605869..52fefdc 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -68,7 +68,8 @@ export default definePlugin({ find: ".USER_PROFILE_ACTIVITY", replacement: [ { - match: /getGlobalName\(\i\);(?<=displayProfile.{0,200})/, + /* FIXME: old name is getGlobalName, new name is getName. Remove optional Global once stable has also migrated */ + match: /\.get(?:Global)?Name\(\i\);(?<=displayProfile.{0,200})/, replace: "$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id,true);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;" }, PRONOUN_TOOLTIP_PATCH diff --git a/src/plugins/webContextMenus.web.ts b/src/plugins/webContextMenus.web.ts index 7ec6348..ca29540 100644 --- a/src/plugins/webContextMenus.web.ts +++ b/src/plugins/webContextMenus.web.ts @@ -86,7 +86,7 @@ export default definePlugin({ }, // Fix silly Discord calling the non web support copy { - match: /\w\.default\.copy/, + match: /\i\.\i\.copy/, replace: "Vencord.Webpack.Common.Clipboard.copy" } ] @@ -102,7 +102,7 @@ export default definePlugin({ replace: "if(null==" }, { - match: /return\s*?\[\i\.default\.canCopyImage\(\)/, + match: /return\s*?\[\i\.\i\.canCopyImage\(\)/, replace: "return [true" }, { @@ -158,7 +158,7 @@ export default definePlugin({ }, { // Change calls to DiscordNative.clipboard to us instead - match: /\b\i\.default\.(copy|cut|paste)/g, + match: /\b\i\.\i\.(copy|cut|paste)/g, replace: "$self.$1" } ] diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 40a45da..2c814de 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -93,7 +93,7 @@ export const UserUtils = { }; export const Clipboard = mapMangledModuleLazy('document.queryCommandEnabled("copy")||document.queryCommandSupported("copy")', { - copy: filters.byCode(".default.copy("), + copy: filters.byCode(".copy("), SUPPORTS_COPY: x => typeof x === "boolean", }); |