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,6 +12,7 @@ Object.defineProperty(window, "webpackJsonp", {
electron.webFrame.top.context.global = electron.webFrame.top.context; electron.webFrame.top.context.global = electron.webFrame.top.context;
electron.webFrame.top.context.require = require; electron.webFrame.top.context.require = require;
electron.webFrame.top.context.process = process; electron.webFrame.top.context.process = process;
electron.webFrame.top.context.Buffer = Buffer;
// Load Discord's original preload // Load Discord's original preload
const preload = process.env.DISCORD_PRELOAD; const preload = process.env.DISCORD_PRELOAD;

View File

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