Skip to content

fix(electron): do not drop windows that have not navigated while connecting - #43250

Merged
Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
fix-43247
Oct 9, 2026
Merged

Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
fix-43247

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

While connecting, #42936 and #43075 send Inspector.enable to each page. A page without a renderer (crashed or discarded) then reports Inspector.targetCrashed and is dropped instead of stalling the connection. But an Electron window that has not navigated yet has no renderer either. Packaged apps are launched without our loader, so their ready handler creates windows while Playwright is still connecting. Such a window is reported as crashed and dropped, and firstWindow() times out.

  • Do not send Inspector.enable while connecting to Electron.

Ref: #43247

…ecting

When connecting, pages without a renderer are probed with Inspector.enable
and dropped as crashed or discarded. An Electron window that has not
navigated yet has no renderer either, so a packaged app, which creates its
windows while Playwright is still connecting, lost its first window. Only
probe pages that have a url.

Fixes: #43247
@pavelfeldman
Pavel Feldman (pavelfeldman) marked this pull request as ready for review October 9, 2026 16:17
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@pavelfeldman Pavel Feldman (pavelfeldman) changed the title fix(chromium): do not drop windows that have not navigated while connecting fix(electron): do not drop windows that have not navigated while connecting Oct 9, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Instead of checking the target url, do not send Inspector.enable to
Electron windows. An Electron window that has not navigated yet has no
renderer, but it is not crashed.
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit eae2e3f into main Oct 9, 2026
41 of 43 checks passed
Pavel Feldman (pavelfeldman) added a commit that referenced this pull request Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [installation tests] › playwright-electron-should-work.spec.ts:43 › electron should work with special characters in path `@package-installations-ubuntu-latest`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:715 › should indicate current test status `@windows-latest-node22`

52153 passed, 1261 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-core.spec.ts:43 › click button @mcp-windows-latest-firefox

9112 passed, 1495 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failure.

🟢 The failure is a confirmed pre-existing flake

The same Windows Firefox test failed with the same assertion on six other SHAs before this PR and passed on 104 of 111 recent runs. This PR changes Chromium connection and Electron code, not the failing Firefox MCP path.

Details

The CI failure is not likely caused by this PR.

Pre-existing flake / infra

  • [firefox] › mcp/cli-core.spec.ts:43 › click button on mcp-windows-latest-firefox — the test timed out and then failed because expect(received).toBeTruthy() received undefined. The exact test and bot combination failed with the same assertion on six unrelated SHAs, including ae894630 on main before this PR, while passing 104 of 111 recent runs. The PR only changes Electron and Chromium's connect-time Inspector.enable behavior, so it does not reach this Firefox MCP test.

Triaged by the Playwright bot - agent run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants