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 #138 from joe27g/hotfix
Browse files Browse the repository at this point in the history
Updates for Discord's context isolation/bridge
  • Loading branch information
joe27g committed Aug 6, 2020
2 parents 7e89907 + d919aa1 commit 835e7fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions dom_shit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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();
Expand Down
4 changes: 3 additions & 1 deletion injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class BrowserWindow extends electron.BrowserWindow {
// Make sure Node integration is enabled
originalOptions.webPreferences.nodeIntegration = true;
// Make sure remote module is enabled
originalOptions.webPreferences.enableRemoteModule = true;
originalOptions.webPreferences.enableRemoteModule = true;
// Make sure context isolation is disabled
originalOptions.webPreferences.contextIsolation = false;
originalOptions.webPreferences.preload = path.join(process.env.injDir, 'dom_shit.js');
originalOptions.webPreferences.transparency = true;

Expand Down

0 comments on commit 835e7fd

Please sign in to comment.