public CreateWindowEventArgs( CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, CefClient client, CefBrowserSettings settings, CefDictionaryValue extraInfo, bool noJavascriptAccess) { this.Frame = frame; this.TargetUrl = targetUrl; this.TargetFrameName = targetFrameName; this.TargetDisposition = targetDisposition; this.UserGesture = userGesture; this.PopupFeatures = popupFeatures; this.Settings = settings; this.WindowInfo = windowInfo; this.Client = client; this.ExtraInfo = extraInfo; this.NoJavaScriptAccess = noJavascriptAccess; }
/// <summary> /// Returns a WebView control for this <see cref="CefClient"/>. /// </summary> /// <param name="client">The <see cref="CefClient"/> object.</param> /// <returns>An <see cref="IChromiumWebView"/> object associated with this client or null.</returns> public static IChromiumWebView GetWebView(this CefClient client) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var glue = client as CefClientGlue; if (glue is null) { return(null); } return(glue.Implementation.WebView as IChromiumWebView); }
/// <summary> /// Returns a WebView control for this <see cref="CefBrowser"/>. /// </summary> /// <param name="browser">The <see cref="CefBrowser"/> object.</param> /// <returns>An <see cref="IChromiumWebView"/> object associated with this client or null.</returns> public static IChromiumWebView GetWebView(this CefBrowser browser) { if (browser is null) { throw new ArgumentNullException(nameof(browser)); } CefBrowserHost host = browser.Host; if (host is null) { return(null); } CefClient client = host.Client; if (client is null) { return(null); } return(GetWebView(client)); }
/// <summary> /// 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. |extension| is the extension that /// is loading the background script. |url| is an internally generated /// reference to an HTML page that will be used to load the background script /// via a /// <script /// > src attribute. To allow creation of the browser optionally /// modify |client| and |settings| and return false (0). To cancel creation of /// the browser (and consequently cancel load of the background script) return /// true (1). Successful creation will be indicated by a call to /// cef_life_span_handler_t::OnAfterCreated, and /// cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting /// browser. See https://developer.chrome.com/extensions/event_pages for more /// information about extension background script usage. /// </summary> protected internal unsafe virtual bool OnBeforeBackgroundBrowser(CefExtension extension, string url, ref CefClient client, CefBrowserSettings settings) { return(default);
/// <summary> /// Open developer tools (DevTools) in its own browser. The DevTools browser /// will remain associated with this browser. If the DevTools browser is /// already open then it will be focused, in which case the |windowInfo|, /// |client| and |settings| parameters will be ignored. If |inspect_element_at| /// is non-NULL then the element at the specified (x,y) location will be /// inspected. The |windowInfo| parameter will be ignored if this browser is /// wrapped in a cef_browser_view_t. /// </summary> public unsafe virtual void ShowDevTools(CefWindowInfo windowInfo, CefClient client, CefBrowserSettings settings, CefPoint inspectElementAt) { NativeInstance->ShowDevTools(windowInfo.GetNativeInstance(), (client != null) ? client.GetNativeInstance() : null, settings.GetNativeInstance(), (cef_point_t *)&inspectElementAt); GC.KeepAlive(this); }
/// <summary> /// Called on the UI thread before a new popup browser is created. The /// |browser| and |frame| values represent the source of the popup request. The /// |target_url| and |target_frame_name| values indicate where the popup /// browser should navigate and may be NULL if not specified with the request. /// The |target_disposition| value indicates where the user intended to open /// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will /// be true (1) if the popup was opened via explicit user gesture (e.g. /// clicking a link) or false (0) if the popup opened automatically (e.g. via /// the DomContentLoaded event). The |popupFeatures| structure contains /// additional information about the requested popup window. To allow creation /// of the popup browser optionally modify |windowInfo|, |client|, |settings| /// and |no_javascript_access| and return false (0). To cancel creation of the /// popup browser return true (1). The |client| and |settings| values will /// default to the source browser's values. If the |no_javascript_access| value /// is set to false (0) the new browser will not be scriptable and may not be /// hosted in the same renderer process as the source browser. Any /// modifications to |windowInfo| will be ignored if the parent browser is /// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if /// the parent browser is destroyed before the popup browser creation completes /// (indicated by a call to OnAfterCreated for the popup browser). The /// |extra_info| parameter provides an opportunity to specify extra information /// specific to the created popup browser that will be passed to /// cef_render_process_handler_t::on_browser_created() in the render process. /// </summary> protected internal unsafe virtual bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref CefDictionaryValue extraInfo, ref int noJavascriptAccess) { return(default);