Skip to content

Commit 0c49c3f

Browse files
authored
v2.2.0-alpha
1 parent d06b8f8 commit 0c49c3f

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

NetWebView2Lib.au3

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#Tidy_Parameters=/tcb=-1
88

9-
; NetWebView2Lib.au3 - Script Version: 2026.3.17.12 🚩
9+
; NetWebView2Lib.au3 - Script Version: 2026.3.17.22 🚩
1010

1111
#include <Array.au3>
1212
#include <GUIConstantsEx.au3>
@@ -1498,7 +1498,7 @@ EndFunc ;==>__NetWebView2_freezer
14981498

14991499
#EndRegion ; === NetWebView2Lib UDF === #INTERNAL_USE_ONLY#
15001500

1501-
#Region ; === NetWebView2Lib UDF === EVENT HANDLERS === Collection ===
1501+
#Region ; === NetWebView2Lib UDF === EVENT HANDLERS ***** Collection *****
15021502

15031503
#Region ; === NetWebView2Lib UDF === EVENT HANDLERS === Error Handlers ===
15041504
; #INTERNAL_USE_ONLY# ===========================================================================================================
@@ -1628,9 +1628,17 @@ Volatile Func __NetWebView2_Events__OnMessageReceived($oWebV2M, $hGUI, $sMsg)
16281628
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__URL_CHANGED)
16291629

16301630
Case "NAV_ERROR"
1631-
__NetWebView2_Log(@ScriptLineNumber, $s_Prefix & " COMMAND:" & $sCommand, 1)
1632-
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__NAV_ERROR)
1633-
$oWebV2M.Stop()
1631+
If $sData = "OperationCanceled" Then ; Check if the error is actually a user cancellation
1632+
__NetWebView2_Log(@ScriptLineNumber, $s_Prefix & " COMMAND:USER_ABORT (Navigation Canceled)", 1)
1633+
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__USER_ABORT)
1634+
Else
1635+
__NetWebView2_Log(@ScriptLineNumber, $s_Prefix & " COMMAND:" & $sCommand & " Data:" & $sData, 1)
1636+
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__NAV_ERROR)
1637+
$oWebV2M.Stop() ; We only stop if it is a real error.
1638+
EndIf
1639+
1640+
; 🚧 *******************************************
1641+
ConsoleWrite("> TEST NAV_ERR: " & $sMsg & @CRLF)
16341642
ConsoleWrite("> TEST NAV_ERR: __NetWebView2_LastMessage_KEEPER($oWebV2M)=" & __NetWebView2_LastMessage_KEEPER($oWebV2M) & " SLN=" & @ScriptLineNumber & @CRLF)
16351643

16361644
Case "NAV_COMPLETED"
@@ -1957,7 +1965,7 @@ EndFunc ;==>__NetWebView2_Events__OnTitleChanged
19571965
; Modified ......:
19581966
; Remarks .......:
19591967
; Related .......:
1960-
; Link ..........:
1968+
; Link ..........: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.navigationstarting
19611969
; Example .......: No
19621970
; ===============================================================================================================================
19631971
Volatile Func __NetWebView2_Events__OnNavigationStarting($oWebV2M, $hGUI, $oArgs)
@@ -2052,7 +2060,7 @@ EndFunc ;==>__NetWebView2_Events__OnContextMenu
20522060
; Modified ......:
20532061
; Remarks .......:
20542062
; Related .......:
2055-
; Link ..........: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.webresourceresponsereceived?view=webview2-dotnet-1.0.2849.39
2063+
; Link ..........: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.webresourceresponsereceived
20562064
; Example .......: No
20572065
; ===============================================================================================================================
20582066
Volatile Func __NetWebView2_Events__OnWebResourceResponseReceived($oWebV2M, $hGUI, $iStatusCode, $sReasonPhrase, $sRequestUrl)
@@ -2205,7 +2213,7 @@ EndFunc ;==>__NetWebView2_Events__OnProcessFailed
22052213
; Remarks .......: The host can provide a response with credentials for the authentication or cancel the request.
22062214
; If the host sets the Cancel property to false but does not provide either UserName or Password properties on the Response property, then WebView2 will show the default authentication challenge dialog prompt to the user.
22072215
; Related .......:
2208-
; Link ..........: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.basicauthenticationrequested?view=webview2-dotnet-1.0.2903.40
2216+
; Link ..........: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.basicauthenticationrequested
22092217
; Example .......: No
22102218
; ===============================================================================================================================
22112219
Volatile Func __NetWebView2_Events__OnBasicAuthenticationRequested($oWebV2M, $hGUI, $oArgs)
@@ -2431,4 +2439,4 @@ EndFunc ;==>__NetWebView2_Events__FrameKeeper
24312439
;~ EndFunc ;==>__NetWebView2_Events__OnScreenCaptureStarting
24322440
#EndRegion ; === NetWebView2Lib UDF === EVENT HANDLERS * #TODO ===
24332441

2434-
#EndRegion ; === NetWebView2Lib UDF === EVENT HANDLERS === Collection ===
2442+
#EndRegion ; === NetWebView2Lib UDF === EVENT HANDLERS ***** Collection *****

0 commit comments

Comments
 (0)