Skip to content

Show the Discord title bar on WebView2 - #2

Closed
3vcloud wants to merge 1 commit into
mainfrom
graphics-and-link-handling
Closed

3vcloud wants to merge 1 commit into
mainfrom
graphics-and-link-handling

Conversation

@3vcloud

@3vcloud 3vcloud commented Nov 7, 2026

Copy link
Copy Markdown
Member

Summary

  • On Windows the Discord page's title bar never appeared, and the window had no title bar and couldn't be moved. Two causes, both fixed here:
    • PageScript.h posted its host messages through window.webkit.messageHandlers, which WebView2 doesn't have. The messages were dropped, so the page never sent ready. The bridge now uses window.chrome.webview on Windows and keeps webkit on Linux.
    • The script could run before the document had a body, when the navigation completed, and then failed on document.documentElement. It now waits for DOMContentLoaded in that case.
  • The window opens on a loading page (src/LoadingPage.h). It reports ready at once, so the window appears straight away, and then moves on to Discord.

The branch also carries two earlier commits, dc101cf and 4aa18c3, which are already pushed.

Testing

  • Windows (built with build.sh windows):
    • The window appeared 0.8 seconds after launch.
    • After Discord loaded, UI Automation found the Minimise, Maximise and Close buttons on the page.
    • A simulated drag on the title bar moved the window.
  • Not tested: resizing from the edges, the ready message from Discord after this change, and the Linux build.

🤖 Generated with Claude Code

WebView2 has no window.webkit.messageHandlers, so the page's host messages were dropped on Windows and the page never reported
ready. The bridge now uses window.chrome.webview there, and keeps webkit on Linux.

The page script could also run before the document had a body, when the navigation completed, and then failed on
documentElement. It now waits for DOMContentLoaded in that case.

The window opens on a loading page, which reports ready at once and then moves on to Discord, so the window appears straight away.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@3vcloud 3vcloud closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant