Migrating DotNetBrowser from 2.7 to 2.8

In this migration guide we describe what API has been removed/changed in 2.8 and what alternatives you should use instead.

Updated API

v2.7 Previously, it was necessary to pass the web page URL when setting a cookie:

Cookie cookie = new Cookie.Builder
{
    Name = "name",
    Value = "value",
    DomainName = ".google.com",
    Path = "/"
}.Build();
bool success = engine.CookieStore.SetCookie("https://www.google.com",cookie).Result;
engine.CookieStore.Flush();

v2.8

ICookieStore.SetCookie() now has no URL parameter, as it was previously used for validation purposes only:

Cookie cookie = new Cookie.Builder(".google.com")
{
    Name = "name",
    Value = "value",
    Path = "/"
}.Build();
bool success = engine.CookieStore.SetCookie(cookie).Result;
engine.CookieStore.Flush();

Specifying the domain name is now required. In addition, ICookieStore.Delete() now returns a Task instead of Task<bool>.

Go Top