IBrowser Interface |
Namespace: DotNetBrowser.Browser
public interface IBrowser : IDisposable, IAutoDisposable
The IBrowser type exposes the following members.
Name | Description | |
---|---|---|
AllFrames |
Gets all the frames on the currently loaded web page.
| |
Audio |
Gets the IAudio instance that allows controlling audio on the loaded web page and receive
notifications when audio has been
started or stopped playing.
| |
Capture |
Gets the ICapture instance that can be used for listening and handling capture sessions.
| |
CreatePopupHandler |
Gets or sets a handler that is used when the browser decides whether a new popup instance can be created or not.
| |
DevTools |
Gets the IDevTools instance that allows working with Chromium Developer Tools for this browser.
| |
Dialogs |
Gets the IDialogs instance that can be used for configuring the dialogs that can be shown by
browser.
| |
DragAndDrop |
Gets the IDragAndDrop instance that can be used for managing drag&drop operations for the
browser.
| |
Engine |
Gets the IEngine instance associated with this browser.
| |
Favicon |
Gets the favicon of the currently loaded web page.
| |
FocusedFrame |
Gets the focused frame on the currently loaded web page.
| |
InjectCssHandler |
Gets or sets a handler that is used when the document element has been created and a custom stylesheet can
be injected into the document.
| |
InjectJsHandler |
Gets or sets a handler that is used when the document element has been created and a custom JavaScript can
be injected into the document.
| |
IsDisposed |
Indicates if the object is already disposed.
(Inherited from IAutoDisposable.) | |
JsDialogs |
Gets the IJsDialogs instance that can be used for configuring the JavaScript dialogs that can be
shown by browser.
| |
Keyboard |
Gets the IKeyboard instance that can be used for listening and simulating keyboard input events.
| |
MainFrame |
The main frame on the currently loaded web page, if it exists.
| |
Mouse |
Gets the IMouse instance that can be used for listening and simulating mouse input events.
| |
Navigation |
Gets the INavigation instance that can be used for controlling navigation in the current browser
instance.
| |
OpenPopupHandler |
Gets or sets a handler that is used when a new popup browser instance should be opened.
| |
Passwords |
Gets the IPasswords instance that can be used for working with logins and passwords
saved in the Chromium password store.
| |
PrintHtmlContentHandler |
Gets or sets a handler that is used when the HTML content printing is initiated.
| |
PrintPdfContentHandler |
Gets or sets a handler that is used when the PDF content printing is initiated.
| |
Profile |
Gets the IProfile instance associated with this browser.
| |
RequestPrintHandler |
Gets or sets a handler that is used when the printing is initiated.
| |
SelectCertificateHandler |
Gets or sets a handler that is used when the web server requires authorization via client certificate.
| |
Settings |
Gets the IBrowserSettings instance that can be used for modifying the settings of the browser.
| |
ShowContextMenuHandler |
Gets or sets a handler that is used when the browser should show a context menu.
| |
Size |
Gets or sets the browser size.
| |
StartDownloadHandler |
Gets or sets a handler that is used when the browser is about to start downloading the file.
| |
TextFinder |
Gets the ITextFinder instance that can be used for finding text on a web page loaded in the
browser.
| |
Title |
Gets the title of the currently loaded web page.
| |
Touch |
Gets the ITouch instance that can be used for listening touch input events.
| |
Url |
Gets the URL of the currently loaded web page or an empty string if
the browser hasn't loaded any web page yet.
| |
UserAgent |
Gets or sets the user-agent of the current browser instance.
| |
Zoom |
Gets the IZoom instance that can be used for zooming content of a web page loaded in the current
browser instance.
|
Name | Description | |
---|---|---|
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) | |
DisposeAsync |
Asynchronously disposes the current browser instance according to the given options.
| |
Focus |
Tells the browser that it has focus and must be activated.
| |
ReplaceMisspelledWord |
Replaces misspelled word under cursor on the currently loaded web page with the given word.
If there is no misspelled word under cursor, this method does nothing.
| |
SaveWebPage |
Initiates the saving process of the currently loaded web page. The web page can be saved as a
single HTML file or the file with resources. Before saving a web page make sure that it is
not being loaded. It is recommended to completely loaded the web page and only then save it.
| |
SetPrivateKeyProviderPin |
Sets the key exchange PIN for the particular cryptographic
service provider (CSP) and the particular key container in it.
This functionality can be used to set the PIN that is requested when
trying to use a client certificate stored on the smart card.
| |
TakeImage |
Creates and returns an image of the currently loaded web page.
| |
Unfocus |
Tells the browser that it does not have focus and must be deactivated.
|
Name | Description | |
---|---|---|
BrowserBecameResponsive |
Occurs when the browser instance has become responsive.
| |
BrowserBecameUnresponsive |
Occurs when the browser instance has become unresponsive.
| |
ConsoleMessageReceived |
Occurs when the message was added to the console.
| |
Disposed |
Occurs when the object has been disposed.
(Inherited from IAutoDisposable.) | |
FaviconChanged |
Occurs when the web page favicon has changed.
| |
FocusGained |
Occurs when the browser instance has gained the focus.
| |
FocusLost |
Occurs when the browser instance has lost the focus.
| |
FocusRequested |
Occurs when JavaScript sends a request to focus the Browser instance by calling the
window.focus() method.
| |
FrameCreated |
Occurs when the IFrame has been created.
| |
FrameDeleted |
Occurs when the IFrame has been deleted.
| |
FullScreenEntered |
Occurs when the browser instance has been toggled into full-screen mode.
| |
FullScreenExited |
Occurs when the browser instance has been toggled out of full-screen mode.
| |
RenderProcessTerminated |
Occurs when a render process has been terminated.
| |
SpellCheckCompleted |
Occurs when spell checking on the frame has been completed.
| |
StatusChanged |
Occurs when the status text has been changed.
| |
TitleChanged |
Occurs when the web page title has been changed.
| |
UpdateBoundsRequested |
Occurs when JavaScript requests to update bounds of the Browser instance.
|
The IBrowser instance itself is running in a separate native process that allocates memory and system resources that must be released. So, when a IBrowser instance is no longer needed, it must be disposed through the Dispose method to release all the allocated memory and system resources. For example:
IBrowser browser = engine.CreateBrowser(); ... browser.Dispose();
Any attempt to use an already disposed IBrowser instance will lead to the ObjectDisposedException.
The IBrowser instance is disposed automatically when its IEngine is disposed or unexpectedly crashed. If the instance represents a popup window created by JavaScript via the window.open() function, then JavaScript can close the instance using the window.close() function.
To get notifications that the IBrowser instance has been disposed please subscribe to the following event:
browser.Disposed += (s, e) => {
// The Browser instance has been disposed.
};