IBrowser Interface (original) (raw)

Version 118.6.80

CefSharp interface for CefBrowser.

Namespace: CefSharp
Assembly: CefSharp (in CefSharp.dll) Version: 118.6.80.0 (118.6.80.0)

Syntax

public interface IBrowser : IDisposable

public interface class IBrowser : IDisposable

The IBrowser type exposes the following members.

Properties

| | Name | Description | | | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Public property | CanGoBack | Returns true if the browser can navigate backwards. | | Public property | CanGoForward | Returns true if the browser can navigate forwards. | | Public property | FocusedFrame | Returns the focused frame for the browser window or null. | | Public property | HasDocument | Returns true if a document has been loaded in the browser. | | Public property | Identifier | Returns the globally unique identifier for this browser. | | Public property | IsDisposed | Gets a value indicating whether the browser has been disposed of. | | Public property | IsLoading | Returns true if the browser is currently loading. | | Public property | IsPopup | Returns true if the window is a popup window. | | Public property | IsValid | Returns True if this object is currently valid. This will return false afterOnBeforeClose(IWebBrowser, IBrowser) is called. | | Public property | MainFrame | Returns the main (top-level) frame for the browser window. Returns null if there is currently no MainFrame. |

Top

Methods

| | Name | Description | | | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Public method | CloseBrowser | Request that the browser close. The JavaScript 'onbeforeunload' event will be fired. | | Public method | Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) | | Public method | GetFrame(Int64) | Returns the frame with the specified identifier, or NULL if not found. | | Public method | GetFrame(String) | Returns the frame with the specified name, or NULL if not found. | | Public method | GetFrameCount | Returns the number of frames that currently exist. | | Public method | GetFrameIdentifiers | Returns the identifiers of all existing frames. | | Public method | GetFrameNames | Returns the names of all existing frames. | | Public method | GetHost | Returns the browser host object. This method can only be called in the browser process. | | Public method | GoBack | Navigate backwards. | | Public method | GoForward | Navigate forwards. | | Public method | IsSame | Returns true if this object is pointing to the same handle as that object. | | Public method | Reload | Reload the current page. | | Public method | StopLoad | Stop loading the page. |

Top

Extension Methods

| | Name | Description | | | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Public Extension Method | AddWordToDictionary | Add the specified word to the spelling dictionary. (Defined by WebBrowserExtensions.) | | Public Extension Method | Back | Navigates back, must check CanGoBack before calling this method. (Defined by WebBrowserExtensions.) | | Public Extension Method | CloseDevTools | Explicitly close the developer tools window if one exists for this browser instance. (Defined by WebBrowserExtensions.) | | Public Extension Method | Copy | Execute Copy on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | Cut | Execute Cut on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | Delete | Execute Delete on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | EvaluateScriptAsPromiseAsync | Evaluate Javascript in the context of this Browsers Main Frame. The script will be executed asynchronously and the method returns a Task encapsulating the response from the Javascript. The result of the script execution in javascript is Promise.resolve so even no promise values will be treated as a promise. Your javascript should return a value. The javascript will be wrapped in an Immediately Invoked Function Expression. When the promise either trigger then/catch this returned Task will be completed. (Defined by WebBrowserExtensions.) | | Public Extension Method | EvaluateScriptAsync(String, NullableTimeSpan, Boolean) | Overloaded. Evaluate some Javascript code in the context of the MainFrame of the ChromiumWebBrowser. The script will be executed asynchronously and the method returns a Task encapsulating the response from the Javascript (Defined by WebBrowserExtensions.) | | Public Extension Method | EvaluateScriptAsyncT(String, NullableTimeSpan) | Overloaded. Evaluate some Javascript code in the context of the MainFrame of the ChromiumWebBrowser. The script will be executed asynchronously and the method returns a Task encapsulating the response from the Javascript (Defined by WebBrowserExtensionsEx.) | | Public Extension Method | ExecuteDevToolsMethodAsync | Execute a method call over the DevTools protocol. This is a more structured version of SendDevToolsMessage. ExecuteDevToolsMethod(IBrowserHost, Int32, String, JsonString) can only be called on the CEF UI Thread, this method can be called on any thread. See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details of supported methods and the expected parameters dictionary contents. See the SendDevToolsMessage documentation for additional usage information. (Defined by DevToolsExtensions.) | | Public Extension Method | ExecuteScriptAsync(String) | Overloaded. Execute Javascript in the context of this Browser Main Frame. As the method name implies, the script will be executed asynchronously, and the method therefore returns before the script has actually been executed. (Defined by WebBrowserExtensions.) | | Public Extension Method | ExecuteScriptAsync(String, Object) | Overloaded. Execute Javascript code in the context of this WebBrowser. As the method name implies, the script will be executed asynchronously, and the method therefore returns before the script has actually been executed. This simple helper extension will encapsulate params in single quotes (unless int, uint, etc) (Defined by WebBrowserExtensions.) | | Public Extension Method | Find | Search for text within the current page. (Defined by WebBrowserExtensions.) | | Public Extension Method | Forward | Navigates forward, must check CanGoForward before calling this method. (Defined by WebBrowserExtensions.) | | Public Extension Method | GetDevToolsClient | Gets a new Instance of the DevTools client (Defined by DevToolsExtensions.) | | Public Extension Method | GetSourceAsync | Retrieve the main frame's HTML source using a TaskTResult. (Defined by WebBrowserExtensions.) | | Public Extension Method | GetTextAsync | Retrieve the main frame's display text using a TaskTResult. (Defined by WebBrowserExtensions.) | | Public Extension Method | GetZoomLevelAsync | Asynchronously gets the current Zoom Level. (Defined by WebBrowserExtensions.) | | Public Extension Method | LoadUrlWithPostData | Creates a new instance of IRequest with the specified Url and Method = POST and then callsLoadRequest(IRequest). (Defined by WebBrowserExtensions.) | | Public Extension Method | Paste | Execute Paste on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | Print | Opens a Print Dialog which if used (can be user cancelled) will print the browser contents. (Defined by WebBrowserExtensions.) | | Public Extension Method | PrintToPdfAsync | Asynchronously prints the current browser contents to the PDF file specified. The caller is responsible for deleting the file when done. (Defined by WebBrowserExtensions.) | | Public Extension Method | Redo | Execute Redo on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | Reload | Reloads the page being displayed, optionally ignoring the cache (which means the whole page including all .css, .js etc. resources will be re-fetched). (Defined by WebBrowserExtensions.) | | Public Extension Method | ReplaceMisspelling | If a misspelled word is currently selected in an editable node calling this method will replace it with the specified word. (Defined by WebBrowserExtensions.) | | Public Extension Method | SelectAll | Execute SelectAll on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | SendMouseWheelEvent | Send a mouse wheel event to the browser. (Defined by WebBrowserExtensions.) | | Public Extension Method | SetMainFrameDocumentContentAsync | Set the Document Content for the Main Frame using DevTools Protocol. (Defined by DevToolsExtensions.) | | Public Extension Method | SetZoomLevel | Change the ZoomLevel to the specified value. Can be set to 0.0 to clear the zoom level. (Defined by WebBrowserExtensions.) | | Public Extension Method | ShowDevTools | Open developer tools in its own window. (Defined by WebBrowserExtensions.) | | Public Extension Method | StartDownload | Download the file at url using IDownloadHandler. (Defined by WebBrowserExtensions.) | | Public Extension Method | Stop | Stops loading the current page. (Defined by WebBrowserExtensions.) | | Public Extension Method | StopFinding | Cancel all searches that are currently going on. (Defined by WebBrowserExtensions.) | | Public Extension Method | Undo | Execute Undo on the focused frame. (Defined by WebBrowserExtensions.) | | Public Extension Method | ViewSource | Opens up a new program window (using the default text editor) where the source code of the currently displayed web page is shown. (Defined by WebBrowserExtensions.) |

Top

See Also

Reference