22const { exec } = require ( 'child_process' ) ;
33const electron = require ( 'electron' ) ;
44const os = require ( 'os' ) ;
5+ const path = require ( 'path' ) ;
56
67const { SCREEN_SHARE_EVENTS_CHANNEL , SCREEN_SHARE_EVENTS , SCREEN_SHARE_GET_SOURCES , TRACKER_SIZE } = require ( './constants' ) ;
78const { isMac } = require ( './utils' ) ;
@@ -95,7 +96,8 @@ class ScreenShareMainHook {
9596 }
9697
9798 // Display always on top screen sharing tracker window in the center bottom of the screen.
98- let display = electron . screen . getPrimaryDisplay ( ) ;
99+ const display = electron . screen . getPrimaryDisplay ( ) ;
100+
99101 this . _screenShareTracker = new electron . BrowserWindow ( {
100102 height : TRACKER_SIZE . height ,
101103 width : TRACKER_SIZE . width ,
@@ -112,10 +114,9 @@ class ScreenShareMainHook {
112114 frame : false ,
113115 show : false ,
114116 webPreferences : {
115- // TODO: these 3 should be removed.
116- contextIsolation : false ,
117- enableRemoteModule : true ,
118- nodeIntegration : true
117+ contextIsolation : true ,
118+ nodeIntegration : false ,
119+ preload : path . resolve ( __dirname , './preload.js' )
119120 }
120121 } ) ;
121122
0 commit comments