You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 🚀 What's New in v2.1.0-alpha - Frame Support & Event Isolation
69
66
70
67
This patch introduces first-class support for `iframe` interaction, allowing developers to target specific frames for script execution, messaging, and host object binding.
@@ -357,6 +354,14 @@ Returns a pipe-separated string of all tracked iframe names.
357
354
Asynchronously retrieves the HTML of the frame at the specified index (sent via OnMessageReceived with 'FRAME_HTML_SOURCE|Index|').
358
355
`object.GetFrameHtmlSource(Index As Integer)`
359
356
357
+
##### ⚡ GetFrame
358
+
Returns a `WebView2Frame` COM object for the frame at the specified index. Returns `Null` if the index is invalid.
359
+
`object.GetFrame(Index As Integer)`
360
+
361
+
##### ⚡ GetFrameById
362
+
Returns a `WebView2Frame` COM object for the frame matching the specified FrameId. Returns `Null` if not found.
363
+
`object.GetFrameById(FrameId As UInt)`
364
+
360
365
##### ⚡ GetSelectedText
361
366
Asynchronously retrieves the currently selected text (sent via OnMessageReceived with 'SELECTED_TEXT|').
362
367
`object.GetSelectedText()`
@@ -661,98 +666,108 @@ Fired when the browser requires basic authentication credentials for a URI.
661
666
Complete(): Notifies the browser that credentials have been set (supports asynchronous data gathering).*
662
667
663
668
669
+
##### 🔔 OnPermissionRequested
670
+
Fired when the page requests a permission (e.g. Geolocation, Camera, Microphone).
671
+
`object_OnPermissionRequested(Sender As Object, ParentHandle As String, Args As Object)`
672
+
*Args properties:
673
+
Handled (bool): Set to True to indicate the event is handled.
674
+
IsUserInitiated (bool): Whether the request was triggered by user interaction.
675
+
PermissionKind (int): The type of permission requested.
676
+
State (int): Get/Set the permission state (0=Default, 1=Allow, 2=Deny).
677
+
Uri (string): The URI of the page requesting the permission.
678
+
*Args methods:
679
+
GetDeferral(): Acquires an async deferral for out-of-band decision making.
680
+
Complete(): Completes the deferral and notifies the browser of the decision.*
681
+
664
682
#### ===🔔Frame Events===
665
683
666
684
##### 🔔 OnFrameCreated
667
685
Fired when a new iframe is created in the document.
668
-
`object_OnFrameCreated(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame)`
686
+
`object_OnFrameCreated(Sender As Object, ParentHandle As String, Frame As Object)`
669
687
670
688
##### 🔔 OnFrameDestroyed
671
689
Fired when an iframe is removed from the document.
672
-
`object_OnFrameDestroyed(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame)`
690
+
`object_OnFrameDestroyed(Sender As Object, ParentHandle As String, Frame As Object)`
673
691
674
692
##### 🔔 OnFrameNameChanged
675
693
Fired when an iframe's name attribute changes.
676
-
`object_OnFrameNameChanged(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame)`
694
+
`object_OnFrameNameChanged(Sender As Object, ParentHandle As String, Frame As Object)`
677
695
678
696
##### 🔔 OnFrameNavigationStarting
679
697
Fired when a frame starts navigating to a new URL.
680
-
`object_OnFrameNavigationStarting(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, Url As String)`
698
+
`object_OnFrameNavigationStarting(Sender As Object, ParentHandle As String, Frame As Object, Url As String)`
681
699
682
700
##### 🔔 OnFrameNavigationCompleted
683
701
Fired when a frame navigation has finished.
684
-
`object_OnFrameNavigationCompleted(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, IsSuccess As Boolean, WebErrorStatus As Integer)`
702
+
`object_OnFrameNavigationCompleted(Sender As Object, ParentHandle As String, Frame As Object, IsSuccess As Boolean, WebErrorStatus As Integer)`
685
703
686
704
##### 🔔 OnFrameContentLoading
687
705
Fired when a frame starts loading content.
688
-
`object_OnFrameContentLoading(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, NavigationId As Long)`
706
+
`object_OnFrameContentLoading(Sender As Object, ParentHandle As String, Frame As Object, NavigationId As Long)`
689
707
690
708
##### 🔔 OnFrameDOMContentLoaded
691
709
Fired when a frame's DOM content is fully loaded.
692
-
`object_OnFrameDOMContentLoaded(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, NavigationId As Long)`
710
+
`object_OnFrameDOMContentLoaded(Sender As Object, ParentHandle As String, Frame As Object, NavigationId As Long)`
693
711
694
712
##### 🔔 OnFrameWebMessageReceived
695
713
Fired when a frame receives a message via `window.chrome.webview.postMessage`.
696
-
`object_OnFrameWebMessageReceived(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, Message As String)`
697
-
698
-
##### 🔔 OnFrameProcessFailed 🚧
699
-
Fired when a frame renderer or other process fails.
700
-
`object_OnFrameProcessFailed(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, Args As Object)`
714
+
`object_OnFrameWebMessageReceived(Sender As Object, ParentHandle As String, Frame As Object, Message As String)`
701
715
702
716
##### 🔔 OnFramePermissionRequested
703
717
Fired when a frame requests permission (e.g. Geolocation).
704
-
`object_OnFramePermissionRequested(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, Args As Object)`
705
-
706
-
##### 🔔 OnFrameScreenCaptureStarting
707
-
Fired when a frame starts a screen capture session.
708
-
`object_OnFrameScreenCaptureStarting(Sender As Object, ParentHandle As HWND, Frame As IWebView2Frame, Args As Object)`
718
+
`object_OnFramePermissionRequested(Sender As Object, ParentHandle As String, Frame As Object, Args As Object)`
719
+
*See `OnPermissionRequested` Args for property details.*
0 commit comments