Inject failsafe

This commit is contained in:
Jiiks 2018-01-11 01:07:35 +02:00
parent e72fb0d525
commit c8ebe4bfad
3 changed files with 16 additions and 6 deletions

View File

@ -88,10 +88,15 @@ var _require = __webpack_require__(1),
var BetterDiscord = function BetterDiscord() { var BetterDiscord = function BetterDiscord() {
_classCallCheck(this, BetterDiscord); _classCallCheck(this, BetterDiscord);
Logger.log("Test Log"); Logger.log("Init");
}; };
var bdInstance = new BetterDiscord(); if (window.BetterDiscord) {
console.log("Attepting to inject again?");
} else {
var bdInstance = new BetterDiscord();
window.BetterDiscord = {};
}
/***/ }), /***/ }),
/* 1 */ /* 1 */
@ -145,7 +150,7 @@ var Logger = function () {
_createClass(Logger, null, [{ _createClass(Logger, null, [{
key: 'log', key: 'log',
value: function log(message) { value: function log(message) {
console.log(message); console.log('[BetterDiscord] ' + message);
} }
}]); }]);

View File

@ -15,9 +15,14 @@ const { Logger } = require('./modules');
class BetterDiscord { class BetterDiscord {
constructor() { constructor() {
Logger.log("Test Log"); Logger.log("Init");
} }
} }
let bdInstance = new BetterDiscord(); if (window.BetterDiscord) {
console.log("Attepting to inject again?");
} else {
let bdInstance = new BetterDiscord();
window.BetterDiscord = {};
}

View File

@ -13,7 +13,7 @@ const { Module } = require('./modulebase');
class Logger { class Logger {
static log(message) { static log(message) {
console.log(message); console.log(`[BetterDiscord] ${message}`);
} }
} }