CoreWebView2Frame Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
CoreWebView2Frame provides direct access to the iframes information and handling.
public class CoreWebView2Frame
type CoreWebView2Frame = class
Public Class CoreWebView2Frame
- Inheritance
-
CoreWebView2Frame
Properties
FrameId |
The unique identifier of the current frame. It's the same kind of ID as with the FrameId and FrameId. |
Name |
The name of the iframe from the iframe html tag declaring it. |
UseOverrideTimerWakeInterval |
Methods
AddHostObjectToScript(String, Object, IEnumerable<String>) |
Adds the provided host object to script running in the WebViewFrame with the specified name for the list of the specified origins. The host object will be accessible for this iframe only if the iframe's origin during access matches one of the origins which are passed. The provided origins will be normalized before comparing to the origin of the document. So the scheme name is made lower case, the host will be punycode decoded as appropriate, default port values will be removed, and so on. This means the origin's host may be punycode encoded or not and will match regardless. If list contains malformed origin the call will fail. The method can be called multiple times in a row without calling RemoveHostObjectFromScript for the same object name. It will replace the previous object with the new object and new list of origins. List of origins will be treated as following:
|
ExecuteScriptAsync(String) |
Runs JavaScript code from the |
IsDestroyed() |
Check whether a frame is destroyed. Returns true during the Destroyed event. |
PostSharedBufferToScript(CoreWebView2SharedBuffer, CoreWebView2SharedBufferAccess, String) |
Share a shared buffer object with script of the iframe in the WebView. |
PostWebMessageAsJson(String) |
Posts the specified |
PostWebMessageAsString(String) |
Posts a message that is a simple string rather than a JSON string representation of a JavaScript object. |
RemoveHostObjectFromScript(String) |
Remove the host object specified by the name so that it is no longer accessible from JavaScript code in the iframe. |
Events
ContentLoading |
ContentLoading is raised before any content is loaded, including scripts added with AddScriptToExecuteOnDocumentCreatedAsync(String). ContentLoading is not raised if a same page navigation occurs. |
Destroyed |
Destroyed event is raised when the iframe corresponding to this CoreWebView2Frame object is removed or the document containing that iframe is destroyed. |
DOMContentLoaded |
DOMContentLoaded is raised when the initial HTML document has been parsed. |
NameChanged |
NameChanged is raised when the iframe changes its |
NavigationCompleted |
NavigationCompleted is raised when the current frame has completely loaded ( |
NavigationStarting |
NavigationStarting is raised when the current frame is requesting permission to navigate to a different URI. |
PermissionRequested |
PermissionRequested is raised when content in an iframe or any of its descendant iframes requests permission to access some privileged resources. |
ScreenCaptureStarting |
ScreenCaptureStarting event is raised when the Screen Capture API is requested by the user using getDisplayMedia(). |
WebMessageReceived |
WebMessageReceived is raised when the IsWebMessageEnabled setting is set and the iframe runs |