Skip to content

Commit 0f41fcb

Browse files
vogellaclaude
authored andcommitted
Add toString() to Browser showing the underlying browser type
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>
1 parent aa1dbb8 commit 0f41fcb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser

bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,4 +1276,11 @@ public void stop () {
12761276
checkWidget();
12771277
webBrowser.stop ();
12781278
}
1279+
1280+
@Override
1281+
public String toString () {
1282+
String base = super.toString ();
1283+
if (webBrowser == null) return base;
1284+
return base + " [" + webBrowser.getBrowserType () + "]";
1285+
}
12791286
}

0 commit comments

Comments
 (0)