Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use setWindowOpenHandler over 'new-window' event as it has bee… #27256

Merged
merged 1 commit into from Jul 12, 2023

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Jul 10, 2023

…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 preferred setWindowOpenHandler. The new-window event was deprecated in Electron v13 and was removed in v22. 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 leveraging e.preventDefault() and setting newGuest on the event. The same functionality is now accomplished with action: 'deny'.

Please see Electron PRs and Documentation for more info:

PR Tasks

…n deprecated in Electron v13 and removed in Electron v22
@AtofStryker AtofStryker force-pushed the chore/use-set-window-open-handler branch from e620557 to 29fd60e Compare July 10, 2023 18:31
@cypress
Copy link

cypress bot commented Jul 10, 2023

5 flaky tests on run #48698 ↗︎

0 4444 944 0 Flakiness 5

Details:

chore: use setWindowOpenHandler over 'new-window' event as it has been deprecate...
Project: cypress Commit: 29fd60e08b
Status: Passed Duration: 14:17 💡
Started: Jul 10, 2023 7:20 PM Ended: Jul 10, 2023 7:35 PM
Flakiness  commands/net_stubbing.cy.ts • 2 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
... > with `times` > only uses each handler N times Output Video
... > stops waiting when an xhr request is canceled Output Video
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@AtofStryker AtofStryker merged commit a0024e5 into develop Jul 12, 2023
77 of 79 checks passed
@AtofStryker AtofStryker deleted the chore/use-set-window-open-handler branch July 12, 2023 15:02
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 20, 2023

Released in 12.17.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.17.2, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix electron deprecated new-window event
3 participants