Description
I know that there were some changes involved with new window, specifically implementing a new event that is triggered before the window creation, rather than intercepting 'new-window' which is now deprecated. However, 'new-window' itself appears to have some changes.
In my application, I have a preload script that checks the URL that is loaded, and then creates some instances of some different classes, which then associate themselves to the new window. One of those classes calls 'document.body.appendChild()' inside it's constructor. Since upgrading to 12.0.0, that class fails, indicating that 'document.body' is undefined. Reverting to 11.x, this is not an issue.
While I do plan to upgrade to the new event ( #24517 ), where I have no idea if this same code will work yet (but I suspect it won't...), this does indicate that something unexpected has changed in the now deprecated 'new-window' event.
Several other hooks inside code for this project were tentatively driven off of setTimeout() due to lack of being able to find an adequate event to drive them, and I've had to significantly increase their timeout lengths (from 1sec to 2 or 3sec) to make them trigger correctly with the pieces required from the remote app in place. The windows appear to show significantly faster than before, and they are shown on an event inside the node app, driven on the 'ready-to-show' event.
This leads me to believe that something has changed in the timing of these items -- preload code is running before a document.body exists, when previously that was not the case ... perhaps ready-to-show is also firing earlier than before, although it may just be that electron 12 is faster itself, and getting to that point faster, as i haven't noticed any specific code issues related to ready-to-show.. but there's nothing dependent upon that event, either, other than "show"
Preflight Checklist
- [ x] I have read the Contributing Guidelines for this project.
- [ x] I agree to follow the Code of Conduct that this project adheres to.
- [ x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
- Electron Version: 12.0.0
- Operating System: Microsoft Windows [Version 10.0.21318.1000]
- Last Known Working Electron version: 11.x