Click or drag to resize

ExtensionHandlerOnBeforeBackgroundBrowser Method

Version 93.1.111
Called when an extension needs a browser to host a background script specified via the "background" manifest key. The browser will have no visible window and cannot be displayed. To allow creation of the browser optionally modify newBrowser and settings and return false. To cancel creation of the browser (and consequently cancel load of the background script) return true. Successful creation will be indicated by a call to ILifeSpanHandler.OnAfterCreated, and IBrowserHost.IsBackgroundHost will return true for the resulting browser. See https://developer.chrome.com/extensions/event_pages for more information about extension background script usage.

Namespace:  CefSharp.Handler
Assembly:  CefSharp (in CefSharp.dll) Version: 93.1.111.0 (93.1.111.0)
Syntax
protected virtual bool OnBeforeBackgroundBrowser(
	IExtension extension,
	string url,
	IBrowserSettings settings
)

Parameters

extension
Type: CefSharpIExtension
is the extension that is loading the background script
url
Type: SystemString
is an internally generated reference to an HTML page that will be used to load the background script via a script src attribute
settings
Type: CefSharpIBrowserSettings
browser settings

Return Value

Type: Boolean
To cancel creation of the browser (and consequently cancel load of the background script) return true, otherwise return false.
See Also