From 4cbe66cb09e967dc69872abc81eeb4015a79af6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipok?= <11089482+mlipok@users.noreply.github.com> Date: Tue, 17 Feb 2026 23:34:26 +0100 Subject: [PATCH 1/5] 018-BasicFramesDemo.au3 --- examples/018-BasicFramesDemo.au3 | 286 +++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 examples/018-BasicFramesDemo.au3 diff --git a/examples/018-BasicFramesDemo.au3 b/examples/018-BasicFramesDemo.au3 new file mode 100644 index 0000000..c59ac4f --- /dev/null +++ b/examples/018-BasicFramesDemo.au3 @@ -0,0 +1,286 @@ +#WIP - this Example is imported from 1.5.0 UDF - and is in "WORK IN PROGRESS" state +#AutoIt3Wrapper_UseX64=y +#AutoIt3Wrapper_Run_AU3Check=Y +#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y +;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 + +; 001-BasicDemo.au3 + +#include +#include +#include "..\NetWebView2Lib.au3" + +Main() + +Func Main() + ConsoleWrite("! MicrosoftEdgeWebview2 : version check: " & _NetWebView2_IsAlreadyInstalled() & ' ERR=' & @error & ' EXT=' & @extended & @CRLF) + + Local $oMyError = ObjEvent("AutoIt.Error", __NetWebView2_COMErrFunc) + #forceref $oMyError + + ; Create the UI + Local $iHeight = 800 + Local $hGUI = GUICreate("WebView2 .NET Manager - Community Demo", 1100, $iHeight) + GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI") + + WinMove($hGUI, '', Default, Default, 800, 440) + GUISetState(@SW_SHOW, $hGUI) + + ; Initialize WebView2 Manager and register events + Local $oWebV2M = _NetWebView2_CreateManager("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0", "", "--disable-gpu, --mute-audio") + If @error Then Return SetError(@error, @extended, $oWebV2M) + + ; Initialize JavaScript Bridge + Local $oJSBridge = _NetWebView2_GetBridge($oWebV2M, "_BridgeMyEventsHandler_") + If @error Then Return SetError(@error, @extended, $oWebV2M) + + Local $sProfileDirectory = @ScriptDir & "\NetWebView2Lib-UserDataFolder" + _NetWebView2_Initialize($oWebV2M, $hGUI, $sProfileDirectory, 0, 0, 0, 0, True, True, 1.2, "0x2B2B2B", False) + If @error Then Return SetError(@error, @extended, $oWebV2M) + + __Example_Log(@ScriptLineNumber, "After: _NetWebView2_Initialize()" & @CRLF) + + ; navigate to HTML string - full fill the object with your own offline content - without downloading any content + ConsoleWrite(@CRLF) + + __Example_Log(@ScriptLineNumber, "Before: _NetWebView2_NavigateToString()") + GUISetState(@SW_SHOW, $hGUI) + WinMove($hGUI, '', Default, Default, 1100, 800) + + #COMMENT This example is based on ==> ; https://github.com/Danp2/au3WebDriver/blob/1834e95206bd4a6ef6952c47a1f1192042f98c0b/wd_demo.au3#L588-L732 + #Region - Testing how to manage frames + _NetWebView2_Navigate($oWebV2M, 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe', $NETWEBVIEW2_MESSAGE__TITLE_CHANGED, "", 5000) + MsgBox($MB_TOPMOST, "TEST #" & @ScriptLineNumber, 1) +;~ _Demo_NavigateCheckBanner($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe", '//*[@id="snigel-cmp-framework" and @class="snigel-cmp-framework"]') + If @error Then Return SetError(@error, @extended) + + #Region ; testing NetWebView2Lib new methodes + Local $iFrameCount = $oWebV2M.GetFrameCount() + ConsoleWrite(@CRLF) + ConsoleWrite("! " & @ScriptLineNumber & " : Frames=" & $iFrameCount & @CRLF) + For $IDX_Frame = 0 To $iFrameCount -1 + ConsoleWrite("- IDX=" & $IDX_Frame & @CRLF) + ConsoleWrite("- URL=" & $oWebV2M.GetFrameUrl($IDX_Frame) & @CRLF) + ConsoleWrite("- NAME=" & $oWebV2M.GetFrameName($IDX_Frame) & @CRLF) + ConsoleWrite(@CRLF) + Next + + ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameUrls() :" & @CRLF & $oWebV2M.GetFrameUrls() & @CRLF) + ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameNames() :" & @CRLF & $oWebV2M.GetFrameNames() & @CRLF) + For $IDX_Frame = 0 To $iFrameCount -1 + ConsoleWrite(@CRLF & "======================================================" & @CRLF) + ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameHtmlSource("&$IDX_Frame&") :" & @CRLF & $oWebV2M.GetFrameHtmlSource($IDX_Frame) & @CRLF) + Next + ConsoleWrite(@CRLF & "======================================================" & @CRLF) + ConsoleWrite(@CRLF) + ConsoleWrite(@CRLF) + #EndRegion ; testing NetWebView2Lib new methodes + +#CS + ; just after navigate current context should be on top level Window + ConsoleWrite("wd_demo.au3: (" & @ScriptLineNumber & ") : TopWindow = " & $bIsWindowTop & @CRLF) + + $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe[@id='iframeResult']") + ; changing context to first frame + _WD_FrameEnter($sSession, $sElement) + If @error Then Return SetError(@error, @extended) + + $bIsWindowTop = _WD_IsWindowTop($sSession) + ; after changing context to first frame the current context is not on top level Window + ConsoleWrite("wd_demo.au3: (" & @ScriptLineNumber & ") : TopWindow = " & $bIsWindowTop & @CRLF) + + ; changing context to first sub frame using iframe element specified ByXPath + $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe") + _WD_FrameEnter($sSession, $sElement) + If @error Then Return SetError(@error, @extended) + + ; Leaving sub frame + _WD_FrameLeave($sSession) + If @error Then Return SetError(@error, @extended) + + $bIsWindowTop = _WD_IsWindowTop($sSession) + ; after leaving sub frame, the current context is back to first frame but still is not on top level Window + ConsoleWrite("wd_demo.au3: (" & @ScriptLineNumber & ") : TopWindow = " & $bIsWindowTop & @CRLF) + + ; Leaving first frame + _WD_FrameLeave($sSession) + If @error Then Return SetError(@error, @extended) +#CE + + #EndRegion - Testing how to manage frames + +#CS + + #Region - Testing _WD_FrameList() usage + + #Region - Example 1 ; from 'https://www.w3schools.com' get frame list as string + $bIsWindowTop = _WD_IsWindowTop($sSession) + ; after leaving first frame, the current context should back on top level Window + ConsoleWrite("wd_demo.au3: (" & @ScriptLineNumber & ") : TopWindow = " & $bIsWindowTop & @CRLF) + + ; now lets try to check frame list and using locations as path 'null/0' + ; firstly go to website + _WD_Navigate($sSession, 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe') + _WD_LoadWait($sSession) + + Local $sResult = _WD_FrameList($sSession, False) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 1" & @CRLF) + ConsoleWrite($sResult & @CRLF) + #EndRegion - Example 1 ; from 'https://www.w3schools.com' get frame list as string + + #Region - Example 2 ; from 'https://www.w3schools.com' get frame list as array + Local $aFrameList = _WD_FrameList($sSession, True) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 2" & @CRLF) + _ArrayDisplay($aFrameList, 'Example 2 - w3schools.com - get frame list as array', 0, 0, Default, $sArrayHeader) + + #EndRegion - Example 2 ; from 'https://www.w3schools.com' get frame list as array + + #Region - Example 3 ; from 'https://www.w3schools.com' get frame list as array, while current location is "null/0" + ; check if document context location is Top Window - should be as we are after navigation + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + ; change document context location by path 'null/0' + _WD_FrameEnter($sSession, 'null/0') + + ; check if document context location is Top Window - should not be as we enter to frame 'null/0' + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + $aFrameList = _WD_FrameList($sSession, True) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 3" & @CRLF) + _ArrayDisplay($aFrameList, 'Example 3 - w3schools.com - relative to "null/0"', 0, 0, Default, $sArrayHeader) + #EndRegion - Example 3 ; from 'https://www.w3schools.com' get frame list as array, while current location is "null/0" + + #Region - Example 4 ; from 'https://stackoverflow.com' get frame list as string + ; go to another website + _WD_Navigate($sSession, 'https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom') + _WD_LoadWait($sSession) + + $sResult = _WD_FrameList($sSession, False) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 4" & @CRLF) + ConsoleWrite($sResult & @CRLF) + #EndRegion - Example 4 ; from 'https://stackoverflow.com' get frame list as string + + #Region - Example 5 ; from 'https://stackoverflow.com' get frame list as array + $aFrameList = _WD_FrameList($sSession, True) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 5" & @CRLF) + _ArrayDisplay($aFrameList, 'Example 5 - stackoverflow.com - get frame list as array', 0, 0, Default, $sArrayHeader) + #EndRegion - Example 5 ; from 'https://stackoverflow.com' get frame list as array + + #Region - Example 6v1 ; from 'https://stackoverflow.com' get frame list as array, while is current location is "null/2" + ; check if document context location is Top Window - should be as we are after navigation + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + ; change document context location by path 'null/2' + _WD_FrameEnter($sSession, 'null/2') + + ; check if document context location is Top Window - should not be as we enter to frame 'null/2' + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + $aFrameList = _WD_FrameList($sSession, True) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 6v1" & @CRLF) + _ArrayDisplay($aFrameList, 'Example 6v1 - stackoverflow.com - relative to "null/2"', 0, 0, Default, $sArrayHeader) + #EndRegion - Example 6v1 ; from 'https://stackoverflow.com' get frame list as array, while is current location is "null/2" + + #Region - Example 6v2 ; from 'https://stackoverflow.com' get frame list as array, check if it is still relative to the same location as it was before recent _WD_FrameList() was used - still should be "null/2" + ; check if document context location is Top Window + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + $aFrameList = _WD_FrameList($sSession, True) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example 6v2" & @CRLF) + _ArrayDisplay($aFrameList, 'Example 6v2 - stackoverflow.com - check if it is still relative to "null/2"', 0, 0, Default, $sArrayHeader) + #EndRegion - Example 6v2 ; from 'https://stackoverflow.com' get frame list as array, check if it is still relative to the same location as it was before recent _WD_FrameList() was used - still should be "null/2" + + #EndRegion - Testing _WD_FrameList() usage + + #Region - Testing element location in frame set and iframe collecion + ; go to website + _WD_Navigate($sSession, 'https://www.tutorialspoint.com/html/html_frames.htm#') + _WD_LoadWait($sSession) + + ; check if document context location is Top Window + ConsoleWrite("> " & @ScriptLineNumber & " IsWindowTop = " & _WD_IsWindowTop($sSession) & @CRLF) + + MsgBox($MB_TOPMOST, "", 'Before checking location of multiple elements on multiple frames' & @CRLF & 'Try the same example with and without waiting about 30 seconds in order to see that many frames should be fully loaded, and to check the differences') + + $aFrameList = _WD_FrameList($sSession, True, 5000, Default) + ConsoleWrite("! ---> @error=" & @error & " @extended=" & @extended & " : Example : Testing element location in frame set - after pre-checking list of frames" & @CRLF) + _ArrayDisplay($aFrameList, @ScriptLineNumber & ' Before _WD_FrameListFindElement - www.tutorialspoint.com - get frame list as array', 0, 0, Default, $sArrayHeader) + + Local $aLocationOfElement = _WD_FrameListFindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "li.nav-item[data-bs-original-title='Home Page'] a.nav-link[href='https://www.tutorialspoint.com/index.htm']") + ConsoleWrite("wd_demo.au3: (" & @ScriptLineNumber & ") : $aLocationOfElement (" & UBound($aLocationOfElement) & ")=" & @CRLF & _ArrayToString($aLocationOfElement) & @CRLF) + _ArrayDisplay($aLocationOfElement, @ScriptLineNumber & ' $aLocationOfElement', 0, 0, Default, $sArrayHeader) + + #EndRegion - Testing element location in frame set and iframe collecion + +#CE + + ; Main Loop + While 1 + Switch GUIGetMsg() + Case $GUI_EVENT_CLOSE + ExitLoop + EndSwitch + WEnd + + GUIDelete($hGUI) + + + _NetWebView2_CleanUp($oWebV2M, $oJSBridge) +EndFunc ;==>Main + +; ============================================================================== +; ; Function to update a text element inside the WebView UI +; ============================================================================== +Func UpdateWebUI($oWebV2M, $sElementId, $sNewText) + If Not IsObj($oWebV2M) Then Return '' + + ; Escape backslashes, single quotes and handle new lines for JavaScript safety + Local $sCleanText = StringReplace($sNewText, "\", "\\") + $sCleanText = StringReplace($sCleanText, "'", "\'") + $sCleanText = StringReplace($sCleanText, @CRLF, "\n") + $sCleanText = StringReplace($sCleanText, @LF, "\n") + + Local $sJavaScript = "document.getElementById('" & $sElementId & "').innerText = '" & $sCleanText & "';" + _NetWebView2_ExecuteScript($oWebV2M, $sJavaScript) +EndFunc ;==>UpdateWebUI + +; ============================================================================== +; MY EVENT HANDLER: Bridge (JavaScript Messages) +; ============================================================================== +Func _BridgeMyEventsHandler_OnMessageReceived($oWebV2M, $hGUI, $sMessage) + Local Static $iMsgCnt = 0 + + If $sMessage = "CLOSE_APP" Then + If MsgBox(36, "Confirm", "Exit Application?", 0, $hGUI) = 6 Then Exit + Else + MsgBox(64, "JS Notification", "Message from Browser: " & $sMessage) + $iMsgCnt += 1 + UpdateWebUI($oWebV2M, "mainTitle", $iMsgCnt & " Hello from AutoIt!") + EndIf +EndFunc ;==>_BridgeMyEventsHandler_OnMessageReceived + +; ============================================================================== +; HELPER: Demo HTML Content +; ============================================================================== +Func __GetDemoHTML() + Local $sH = _ + '' & _ + '
' & _ + '

WebView2 + AutoIt .NET Manager

' & _ ; Fixed ID attribute + '

The communication is now 100% Event-Driven (No Sleep needed).

' & _ + ' ' & _ + ' ' & _ + '
' & _ + '' + Return $sH +EndFunc ;==>__GetDemoHTML + +Func __Example_Log($s_ScriptLineNumber, $sString, $iError = @error, $iExtended = @extended) + ConsoleWrite(@ScriptName & ' SLN=' & $s_ScriptLineNumber & ' [' & $iError & '/' & $iExtended & '] ::: ' & $sString & @CRLF) + Return SetError($iError, $iExtended, '') +EndFunc ;==>__Example_Log From 1d8ad454d2df54686513275c23cde4bf95ff64a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipok?= <11089482+mlipok@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:19:37 +0100 Subject: [PATCH 2/5] Update 018-BasicFramesDemo.au3 --- examples/018-BasicFramesDemo.au3 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/018-BasicFramesDemo.au3 b/examples/018-BasicFramesDemo.au3 index c59ac4f..6e90af7 100644 --- a/examples/018-BasicFramesDemo.au3 +++ b/examples/018-BasicFramesDemo.au3 @@ -54,27 +54,40 @@ Func Main() ;~ _Demo_NavigateCheckBanner($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe", '//*[@id="snigel-cmp-framework" and @class="snigel-cmp-framework"]') If @error Then Return SetError(@error, @extended) - #Region ; testing NetWebView2Lib new methodes + #Region ; Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) Local $iFrameCount = $oWebV2M.GetFrameCount() ConsoleWrite(@CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : Frames=" & $iFrameCount & @CRLF) - For $IDX_Frame = 0 To $iFrameCount -1 + For $IDX_Frame = 0 To $iFrameCount - 1 ConsoleWrite("- IDX=" & $IDX_Frame & @CRLF) ConsoleWrite("- URL=" & $oWebV2M.GetFrameUrl($IDX_Frame) & @CRLF) ConsoleWrite("- NAME=" & $oWebV2M.GetFrameName($IDX_Frame) & @CRLF) ConsoleWrite(@CRLF) Next + #EndRegion ; Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) + #Region ; Example part 2 - testing NetWebView2Lib new methodes .GetFrameUrls() .GetFrameNames() ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameUrls() :" & @CRLF & $oWebV2M.GetFrameUrls() & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameNames() :" & @CRLF & $oWebV2M.GetFrameNames() & @CRLF) - For $IDX_Frame = 0 To $iFrameCount -1 + #EndRegion ; Example part 2 - testing NetWebView2Lib new methodes .GetFrameUrls() .GetFrameNames() + + #Region ; Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame) + For $IDX_Frame = 0 To $iFrameCount - 1 ConsoleWrite(@CRLF & "======================================================" & @CRLF) - ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameHtmlSource("&$IDX_Frame&") :" & @CRLF & $oWebV2M.GetFrameHtmlSource($IDX_Frame) & @CRLF) + ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameHtmlSource(" & $IDX_Frame & ") :" & @CRLF & $oWebV2M.GetFrameHtmlSource($IDX_Frame) & @CRLF) Next ConsoleWrite(@CRLF & "======================================================" & @CRLF) ConsoleWrite(@CRLF) ConsoleWrite(@CRLF) - #EndRegion ; testing NetWebView2Lib new methodes + #Region ; Example part 1 - testing NetWebView2Lib new methodes + +#cs NOT SUPPORTED YET + Local $oFrame0 = $oWebV2M.GetFrame(0) + Local $oFrame1 = $oWebV2M.GetFrame(1) + Local $oFrame2 = $oWebV2M.GetFrame(2) + Local $oFrame3 = $oWebV2M.GetFrame(3) +#CE NOT SUPPORTED YET + #CS ; just after navigate current context should be on top level Window @@ -107,7 +120,7 @@ Func Main() If @error Then Return SetError(@error, @extended) #CE - #EndRegion - Testing how to manage frames + #EndRegion ; Example part 1 - testing NetWebView2Lib new methodes #CS From 96a5b1a14a621c38fbe92b5831f0e7a9acbd08e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipok?= <11089482+mlipok@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:23:02 +0100 Subject: [PATCH 3/5] Update 018-BasicFramesDemo.au3 --- examples/018-BasicFramesDemo.au3 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/018-BasicFramesDemo.au3 b/examples/018-BasicFramesDemo.au3 index 6e90af7..02ae71d 100644 --- a/examples/018-BasicFramesDemo.au3 +++ b/examples/018-BasicFramesDemo.au3 @@ -55,6 +55,8 @@ Func Main() If @error Then Return SetError(@error, @extended) #Region ; Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) + ConsoleWrite("+ Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame)" & @CRLF) + Local $iFrameCount = $oWebV2M.GetFrameCount() ConsoleWrite(@CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : Frames=" & $iFrameCount & @CRLF) @@ -66,12 +68,15 @@ Func Main() Next #EndRegion ; Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) - #Region ; Example part 2 - testing NetWebView2Lib new methodes .GetFrameUrls() .GetFrameNames() + #Region ; Example part 2 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) + ConsoleWrite("+ Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame)" & @CRLF) + ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameUrls() :" & @CRLF & $oWebV2M.GetFrameUrls() & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameNames() :" & @CRLF & $oWebV2M.GetFrameNames() & @CRLF) #EndRegion ; Example part 2 - testing NetWebView2Lib new methodes .GetFrameUrls() .GetFrameNames() #Region ; Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame) + ConsoleWrite("+ Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame)" & @CRLF) For $IDX_Frame = 0 To $iFrameCount - 1 ConsoleWrite(@CRLF & "======================================================" & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameHtmlSource(" & $IDX_Frame & ") :" & @CRLF & $oWebV2M.GetFrameHtmlSource($IDX_Frame) & @CRLF) From 72f04d6ecfd169d444e8a3b546d94744b05afd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipok?= <11089482+mlipok@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:23:34 +0100 Subject: [PATCH 4/5] Update 018-BasicFramesDemo.au3 --- examples/018-BasicFramesDemo.au3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/018-BasicFramesDemo.au3 b/examples/018-BasicFramesDemo.au3 index 02ae71d..fe74b2b 100644 --- a/examples/018-BasicFramesDemo.au3 +++ b/examples/018-BasicFramesDemo.au3 @@ -69,7 +69,7 @@ Func Main() #EndRegion ; Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) #Region ; Example part 2 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) - ConsoleWrite("+ Example part 1 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame)" & @CRLF) + ConsoleWrite("+ Example part 2 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame)" & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameUrls() :" & @CRLF & $oWebV2M.GetFrameUrls() & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameNames() :" & @CRLF & $oWebV2M.GetFrameNames() & @CRLF) From 8ed88f0e918504dfe7504baee1df0b9ce5add5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipok?= <11089482+mlipok@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:27:28 +0100 Subject: [PATCH 5/5] Update 018-BasicFramesDemo.au3 --- examples/018-BasicFramesDemo.au3 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/018-BasicFramesDemo.au3 b/examples/018-BasicFramesDemo.au3 index fe74b2b..e67de88 100644 --- a/examples/018-BasicFramesDemo.au3 +++ b/examples/018-BasicFramesDemo.au3 @@ -2,9 +2,9 @@ #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y -;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 +#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 -; 001-BasicDemo.au3 +; 018-BasicFramesDemo.au3 #include #include @@ -49,6 +49,7 @@ Func Main() #COMMENT This example is based on ==> ; https://github.com/Danp2/au3WebDriver/blob/1834e95206bd4a6ef6952c47a1f1192042f98c0b/wd_demo.au3#L588-L732 #Region - Testing how to manage frames + _NetWebView2_Navigate($oWebV2M, 'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe', $NETWEBVIEW2_MESSAGE__TITLE_CHANGED, "", 5000) MsgBox($MB_TOPMOST, "TEST #" & @ScriptLineNumber, 1) ;~ _Demo_NavigateCheckBanner($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe", '//*[@id="snigel-cmp-framework" and @class="snigel-cmp-framework"]') @@ -73,7 +74,7 @@ Func Main() ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameUrls() :" & @CRLF & $oWebV2M.GetFrameUrls() & @CRLF) ConsoleWrite("! " & @ScriptLineNumber & " : GetFrameNames() :" & @CRLF & $oWebV2M.GetFrameNames() & @CRLF) - #EndRegion ; Example part 2 - testing NetWebView2Lib new methodes .GetFrameUrls() .GetFrameNames() + #EndRegion ; Example part 2 - testing NetWebView2Lib new methodes: .GetFrameCount() .GetFrameUrl($IDX_Frame) .GetFrameName($IDX_Frame) #Region ; Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame) ConsoleWrite("+ Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame)" & @CRLF) @@ -84,7 +85,8 @@ Func Main() ConsoleWrite(@CRLF & "======================================================" & @CRLF) ConsoleWrite(@CRLF) ConsoleWrite(@CRLF) - #Region ; Example part 1 - testing NetWebView2Lib new methodes + #EndRegion ; Example part 3 - testing NetWebView2Lib new methodes .GetFrameHtmlSource($IDX_Frame) + #cs NOT SUPPORTED YET Local $oFrame0 = $oWebV2M.GetFrame(0) @@ -125,7 +127,7 @@ Func Main() If @error Then Return SetError(@error, @extended) #CE - #EndRegion ; Example part 1 - testing NetWebView2Lib new methodes + #EndRegion - Testing how to manage frames #CS