电子退出而无需发出渲染过程 - 件事活动

问题描述 投票:0回答:2

当我按在一个加载的网站上的一个按钮时,电子应用会退出。这显然是一次崩溃,但并未在浏览器(Renderer)或浏览器上发出

BrowserView
render-process-gone
。它只是退出。但是
window-all-closed
被发出

app.on('ready', () => { app.on('render-process-gone', (e, webContents, details) => { console.log('render-process-gone', details); }); const win = new BrowserWindow({ frame: false, webPreferences: { worldSafeExecuteJavaScript: true, nodeIntegration: true, webviewTag: false, enableRemoteModule: false, } }); win.loadURL('file://' + __dirname + '/renderer.html'); const view = new BrowserView({ webPreferences: { preload: 'preload.js' worldSafeExecuteJavaScript: true, nodeIntegration: false, nodeIntegrationInSubFrames: true, enableRemoteModule: false, } }); view.webContents.loadURL('http://website.com'); view.webContents.on('render-process-gone', (e, details) => { console.log('render-process-gone', details); }); win.setBrowserView(view); }); app.on('window-all-closed', () => { console.log('exiting...'); app.quit(); });
有一种方法可以找出可能导致这一点的是什么?

update:我在WebPreferences中添加了
sandbox: true

,现在不再崩溃了!

    

javascript node.js electron
2个回答
4
投票
添加了应用程序上的新事件,以替换
    render-process-gone
  • 事件。 #23560
    添加了新的
    renderer-process-crashed
    事件,以替换崩溃的事件。 #23096
  • ref:
    https://github.com/electron/electron/pull/23096

https://github.com/electron/electron/pull/23560

i我遇到了同样的错误,即使是“渲染器过程”的原因也未定义。只是npm安装电子@最新和sandbox =true.


0
投票
捕获。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.