Skip to content

Commit 58cf495

Browse files
cherniavskiicodebytere
authored andcommitted
fix: crash and hang demos (electron#429)
* enable node integration * enable node integration
1 parent ccc26eb commit 58cf495

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

renderer-process/windows/process-crash.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ const processCrashBtn = document.getElementById('process-crash')
55

66
processCrashBtn.addEventListener('click', (event) => {
77
const crashWinPath = path.join('file://', __dirname, '../../sections/windows/process-crash.html')
8-
let win = new BrowserWindow({ width: 400, height: 320 })
8+
let win = new BrowserWindow({
9+
width: 400,
10+
height: 320,
11+
webPreferences: {
12+
nodeIntegration: true
13+
}
14+
});
915

1016
win.webContents.on('crashed', () => {
1117
const options = {

renderer-process/windows/process-hang.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ const processHangBtn = document.getElementById('process-hang')
55

66
processHangBtn.addEventListener('click', (event) => {
77
const hangWinPath = path.join('file://', __dirname, '../../sections/windows/process-hang.html')
8-
let win = new BrowserWindow({ width: 400, height: 320 })
8+
let win = new BrowserWindow({
9+
width: 400,
10+
height: 320,
11+
webPreferences: {
12+
nodeIntegration: true
13+
}
14+
});
915

1016
win.on('unresponsive', () => {
1117
const options = {

0 commit comments

Comments
 (0)