Fix ImageZoom, Vencord Notifications & ReactErrorDecoder

This commit is contained in:
Nuckyz 2025-05-05 19:39:34 -03:00
parent 9a3c66abfd
commit 89ef26e719
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
5 changed files with 16 additions and 15 deletions

View file

@ -20,7 +20,7 @@ import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { React } from "@webpack/common";
let ERROR_CODES: any;
let ERROR_CODES: Record<string, string> | undefined;
export default definePlugin({
name: "ReactErrorDecoder",
@ -28,13 +28,12 @@ export default definePlugin({
authors: [Devs.Cyn, Devs.maisymoe],
patches: [
{
find: '"https://reactjs.org/docs/error-decoder.html?invariant="',
find: "React has blocked a javascript: URL as a security precaution.",
replacement: {
match: /(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.<arguments\.length;.\+\+\).\+="&args\[\]="\+encodeURIComponent\(arguments\[.\]\);return"Minified React error #"\+.\+"; visit "\+.\+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")}/,
replace: (_, func, original) =>
`${func}{var decoded=$self.decodeError.apply(null, arguments);if(decoded)return decoded;${original}}`,
},
},
match: /"https:\/\/react.dev\/errors\/"\+\i;/,
replace: "$&const vcDecodedError=$self.decodeError(...arguments);if(vcDecodedError)return vcDecodedError;"
}
}
],
async start() {
@ -56,5 +55,5 @@ export default definePlugin({
index++;
return arg;
});
},
}
});