@@ -94,7 +94,11 @@ let applyPreferences = (prefs) => {
9494
9595let prefWindow = null
9696let menuPreferences = ( item , focusedWindow ) => {
97- win = new BrowserWindow ( { x :20 , y :20 , width : 400 , height : 150 } )
97+ win = new BrowserWindow ( { x :20 , y :20 , width : 400 , height : 150 ,
98+ webPreferences : {
99+ nodeIntegration : true ,
100+ enableRemoteModule : true
101+ } } )
98102
99103 // remember global reference to window, due to garbage collection
100104 prefWindow = win
@@ -118,7 +122,16 @@ let windows = {}
118122
119123// Create a new worksheet window and associate it to a path if necessary.
120124let newWorksheet = ( path ) => {
121- let win = new BrowserWindow ( { x :20 , y :20 , width : 800 , height : 600 } )
125+ let win = new BrowserWindow ( { x : 20 , y : 20 , width : 800 , height : 600 ,
126+ // FIXME: More security consciousness!
127+ // While the interpreter can execute arbitrary Haskell actions,
128+ // we may want to prevent dynamically loaded JavaScript
129+ // from accessing the node.js environment.
130+ webPreferences : {
131+ nodeIntegration : true ,
132+ enableRemoteModule : true
133+ }
134+ } )
122135 let id = win . id
123136
124137 windows [ id ] = win // keep a reference
0 commit comments