Skip to content

fix: handle debugger Page.reload via WebContents reload - #51075

Closed
khoi-oai wants to merge 1 commit into
electron:mainfrom
khoi-oai:khoi/debugger-page-reload
Closed

khoi-oai wants to merge 1 commit into
electron:mainfrom
khoi-oai:khoi/debugger-page-reload

Conversation

@khoi-oai

Copy link
Copy Markdown

Description of Change

Handle top-level Page.reload commands sent through webContents.debugger.sendCommand() with Electron's WebContents reload path instead of forwarding raw CDP to the target.

Electron already special-cases Page.reload from the DevTools frontend in InspectableWebContents::DispatchProtocolMessageFromDevToolsFrontend. The debugger API path bypassed that special-case and sent the raw protocol message directly through DevToolsAgentHost::DispatchProtocolMessage.

This matters for guest <webview> contents: raw CDP Page.reload can reload the embedder window instead of only the guest. The new handling preserves ignoreCache and leaves session-targeted commands unchanged.

Checklist

  • Added a regression spec for Page.reload against a <webview> guest
  • Ran Electron test suite locally

Notes

I have not run the Electron test suite locally from this sparse checkout. This patch is based on a downstream repro where webContents.debugger.sendCommand('Page.reload') against a <webview> guest caused the embedder BrowserWindow renderer to reload, while guestWebContents.reload() reloaded only the guest.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR contains unsigned commits. This repository enforces commit signatures
for all incoming PRs. To get your PR merged, please sign those commits
(git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch
(git push --force-with-lease)

For more information on signing commits, see GitHub's documentation on Telling Git about your signing key.

@github-actions github-actions Bot added the needs-signed-commits Currently some or all of the commits in this PR are not signed label Apr 16, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 23, 2026
@MarshallOfSound

Copy link
Copy Markdown
Member

Heads up: Windows CI builds moved to new runners on Monday and the old ones have now been removed. This branch predates that, so its Windows build jobs still point at the old runners and will sit queued forever if CI runs again. Rebasing on main (or "Update branch") picks up the change, nothing else needed.

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

Labels

needs-signed-commits Currently some or all of the commits in this PR are not signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants