chore: use setWindowOpenHandler over 'new-window' event as it has bee… #27256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…n deprecated in Electron v13 and removed in Electron v22
Additional details
In order to upgrade Electron past v21, Cypress needs to replace the deprecated
new-window
event handler for the preferredsetWindowOpenHandler
. Thenew-window
event was deprecated in Electronv13
and was removed inv22
. This PR maintains that functionality with the new preferred method.Steps to test
How has the user experience changed?
open-new-window.mp4
UX should not change here, as windows can still be opened (in this case with
modifyObstructiveCode: false
). Cypress, when receiving the window open event wishes to create the child window off the parent in order to decorate the window with necessary events. Because of this, we want to deny opening the new window. We were previously doing this by leveraginge.preventDefault()
and settingnewGuest
on the event. The same functionality is now accomplished withaction: 'deny'
.Please see Electron PRs and Documentation for more info:
PR Tasks
cypress-documentation
?type definitions
?