Skip to content

Commit 2776616

Browse files
author
paulgo
committed
Fixes for the new version of electron
1 parent a90df26 commit 2776616

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

core/!.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
namespace Moduless
44
{
55
export const inElectronMain =
6-
typeof process === "object" &&
7-
"electronBinding" in process &&
8-
typeof window === "undefined" &&
9-
typeof postMessage === "undefined";
6+
typeof process !== "undefined" &&
7+
(window.process as any).type !== "renderer";
108

119
export const inElectronRender =
12-
typeof process === "object" &&
13-
"electronBinding" in process &&
14-
typeof window !== "undefined" &&
15-
typeof postMessage === "function";
10+
typeof window !== "undefined" &&
11+
typeof window.process === "object" &&
12+
(window.process as any).type === "renderer";
1613

1714
export const inNode =
1815
!inElectronMain &&
1916
!inElectronRender &&
2017
typeof process === "object" &&
21-
"binding" in process;
18+
process.release.name === "node";
2219

2320
/**
2421
* Gets whether the host environment is a browser, whether that is

core/Zenith.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Moduless
44
/** */
55
function runFromCommandLine()
66
{
7-
const cli = require("cac")() as
7+
const cli = require("cac")() as
88
ReturnType<typeof import("../node_modules/cac/types/index").cac>;
99

1010
cli
@@ -159,6 +159,7 @@ namespace Moduless
159159
webPreferences: {
160160
enableRemoteModule: true,
161161
nodeIntegration: true,
162+
contextIsolation: false,
162163
webSecurity: false,
163164
devTools: true
164165
}

0 commit comments

Comments
 (0)