Skip to content

Commit 148d4bc

Browse files
Maintenance: Update to Electron 10.1.5
1 parent 28203a5 commit 148d4bc

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"version": "2.2.0",
44
"main": "src/main.js",
55
"devDependencies": {
6-
"electron": "^3.1.8"
6+
"electron": "^10.1.5"
77
}
88
}

app/src/main.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ let applyPreferences = (prefs) => {
9494

9595
let prefWindow = null
9696
let 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.
120124
let 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

app/worksheet.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
5+
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
56

67
<link rel="stylesheet" href="vendor/FiraCode_1.203/fira_code.css">
78
<link rel="stylesheet" href="vendor/codemirror-5.6.css">

0 commit comments

Comments
 (0)