Click or drag to resize

LifeSpanHandler.OnBeforePopup Method

Version 103.0.120
Called before a popup window is created.

Namespace:  CefSharp.Handler
Assembly:  CefSharp (in CefSharp.dll) Version: 103.0.120.0 (103.0.120.0)
Syntax
protected virtual bool OnBeforePopup(
	IWebBrowser chromiumWebBrowser,
	IBrowser browser,
	IFrame frame,
	string targetUrl,
	string targetFrameName,
	WindowOpenDisposition targetDisposition,
	bool userGesture,
	IPopupFeatures popupFeatures,
	IWindowInfo windowInfo,
	IBrowserSettings browserSettings,
	ref bool noJavascriptAccess,
	out IWebBrowser newBrowser
)

Parameters

chromiumWebBrowser
Type: CefSharp.IWebBrowser
the ChromiumWebBrowser control
browser
Type: CefSharp.IBrowser
The browser instance that launched this popup.
frame
Type: CefSharp.IFrame
The HTML frame that launched this popup.
targetUrl
Type: System.String
The URL of the popup content. (This may be empty/null)
targetFrameName
Type: System.String
The name of the popup. (This may be empty/null)
targetDisposition
Type: CefSharp.WindowOpenDisposition
The value indicates where the user intended to open the popup (e.g. current tab, new tab, etc)
userGesture
Type: System.Boolean
The value will be true if the popup was opened via explicit user gesture (e.g. clicking a link) or false if the popup opened automatically (e.g. via the DomContentLoaded event).
popupFeatures
Type: CefSharp.IPopupFeatures
structure contains additional information about the requested popup window
windowInfo
Type: CefSharp.IWindowInfo
window information
browserSettings
Type: CefSharp.IBrowserSettings
browser settings, defaults to source browsers
noJavascriptAccess
Type: System.Boolean
value indicates whether the new browser window should be scriptable and in the same process as the source browser.
newBrowser
Type: CefSharp.IWebBrowser
EXPERIMENTAL - A newly created browser that will host the popup. Set to null for default behaviour.

Return Value

Type: Boolean
To cancel creation of the popup window return true otherwise return false.
Remarks
CEF documentation: Called on the IO thread before a new popup window is created. The |browser| and |frame| parameters represent the source of the popup request. The |target_url| and |target_frame_name| values may be empty if none were specified with the request. The |popupFeatures| structure contains information about the requested popup window. To allow creation of the popup window optionally modify |windowInfo|, |client|, |settings| and |no_javascript_access| and return false. To cancel creation of the popup window return true. The |client| and |settings| values will default to the source browser's values. The |no_javascript_access| value indicates whether the new browser window should be scriptable and in the same process as the source browser.
See Also