diff options
author | Vendicated <vendicated@riseup.net> | 2022-08-29 22:05:22 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-08-29 22:05:22 +0200 |
commit | 483bc13a31ab2ba878ff8d9002b0a8671a640ec8 (patch) | |
tree | 9967493cf8d65dc90202bb76d604749c5c4ba5ca /src/plugins/noTrack.ts | |
parent | c39ff8f6481463a1700014ebd204f2b6189759a1 (diff) | |
download | Vencord-483bc13a31ab2ba878ff8d9002b0a8671a640ec8.tar.gz Vencord-483bc13a31ab2ba878ff8d9002b0a8671a640ec8.tar.bz2 Vencord-483bc13a31ab2ba878ff8d9002b0a8671a640ec8.zip |
Finish rewrite
Diffstat (limited to 'src/plugins/noTrack.ts')
-rw-r--r-- | src/plugins/noTrack.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/plugins/noTrack.ts b/src/plugins/noTrack.ts new file mode 100644 index 0000000..6d3a0ba --- /dev/null +++ b/src/plugins/noTrack.ts @@ -0,0 +1,31 @@ +import definePlugin from "../utils/types"; +import { findByProps } from "../utils/webpack"; + +const DO_NOTHING = () => void 0; + +export default definePlugin({ + name: "NoTrack", + description: "Disable Discord's tracking and crash reporting", + author: "Vendicated", + 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__; + } + } + +});
\ No newline at end of file |