From 967229fea8ed4fd791db21598399caf71e828a97 Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 10 Jun 2022 09:08:29 +0100 Subject: [PATCH] [NoTrack] Fallback/more disabling of Sentry in inject --- src/mainWindow.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mainWindow.js b/src/mainWindow.js index 62088b9..ba04da5 100644 --- a/src/mainWindow.js +++ b/src/mainWindow.js @@ -1,6 +1,12 @@ if ('' === 'true') { // Disable sentry try { window.__SENTRY__.hub.getClient().getOptions().enabled = false; + + window.__SENTRY__.hub.getClient().close(); + window.__SENTRY__.hub.getScope().clear(); + + window.__SENTRY__.hub.addBreadcrumb = () => {}; + Object.keys(console).forEach(x => console[x] = console[x].__sentry_original__ ?? console[x]); } catch { } }