diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 5b02132af542..68e772caf3af 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -154,7 +154,7 @@ void BrowserWindow::RenderFrameCreated( } void BrowserWindow::DidFirstVisuallyNonEmptyPaint() { - if (window()->IsVisible()) + if (window()->IsClosed() || window()->IsVisible()) return; // When there is a non-empty first paint, resize the RenderWidget to force diff --git a/spec-main/fixtures/crash-cases/native-window-open-exit/index.html b/spec-main/fixtures/crash-cases/native-window-open-exit/index.html new file mode 100644 index 000000000000..ee82a9694ed5 --- /dev/null +++ b/spec-main/fixtures/crash-cases/native-window-open-exit/index.html @@ -0,0 +1,3 @@ +
+ MAIN PAGE + \ No newline at end of file diff --git a/spec-main/fixtures/crash-cases/native-window-open-exit/index.js b/spec-main/fixtures/crash-cases/native-window-open-exit/index.js new file mode 100644 index 000000000000..4ef61051800a --- /dev/null +++ b/spec-main/fixtures/crash-cases/native-window-open-exit/index.js @@ -0,0 +1,40 @@ +const { app, ipcMain, BrowserWindow } = require('electron'); +const path = require('path'); +const http = require('http'); + +function createWindow () { + const mainWindow = new BrowserWindow({ + webPreferences: { + webSecurity: false, + preload: path.join(__dirname, 'preload.js') + } + }); + + mainWindow.loadFile('index.html'); + mainWindow.webContents.on('render-process-gone', () => { + process.exit(1); + }); +} + +const server = http.createServer((_req, res) => { + res.end('