Interface IFrame
- Namespace
- DotNetBrowser.Frames
- Assembly
- DotNetBrowser.dll
Represents a frame in the browser. Each web page loaded in the browser has a main(top-level) frame. The frame itself may have child frames. When a web page is unloaded, its frame and all child frames are closed automatically.
public interface IFrame : IAutoDisposable
- Inherited Members
- Extension Methods
Properties
- Children
The collection of the child frames.
- Document
The IDocument that can be used to work with DOM of the frame. Can be null if the frame doesn't have a document.
- Html
The HTML content of the frame. Can be an empty string if the frame doesn't have a content or its content is empty.
- IsMain
Indicates whether the frame is a main (top-level) frame in the browser.
- LocalStorage
The
localStorage
instance of this frame.
- Name
The name of the frame. Can be an empty string if the frame doesn't have a name.
- Parent
The parent frame.
- SelectedHtml
The HTML representation of the selected content in the frame. Can be an empty string if there's no selection.
- SelectedText
The text representation of the selected content in the frame. Can be an empty string if there's no selection.
- SessionStorage
The
sessionStorage
instance of this frame.
- Text
Gets the content of the frame and its sub-frames as plain text or an empty string if the frame does not have content or its content is empty.
Methods
- CreateJsArrayBuffer(byte[])
Creates a new IJsArrayBuffer and copies the contents of the byte array to it.
- CreateJsArray<T>(IEnumerable<T>)
Creates a new IJsArray and copies the contents of the IEnumerable<T> to it.
- CreateJsMap<TKey, TValue>(IDictionary<TKey, TValue>)
Creates a new IJsMap and copies the contents of the IDictionary<TKey, TValue> to it.
- CreateJsMap<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>)
Creates a new IJsMap and copies the contents of the IReadOnlyDictionary<TKey, TValue> to it.
- CreateJsSet<T>(IEnumerable<T>)
Creates a new IJsSet and copies the contents of the IEnumerable<T> to it.
- Execute(EditorCommand)
Executes the given
command
in the frame. Before executing the command, it's recommended to check whether it can be executed or not using the IsCommandEnabled(EditorCommand) method.
- ExecuteJavaScript(string, bool)
Asynchronously executes JavaScript code using the current context.
- ExecuteJavaScript<T>(string, bool)
Asynchronously executes JavaScript code using the current context and converts the execution result to the specified .NET type.
- Inspect(Point)
Inspects the given
location
in the frame and returns the result of inspection.
- Inspect(int, int)
Inspects the given location in the frame and returns the result of inspection.
- IsCommandEnabled(EditorCommand)
Indicates if the command with the given
command
can be executed in the frame. Some commands can be executed only under certain conditions. For example, the InsertText(string) command can be executed only if there's a focused text field in the frame.
- LoadUrl(string)
Navigates the frame to a resource identified by the given
url
.
- LoadUrl(string, TimeSpan)
Navigates the frame to a resource identified by the given
url
.
- Print()
Requests printing of the currently loaded web page in this frame.
- ViewSource()
Opens a popup with the frame's source like the browser does when showing page source.