Skip to content

Commit

Permalink
Fix broken patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Jun 28, 2024
1 parent 96873cc commit df6ffd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
27 changes: 12 additions & 15 deletions src/plugins/_core/noTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@

import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";

// FIXME Do this without monkey patching maybe
Object.defineProperty(window, "DiscordSentry", {
configurable: true,
set(v) { }
});
import definePlugin, { OptionType, StartAt } from "@utils/types";

const settings = definePluginSettings({
disableAnalytics: {
Expand Down Expand Up @@ -52,13 +46,6 @@ export default definePlugin({
replace: "()=>{}",
},
},
{
find: "window.DiscordSentry=",
replacement: {
match: /^.+$/,
replace: "()=>{}",
}
},
{
find: ".METRICS,",
replacement: [
Expand All @@ -80,5 +67,15 @@ export default definePlugin({
replace: "getDebugLogging(){return false;"
}
},
]
],

startAt: StartAt.Init,
start() {
Object.defineProperty(window, "DiscordSentry", {
configurable: true,
set() {
Reflect.deleteProperty(window, "DiscordSentry");
}
});
}
});
4 changes: 2 additions & 2 deletions src/plugins/showHiddenThings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export default definePlugin({
find: '"pepe","nude"',
predicate: () => settings.store.disableDisallowedDiscoveryFilters,
replacement: {
match: /\?\["pepe",.+?\]/,
replace: "?[]",
match: /(?<=[?=])\["pepe",.+?\]/,
replace: "[]",
},
},
// patch request that queries if term is allowed
Expand Down

0 comments on commit df6ffd9

Please sign in to comment.