Add toString() to Browser showing the underlying browser type#3259
Merged
vogella merged 1 commit intoApr 25, 2026
Conversation
Contributor
Override Browser.toString() to append the active browser backend (e.g. "webkit", "edge", "ie", "safari") returned by getBrowserType(). This makes it easy to see in the debugger or in logs which native browser implementation a Browser instance is using, without having to drill into the internal webBrowser field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2ec0b30 to
0f41fcb
Compare
HeikoKlare
approved these changes
Apr 24, 2026
HeikoKlare
left a comment
Contributor
There was a problem hiding this comment.
The change looks fine to me. Did you follow the test plan already? I don't see why it shouldn't work but probably still good to once test that the browser type is properly embedded into the toString() representation.
Contributor
Author
|
Browser {} [layout=null] [webkit] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Browser.toString()to append the active browser backend (e.g.webkit,edge,ie,safari) returned bygetBrowserType().Browserinstance is using, both in the debugger and in log output, without having to drill into the internalwebBrowserfield.webBrowser.getBrowserType()directly (with a null guard) instead of the publicgetBrowserType()method, because the public method callscheckWidget()whichtoString()is not expected to trigger (e.g. when called on a disposed widget or from a non-UI thread, mirroringWidget.toString()behavior).Test plan
Browserand inspect/print it; the result should look likeBrowser {} [webkit](or the corresponding backend on Windows/macOS).Browserand confirmtoString()does not throw.🤖 Generated with Claude Code