List icon Contents

Posted on June 18, 2020

DotNetBrowser 2.1

This update enhances the DotNetBrowser with possibilities of the Chromium 79 and a range of features, adding to the convenience of interaction with the library.

What’s New

Chromium 79

The Chromium engine has been upgraded to version 79.0.3945.130.

Access to Engine options

It got possible to access the Engine options when two or more Engine instances run simultaneously. Now you can easily customize the Engine language, rendering mode and much more.

Flexible interaction with the Element functionality

Emulating user keyboard behaviour for testing or automation purposes became more convenient due Focus() and Blur() methods added to the Element functionality.

IJsFunction

The IJsFunction interface has been added in the JavaScript-.NET Bridge API. Now you can work with the JavaScript functions directly from the .NET code and pass the reference to a function from JavaScript to .NET and vice versa. For example:

IJsFunction alert = frame.ExecuteJavaScript<IJsFunction>("window.alert").Result;
alert?.Invoke(window, "Hello world!");

Fixed issues

  • The ArgumentException occurring when minimizing and restoring a BrowserView instance in WinForms or WPF application using Hardware-accelerated rendering mode.
  • The UnobservedTaskException event being raised intermittently during an Engine instance disposing process.
  • Several Engine instances being able to use the same user data folder.
  • The Tab key not working properly in WinForms applications using the Off-screen rendering mode.
  • The access to media devices (microphone and camera) not working properly.
  • Incorrect BrowserView layout relative to a form when using Hardware-accelerated rendering mode in WinForms applications.
  • The crash occurring if the Engine.Network.AcceptLanguage property is set before creating any Browser instance.
  • The Accept-Language parameter changed by the DotNetBrowser library.

Improvements

  • DotNetBrowser now supports the Global Assembly Cache.
  • DotNetBrowserHostWindow title was removed from the BrowserView control in WPF applications which use Hardware-accelerated rendering mode.
  • The Navigation.LoadUrl() and Frame.LoadUrl() methods do not require the protocol to be specified explicitly anymore. The library uses the same approach to detect the protocol as the one used by Google Chrome in the address bar.
  • The StartDownloadHandler property has been moved from IDownloads to IBrowser interface. Please see the implementation comparison for v2.0 and 2.1:

v2.0

C#

engine.Downloads.StartDownloadHandler = 
    new Handler<StartDownloadParameters, StartDownloadResponse>((p) =>
    {
        return StartDownloadResponse.DownloadTo(Path.Combine(Path.GetTempPath(),
            p.Download.Info.SuggestedFileName));
    });

VB .NET

engine.Downloads.StartDownloadHandler = 
    New Handler(Of StartDownloadParameters, StartDownloadResponse)(Function(p)
        Return StartDownloadResponse.DownloadTo(Path.Combine(Path.GetTempPath(),
            p.Download.Info.SuggestedFileName))
    End Function)

v2.1

C#

browser.StartDownloadHandler = 
    new Handler<StartDownloadParameters, StartDownloadResponse>((p) =>
    {
        return StartDownloadResponse.DownloadTo(Path.Combine(Path.GetTempPath(),
            p.Download.Info.SuggestedFileName));
    });

VB .NET

browser.StartDownloadHandler = 
    New Handler(Of StartDownloadParameters, StartDownloadResponse)(Function(p)
        Return StartDownloadResponse.DownloadTo(Path.Combine(Path.GetTempPath(),
            p.Download.Info.SuggestedFileName))
    End Function)

Dropped functionality

  • The INetwork.TransactionStarted event. You can use the INetwork.StartTransactionHandler instead.
  • The INetwork.BytesReceived event. You can use the INetwork.ResponseBytesReceived event instead.
  • The INetwork.BytesSent event.
  • The Url propertty is no longer available in the CanAccessFileParameters used by INetwork.CanAccessFileHandler.

Request evaluation licence
Download DotNetBrowser 2.1 (.NET Framework)
Download DotNetBrowser 2.1 (.NET Core)

Go Top