Skip to content

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

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

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

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 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jun 3, 2026
@MarshallOfSound MarshallOfSound merged commit 6fb8b1a into 42-x-y Jun 3, 2026
76 of 78 checks passed
@MarshallOfSound MarshallOfSound deleted the trop/42-x-y-bp-fix-use-chromium-s-native-devtools-context-menu-and-dialog-paths-1780505287217 branch June 3, 2026 23:58
@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.

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

Labels

42-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