-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Labels
35-x-ybug 🪲component/webcontentscrash 💥has-repro-gistIssue can be reproduced with code at https://gist.github.com/Issue can be reproduced with code at https://gist.github.com/platform/allstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
35.7
What operating system(s) are you using?
Ubuntu
Operating System Version
Ubuntu 24.04
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
No
Actual Behavior
This code:
const webContents = this.webContentsView.webContents;
console.log("webContents.isDestroyed():", webContents.isDestroyed());
console.log("webContents.isDevToolsOpened()", webContents.isDevToolsOpened());
Results in:
webContents.isDestroyed(): false
<crash>
The original code was more like this: if (!webContents.isDestroyed() && webContents.isDevToolsOpened()) {..}
, and crashes as well.
The underlying web Contents has likely called "window.close()".
Its called from an "blur" event listener:
webContentsView.webContents.on("blur", () => {..});
Expected Behavior
It should not crash..
Testcase Gist URL
https://gist.github.com/b797e4f192345ed19276e39a3bc72ac5
Additional Information
No response
Metadata
Metadata
Assignees
Labels
35-x-ybug 🪲component/webcontentscrash 💥has-repro-gistIssue can be reproduced with code at https://gist.github.com/Issue can be reproduced with code at https://gist.github.com/platform/allstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature