Inject failsafe
This commit is contained in:
parent
e72fb0d525
commit
c8ebe4bfad
|
@ -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);
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -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 = {};
|
||||||
|
}
|
|
@ -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}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue