Click or drag to resize

ExtensionHandlerOnBeforeBrowser Method

Version 101.0.180
Called when an extension API (e.g. chrome.tabs.create) requests creation of a new browser. Successful creation will be indicated by a call to OnAfterCreated(IWebBrowser, IBrowser).

Namespace:  CefSharp.Handler
Assembly:  CefSharp (in CefSharp.dll) Version: 101.0.180.0 (101.0.180.0)
Syntax
protected virtual bool OnBeforeBrowser(
	IExtension extension,
	IBrowser browser,
	IBrowser activeBrowser,
	int index,
	string url,
	bool active,
	IWindowInfo windowInfo,
	IBrowserSettings settings
)

Parameters

extension
Type: CefSharpIExtension
the source of the API call
browser
Type: CefSharpIBrowser
the source of the API call
activeBrowser
Type: CefSharpIBrowser
may optionally be specified via the windowId property or returned via the GetActiveBrowser() callback and provides the default for the new browser
index
Type: SystemInt32
is the position value optionally specified via the index property
url
Type: SystemString
is the URL that will be loaded in the browser
active
Type: SystemBoolean
is true if the new browser should be active when opened
windowInfo
Type: CefSharpIWindowInfo
optionally modify if you are going to allow creation of the browser
settings
Type: CefSharpIBrowserSettings
optionally modify browser settings

Return Value

Type: Boolean
To cancel creation of the browser return true. To allow creation return false and optionally modify windowInfo and settings
See Also