Fix bugs for plugins and themes

This commit is contained in:
Zack Rauen 2021-04-03 15:56:46 -04:00
parent 826aa7999c
commit 66d8d7a069
2 changed files with 4 additions and 2 deletions

View File

@ -12,14 +12,15 @@ Object.defineProperty(window, "webpackJsonp", {
electron.webFrame.top.context.global = electron.webFrame.top.context;
electron.webFrame.top.context.require = require;
electron.webFrame.top.context.process = process;
electron.webFrame.top.context.Buffer = Buffer;
// Load Discord's original preload
const preload = process.env.DISCORD_PRELOAD;
if (preload) {
// Restore original preload for future windows
process.electronBinding("command_line").appendSwitch("preload", preload);
// Run original preload
try {
const originalKill = process.kill;

View File

@ -55,6 +55,7 @@ export default new class ThemeManager extends AddonManager {
/* Overrides */
getFileModification(module, fileContent, meta) {
meta.css = fileContent;
if (meta.format == "json") meta.css = meta.css.split("\n").slice(1).join("\n");
return `module.exports = ${JSON.stringify(meta)};`;
}