[Bug]: Calling session.defaultSession.webRequest.onHeadersReceived after ready and before window creation causes silent crash #42000
Labels
30-x-y
31-x-y
bug 🪲
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
platform/linux
Preflight Checklist
Electron Version
30.0.1
What operating system are you using?
Ubuntu
Operating System Version
PopOS 22.04 (based on Ubuntu)
What arch are you using?
x64
Last Known Working Electron version
29.3.1
Expected Behavior
Once electron's ready event has fired I can setup an onHeadersReceived handler for the default session, prior to creating a window.
Actual Behavior
If a onHeadersReceived is registered after the ready event, but before a window is created, then some time later the window is maximized electron will silently crash; the process will simply exit without any log message.
Testcase Gist URL
https://gist.github.com/RobertWHurst/db17ceefd432ab272c4689991263594e
Additional Information
Possibly related to #41839
Note that creating a window before using onHeadersReceived prevents the crash. To see what I mean, load the electron fiddle linked above, and move createWindow() above the call to onHeadersReceived.
The text was updated successfully, but these errors were encountered: