Skip to content

Commit

Permalink
fix: crash and hang demos (electron#429)
Browse files Browse the repository at this point in the history
* enable node integration

* enable node integration
  • Loading branch information
cherniavskii authored and codebytere committed Jul 8, 2019
1 parent ccc26eb commit 58cf495
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion renderer-process/windows/process-crash.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ const processCrashBtn = document.getElementById('process-crash')

processCrashBtn.addEventListener('click', (event) => {
const crashWinPath = path.join('file://', __dirname, '../../sections/windows/process-crash.html')
let win = new BrowserWindow({ width: 400, height: 320 })
let win = new BrowserWindow({
width: 400,
height: 320,
webPreferences: {
nodeIntegration: true
}
});

win.webContents.on('crashed', () => {
const options = {
Expand Down
8 changes: 7 additions & 1 deletion renderer-process/windows/process-hang.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ const processHangBtn = document.getElementById('process-hang')

processHangBtn.addEventListener('click', (event) => {
const hangWinPath = path.join('file://', __dirname, '../../sections/windows/process-hang.html')
let win = new BrowserWindow({ width: 400, height: 320 })
let win = new BrowserWindow({
width: 400,
height: 320,
webPreferences: {
nodeIntegration: true
}
});

win.on('unresponsive', () => {
const options = {
Expand Down

0 comments on commit 58cf495

Please sign in to comment.