Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #144 from llyyr/patch-4
Browse files Browse the repository at this point in the history
Update dom_shit.js
  • Loading branch information
joe27g committed Sep 24, 2020
2 parents 71f79a0 + c5a0125 commit a6d2548
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dom_shit.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const path = window.require('path');
const fs = window.require('fs');
const electron = window.require('electron');
electron.contextBridge.exposeInMainWorld = (key, val) => window[key] = val; // Expose DiscordNative
const Module = window.require('module').Module;
Module.globalPaths.push(path.resolve(electron.remote.app.getAppPath(), 'node_modules'));
const currentWindow = electron.remote.getCurrentWindow();
if (currentWindow.__preload) require(currentWindow.__preload);
if (currentWindow.__preload) {
process.electronBinding("command_line").appendSwitch("preload", currentWindow.__preload)
electron.contextBridge.exposeInMainWorld = (key, val) => window[key] = val; // Expose DiscordNative
require(currentWindow.__preload);
}

//Get inject directory
if (!process.env.injDir) process.env.injDir = __dirname;
Expand Down Expand Up @@ -577,4 +580,4 @@ window.BdApi.saveData = function(pluginName, key, data) {
const obj = this.loadPluginSettings(id);
obj[key] = data;
return this.savePluginSettings(id, obj);
}
}

0 comments on commit a6d2548

Please sign in to comment.