Skip to content

Commit 1ba4d93

Browse files
feat: disable sentry (#663)
* feat: disable sentry * fix: block sentry asset file on other clients --------- Co-authored-by: Federico Di Leo <38290480+FedeIlLeone@users.noreply.github.com>
1 parent 5ebd1fb commit 1ba4d93

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/main/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ async function loadReactDevTools(): Promise<void> {
117117
electron.app.once("ready", () => {
118118
electron.session.defaultSession.webRequest.onBeforeRequest(
119119
{
120-
urls: ["https://*/api/v*/science", "https://*/api/v*/metrics", "https://sentry.io/*"],
120+
urls: [
121+
"https://*/api/v*/science",
122+
"https://*/api/v*/metrics",
123+
"https://*/api/v*/metrics/*",
124+
"https://sentry.io/*",
125+
"https://discord.com/assets/sentry.*.js",
126+
"https://*.discord.com/assets/sentry.*.js",
127+
],
121128
},
122129
function (_details, callback) {
123130
callback({ cancel: true });
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Injector } from "../../modules/injector";
2+
import { filters, getFunctionKeyBySource, waitForModule } from "../../modules/webpack";
3+
4+
const injector = new Injector();
5+
6+
export async function start(): Promise<void> {
7+
const clientCheckerMod = await waitForModule<Record<string, () => boolean>>(
8+
filters.bySource(".$||"),
9+
);
10+
const clientCheckerKey = getFunctionKeyBySource(clientCheckerMod, ".$||")!;
11+
12+
injector.instead(clientCheckerMod, clientCheckerKey, () => false);
13+
}
14+
15+
export function stop(): void {
16+
injector.uninjectAll();
17+
}

src/renderer/managers/coremods.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export namespace coremods {
2929
export let notices: Coremod;
3030
export let contextMenu: Coremod;
3131
export let language: Coremod;
32+
export let notrack: Coremod;
3233
export let rpc: Coremod;
3334
export let watcher: Coremod;
3435
export let commands: Coremod;
@@ -54,6 +55,7 @@ export async function startAll(): Promise<void> {
5455
coremods.notices = await import("../coremods/notices");
5556
coremods.contextMenu = await import("../coremods/contextMenu");
5657
coremods.language = await import("../coremods/language");
58+
coremods.notrack = await import("../coremods/notrack");
5759
coremods.rpc = await import("../coremods/rpc");
5860
coremods.watcher = await import("../coremods/watcher");
5961
coremods.commands = await import("../coremods/commands");

0 commit comments

Comments
 (0)