WebBrowserExtensions Class (original) (raw)

Name

Description

Public methodStatic member

AddWordToDictionary(IBrowser, String)

Add the specified word to the spelling dictionary.

Public methodStatic member

AddWordToDictionary(IChromiumWebBrowserBase, String)

Add the specified word to the spelling dictionary.

Public methodStatic member

Back(IBrowser)

Navigates back, must check CanGoBack before calling this method.

Public methodStatic member

Back(IChromiumWebBrowserBase)

Navigates back, must check CanGoBack before calling this method.

Public methodStatic member

CloseDevTools(IBrowser)

Explicitly close the developer tools window if one exists for this browser instance.

Public methodStatic member

CloseDevTools(IChromiumWebBrowserBase)

Explicitly close the developer tools window if one exists for this browser instance.

Public methodStatic member

Copy(IBrowser)

Execute Copy on the focused frame.

Public methodStatic member

Copy(IChromiumWebBrowserBase)

Execute Copy on the focused frame.

Public methodStatic member

Cut(IBrowser)

Execute Cut on the focused frame.

Public methodStatic member

Cut(IChromiumWebBrowserBase)

Execute Cut on the focused frame.

Public methodStatic member

Delete(IBrowser)

Execute Delete on the focused frame.

Public methodStatic member

Delete(IChromiumWebBrowserBase)

Execute Delete on the focused frame.

Public methodStatic member

DisposeDevToolsContext

Dispose of the DevToolsContext (if any). Used in conjunction with CefSharp.Dom

Public methodStatic member

EvaluateScriptAsPromiseAsync(IBrowser, String, NullableTimeSpan)

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.

Public methodStatic member

EvaluateScriptAsPromiseAsync(IWebBrowser, String, NullableTimeSpan)

Evaluate Javascript 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. 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.

Public methodStatic member

EvaluateScriptAsPromiseAsync(IFrame, String, NullableTimeSpan, String)

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.

Public methodStatic member

EvaluateScriptAsync(IChromiumWebBrowserBase, String, Object)

Evaluate some Javascript code in the context of this WebBrowser. The script will be executed asynchronously and the method returns a Task encapsulating the response from the Javascript This simple helper extension will encapsulate params in single quotes (unless int, uint, etc)

Public methodStatic member

EvaluateScriptAsync(IBrowser, String, NullableTimeSpan, Boolean)

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

Public methodStatic member

EvaluateScriptAsync(IChromiumWebBrowserBase, NullableTimeSpan, String, Object)

Evaluate Javascript code in the context of this WebBrowser using the specified timeout. The script will be executed asynchronously and the method returns a Task encapsulating the response from the Javascript This simple helper extension will encapsulate params in single quotes (unless int, uint, etc).

Public methodStatic member

EvaluateScriptAsync(IChromiumWebBrowserBase, String, NullableTimeSpan, Boolean)

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

Public methodStatic member

ExecuteScriptAsync(IBrowser, String)

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.

Public methodStatic member

ExecuteScriptAsync(IChromiumWebBrowserBase, String)

Execute Javascript in the context of this Browsers 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.

Public methodStatic member

ExecuteScriptAsync(IBrowser, String, Object)

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)

Public methodStatic member

ExecuteScriptAsync(IChromiumWebBrowserBase, String, Object)

Execute Javascript code in the context of this Browser. 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)

Public methodStatic member

ExecuteScriptAsyncWhenPageLoaded

Execute Javascript code in the context of this Browsers Main Frame. This extension method uses the LoadingStateChanged event. As the method name implies, the script will be executed asynchronously, and the method therefore returns before the script has actually been executed.

Public methodStatic member

Find(IBrowser, String, Boolean, Boolean, Boolean)

Search for text within the current page.

Public methodStatic member

Find(IChromiumWebBrowserBase, String, Boolean, Boolean, Boolean)

Search for text within the current page.

Public methodStatic member

Forward(IBrowser)

Navigates forward, must check CanGoForward before calling this method.

Public methodStatic member

Forward(IChromiumWebBrowserBase)

Navigates forward, must check CanGoForward before calling this method.

Public methodStatic member

FreeDevToolsContext

Set the DevToolsContext property to null. Used in conjunction with CefSharp.Dom

Public methodStatic member

GetBrowserHost

Shortcut method to get the browser IBrowserHost.

Public methodStatic member

GetCookieManager

Public methodStatic member

GetFocusedFrame

Returns the focused frame for the browser window.

Public methodStatic member

GetMainFrame

Returns the main (top-level) frame for the browser window.

Public methodStatic member

GetRequestContext

Public methodStatic member

GetScriptForJavascriptMethodWithArgs

Transforms the methodName and arguments into valid Javascript code. Will encapsulate params in single quotes (unless int, uint, etc)

Public methodStatic member

GetSourceAsync(IBrowser)

Retrieve the main frame's HTML source using a TaskTResult.

Public methodStatic member

GetSourceAsync(IChromiumWebBrowserBase)

Retrieve the main frame's HTML source using a TaskTResult.

Public methodStatic member

GetTextAsync(IBrowser)

Retrieve the main frame's display text using a TaskTResult.

Public methodStatic member

GetTextAsync(IChromiumWebBrowserBase)

Retrieve the main frame's display text using a TaskTResult.

Public methodStatic member

GetZoomLevelAsync(IBrowser)

Asynchronously gets the current Zoom Level.

Public methodStatic member

GetZoomLevelAsync(IChromiumWebBrowserBase)

Asynchronously gets the current Zoom Level.

Public methodStatic member

LoadHtml(IChromiumWebBrowserBase, String, Boolean)

Loads html as Data Uri See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics\_of\_HTTP/Data\_URIs for details If base64Encode is false then html will be Uri encoded.

Public methodStatic member

LoadHtml(IFrame, String, Boolean)

Loads html as Data Uri See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics\_of\_HTTP/Data\_URIs for details If base64Encode is false then html will be Uri encoded.

Public methodStatic member

LoadHtml(IWebBrowser, String, String)

Registers and loads a ResourceHandler that represents the HTML content.

Public methodStatic member

LoadHtml(IWebBrowser, String, String, Encoding, Boolean)

Registers and loads a ResourceHandler that represents the HTML content.

Public methodStatic member

LoadUrlAsync

Public methodStatic member

LoadUrlWithPostData(IBrowser, String, Byte, String)

Creates a new instance of IRequest with the specified Url and Method = POST and then callsLoadRequest(IRequest).

Public methodStatic member

LoadUrlWithPostData(IChromiumWebBrowserBase, String, Byte, String)

Creates a new instance of IRequest with the specified Url and Method = POST and then callsLoadRequest(IRequest).

Public methodStatic member

Paste(IBrowser)

Execute Paste on the focused frame.

Public methodStatic member

Paste(IChromiumWebBrowserBase)

Execute Paste on the focused frame.

Public methodStatic member

Print(IBrowser)

Opens a Print Dialog which if used (can be user cancelled) will print the browser contents.

Public methodStatic member

Print(IChromiumWebBrowserBase)

Opens a Print Dialog which if used (can be user cancelled) will print the browser contents.

Public methodStatic member

PrintToPdfAsync(IBrowser, String, PdfPrintSettings)

Asynchronously prints the current browser contents to the PDF file specified. The caller is responsible for deleting the file when done.

Public methodStatic member

PrintToPdfAsync(IChromiumWebBrowserBase, String, PdfPrintSettings)

Asynchronously prints the current browser contents to the PDF file specified. The caller is responsible for deleting the file when done.

Public methodStatic member

Redo(IBrowser)

Execute Redo on the focused frame.

Public methodStatic member

Redo(IChromiumWebBrowserBase)

Execute Redo on the focused frame.

Public methodStatic member

RegisterAsyncJsObject

Obsolete.

Asynchronously registers a Javascript object in this specific browser instance.

Only methods of the object will be availabe.

Public methodStatic member

RegisterJsObject

Obsolete.

Registers a Javascript object in this specific browser instance.

Public methodStatic member

RegisterResourceHandler

Register a ResourceHandler. Can only be used when browser.ResourceHandlerFactory is an instance of DefaultResourceHandlerFactory.

Public methodStatic member

Reload(IChromiumWebBrowserBase)

Reloads the page being displayed. This method will use data from the browser's cache, if available.

Public methodStatic member

Reload(IBrowser, Boolean)

Reloads the page being displayed, optionally ignoring the cache (which means the whole page including all .css, .js etc. resources will be re-fetched).

Public methodStatic member

Reload(IChromiumWebBrowserBase, Boolean)

Reloads the page being displayed, optionally ignoring the cache (which means the whole page including all .css, .js etc. resources will be re-fetched).

Public methodStatic member

ReplaceMisspelling(IBrowser, String)

If a misspelled word is currently selected in an editable node calling this method will replace it with the specified word.

Public methodStatic member

ReplaceMisspelling(IChromiumWebBrowserBase, String)

If a misspelled word is currently selected in an editable node calling this method will replace it with the specified word.

Public methodStatic member

SelectAll(IBrowser)

Execute SelectAll on the focused frame.

Public methodStatic member

SelectAll(IChromiumWebBrowserBase)

Execute SelectAll on the focused frame.

Public methodStatic member

SendMouseClickEvent

Send a mouse click event to the browser.

Public methodStatic member

SendMouseMoveEvent

Send a mouse move event to the browser.

Public methodStatic member

SendMouseWheelEvent(IBrowser, Int32, Int32, Int32, Int32, CefEventFlags)

Send a mouse wheel event to the browser.

Public methodStatic member

SendMouseWheelEvent(IBrowserHost, Int32, Int32, Int32, Int32, CefEventFlags)

Send a mouse wheel event to the browser.

Public methodStatic member

SendMouseWheelEvent(IChromiumWebBrowserBase, Int32, Int32, Int32, Int32, CefEventFlags)

Send a mouse wheel event to the browser.

Public methodStatic member

SetAsPopup

An IWebBrowser extension method that sets the HasParent property used when passing a ChromiumWebBrowser instance to OnBeforePopup(IWebBrowser, IBrowser, IFrame, String, String, WindowOpenDisposition, Boolean, IPopupFeatures, IWindowInfo, IBrowserSettings, Boolean, IWebBrowser)

Public methodStatic member

SetZoomLevel(IBrowser, Double)

Change the ZoomLevel to the specified value. Can be set to 0.0 to clear the zoom level.

Public methodStatic member

SetZoomLevel(IChromiumWebBrowserBase, Double)

Change the ZoomLevel to the specified value. Can be set to 0.0 to clear the zoom level.

Public methodStatic member

ShowDevTools(IBrowser, IWindowInfo, Int32, Int32)

Open developer tools in its own window.

Public methodStatic member

ShowDevTools(IChromiumWebBrowserBase, IWindowInfo, Int32, Int32)

Open developer tools in its own window.

Public methodStatic member

StartDownload(IBrowser, String)

Public methodStatic member

StartDownload(IChromiumWebBrowserBase, String)

Public methodStatic member

Stop(IBrowser)

Stops loading the current page.

Public methodStatic member

Stop(IChromiumWebBrowserBase)

Stops loading the current page.

Public methodStatic member

StopFinding(IBrowser, Boolean)

Cancel all searches that are currently going on.

Public methodStatic member

StopFinding(IChromiumWebBrowserBase, Boolean)

Cancel all searches that are currently going on.

Public methodStatic member

ThrowExceptionIfBrowserHostNull

Throw exception if browser host null.

Public methodStatic member

ThrowExceptionIfBrowserNull

An IBrowser extension method that throw exception if browser null.

Public methodStatic member

ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse

Throw exception if can execute javascript in main frame false.

Public methodStatic member

ThrowExceptionIfChromiumWebBrowserDisposed

Public methodStatic member

ThrowExceptionIfFrameNull

Throw exception if frame null.

Public methodStatic member

Undo(IBrowser)

Execute Undo on the focused frame.

Public methodStatic member

Undo(IChromiumWebBrowserBase)

Execute Undo on the focused frame.

Public methodStatic member

UnRegisterResourceHandler

Unregister a ResourceHandler. Can only be used when browser.ResourceHandlerFactory is an instance of DefaultResourceHandlerFactory.

Public methodStatic member

ViewSource(IBrowser)

Opens up a new program window (using the default text editor) where the source code of the currently displayed web page is shown.

Public methodStatic member

ViewSource(IChromiumWebBrowserBase)

Opens up a new program window (using the default text editor) where the source code of the currently displayed web page is shown.

Public methodStatic memberCode example

WaitForNavigationAsync

This resolves when the browser navigates to a new URL or reloads. It is useful for when you run code which will indirectly cause the browser to navigate. A common use case would be when executing javascript that results in a navigation. e.g. clicks a link This must be called before executing the action that navigates the browser. It may not resolve correctly if called after.

Public methodStatic memberCode example

WaitForSelectorAsync

Waits for a DOM element specified by the selector string to be added to or removed from the DOM. A simplified version of Puppeteer WaitForSelector. Uses a MutationObserver to wait for the element to become added or removed.