Click or drag to resize

ChromiumWebBrowser Constructor (String, IBrowserSettings, IRequestContext, Boolean, ActionIBrowser, Boolean)

Version 113.3.50
Create a new OffScreen Chromium Browser. If you use LegacyBindingEnabled = true then you must set automaticallyCreateBrowser to false and call CreateBrowser(IWindowInfo, IBrowserSettings) after the objects are registered. The underlying Chromium Embedded Framework(CEF) Browser is created asynchronouly, to subscribe to the BrowserInitialized event it is recommended that you set automaticallyCreateBrowser to false, subscribe to the event and then call CreateBrowser(IWindowInfo, IBrowserSettings) to ensure you are subscribe to the event before it's fired (Issue https://github.com/cefsharp/CefSharp/issues/3552).

Namespace:  CefSharp.OffScreen
Assembly:  CefSharp.OffScreen (in CefSharp.OffScreen.dll) Version: 113.3.50.0 (113.3.50.0)
Syntax
public ChromiumWebBrowser(
	string address = "",
	IBrowserSettings browserSettings = null,
	IRequestContext requestContext = null,
	bool automaticallyCreateBrowser = true,
	Action<IBrowser> onAfterBrowserCreated = null,
	bool useLegacyRenderHandler = true
)

Parameters

address (Optional)
Type: SystemString
Initial address (url) to load
browserSettings (Optional)
Type: CefSharpIBrowserSettings
The browser settings to use. If null, the default settings are used.
requestContext (Optional)
Type: CefSharpIRequestContext
See RequestContext for more details. Defaults to null
automaticallyCreateBrowser (Optional)
Type: SystemBoolean
automatically create the underlying Browser
onAfterBrowserCreated (Optional)
Type: SystemActionIBrowser
Use as an alternative to the BrowserInitialized event. If the underlying Chromium Embedded Framework (CEF) browser is created successfully, this action is guranteed to be called after the browser created where as the BrowserInitialized event may be called before you have a chance to subscribe to the event as the CEF Browser is created async. (Issue https://github.com/cefsharp/CefSharp/issues/3552).
useLegacyRenderHandler (Optional)
Type: SystemBoolean
For those using ScreenshotAsync(Boolean, PopupBlending) or ScreenshotOrNull(PopupBlending) then this must be true, for those using CaptureScreenshotAsync(NullableCaptureScreenshotFormat, NullableInt32, Viewport) this can be false. Lower memory usage when false. Defaults to true for backwards compatability.
Exceptions
ExceptionCondition
InvalidOperationExceptionCef::Initialize() failed
See Also