add tracking protection
This commit is contained in:
parent
4f98eaf85b
commit
572c57d3a7
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* BetterDiscord Tracking Protection Module
|
||||
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
|
||||
* All rights reserved.
|
||||
* https://betterdiscord.net
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import BuiltinModule from './BuiltinModule';
|
||||
|
||||
import { Patcher, MonkeyPatch, WebpackModules } from 'modules';
|
||||
|
||||
export default new class E2EE extends BuiltinModule {
|
||||
|
||||
get settingPath() {
|
||||
return ['security', 'default', 'tracking-protection'];
|
||||
}
|
||||
|
||||
track(e) {
|
||||
// console.log('Blocked Tracking');
|
||||
}
|
||||
|
||||
enabled(e) {
|
||||
if (Patcher.getPatchesByCaller('BD:TrackingProtection').length) return;
|
||||
MonkeyPatch('BD:TrackingProtection', WebpackModules.getModuleByProps(['track'])).instead('track', this.track);
|
||||
}
|
||||
|
||||
disabled(e) {
|
||||
for (const patch of Patcher.getPatchesByCaller('BD:TrackingProtection')) patch.unpatch();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
export { default as EmoteModule } from './EmoteModule';
|
||||
export { default as ReactDevtoolsModule } from './ReactDevtoolsModule';
|
||||
export { default as VueDevtoolsModule } from './VueDevToolsModule';
|
||||
export { default as TrackingProtection } from './TrackingProtection';
|
||||
|
|
|
@ -149,6 +149,13 @@
|
|||
{
|
||||
"id": "default",
|
||||
"settings": [
|
||||
{
|
||||
"id": "tracking-protection",
|
||||
"type": "bool",
|
||||
"text": "Tracking Protection",
|
||||
"hint": "Completely disabled any Discord tracking",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"id": "e2ee",
|
||||
"type": "bool",
|
||||
|
|
|
@ -12,7 +12,7 @@ import { DOM, BdUI, BdMenu, Modals, Reflection, Toasts } from 'ui';
|
|||
import BdCss from './styles/index.scss';
|
||||
import { Events, CssEditor, Globals, Settings, Database, Updater, ModuleManager, PluginManager, ThemeManager, ExtModuleManager, Vendor, WebpackModules, Patcher, MonkeyPatch, ReactComponents, ReactHelpers, ReactAutoPatcher, DiscordApi, BdWebApi, Connectivity } from 'modules';
|
||||
import { ClientLogger as Logger, ClientIPC, Utils } from 'common';
|
||||
import { EmoteModule, ReactDevtoolsModule, VueDevtoolsModule } from 'builtin';
|
||||
import { EmoteModule, ReactDevtoolsModule, VueDevtoolsModule, TrackingProtection } from 'builtin';
|
||||
import electron from 'electron';
|
||||
import path from 'path';
|
||||
|
||||
|
@ -75,6 +75,7 @@ class BetterDiscord {
|
|||
try {
|
||||
ReactDevtoolsModule.init();
|
||||
VueDevtoolsModule.init();
|
||||
TrackingProtection.init();
|
||||
await Database.init();
|
||||
await Settings.loadSettings();
|
||||
await ModuleManager.initModules();
|
||||
|
|
Loading…
Reference in New Issue