diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 655b74f..8273b7c 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -11,7 +11,7 @@ { "name": "dotnetbrowser", "source": "./", - "description": "Official TeamDev skill for DotNetBrowser 4.3.4, the Chromium-based browser component for .NET (WPF, Windows Forms, WinUI 3, Avalonia UI, console). Coding guidance, full API reference, and offline docs, release notes, and migration guides.", + "description": "Official TeamDev skill for DotNetBrowser 4.3.5, the Chromium-based browser component for .NET (WPF, Windows Forms, WinUI 3, Avalonia UI, console). Coding guidance, full API reference, and offline docs, release notes, and migration guides.", "author": { "name": "TeamDev" }, diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 89eaaf2..961a005 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,8 +1,8 @@ { "name": "dotnetbrowser", "displayName": "DotNetBrowser", - "version": "4.3.4", - "description": "Official TeamDev skill for DotNetBrowser 4.3.4, the Chromium-based browser component for .NET (WPF, Windows Forms, WinUI 3, Avalonia UI, console). Coding guidance, full API reference, and offline docs, release notes, and migration guides.", + "version": "4.3.5", + "description": "Official TeamDev skill for DotNetBrowser 4.3.5, the Chromium-based browser component for .NET (WPF, Windows Forms, WinUI 3, Avalonia UI, console). Coding guidance, full API reference, and offline docs, release notes, and migration guides.", "author": { "name": "TeamDev", "url": "https://teamdev.com/dotnetbrowser" diff --git a/README.md b/README.md index 51b74d9..01d23a0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ DotNetBrowser code: choosing NuGet packages, engine and browser lifecycle, `BrowserView`, handlers and events, navigation, DOM access, the JavaScript bridge, printing, network interception, deployment, and licensing. It bundles the full API reference and an offline copy of the guides, release notes, migration guides, -and blog for **DotNetBrowser 4.3.4**, so the agent answers from documentation that +and blog for **DotNetBrowser 4.3.5**, so the agent answers from documentation that matches the version rather than from memory. ## Install diff --git a/skills/dotnetbrowser/SKILL.md b/skills/dotnetbrowser/SKILL.md index 23f58ef..d4fa2ee 100644 --- a/skills/dotnetbrowser/SKILL.md +++ b/skills/dotnetbrowser/SKILL.md @@ -1,11 +1,11 @@ --- name: dotnetbrowser -description: Use when writing, reviewing, or debugging .NET code that embeds a Chromium browser with DotNetBrowser (WPF, Windows Forms, WinUI 3, Avalonia UI, or headless/console) - choosing NuGet packages, engine and browser lifecycle, BrowserView, handlers and events, navigation, DOM, JavaScript bridge, printing, network interception, deployment, licensing, and API lookups. Bundles API references and an offline snapshot of the guides, release notes, migration guides, and blog for DotNetBrowser 4.3.4. +description: Use when writing, reviewing, or debugging .NET code that embeds a Chromium browser with DotNetBrowser (WPF, Windows Forms, WinUI 3, Avalonia UI, or headless/console) - choosing NuGet packages, engine and browser lifecycle, BrowserView, handlers and events, navigation, DOM, JavaScript bridge, printing, network interception, deployment, licensing, and API lookups. Bundles API references and an offline snapshot of the guides, release notes, migration guides, and blog for DotNetBrowser 4.3.5. metadata: product: DotNetBrowser - product-version: "4.3.4" - chromium-version: "156.0.8078.48" - generated: "2026-10-22" + product-version: "4.3.5" + chromium-version: "156.0.8078.74" + generated: "2026-10-28" --- # DotNetBrowser @@ -17,9 +17,9 @@ the DOM, JavaScript, the network, printing, and more. Using it requires a license key; a free 30-day evaluation license is available from https://www.teamdev.com/dotnetbrowser#evaluate. -This skill describes DotNetBrowser 4.3.4 (Chromium -156.0.8078.48). Everything here was generated from the product on -2026-10-22. Prefer the bundled references over memory: the API changes +This skill describes DotNetBrowser 4.3.5 (Chromium +156.0.8078.74). Everything here was generated from the product on +2026-10-28. Prefer the bundled references over memory: the API changes between major versions, and code written for DotNetBrowser 1.x or 2.x is mostly wrong for 4.x. @@ -34,7 +34,7 @@ file. | `references/api/INDEX.md` | Find a covered public type: namespace, kind, one-line summary, file name. | | `references/api/..md` | Complete members of one type (587 types): signatures, remarks, parameters. | | `references/site/INDEX.md` | Find a guide, quick start, tutorial, release note, migration guide, or blog post. | -| `references/site/**/index.md` | The pages themselves (140 pages), with C# and VB.NET samples. | +| `references/site/**/index.md` | The pages themselves (142 pages), with C# and VB.NET samples. | | `references/site/llms.txt` | The same list with live URLs, for when a newer page might exist online. | Workflow for most tasks: @@ -42,7 +42,7 @@ Workflow for most tasks: 1. Check the project's DotNetBrowser package version, target framework, and UI framework version (including centrally managed package versions). Preserve them unless the task calls for an upgrade. If the package version differs - from 4.3.4, verify APIs against that version's documentation + from 4.3.5, verify APIs against that version's documentation or installed assemblies before using these references. 2. Read every topic note below that matches the task. 3. Search `references/site/INDEX.md` for the needed topic, then read the @@ -210,4 +210,4 @@ All pages below are under `references/site/docs/guides/`. | Pop-ups, dialogs, context menu, downloads, permissions | `gs/popups/`, `gs/dialogs/`, `gs/context-menu/`, `gs/downloads/`, `gs/permissions/` | | Deployment, Chromium binaries, trimming and Native AOT | `gs/deployment/index.md`, `gs/chromium/index.md`, `gs/aot-support/index.md` | | Logging, common exceptions, startup failures, crashes | `troubleshoot/logging/index.md`, `troubleshoot/common-exceptions/index.md`, `troubleshoot/startup-failure/index.md`, `troubleshoot/unexpected-termination/index.md` | -| Migrating from 3.x, from CefSharp or WebView2 | `../../migration/from-v3-to-v4/overview/index.md`, `../../blog/migrating-from-cefsharp-to-dotnetbrowser/index.md`, `../../blog/from-webview2-to-dotnetbrowser-part-1/index.md` | +| Migrating from 3.x, from CefSharp or WebView2 | `../../migration/from-v3-to-v4/overview/index.md`, `../../blog/migrating-from-cefsharp-to-dotnetbrowser/index.md`, `../../blog/from-webview2-to-dotnetbrowser-part-1/index.md`, `../../blog/from-webview2-to-dotnetbrowser-part-2/index.md` | diff --git a/skills/dotnetbrowser/references/api/INDEX.md b/skills/dotnetbrowser/references/api/INDEX.md index 52a073b..be2dffc 100644 --- a/skills/dotnetbrowser/references/api/INDEX.md +++ b/skills/dotnetbrowser/references/api/INDEX.md @@ -1,6 +1,6 @@ # DotNetBrowser API index -DotNetBrowser 4.3.4, generated 2026-10-22. 587 types in 93 namespaces. Every file in this directory is one public type with all of its members. Find the type below and open the file from the last column; the namespace page lists the same types with their summaries. +DotNetBrowser 4.3.5, generated 2026-10-28. 587 types in 93 namespaces. Every file in this directory is one public type with all of its members. Find the type below and open the file from the last column; the namespace page lists the same types with their summaries. ## DotNetBrowser diff --git a/skills/dotnetbrowser/references/lookup.md b/skills/dotnetbrowser/references/lookup.md index e759197..04dccf7 100644 --- a/skills/dotnetbrowser/references/lookup.md +++ b/skills/dotnetbrowser/references/lookup.md @@ -55,7 +55,7 @@ live-only links (FAQ, Roadmap). Pages are the raw Markdown of the site: empty. The surrounding text describes what they showed. - Samples come in C# and VB.NET pairs; use whichever matches the project. - Release notes are under `references/site/releases/`; a version newer than - 4.3.4 may exist online. Use the URLs in + 4.3.5 may exist online. Use the URLs in `references/site/llms.txt` (every page is also served as Markdown at that URL) when the user runs a newer version. diff --git a/skills/dotnetbrowser/references/project-setup.md b/skills/dotnetbrowser/references/project-setup.md index b5fba4e..6e91f80 100644 --- a/skills/dotnetbrowser/references/project-setup.md +++ b/skills/dotnetbrowser/references/project-setup.md @@ -8,7 +8,7 @@ Single-platform UI variants exist too, for example `DotNetBrowser.Wpf.x64`. See `references/site/docs/guides/installation/nuget/index.md` for the full list. For a new project using this skill's version, install the matching templates: -`dotnet new install DotNetBrowser.Templates::4.3.4`, then +`dotnet new install DotNetBrowser.Templates::4.3.5`, then `dotnet new dotnetbrowser.wpf.app` (also `winforms`, `winui`, `avalonia`, `avalonia12`, `blazor.avalonia`, `console`). diff --git a/skills/dotnetbrowser/references/site/INDEX.md b/skills/dotnetbrowser/references/site/INDEX.md index 32f87d9..115dc91 100644 --- a/skills/dotnetbrowser/references/site/INDEX.md +++ b/skills/dotnetbrowser/references/site/INDEX.md @@ -1,6 +1,6 @@ # DotNetBrowser documentation index -Snapshot of https://teamdev.com/dotnetbrowser/ taken 2026-10-22 for DotNetBrowser 4.3.4. Local files are relative to this file. Entries without a local file exist only online. Links inside the pages point to the live site; see ../lookup.md for how to resolve them to local files. +Snapshot of https://teamdev.com/dotnetbrowser/ taken 2026-10-28 for DotNetBrowser 4.3.5. Local files are relative to this file. Entries without a local file exist only online. Links inside the pages point to the live site; see ../lookup.md for how to resolve them to local files. ## Overview @@ -96,6 +96,7 @@ Snapshot of https://teamdev.com/dotnetbrowser/ taken 2026-10-22 for DotNetBrowse | Title | Description | Local file | Live URL | |---|---|---|---| +| DotNetBrowser 4.3.5 | DotNetBrowser 4.3.5 - Chromium 156 with Avalonia memory leak fixes. | releases/2026/v4-3-5/index.md | https://teamdev.com/dotnetbrowser/releases/2026/v4-3-5/index.md | | DotNetBrowser 4.3.4 | DotNetBrowser 4.3.4 - Chromium 156 with text input and image fixes. | releases/2026/v4-3-4/index.md | https://teamdev.com/dotnetbrowser/releases/2026/v4-3-4/index.md | | DotNetBrowser 4.3.3 | DotNetBrowser 4.3.3 - Chromium 155 with screen capture fixes. | releases/2026/v4-3-3/index.md | https://teamdev.com/dotnetbrowser/releases/2026/v4-3-3/index.md | | DotNetBrowser 4.3.2 | DotNetBrowser 4.3.2 - Memory management and stability fixes. | releases/2026/v4-3-2/index.md | https://teamdev.com/dotnetbrowser/releases/2026/v4-3-2/index.md | @@ -157,6 +158,7 @@ Snapshot of https://teamdev.com/dotnetbrowser/ taken 2026-10-22 for DotNetBrowse | Embedded browser control for .NET | In this article, we explain the embedded browser controls for .NET: what they are and what they are good for. | blog/embedded-browser-control-for-dotnet/index.md | https://teamdev.com/dotnetbrowser/blog/embedded-browser-control-for-dotnet/index.md | | Embedding a web view into an Excel add-in | Embed a web view into Excel using DotNetBrowser and a COM add-in. | blog/embedding-web-view-to-excel-add-in/index.md | https://teamdev.com/dotnetbrowser/blog/embedding-web-view-to-excel-add-in/index.md | | From WebView2 to DotNetBrowser: Part 1 | This article shows how to migrate existing project from WebView2 to DotNetBrowser. | blog/from-webview2-to-dotnetbrowser-part-1/index.md | https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-1/index.md | +| From WebView2 to DotNetBrowser: Part 2 | This article shows how to migrate proxy, cookies, profiles, context menus, downloads, printing, DevTools, and extensions from WebView2 to DotNetBrowser. | blog/from-webview2-to-dotnetbrowser-part-2/index.md | https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-2/index.md | | How to generate PDF in C# | The step-by-step tutorial on how to generate PDF files in C# with DotNetBrowser. | blog/how-to-generate-pdf-in-c-sharp/index.md | https://teamdev.com/dotnetbrowser/blog/how-to-generate-pdf-in-c-sharp/index.md | | How to render web content as a texture in Unity3D | The step-by-step tutorial on how to render web content as a texture in Unity3D with DotNetBrowser. | blog/how-to-render-web-content-as-a-texture-in-unity3d/index.md | https://teamdev.com/dotnetbrowser/blog/how-to-render-web-content-as-a-texture-in-unity3d/index.md | | How to use a local AI model in DotNetBrowser | This article demonstrates how to use a local AI model in DotNetBrowser applications. | blog/how-to-use-local-llm-in-dotnetbrowser/index.md | https://teamdev.com/dotnetbrowser/blog/how-to-use-local-llm-in-dotnetbrowser/index.md | diff --git a/skills/dotnetbrowser/references/site/blog/chrome-extensions-in-dotnetbrowser/index.md b/skills/dotnetbrowser/references/site/blog/chrome-extensions-in-dotnetbrowser/index.md index f8dbc41..9f87112 100644 --- a/skills/dotnetbrowser/references/site/blog/chrome-extensions-in-dotnetbrowser/index.md +++ b/skills/dotnetbrowser/references/site/blog/chrome-extensions-in-dotnetbrowser/index.md @@ -40,8 +40,8 @@ Here's how to get the demo application: If you already use DotNetBrowser, you can get the latest build from NuGet: ```shell -dotnet add package DotNetBrowser -v "4.3.4" -dotnet add package DotNetBrowser.WPF -v "4.3.4" +dotnet add package DotNetBrowser -v "4.3.5" +dotnet add package DotNetBrowser.WPF -v "4.3.5" ``` ## Install the extension diff --git a/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-1/index.md b/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-1/index.md index 3e0513c..c6364cb 100644 --- a/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-1/index.md +++ b/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-1/index.md @@ -443,7 +443,7 @@ the form boundary plus each part's `Content-Disposition` and `Content-Type`. You can override the default headers and add more in the - + HttpHeaders parameter. diff --git a/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-2/index.md b/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-2/index.md new file mode 100644 index 0000000..0c2ede1 --- /dev/null +++ b/skills/dotnetbrowser/references/site/blog/from-webview2-to-dotnetbrowser-part-2/index.md @@ -0,0 +1,718 @@ +# From WebView2 to DotNetBrowser: Part 2 + +This is the second part of the guide for .NET developers moving from +WebView2 to DotNetBrowser. [Part 1][part-1] covered installation, +initialization, navigation, JavaScript, traffic interception, DOM, dialogs, and +pop-ups. + +This part covers the advanced topics Part 1 promised: proxy and +authentication, cookies and persistent storage, profiles, context menus, +downloads, printing, DevTools, and Chrome extensions. As before, each section +shows the WebView2 code, its DotNetBrowser replacement, +the differences that matter, and a link to the guide. + +Like Part 1, this part is about **how** to migrate. To learn **why**, check out +the [DotNetBrowser or WebView2 article][dotnetbrowser-vs-wv2]. + +The code targets WebView2 SDK 1.0.4258.31 and DotNetBrowser 4.3.3. We ran +every snippet against both libraries, with WebView2 Runtime 155 and +DotNetBrowser's Chromium 155. Part 1 targeted DotNetBrowser 3.3.0; its snippets +need no changes for 4.3.3. + +In the WebView2 snippets, `core` is the control's `CoreWebView2`, and +`view` is the `WebView2` control. In the DotNetBrowser snippets, +`engine` and `browser` are an `IEngine` and an `IBrowser`, as in Part +1; `profile` is an `IProfile`, and `view` is the `BrowserView`. + +## Two recurring differences + +In DotNetBrowser, most settings belong to a profile. The profile owns +proxy settings, cookies, extensions, and network handlers. Every engine has +a default profile, `engine.Profiles.Default`, and you can create more. In +WebView2, the same settings sit in three places: the environment +options, which apply to the whole browser process; +the `CoreWebView2Profile`; and the `CoreWebView2` itself. + +Threading differs too. WebView2 raises its events on the UI thread. +DotNetBrowser calls its handlers and raises its events on background threads, so +the code below uses `Dispatcher` wherever a handler touches WPF +controls. + +![Where WebView2 and DotNetBrowser keep the proxy, profiles, and handlers][img-settings]

Where the settings and the +handlers live.

+ +## API map + +The table below maps each WebView2 API to its DotNetBrowser counterpart, +and the sections after it explain the rows. + +| Feature | WebView2 | DotNetBrowser | +|---|---|---| +| Proxy | `--proxy-server` in `AdditionalBrowserArguments` | `profile.Proxy.Settings` | +| Authentication | `BasicAuthenticationRequested` | `profile.Network.AuthenticateHandler` | +| Client certificates | `ClientCertificateRequested` | `browser.SelectCertificateHandler` | +| Cookies | `CoreWebView2Profile.CookieManager` | `profile.CookieStore` | +| User data | `CreationProperties.UserDataFolder` | `EngineOptions.UserDataDirectory` | +| Profiles | `CreationProperties.ProfileName` | `engine.Profiles.Create()` | +| Context menu | `ContextMenuRequested` | `browser.ShowContextMenuHandler` | +| Downloads | `DownloadStarting` | `browser.StartDownloadHandler` | +| Printing | `PrintAsync()`, `PrintToPdfAsync()` | `RequestPrintHandler`, `PrintHtmlContentHandler`, `PrintPdfContentHandler` | +| DevTools | `OpenDevToolsWindow()` | `browser.DevTools.Show()` | +| Remote debugging | `--remote-debugging-port` | `EngineOptions.RemoteDebuggingPort` | +| Extensions | `Profile.AddBrowserExtensionAsync()` | `profile.Extensions.Install()` | +| Virtual host names | `SetVirtualHostNameToFolderMapping()` | `InterceptRequestHandler` | + +## Proxy + +WebView2 has no proxy API. You pass Chromium's `--proxy-server` +command-line switch through the environment options when you create +the environment: + + +**WebView2** +```csharp +CoreWebView2EnvironmentOptions options = + new CoreWebView2EnvironmentOptions(); +options.AdditionalBrowserArguments = + "--proxy-server=127.0.0.1:5075 " + + "--proxy-bypass-list=<-loopback>"; +return await CoreWebView2Environment.CreateAsync( + null, userDataFolder, options); +``` + + +**DotNetBrowser** +```csharp +IProfile proxied = engine.Profiles.Default; +proxied.Proxy.Settings = + new CustomProxySettings("127.0.0.1:5075", "<-loopback>"); + +IProfile direct = engine.Profiles.Create("direct"); +direct.Proxy.Settings = new DirectProxySettings(); +``` + + + +The switch applies to the whole browser process, so every `WebView2` +control that shares the user data folder goes through the same proxy, +whatever its profile. You also can't change it after the environment +exists. Microsoft's [page on browser flags][webview2-flags] says that apps in +production shouldn't use them. + +In DotNetBrowser, proxy settings belong to a profile and can change at any +time; the next request uses the new settings. To use several proxies +in one application, create a profile for each. Besides a custom proxy, +you can pick `DirectProxySettings`, `AutoDetectProxySettings`, +`SystemProxySettings` (the default), or `PacProxySettings` with +the URL of a proxy auto-config (PAC) script. + +The second argument of `CustomProxySettings` is the bypass list +(addresses that skip the proxy). By default, Chromium in both libraries +sends local addresses directly, not through the proxy. +The `<-loopback>` entry removes that exception, which is why both +snippets include it. See the [guide on proxy][proxy-guide]. + +## Authentication + +In WebView2, the `BasicAuthenticationRequested` event handles +authentication challenges: the requests for a user name and password +that a server or a proxy sends. It covers Basic, Digest, and NTLM. In +DotNetBrowser, the `AuthenticateHandler` of the profile's network does +the same job: + + +**WebView2** +```csharp +core.BasicAuthenticationRequested += (sender, args) => +{ + args.Response.UserName = "demo"; + args.Response.Password = "secret"; +}; +``` + + +**DotNetBrowser** +```csharp +profile.Network.AuthenticateHandler = + new Handler(p => + { + if (!p.IsProxy && p.Realm == "demo") + { + return AuthenticateResponse.Continue("demo", "secret"); + } + return AuthenticateResponse.Cancel(); + }); +``` + + + +The parameters carry the realm, the scheme, the host, and +`IsProxy`, which is `true` for a proxy challenge. The realm is +the name the server gives the protected area; the scheme is +Basic, Digest, or NTLM. + +Without a handler, DotNetBrowser shows the server's 401 (Unauthorized) +page; WebView2, according to Microsoft's docs, shows its own login dialog. If +you want a dialog, the WPF package has one: +`DotNetBrowser.Wpf.Dialogs.DefaultAuthenticationHandler`. + +For client certificates, replace `ClientCertificateRequested` with +`browser.SelectCertificateHandler`. It receives the available certificates +and returns `SelectCertificateResponse.Select()` with one of them. You can also +pass one you load from a PFX file, even if it isn't installed. A PFX +file holds a certificate with its private key. For server certificate +errors, `ServerCertificateErrorDetected` becomes +the `VerifyCertificateHandler` of the network. See the [guide on +authentication][auth-guide] and the [guide on network][network-guide]. + +## Cookies and persistent storage + +Both libraries expose a cookie store per profile. In WebView2, it's +`CoreWebView2Profile.CookieManager`; in DotNetBrowser, `profile.CookieStore`: + + +**WebView2** +```csharp +CoreWebView2CookieManager cookies = core.Profile.CookieManager; +CoreWebView2Cookie extra = + cookies.CreateCookie("extra", "1", "localhost", "/"); +extra.Expires = DateTime.UtcNow.AddDays(30); +cookies.AddOrUpdateCookie(extra); +return await cookies.GetCookiesAsync("http://localhost:5065/"); +``` + + +**DotNetBrowser** +```csharp +Cookie extra = new Cookie.Builder("localhost") +{ + Name = "extra", + Value = "1", + Path = "/", + ExpirationTime = DateTime.UtcNow.AddDays(30) +}.Build(); +await profile.CookieStore.SetCookie(extra); +profile.CookieStore.Flush(); +IEnumerable all = await profile.CookieStore + .GetAllCookies("http://localhost:5065/"); +``` + + + +DotNetBrowser differs in two ways. First, you build a cookie with +`Cookie.Builder`: it takes the domain, and you set the name, value, +path, expiration time, and the secure and HTTP-only flags. Second, after +you change cookies, call `Flush()` to write them to disk. + +If your C# file also imports `System.Net`, add a `using` alias for +`Cookie`, because `System.Net` has a `Cookie` class too. + +In both libraries, a cookie without an expiration time is +a session cookie and doesn't survive a restart. See the [guide on +cookies][cookies-guide]. + +Persistent data lives in the user data folder in both libraries. In +WebView2, you pass it to `CoreWebView2Environment.CreateAsync()`, as in +the proxy snippet above, or set it in the control's +`CreationProperties`. In DotNetBrowser, you set `UserDataDirectory` in +the engine options: + + +**DotNetBrowser** +```csharp +EngineOptions options = new EngineOptions.Builder +{ + RenderingMode = RenderingMode.HardwareAccelerated, + UserDataDirectory = userDataDir, + IncognitoEnabled = incognito +}.Build(); +return EngineFactory.CreateAsync(options); +``` + + + +If you don't set the directory, DotNetBrowser uses a temporary one. +One directory can serve only one engine at a time, even if the second +engine runs in another process. + +To clear data, WebView2 has `Profile.ClearBrowsingDataAsync()` with a set +of data kinds. In DotNetBrowser, clear the stores one by one, through +`CookieStore`, `HttpCache`, and `HttpAuthCache`, or call +`profile.ClearAllData()`. See the [guide on cache][cache-guide]. + +To keep cookies, history, and site data in memory only, set `IncognitoEnabled` +in the engine options, as the snippet above does. This option makes +the default profile incognito; the next section shows how to create +other incognito profiles. + +## Profiles + +In WebView2, you choose the profile when you create the control: set +`ProfileName` and, optionally, `IsInPrivateModeEnabled` in the creation +properties. In DotNetBrowser, profiles are objects you create from +the engine, and each profile creates its own browsers: + + +**WebView2** +```csharp +WebView2 view = new WebView2(); +view.CreationProperties = new CoreWebView2CreationProperties +{ + UserDataFolder = userDataFolder, + ProfileName = profileName, + IsInPrivateModeEnabled = inPrivate +}; +``` + + +**DotNetBrowser** +```csharp +IProfile alpha = engine.Profiles.Create("alpha"); +IProfile beta = engine.Profiles.Create("beta"); +IProfile secret = + engine.Profiles.Create("secret", ProfileType.Incognito); +IBrowser browser = alpha.CreateBrowser(); +bool removed = engine.Profiles.Remove(beta); +``` + + + +In DotNetBrowser, each profile keeps its data in its own folder inside +the user data directory. Besides the settings listed at the start +of this article, it has its own permissions, zoom levels, and spell checker. + +Deleting a profile works differently in the two libraries. +`CoreWebView2Profile.Delete()` closes every `WebView2` control that uses +the profile and removes the profile's folder. `Delete()` works on +the default profile too. + +Microsoft's docs say the folder is removed when the browser process +exits; in our test, it was gone within seconds. Even so, creating a profile +with the same name failed: the error said the folder was still +being deleted. So don't plan to reuse a name within one run of your +application. + +In DotNetBrowser, `engine.Profiles.Remove()` disposes the profile's +browsers immediately and deletes the folder a moment later. +The default profile can't be removed: `Remove()` returns `false`. You can +create a profile with the same name right away; it starts with empty +data. See the [guide on profiles][profile-guide]. + +## Context menus + +WebView2 raises `ContextMenuRequested` with the default items. You can add +your own items to the list, or set `Handled` and show your own menu built +from `MenuItems`. If you build that menu asynchronously, call `GetDeferral()` so +WebView2 waits for your result. DotNetBrowser shows its default menu only inside +a `BrowserView`. To replace it with your own, set `ShowContextMenuHandler` +and build the menu yourself: + + +**WebView2** +```csharp +core.ContextMenuRequested += (sender, args) => +{ + CoreWebView2ContextMenuItem item = + core.Environment.CreateContextMenuItem( + "Say hi", null, + CoreWebView2ContextMenuItemKind.Command); + item.CustomItemSelected += (s, e) => onSelected(); + args.MenuItems.Insert(0, item); +}; +``` + + +**DotNetBrowser** +```csharp +browser.ShowContextMenuHandler = + new AsyncHandler(p => + { + TaskCompletionSource tcs = + new TaskCompletionSource( + TaskCreationOptions.RunContinuationsAsynchronously); + view.Dispatcher.BeginInvoke(new Action(() => + { + ContextMenu menu = new ContextMenu(); + menu.Items.Add(Item("Say hi", sayHi)); + menu.Closed += (s, e) => + tcs.TrySetResult(ShowContextMenuResponse.Close()); + menu.PlacementTarget = view; + menu.Placement = PlacementMode.Relative; + menu.HorizontalOffset = p.Location.X; + menu.VerticalOffset = p.Location.Y; + menu.IsOpen = true; + })); + return tcs.Task; + }); +``` + + + +Here `Item()` is a small helper that creates a `MenuItem` with +a click handler. The `ShowContextMenuHandler` is +an `AsyncHandler`: it builds the menu on the UI thread through +`Dispatcher` and returns a task that completes when the menu closes. +To turn the menu off, return `ShowContextMenuResponse.Close()` right away. + +Unlike WebView2's event args, `ShowContextMenuParameters` doesn't carry +the default items. If your menu needs "Back" or "Reload", you add them +yourself. What the parameters do carry is the context: the link, +the media, the selected text, and the spell-check suggestions. +The [guide on context menus][context-menu-guide] has the details. + +## Downloads + +In WebView2, `DownloadStarting` lets you pick the file path, hide +the default download UI, or cancel, and `CoreWebView2DownloadOperation` +reports progress. In DotNetBrowser, `StartDownloadHandler` makes the same +decision, and the `IDownload` object raises the progress events: + + +**WebView2** +```csharp +core.DownloadStarting += (sender, args) => +{ + args.ResultFilePath = path; + args.Handled = true; + CoreWebView2DownloadOperation download = + args.DownloadOperation; + download.StateChanged += (s, e) => + { + if (download.State != + CoreWebView2DownloadState.InProgress) + { + onFinished(download); + } + }; +}; +``` + + +**DotNetBrowser** +```csharp +browser.StartDownloadHandler = + new Handler(p => + { + IDownload download = p.Download; + download.Finished += (s, e) => finished(download); + string name = download.Info.SuggestedFileName; + return StartDownloadResponse.DownloadTo( + Path.Combine(folder, Path.GetFileName(name))); + }); +``` + + + +`DownloadTo()` takes the absolute path of the file. `IDownload` also +reports progress through `Updated`, and you can pause, resume, or cancel it. + +The default behavior differs. WebView2 downloads to the profile's +download folder and shows its own UI. Without a handler, DotNetBrowser +cancels every download. A `BrowserView` installs its own handler, which +shows a "Save As" dialog. Read more in the [guide on +downloads][downloads-guide]. + +## Printing + +In WebView2, you call a method when you want to print. `PrintAsync()` takes +print settings, `PrintToPdfAsync()` or `PrintToPdfStreamAsync()` produces +a PDF, and `ShowPrintUI()` opens the browser's or the system's +print dialog. + +In DotNetBrowser, you start printing with `browser.MainFrame.Print()`. Every +print request, this call included, goes through `RequestPrintHandler`, where you +cancel it, show the print preview, or continue with +`RequestPrintResponse.Print()`. If you continue, `PrintHtmlContentHandler` runs +next; there you pick the printer and its settings: + + +**WebView2** +```csharp +CoreWebView2PrintSettings settings = + core.Environment.CreatePrintSettings(); +settings.PageRanges = pages; +return await core.PrintToPdfAsync(path, settings); +``` + + +**DotNetBrowser** +```csharp +browser.RequestPrintHandler = + new Handler(p => + RequestPrintResponse.Print()); +browser.PrintHtmlContentHandler = + new Handler(p => + { + PdfPrinter pdf = p.Printers.Pdf; + pdf.PrintJob.Settings.Apply(s => + { + s.PdfFilePath = pdfPath; + s.PageRanges = new[] { pages }; + }); + pdf.PrintJob.PrintCompleted += (s, e) => + done(e.IsCompletedSuccessfully); + return PrintHtmlContentResponse.Print(pdf); + }); +``` + + + +The printers collection has the system default, the built-in PDF +printer, and every installed printer by device name. Each printer reports its +capabilities, such as paper sizes, color modes, and duplex modes, so you can +check them before applying settings. `PrintCompleted` tells you when +the file is written. + +If you don't set a `RequestPrintHandler`, DotNetBrowser cancels every print +request. Inside a `BrowserView`, the default handler shows +the print preview instead. + +In WebView2, `pages` is a string such as `"2-3"`; in +DotNetBrowser, it's a `PageRange`, such as +`new PageRange(2, 3)`. WPF has its own +`System.Windows.Controls.PageRange`, so add a `using` alias. `Apply()` is +an extension method, so add +`using DotNetBrowser.Print.Settings;`. + +There is no stream variant: the PDF printer writes to `PdfFilePath`. When +the browser shows a PDF document rather than a web page, +`PrintPdfContentHandler` runs instead of `PrintHtmlContentHandler`. + +DotNetBrowser has no equivalent of `ShowPrintUI(System)`, the system print +dialog; `RequestPrintResponse.ShowPrintPreview()` shows Chromium's print preview +instead. WebView2, in turn, has no event for `window.print()`: the page +gets the browser's print dialog, and your code receives no notification. In +DotNetBrowser, `window.print()` goes through `RequestPrintHandler` like any +other print request, so a page can't open a dialog you didn't choose. +See the [guide on printing][printing-guide]. + +## DevTools + +Opening DevTools takes one line in both: `OpenDevToolsWindow()` in WebView2, +`browser.DevTools.Show()` in DotNetBrowser. Remote debugging lets another +browser or an automation tool inspect your browser over a port. It +needs the `--remote-debugging-port` switch in WebView2 and +the `RemoteDebuggingPort` engine option in DotNetBrowser: + + +**WebView2** +```csharp +CoreWebView2EnvironmentOptions options = + new CoreWebView2EnvironmentOptions(); +options.AdditionalBrowserArguments = + "--remote-debugging-port=9334"; +return await CoreWebView2Environment.CreateAsync( + null, userDataFolder, options); +// ... +core.OpenDevToolsWindow(); +``` + + +**DotNetBrowser** +```csharp +EngineOptions options = new EngineOptions.Builder +{ + RenderingMode = RenderingMode.HardwareAccelerated, + RemoteDebuggingPort = 9334, + ChromiumSwitches = + { + "--remote-allow-origins=http://localhost:9334" + } +}.Build(); +IEngine engine = await EngineFactory.CreateAsync(options); +IBrowser browser = engine.CreateBrowser(); +browser.DevTools.Show(); +``` + + + +`Show()` opens DevTools in a separate window, and `Hide()` closes it. + +`browser.DevTools.RemoteDebuggingUrl` gives you the address of +the DevTools page for that browser. Load that page in another `IBrowser`, +not in Firefox or any other browser: the [engine +guide][remote-debugging-guide] warns that loading it elsewhere can crash +the DevTools server. The `--remote-allow-origins` switch in +the snippet lets the page connect; without it, the page opens but +reports a closed connection. + +WebView2's `CallDevToolsProtocolMethodAsync()` has no direct equivalent. +The remote debugging port exposes the same DevTools Protocol. +The [DevTools Protocol examples][github-cdp] show how to control +the browser through it with Puppeteer, Playwright, and Selenium. See +the [DevTools section][devtools-guide] of the browser guide. + +## Chrome extensions + +Both libraries install extensions per profile, but from different sources. +WebView2 loads an unpacked extension folder, and only if extensions were +enabled in the environment options. DotNetBrowser installs CRX files, +the packed format used by the Chrome Web Store. It can also let +the user install extensions from the Web Store, if you allow it: + + +**WebView2** +```csharp +CoreWebView2EnvironmentOptions options = + new CoreWebView2EnvironmentOptions(); +options.AreBrowserExtensionsEnabled = true; +CoreWebView2Environment env = + await CoreWebView2Environment.CreateAsync( + null, userDataFolder, options); +await view.EnsureCoreWebView2Async(env); +CoreWebView2Profile profile = view.CoreWebView2.Profile; +return await profile.AddBrowserExtensionAsync(extensionFolder); +``` + + +**DotNetBrowser** +```csharp +IExtension extension = + await profile.Extensions.Install(Path.GetFullPath(crxPath)); +IExtensionAction action = extension.GetAction(browser); +action?.Click(); +await extension.Uninstall(); +``` + + + +`Install()` accepts CRX files only; passing an unpacked folder throws +an exception. Web Store installs go through `InstallExtensionHandler`, +which is your chance to allow or refuse them. + +WebView2 has no API for the extension's toolbar button. In DotNetBrowser, +`extension.GetAction(browser)` gives you the icon, badge, and tooltip, and +`Click()` opens the extension's pop-up. When the browser is in +a `BrowserView`, the pop-up appears as a separate window. + +In the other direction, WebView2 can disable an extension with +`EnableAsync(false)`, while DotNetBrowser can only uninstall it. DotNetBrowser +doesn't support every extension API; the [guide on +extensions][extensions-guide] lists the exceptions. + +## What has no one-to-one equivalent + +Three WebView2 features map to a different mechanism rather than to +a method with the same shape. + +### Synchronous host objects + +Part 1 showed how to inject .NET objects into JavaScript. In WebView2, +synchronous calls go through `chrome.webview.hostObjects.sync`. Calls to +injected DotNetBrowser objects are synchronous from the page's point of +view: `bridge.Add(2, 3)` returns `5`, not a promise. So +`hostObjects.sync` has no counterpart and needs none. One difference remains: +WebView2 runs host object methods on the UI thread; DotNetBrowser runs them +on a background thread, so use `Dispatcher` to touch UI controls. + +### Messages to the page + +WebView2 sends data to the page with `PostWebMessageAsJson()`. +DotNetBrowser has no equivalent: call a JavaScript function instead, with +`ExecuteJavaScript()` or through an `IJsObject`. Part 1 showed +the other direction, how to emulate `WebMessageReceived`. + +### Virtual host names + +WebView2 maps a host name to a folder with +`SetVirtualHostNameToFolderMapping()`. DotNetBrowser serves local files through +the request interception from Part 1: register +an `InterceptRequestHandler` for the `https` URL scheme and answer +requests to your host name from a folder: + + +**WebView2** +```csharp +core.SetVirtualHostNameToFolderMapping( + "app.example", folder, + CoreWebView2HostResourceAccessKind.Allow); +``` + + +**DotNetBrowser** +```csharp +IHandler + handler = new Handler(p => + { + Uri uri = new Uri(p.UrlRequest.Url); + if (uri.Host != "app.example") + { + return InterceptRequestResponse.Proceed(); + } + string root = Path.GetFullPath(folder); + string file = Path.GetFullPath(Path.Combine(root, + Uri.UnescapeDataString(uri.AbsolutePath) + .TrimStart('/'))); + bool found = file.StartsWith( + root + Path.DirectorySeparatorChar, + StringComparison.OrdinalIgnoreCase) + && File.Exists(file); + UrlRequestJobOptions options = new UrlRequestJobOptions + { + HttpStatusCode = found + ? HttpStatusCode.OK + : HttpStatusCode.NotFound, + Headers = new List + { + new HttpHeader("Content-Type", MimeOf(file)) + } + }; + UrlRequestJob job = + p.Network.CreateUrlRequestJob(p.UrlRequest, options); + if (found) + { + job.Write(File.ReadAllBytes(file)); + } + job.Complete(); + return InterceptRequestResponse.Intercept(job); + }); +EngineOptions engineOptions = new EngineOptions.Builder +{ + RenderingMode = RenderingMode.HardwareAccelerated, + Schemes = { { Scheme.Https, handler } } +}.Build(); +``` + + + +`MimeOf()` maps the file extension to a content type. +The `StartsWith()` check rejects every path outside the folder, +including tricks such as `https://app.example/C:/Windows/win.ini`. The set +of intercepted URL schemes is fixed when the engine is created. Every HTTPS +request of every profile passes through the handler, so return `Proceed()` +early for the hosts you don't serve. + +## Conclusion + +Together with Part 1, this guide maps the WebView2 APIs most applications +use to their DotNetBrowser replacements. If your application uses something +neither part covers, write to us at +[https://teamdev.com/contacts](https://teamdev.com/contacts/), and we'll +help. + +The fastest way to check your own application is a [free evaluation +license][evaluate]: + + + +[part-1]: https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-1/ +[dotnetbrowser-vs-wv2]: https://teamdev.com/dotnetbrowser/blog/dotnetbrowser-or-webview2/ +[webview2-flags]: https://learn.microsoft.com/microsoft-edge/webview2/concepts/webview-features-flags +[proxy-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/proxy/ +[auth-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/authentication/ +[network-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/network/#tls +[cookies-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/cookies/ +[cache-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/cache/ +[profile-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/profile/ +[context-menu-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/context-menu/ +[downloads-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/downloads/ +[printing-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/printing/ +[remote-debugging-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/engine/#remote-debugging-port +[github-cdp]: https://github.com/TeamDev-IP/DotNetBrowser-Examples/tree/v4/csharp/devtools-protocol +[devtools-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/browser/#devtools +[extensions-guide]: https://teamdev.com/dotnetbrowser/docs/guides/gs/extensions/#unsupported-extensions-apis +[evaluate]: https://teamdev.com/dotnetbrowser?utm_campaign=webview2-migration-part-2&utm_medium=article&utm_source=product-blog#evaluate +[img-settings]: https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-2/where-settings-live.webp diff --git a/skills/dotnetbrowser/references/site/docs/guides/gs/browser/index.md b/skills/dotnetbrowser/references/site/docs/guides/gs/browser/index.md index 08d34d5..6f2c3d7 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/gs/browser/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/gs/browser/index.md @@ -226,7 +226,7 @@ Dim userAgent As String = browser.UserAgent ## User-Agent Client Hints -You can override the default [User-Agent Client Hints](https://api.dotnetbrowser.dev/4.3.4/api/DotNetBrowser.Profile.IProfile.UserAgentMetadata) string and configure `IBrowser` to use a custom set of values. See the code sample below: +You can override the default [User-Agent Client Hints](https://api.dotnetbrowser.dev/4.3.5/api/DotNetBrowser.Profile.IProfile.UserAgentMetadata) string and configure `IBrowser` to use a custom set of values. See the code sample below: **C#** ```csharp diff --git a/skills/dotnetbrowser/references/site/docs/guides/gs/content/index.md b/skills/dotnetbrowser/references/site/docs/guides/gs/content/index.md index da4e21d..6a35ddf 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/gs/content/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/gs/content/index.md @@ -412,7 +412,7 @@ Using `IBrowserSettings` you can configure different content settings for a sing - disable images, plugins, JavaScript, local storage, application cache; - allow running insecure content or allow JavaScript access clipboard. -You can find the list of other supported settings in [API specification](https://api.dotnetbrowser.dev/4.3.4/api/DotNetBrowser.Browser.IBrowserSettings). +You can find the list of other supported settings in [API specification](https://api.dotnetbrowser.dev/4.3.5/api/DotNetBrowser.Browser.IBrowserSettings). ### Default encoding diff --git a/skills/dotnetbrowser/references/site/docs/guides/gs/cookies/index.md b/skills/dotnetbrowser/references/site/docs/guides/gs/cookies/index.md index 26cca48..0743b16 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/gs/cookies/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/gs/cookies/index.md @@ -305,7 +305,7 @@ You can configure how Chromium controls the third-party cookies: * Block third-party cookies in incognito mode. See available options in -[CookieControlsMode](https://api.dotnetbrowser.dev/4.3.4/api/DotNetBrowser.Profile.CookieControlsMode) +[CookieControlsMode](https://api.dotnetbrowser.dev/4.3.5/api/DotNetBrowser.Profile.CookieControlsMode) enum. For example: diff --git a/skills/dotnetbrowser/references/site/docs/guides/gs/engine/index.md b/skills/dotnetbrowser/references/site/docs/guides/gs/engine/index.md index 4f9c791..a6d10dd 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/gs/engine/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/gs/engine/index.md @@ -99,7 +99,7 @@ Read [more](https://teamdev.com/dotnetbrowser/docs/guides/gs/browser-view/#off-s ### Language -This option configures the language used on the default error pages and message [dialogs](https://teamdev.com/dotnetbrowser/docs/guides/gs/dialogs/). By default, the language is dynamically configured according to the default locale of your .NET application. If the list of [supported languages](https://api.dotnetbrowser.dev/4.3.4/api/DotNetBrowser.Ui.Language) does not contain the language obtained from the .NET application locale, American English is used. +This option configures the language used on the default error pages and message [dialogs](https://teamdev.com/dotnetbrowser/docs/guides/gs/dialogs/). By default, the language is dynamically configured according to the default locale of your .NET application. If the list of [supported languages](https://api.dotnetbrowser.dev/4.3.5/api/DotNetBrowser.Ui.Language) does not contain the language obtained from the .NET application locale, American English is used. Current option allows to override the default behavior and configure the Chromium engine with the given language. See the code sample below: @@ -387,7 +387,7 @@ Do not open the remote debugging URL in other web browser applications such as M **Note** -The remote debugging feature is compatible only with the Chromium version used by DotNetBrowser library. For example, if you use DotNetBrowser 4.3.4 based on Chromium 156.0.8078.48, you can open the remote debugging URL only in the same Chromium/Google Chrome. +The remote debugging feature is compatible only with the Chromium version used by DotNetBrowser library. For example, if you use DotNetBrowser 4.3.5 based on Chromium 156.0.8078.74, you can open the remote debugging URL only in the same Chromium/Google Chrome.

We recommend loading the remote debugging URL in an `IBrowser` instance instead of Google Chrome. diff --git a/skills/dotnetbrowser/references/site/docs/guides/installation/agent-skill/index.md b/skills/dotnetbrowser/references/site/docs/guides/installation/agent-skill/index.md index c8b087a..d724364 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/installation/agent-skill/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/installation/agent-skill/index.md @@ -20,8 +20,8 @@ Each DotNetBrowser release has its own skill, so the API reference matches the version you build against. The agent reads the skill on its own when a task involves DotNetBrowser. -The skill is installed in the `dotnetbrowser` subdirectory of the agent's -skills directory: +For NuGet and ZIP installations, the skill is installed in the `dotnetbrowser` +subdirectory of the agent's skills directory: | Agent | Skills directory in the project | | --- | --- | @@ -33,10 +33,11 @@ skills directory: Agents look for skills in the repository root, and some also in the directory where you start them. -You can install the skill in three ways: +You can install the skill in four ways: * from NuGet, in an existing project; * from a ZIP archive, copied into a project or into your home directory; +* from the public GitHub repository, for the latest DotNetBrowser release; * with a project template, in a new project. ## Installing in an existing project @@ -54,7 +55,7 @@ dotnet add package DotNetBrowser.AgentSkills --version ``` Replace `` with the version of your DotNetBrowser packages, for -example `4.3.4`. The command adds the package with +example `4.3.5`. The command adds the package with `PrivateAssets="all"`, so it does not flow to projects that reference yours. In Visual Studio, you can add the package with the NuGet Package Manager instead, as described in [Installing from NuGet][guides-nuget]. This also works @@ -155,7 +156,7 @@ Keep in mind: ### From ZIP -[Download the DotNetBrowser 4.3.4 agent skill][docs-skill-zip] +[Download the DotNetBrowser 4.3.5 agent skill][docs-skill-zip] and unpack it. The archive contains the `dotnetbrowser` folder. Copy this folder, as is, into the agent's skills directory in the repository @@ -167,6 +168,15 @@ For an agent that does not read the Agent Skills format, keep the folder anywhere in the repository and reference `dotnetbrowser/SKILL.md` from the agent's rules or instructions file. +### From GitHub + +The skill is also available in the public +[DotNetBrowser-Skill repository][docs-skill-github]. Follow the installation +instructions in its README for your agent. + +The repository tracks the latest DotNetBrowser release. To get the skill for +a specific DotNetBrowser version, use NuGet or ZIP as described above. + ## Creating a project with the skill The DotNetBrowser project templates add the skill with the `--agent` option: @@ -220,7 +230,8 @@ directory. To remove a skill installed from ZIP, delete the `dotnetbrowser` folder. [docs-agent-skills]: https://agentskills.io -[docs-skill-zip]: https://teamdev.download/downloads/dotnetbrowser/4.3.4/dotnetbrowser-4.3.4-agent-skill.zip +[docs-skill-github]: https://github.com/TeamDev-IP/DotNetBrowser-Skill +[docs-skill-zip]: https://teamdev.download/downloads/dotnetbrowser/4.3.5/dotnetbrowser-4.3.5-agent-skill.zip [guides-from-nuget]: #from-nuget [guides-nuget]: https://teamdev.com/dotnetbrowser/docs/guides/installation/nuget/ [guides-quickstart]: https://teamdev.com/dotnetbrowser/docs/quickstart/ diff --git a/skills/dotnetbrowser/references/site/docs/guides/installation/vsix/index.md b/skills/dotnetbrowser/references/site/docs/guides/installation/vsix/index.md index 7a999f9..a1dbb4a 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/installation/vsix/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/installation/vsix/index.md @@ -9,7 +9,7 @@ This guide describes how to add DotNetBrowser BrowserView control to Visual Stud To add the DotNetBrowser BrowserView control to the Visual Studio Toolbox, download and install the VSIX package: -[DotNetBrowser](https://teamdev.download/downloads/dotnetbrowser/4.3.4/vsix/DotNetBrowser.WinForms.Package.vsix) +[DotNetBrowser](https://teamdev.download/downloads/dotnetbrowser/4.3.5/vsix/DotNetBrowser.WinForms.Package.vsix) After completing installation, the BrowserView control will appear in the VS ToolBox and can be dragged and dropped onto the form: diff --git a/skills/dotnetbrowser/references/site/docs/guides/installation/zip/index.md b/skills/dotnetbrowser/references/site/docs/guides/installation/zip/index.md index fb80b7d..19d5774 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/installation/zip/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/installation/zip/index.md @@ -7,9 +7,9 @@ This guide describes how to add DotNetBrowser downloaded in ZIP archive to .NET To include DotNetBrowser into your project, download the required archive, extract assemblies and include them into your project. -[Download DotNetBrowser 4.3.4 (.NET Framework)](https://teamdev.download/downloads/dotnetbrowser/4.3.4/dotnetbrowser-net462-4.3.4.zip)
-[Download DotNetBrowser 4.3.4 (.NET Core)](https://teamdev.download/downloads/dotnetbrowser/4.3.4/dotnetbrowser-netcore30-4.3.4.zip)
-[Download DotNetBrowser 4.3.4 (Cross-platform)](https://teamdev.download/downloads/dotnetbrowser/4.3.4/dotnetbrowser-netstandard20-4.3.4.zip) +[Download DotNetBrowser 4.3.5 (.NET Framework)](https://teamdev.download/downloads/dotnetbrowser/4.3.5/dotnetbrowser-net462-4.3.5.zip)
+[Download DotNetBrowser 4.3.5 (.NET Core)](https://teamdev.download/downloads/dotnetbrowser/4.3.5/dotnetbrowser-netcore30-4.3.5.zip)
+[Download DotNetBrowser 4.3.5 (Cross-platform)](https://teamdev.download/downloads/dotnetbrowser/4.3.5/dotnetbrowser-netstandard20-4.3.5.zip) ## Assemblies list diff --git a/skills/dotnetbrowser/references/site/docs/guides/licensing/index.md b/skills/dotnetbrowser/references/site/docs/guides/licensing/index.md index 9a6adf4..6300329 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/licensing/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/licensing/index.md @@ -212,7 +212,8 @@ We perform a regular review of the licenses associated with the Chromium compone Below you can find the links to Chromium components licenses associated with DotNetBrowser releases: -- [Chromium 156.0.8078.48 Licenses](https://docs.google.com/spreadsheets/d/1zUTnqtVry58HDjd59TF6dfVIrVlkTmz6tUjFKckwtZE) (4.3.4 and higher) +- [Chromium 156.0.8078.74 Licenses](https://docs.google.com/spreadsheets/d/1Dg7W8JxOL2eJm1lJY2QZMec8D0Fx_cY-N1oMzqWbqwk) (4.3.5 and higher) +- [Chromium 156.0.8078.48 Licenses](https://docs.google.com/spreadsheets/d/1zUTnqtVry58HDjd59TF6dfVIrVlkTmz6tUjFKckwtZE) (4.3.4) - [Chromium 155.0.8059.40 Licenses](https://docs.google.com/spreadsheets/d/1EBT0xVvO0HAAJ_uK5RpYH5X30262EZ3CWokAQT3Ymwk) (4.3.3) - [Chromium 154.0.8037.58 Licenses](https://docs.google.com/spreadsheets/d/1Yw97AFCebZsu4bxayTCOtC5dTO2ItPAR-aAks5C18Aw) (4.3.2) - [Chromium 153.0.8010.37 Licenses](https://docs.google.com/spreadsheets/d/1C72QstsYU8Lel0JkcunBlE113zgpqAE0XF6OnDT4cHA) (4.3.1) diff --git a/skills/dotnetbrowser/references/site/docs/guides/troubleshoot/common-issues/index.md b/skills/dotnetbrowser/references/site/docs/guides/troubleshoot/common-issues/index.md index 25f4109..611a295 100644 --- a/skills/dotnetbrowser/references/site/docs/guides/troubleshoot/common-issues/index.md +++ b/skills/dotnetbrowser/references/site/docs/guides/troubleshoot/common-issues/index.md @@ -34,7 +34,7 @@ We're aware of two factors that influence that: * The [remote debugging][remote-debugging] is enabled. Google may block a login attempt if the browser exposes the remote debugging port. -* An outdated browser version. Consider upgrading to the latest DotNetBrowser 4.3.4. +* An outdated browser version. Consider upgrading to the latest DotNetBrowser 4.3.5. ## User data is not stored diff --git a/skills/dotnetbrowser/references/site/docs/reference/index.md b/skills/dotnetbrowser/references/site/docs/reference/index.md index dfa249f..9e293de 100644 --- a/skills/dotnetbrowser/references/site/docs/reference/index.md +++ b/skills/dotnetbrowser/references/site/docs/reference/index.md @@ -9,6 +9,7 @@ This page provides the links to the official automatically-generated API referen For information on the API changes, refer to the [Release Notes](https://teamdev.com/dotnetbrowser/releases/) page. +- [4.3.5](https://api.dotnetbrowser.dev/4.3.5/api/DotNetBrowser.html) - [4.3.4](https://api.dotnetbrowser.dev/4.3.4/api/DotNetBrowser.html) - [4.3.3](https://api.dotnetbrowser.dev/4.3.3/api/DotNetBrowser.html) - [4.3.2](https://api.dotnetbrowser.dev/4.3.2/api/DotNetBrowser.html) diff --git a/skills/dotnetbrowser/references/site/docs/tutorials/automation/devtools-protocol/index.md b/skills/dotnetbrowser/references/site/docs/tutorials/automation/devtools-protocol/index.md index e1ec82f..7e70963 100644 --- a/skills/dotnetbrowser/references/site/docs/tutorials/automation/devtools-protocol/index.md +++ b/skills/dotnetbrowser/references/site/docs/tutorials/automation/devtools-protocol/index.md @@ -100,8 +100,8 @@ guaranteed — match on the page URL rather than taking the first entry. How closely the client has to track Chromium depends on the tool. ChromeDriver is versioned against Chromium directly and refuses to attach to a -build it does not recognize. DotNetBrowser 4.3.4 is based on Chromium -156.0.8078.48, so the +build it does not recognize. DotNetBrowser 4.3.5 is based on Chromium +156.0.8078.74, so the `Selenium.WebDriver.ChromeDriver` package has to be built for that Chromium release. A mismatch is the most common reason a Selenium connection fails. diff --git a/skills/dotnetbrowser/references/site/docs/tutorials/automation/selenium/index.md b/skills/dotnetbrowser/references/site/docs/tutorials/automation/selenium/index.md index 99ef5e4..6377e11 100644 --- a/skills/dotnetbrowser/references/site/docs/tutorials/automation/selenium/index.md +++ b/skills/dotnetbrowser/references/site/docs/tutorials/automation/selenium/index.md @@ -23,8 +23,8 @@ Reference two NuGet packages in the project that runs the test scenario: the API shown here is unchanged in Selenium 4. * `Selenium.WebDriver.ChromeDriver` — the ChromeDriver executable. -DotNetBrowser 4.3.4 is based on Chromium -156.0.8078.48, so use a +DotNetBrowser 4.3.5 is based on Chromium +156.0.8078.74, so use a `Selenium.WebDriver.ChromeDriver` package built for that release. ## Enabling the endpoint diff --git a/skills/dotnetbrowser/references/site/llms.txt b/skills/dotnetbrowser/references/site/llms.txt index 0abbf56..6f5dc5e 100644 --- a/skills/dotnetbrowser/references/site/llms.txt +++ b/skills/dotnetbrowser/references/site/llms.txt @@ -1,8 +1,8 @@ - + ## DotNetBrowser -Current version: 4.3.4. Chromium build: 156.0.8078.48. Release date: 2026-10-22. +Current version: 4.3.5. Chromium build: 156.0.8078.74. Release date: 2026-10-28. - [DotNetBrowser | .NET web browser for WPF, Avalonia UI, and WinForms apps](https://teamdev.com/dotnetbrowser/): Add Chromium web browser to your .NET app. Display modern web pages in WPF, Avalonia UI, WinUI 3, and WinForms. Work with DOM, JS, network, printing, etc. @@ -90,6 +90,7 @@ Current version: 4.3.4. Chromium build: 156.0.8078.48. Release date: 2026-10-22. ### Releases +- [DotNetBrowser 4.3.5](https://teamdev.com/dotnetbrowser/releases/2026/v4-3-5/index.md): DotNetBrowser 4.3.5 - Chromium 156 with Avalonia memory leak fixes. - [DotNetBrowser 4.3.4](https://teamdev.com/dotnetbrowser/releases/2026/v4-3-4/index.md): DotNetBrowser 4.3.4 - Chromium 156 with text input and image fixes. - [DotNetBrowser 4.3.3](https://teamdev.com/dotnetbrowser/releases/2026/v4-3-3/index.md): DotNetBrowser 4.3.3 - Chromium 155 with screen capture fixes. - [DotNetBrowser 4.3.2](https://teamdev.com/dotnetbrowser/releases/2026/v4-3-2/index.md): DotNetBrowser 4.3.2 - Memory management and stability fixes. @@ -147,6 +148,7 @@ Current version: 4.3.4. Chromium build: 156.0.8078.48. Release date: 2026-10-22. - [Embedded browser control for .NET](https://teamdev.com/dotnetbrowser/blog/embedded-browser-control-for-dotnet/index.md): In this article, we explain the embedded browser controls for .NET: what they are and what they are good for. - [Embedding a web view into an Excel add-in](https://teamdev.com/dotnetbrowser/blog/embedding-web-view-to-excel-add-in/index.md): Embed a web view into Excel using DotNetBrowser and a COM add-in. - [From WebView2 to DotNetBrowser: Part 1](https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-1/index.md): This article shows how to migrate existing project from WebView2 to DotNetBrowser. +- [From WebView2 to DotNetBrowser: Part 2](https://teamdev.com/dotnetbrowser/blog/from-webview2-to-dotnetbrowser-part-2/index.md): This article shows how to migrate proxy, cookies, profiles, context menus, downloads, printing, DevTools, and extensions from WebView2 to DotNetBrowser. - [How to generate PDF in C#](https://teamdev.com/dotnetbrowser/blog/how-to-generate-pdf-in-c-sharp/index.md): The step-by-step tutorial on how to generate PDF files in C# with DotNetBrowser. - [How to render web content as a texture in Unity3D](https://teamdev.com/dotnetbrowser/blog/how-to-render-web-content-as-a-texture-in-unity3d/index.md): The step-by-step tutorial on how to render web content as a texture in Unity3D with DotNetBrowser. - [How to use a local AI model in DotNetBrowser](https://teamdev.com/dotnetbrowser/blog/how-to-use-local-llm-in-dotnetbrowser/index.md): This article demonstrates how to use a local AI model in DotNetBrowser applications. diff --git a/skills/dotnetbrowser/references/site/migration/within-v2/v2-26-2-v2-27-0/index.md b/skills/dotnetbrowser/references/site/migration/within-v2/v2-26-2-v2-27-0/index.md index 064a89f..40942dd 100644 --- a/skills/dotnetbrowser/references/site/migration/within-v2/v2-26-2-v2-27-0/index.md +++ b/skills/dotnetbrowser/references/site/migration/within-v2/v2-26-2-v2-27-0/index.md @@ -38,4 +38,4 @@ browser.PrintPdfContentHandler = ``` -[fit]: https://api.dotnetbrowser.dev/2.27.0/html/P_DotNetBrowser_Print_Settings_IFit_1_Fit.htm +[fit]: https://api.dotnetbrowser.dev/2.27.20/html/P_DotNetBrowser_Print_Settings_IFit_1_Fit.htm diff --git a/skills/dotnetbrowser/references/site/releases/2026/v4-3-5/index.md b/skills/dotnetbrowser/references/site/releases/2026/v4-3-5/index.md new file mode 100644 index 0000000..c89dd48 --- /dev/null +++ b/skills/dotnetbrowser/references/site/releases/2026/v4-3-5/index.md @@ -0,0 +1,37 @@ +# DotNetBrowser 4.3.5 + +Version 4.3.5 · Posted on 2026-10-28 + +## Chromium 156.0.8078.74 + +We upgraded Chromium to a newer version, which introduces 52 +security fixes. Among them: + +* [CVE-2026-118306: Memory corruption in FileSystem][cve-2026-118306] +* [CVE-2026-118331: Improper input validation in FileAPI][cve-2026-118331] +* [CVE-2026-118348: Improper input validation in Skia][cve-2026-118348] +* [CVE-2026-118344: Use after free in Layout][cve-2026-118344] +* [CVE-2026-118357: Use after free in FileSystem][cve-2026-118357] + +See the Chromium [release announcement][chromium-oct-27-2026] for more +details. + +## Quality enhancements + +* Fixed memory leaks in Avalonia views after browser disposal while the host + window remained open. This affected off-screen rendering on Windows, Linux, + and macOS, and hardware-accelerated rendering on macOS. +* On macOS, loading DotNetBrowser’s native libraries no longer makes Chromium's + allocator the default malloc zone for the .NET application process. This + prevents unrelated native allocations in the same process from going through + Chromium's allocator. +* Removed trust for the emSign ECC Root CA - G3 root certificate. DotNetBrowser now + rejects the affected eMudhra certificate hierarchy in line with Chrome's + distrust decision. + +[cve-2026-118306]: https://nvd.nist.gov/vuln/detail/CVE-2026-118306 +[cve-2026-118331]: https://nvd.nist.gov/vuln/detail/CVE-2026-118331 +[cve-2026-118348]: https://nvd.nist.gov/vuln/detail/CVE-2026-118348 +[cve-2026-118344]: https://nvd.nist.gov/vuln/detail/CVE-2026-118344 +[cve-2026-118357]: https://nvd.nist.gov/vuln/detail/CVE-2026-118357 +[chromium-oct-27-2026]: https://chromereleases.googleblog.com/2026/10/stable-channel-update-for-desktop_0562499947.html