BetterDiscordApp-v2/client/src/builtin/TrackingProtection.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-08-09 12:04:19 +02:00
/**
* 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';
2018-08-25 16:01:37 +02:00
import { Reflection } from 'modules';
2018-08-09 12:04:19 +02:00
export default new class TrackingProtection extends BuiltinModule {
2018-08-09 12:04:19 +02:00
/* Getters */
get moduleName() { return 'TrackingProtection' }
get settingPath() { return ['security', 'default', 'tracking-protection'] }
/* Patches */
applyPatches() {
if (this.patches.length) return;
const TrackingModule = Reflection.module.byProps('track');
if (!TrackingModule) {
this.warn('Tracking module not found!');
return;
}
this.patch(TrackingModule, 'track', this.track, 'instead');
2018-08-09 12:04:19 +02:00
}
track(e) {
this.debug('Tracking blocked');
2018-08-09 12:04:19 +02:00
}
}