Posted on February 17, 2025
DotNetBrowser 3.1.0
Customizing User-Agent Client Hints
Traditionally, the User-Agent
string has been used to retrieve information about a user’s browser or device. However, User-Agent Client Hints offer a more privacy-friendly approach, allowing browsers to limit the amount of information exposed by default. In Chromium, for example, the User-Agent
string now provides only basic details, while more specific data is accessible through the User-Agent Client Hints API.
This version of DotNetBrowser introduces the ability to override the information returned via the User-Agent Client Hints API, giving you full control over what data is shared with websites.
Here’s an example of how to configure custom User-Agent Client Hints programmatically:
UserAgentMetadata userAgentMetadata = new UserAgentMetadata.Builder
{
Platform = "Windows",
FullVersion = "133.0.6943.98",
PlatformVersion = "10.0.0",
BrandVersionList =
{
new UserAgentBrandVersion.Builder
{ Brand = "Chromium", Version = "133" }.Build()
},
BrandFullVersionList =
{
new UserAgentBrandVersion.Builder
{ Brand = "Chromium", Version = "133.0.6943.98" }.Build()
},
}.Build();
browser.UserAgentMetadata = userAgentMetadata;
Context menu items of extensions
Chrome extensions can add menu items to the context menu. We extended ShowContextMenuHandler
to provide access to these menu items when Chromium attempts to show the context menu:
browser.ShowContextMenuHandler =
new Handler<ShowContextMenuParameters, ShowContextMenuResponse>(p =>
{
var extensionMenuItems = p.ExtensionMenuItems;
return ShowContextMenuResponse.Select(extensionMenuItems.First());
});
Quality enhancements
- In the off-screen rendering mode, the autofill suggestions are now accepted properly after selection.
- The WPF
BrowserView
now respects the parent container size properly in the off-screen rendering mode. - In WinUI 3 off-screen, the combo box drop-down now opens and closes properly after moving the application window.
- In WPF off-screen, the keyboard focus now leaves the
BrowserView
after pressing Shift+Tab.
Download DotNetBrowser 3.1.0 (.NET Framework)
Download DotNetBrowser 3.1.0 (.NET Core)
Download DotNetBrowser 3.1.0 (Cross-platform)
Follow @DotNetBrowser to get notified of the library updates.
Subscribe to our RSS feed to get instant updates on new releases.