Skip to content

fix: use Chromium's native DevTools context menu and dialog paths#51863

Merged
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-use-chromium-s-native-devtools-context-menu-and-dialog-paths-1780505286436
Jun 3, 2026
Merged

fix: use Chromium's native DevTools context menu and dialog paths#51863
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-use-chromium-s-native-devtools-context-menu-and-dialog-paths-1780505286436

Conversation

@trop

@trop trop Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Backport of #51805

See that PR for details.

Notes: Fixed the context menu in a detached DevTools window focusing the inspected page's window instead of the DevTools window.

Previously DevTools context menus were implemented by overriding
InspectorFrontendHost.showContextMenuAtPoint in JS and popping an
Electron Menu on the inspected page's BrowserWindow. Since a detached
DevTools window is not an Electron window, the menu was always anchored
to (and focused) the inspected page's window.

Remove the JS overrides and let Blink's native
DevToolsHost.showContextMenuAtPoint path run instead: menu items arrive
via WebContentsDelegate::HandleContextMenu and are shown as a native
menu anchored to whichever widget hosts the DevTools view, with
selections routed back through ExecuteCustomContextMenuCommand /
NotifyContextMenuClosed. window.confirm in DevTools now works through a
JavaScriptDialogManager on InspectableWebContents.

Co-authored-by: Samuel Attard <sattard@anthropic.com>
@trop trop Bot requested a review from a team as a code owner June 3, 2026 16:48
@trop trop Bot requested a review from MarshallOfSound June 3, 2026 16:48
@trop trop Bot added 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jun 3, 2026
@MarshallOfSound MarshallOfSound merged commit c9bef8b into 43-x-y Jun 3, 2026
75 of 78 checks passed
@release-clerk

release-clerk Bot commented Jun 3, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed the context menu in a detached DevTools window focusing the inspected page's window instead of the DevTools window.

@MarshallOfSound MarshallOfSound deleted the trop/43-x-y-bp-fix-use-chromium-s-native-devtools-context-menu-and-dialog-paths-1780505286436 branch June 3, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant