File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 3
3
namespace Moduless
4
4
{
5
5
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" ;
10
8
11
9
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" ;
16
13
17
14
export const inNode =
18
15
! inElectronMain &&
19
16
! inElectronRender &&
20
17
typeof process === "object" &&
21
- "binding" in process ;
18
+ process . release . name === "node" ;
22
19
23
20
/**
24
21
* Gets whether the host environment is a browser, whether that is
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ namespace Moduless
4
4
/** */
5
5
function runFromCommandLine ( )
6
6
{
7
- const cli = require ( "cac" ) ( ) as
7
+ const cli = require ( "cac" ) ( ) as
8
8
ReturnType < typeof import ( "../node_modules/cac/types/index" ) . cac > ;
9
9
10
10
cli
@@ -159,6 +159,7 @@ namespace Moduless
159
159
webPreferences : {
160
160
enableRemoteModule : true ,
161
161
nodeIntegration : true ,
162
+ contextIsolation : false ,
162
163
webSecurity : false ,
163
164
devTools : true
164
165
}
You can’t perform that action at this time.
0 commit comments