Skip to content

feat: toggle Developer Tools (Cmd+I)#3928

Merged
esengine merged 1 commit into
esengine:main-v2from
ttmouse:pr/devtools
Jun 11, 2026
Merged

feat: toggle Developer Tools (Cmd+I)#3928
esengine merged 1 commit into
esengine:main-v2from
ttmouse:pr/devtools

Conversation

@ttmouse

@ttmouse ttmouse commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Add a native menu item "Toggle Developer Tools" (Cmd+I) that opens the WebKit Inspector via runtime.WindowExecJS with the wails:openInspector protocol.

@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09f02c16de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/menu.go
Comment on lines +30 to +32
fileMenu.AddText("Toggle Developer Tools", keys.CmdOrCtrl("i"), func(_ *menu.CallbackData) {
if a.ctx != nil {
runtime.WindowExecJS(a.ctx, `window.webkit.messageHandlers.external.postMessage("wails:openInspector");`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate the devtools menu to builds where it works

On macOS release builds produced by scripts/desktop-build.sh (lines 42-49 pass no -devtools/debug tag), this menu item is still shown but the Wails wails:openInspector handler resolves to the production Darwin inspector stub, so File > Toggle Developer Tools / Cmd+I silently does nothing for shipped apps. Please either add the Wails devtools build flag for builds where this should be available, or hide/gate this menu entry to dev/debug builds so the user-facing menu does not expose a dead command.

Useful? React with 👍 / 👎.

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful escape hatch — wails:openInspector via the external message handler is the known WKWebView trick for opening the inspector outside dev mode. Worth noting for the record: window.webkit only exists on macOS, so on Windows/Linux this menu entry is a silent no-op (WebView2 users still have their own F12 path in dev builds). Fine as-is for a macOS debugging aid. Merging, thanks!

@esengine esengine merged commit cc1023c into esengine:main-v2 Jun 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants