Skip to content

Invoking devtools from native menu should open devtools for the focused webContents #45821

@nikwen

Description

@nikwen

Preflight Checklist

Problem Description

When using BaseWindows, the native menu shortcut to invoke the devtools doesn't work (related: #45386).

I took this for granted because a BrowserWindow can have multiple webContents until I saw this comment from @codebytere with regards to the zoom menu items:

The default takes the focused webContents to zoom.

Something like this might work for opening the devtools, too!

Proposed Solution

Open the devtools for the currently focused webContents (if that is technically feasible).

Alternatives Considered

  • Do nothing when the shortcut is clicked.
    • Acceptable, too, especially in situations where a BaseWindow has multiple webContents. However, that approach makes life harder for developers.

Additional Information

Related issue: #45386

Metadata

Metadata

Assignees

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions