Skip to content

Commit a6bbcf1

Browse files
committed
Use @electron/remote
1 parent c7f11c0 commit a6bbcf1

File tree

5 files changed

+3796
-1550
lines changed

5 files changed

+3796
-1550
lines changed

extwindow.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
const {remote,ipcRenderer} = require('electron');
1+
const {ipcRenderer} = require('electron');
2+
const remote = require('@electron/remote');
3+
const remoteMain = remote.require("@electron/remote/main");
4+
remoteMain.enable(window.webContents);
25

36
window.GitSpeak = {
47
ipc: {

main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
const remoteMain = require('@electron/remote/main');
2+
// remoteMain.enable(window.webContents)
3+
remoteMain.initialize();
4+
15
// Modules to control application life and create native browser window
26
const path = require('path')
37
var fp = require("find-free-port")
@@ -208,6 +212,7 @@ async function setupApplication () {
208212
});
209213

210214
var doc = main.webContents;
215+
remoteMain.enable(doc);
211216
doc.on('will-navigate', function(event, url) {
212217
console.log("will-navigate somewhere?!?",url);
213218
event.preventDefault();

0 commit comments

Comments
 (0)