diff --git a/injector/src/index.js b/injector/src/index.js index c881f953..d5a8d30e 100644 --- a/injector/src/index.js +++ b/injector/src/index.js @@ -1,7 +1,4 @@ -import fs from "fs"; -import path from "path"; import {app} from "electron"; -import Module from "module"; import ipc from "./modules/ipc"; import BrowserWindow from "./modules/browserwindow"; @@ -19,8 +16,7 @@ if (!process.argv.includes("--vanilla")) { // Remove CSP immediately on linux since they install to discord_desktop_core still - if (process.platform == "win32" || process.platform == "darwin") app.once("ready", CSP.remove); - else CSP.remove(); + CSP.remove(); } // Enable DevTools on Stable. @@ -36,17 +32,6 @@ Object.defineProperty(global, "appSettings", { }, }); -// Use Discord's info to run the app -if (process.platform == "win32" || process.platform == "darwin") { - const appAsar = path.join(app.getAppPath(), "..", "app.asar"); - const discordAsar = path.join(app.getAppPath(), "..", "discord.asar"); - const basePath = fs.existsSync(discordAsar) ? discordAsar : appAsar; - const pkg = __non_webpack_require__(path.join(basePath, "package.json")); - app.setAppPath(basePath); - app.name = pkg.name; - Module._load(path.join(basePath, pkg.main), null, true); -} - // Needs to run this after Discord but before ready() if (!process.argv.includes("--vanilla")) { const BetterDiscord = require("./modules/betterdiscord").default; diff --git a/injector/src/modules/betterdiscord.js b/injector/src/modules/betterdiscord.js index 1f116f2d..1ab48845 100644 --- a/injector/src/modules/betterdiscord.js +++ b/injector/src/modules/betterdiscord.js @@ -46,16 +46,6 @@ export default class BetterDiscord { if (!fs.existsSync(path.join(dataPath, "themes"))) fs.mkdirSync(path.join(dataPath, "themes")); } - static async ensureWebpackModules(browserWindow) { - await browserWindow.webContents.executeJavaScript(`new Promise(resolve => { - const check = function() { - if (window.webpackJsonp && window.webpackJsonp.flat().flat().length >= 7000) return resolve(); - setTimeout(check, 100); - }; - check(); - });`); - } - static async injectRenderer(browserWindow) { const location = path.join(__dirname, "renderer.js"); if (!fs.existsSync(location)) return; // TODO: cut a fatal log