diff options
author | Cynthia Foxwell <LUModder@gmail.com> | 2022-09-01 21:27:32 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-02 05:27:32 +0200 |
commit | 71072cf3a3a96992c99265ca641239bffadd96c3 (patch) | |
tree | 979bd6d34957034c255770ab386c78b87c3dbd62 | |
parent | 5488f5cecb0be8d1ffaefdd488b34e599ae198d9 (diff) | |
download | Vencord-71072cf3a3a96992c99265ca641239bffadd96c3.tar.gz Vencord-71072cf3a3a96992c99265ca641239bffadd96c3.tar.bz2 Vencord-71072cf3a3a96992c99265ca641239bffadd96c3.zip |
noTrack: switch to patches (#6)
-rw-r--r-- | src/plugins/noTrack.ts | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/plugins/noTrack.ts b/src/plugins/noTrack.ts index 642d88c..6f15d4c 100644 --- a/src/plugins/noTrack.ts +++ b/src/plugins/noTrack.ts @@ -1,32 +1,24 @@ import definePlugin from "../utils/types"; -import { findByProps } from "../webpack"; - -const DO_NOTHING = () => void 0; export default definePlugin({ name: "NoTrack", description: "Disable Discord's tracking and crash reporting", author: "Vendicated", required: true, - start() { - findByProps("getSuperPropertiesBase64", "track").track = DO_NOTHING; - findByProps("submitLiveCrashReport").submitLiveCrashReport = DO_NOTHING; - findByProps("AnalyticsActionHandlers").AnalyticsActionHandlers.handleTrack = DO_NOTHING; - - const sentry = window.__SENTRY__; - sentry.logger.disable(); - - sentry.hub.addBreadcrumb = DO_NOTHING; - sentry.hub.getClient().close(0); - sentry.hub.getScope().clear(); - - const c = console; - for (const method in c) { - if (c[method].__sentry_original__) - c[method] = c[method].__sentry_original__; - if (c[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__?.__sentry_original__) - c[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__ = c[method].__REACT_DEVTOOLS_ORIGINAL_METHOD__.__sentry_original__; + patches: [ + { + find: "TRACKING_URL:", + replacement: { + match: /=\(0,.\.analyticsTrackingStoreMaker\)/, + replace: "=(function(){})", + }, + }, + { + find: "window.DiscordSentry=", + replacement: { + match: /window\.DiscordSentry=\(0,.\.initSentry\)\(\)/, + replace: "", + } } - } - -});
\ No newline at end of file + ] +}); |