@@ -73,6 +73,12 @@ Global Enum _ ; $NETWEBVIEW2_MESSAGE__* are set by __NetWebView2_Events__OnMessa
7373 $NETWEBVIEW2_MESSAGE__BROWSER_LOST_FOCUS , _
7474 $NETWEBVIEW2_MESSAGE___FAKE_COUNTER
7575
76+ Global Enum _
77+ $NETWEBVIEW2_EXECUTEJS_MODE0_FIREANDFORGET , _
78+ $NETWEBVIEW2_EXECUTEJS_MODE1_ASYNC , _
79+ $NETWEBVIEW2_EXECUTEJS_MODE2_RESULT , _
80+ $NETWEBVIEW2_ExecuteJS__FAKE_COUNTER
81+
7682#Region ; NetWebView2Lib UDF - _NetWebView2_* core functions
7783; #FUNCTION# ====================================================================================================================
7884; Name ..........: _NetWebView2_Initialize
@@ -100,7 +106,7 @@ Global Enum _ ; $NETWEBVIEW2_MESSAGE__* are set by __NetWebView2_Events__OnMessa
100106; Example .......: No
101107; ===============================================================================================================================
102108Func _NetWebView2_Initialize($oWebV2M , $hGUI , $s_ProfileDirectory , $i_Left = 0 , $i_Top = 0 , $i_Width = 0 , $i_Height = 0 , $b_LoadWait = True , $b_SetAutoResize = True , $b_DevToolsEnabled = True , $i_ZoomFactor = 1.0 , $s_BackColor = " 0x2B2B2B" , $b_InitConsole = False )
103- Local Const $s_Prefix = " [_NetWebView2_Initialize]:" & " GUI:" & $hGUI & " ProfileDirectory:" & $s_ProfileDirectory & " LEFT:" & $i_Left & " TOP:" & $i_Top & " WIDTH" & $i_Width & " HEIGHT:" & $i_Height & " LOADWAIT:" & $b_LoadWait & " SETAUTORESIZE:" & $b_SetAutoResize & " SetAutoResize:" & $b_DevToolsEnabled & " ZoomFactor:" & $i_ZoomFactor & " BackColor:" & $s_BackColor
109+ Local Const $s_Prefix = " [_NetWebView2_Initialize]: GUI:" & $hGUI & " ProfileDirectory:" & $s_ProfileDirectory & " LEFT:" & $i_Left & " TOP:" & $i_Top & " WIDTH" & $i_Width & " HEIGHT:" & $i_Height & " LOADWAIT:" & $b_LoadWait & " SETAUTORESIZE:" & $b_SetAutoResize & " SetAutoResize:" & $b_DevToolsEnabled & " ZoomFactor:" & $i_ZoomFactor & " BackColor:" & $s_BackColor
104110
105111 ; ⚠️ Important: Enclose ($hGUI) in parentheses to force "Pass-by-Value".
106112 ; This prevents the COM layer from changing the AutoIt variable type from Ptr to Int64.
@@ -143,7 +149,7 @@ EndFunc ;==>_NetWebView2_Initialize
143149; Example .......: No
144150; ===============================================================================================================================
145151Func _NetWebView2_CreateManager($sUserAgent = ' ' , $s_fnEventPrefix = " " , $s_AddBrowserArgs = " " )
146- Local Const $s_Prefix = " [_NetWebView2_CreateManager]:"
152+ Local Const $s_Prefix = " [_NetWebView2_CreateManager]: fnEventPrefix= " & $s_fnEventPrefix & " AddBrowserArgs= " & $s_AddBrowserArgs
147153 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
148154 #forceref $oMyError
149155
@@ -162,10 +168,6 @@ Func _NetWebView2_CreateManager($sUserAgent = '', $s_fnEventPrefix = "", $s_AddB
162168 EndIf
163169 ObjEvent ($oWebV2M , " __NetWebView2_Events__" , " IWebViewEvents" )
164170
165- If $s_fnEventPrefix <> " " Then
166- ObjEvent ($oWebV2M , $s_fnEventPrefix , " IWebViewEvents" )
167- EndIf
168-
169171 Return SetError (@error , @extended , $oWebV2M )
170172EndFunc ; ==>_NetWebView2_CreateManager
171173
@@ -201,10 +203,6 @@ Func _NetWebView2_GetBridge($oWebV2M, $s_fnEventPrefix = "")
201203 EndIf
202204 ObjEvent ($oWebJS , " __NetWebView2_JSEvents__" , " IBridgeEvents" )
203205
204- If $s_fnEventPrefix <> " " Then
205- ObjEvent ($oWebJS , $s_fnEventPrefix , " IBridgeEvents" )
206- EndIf
207-
208206 Return SetError (@error , @extended , $oWebJS )
209207EndFunc ; ==>_NetWebView2_GetBridge
210208
@@ -214,21 +212,21 @@ EndFunc ;==>_NetWebView2_GetBridge
214212; Syntax ........: _NetWebView2_ExecuteScript($oWebV2M, $sJavaScript[, $iMode = 0])
215213; Parameters ....: $oWebV2M - an object.
216214; $sJavaScript - a string value.
217- ; $iMode - [optional] One of the following search modes:
218- ; |0 - Execute, do not wait "Fire-and-Forget" - Default
219- ; |1 - ExecuteScriptOnPage "Async-Void Trap"
220- ; |2 - ExecuteScriptWithResult - This is the only method designed to return data
215+ ; $iMode - [optional] Default is $NETWEBVIEW2_EXECUTEJS_MODE0_FIREANDFORGET. One of the following search modes:
216+ ; |0 - $NETWEBVIEW2_EXECUTEJS_MODE0_FIREANDFORGET - Execute, do not wait "Fire-and-Forget"
217+ ; |1 - $NETWEBVIEW2_EXECUTEJS_MODE1_ASYNC - ExecuteScriptOnPage "Async-Void Trap"
218+ ; |2 - $NETWEBVIEW2_EXECUTEJS_MODE2_RESULT - ExecuteScriptWithResult - This is the only method designed to return data
221219; Return values .: None
222220; Author ........: mLipok, ioa747
223221; Modified ......:
224222; Remarks .......: $iMode additionall information:
225- ; 0. ExecuteScript (Fire-and-Forget)
223+ ; $NETWEBVIEW2_EXECUTEJS_MODE0_FIREANDFORGET - ExecuteScript (Fire-and-Forget)
226224; In the C# bridge, this is defined as a public void. It uses _webView.Invoke to send the command to the UI thread and exits immediately. It does not wait for the JavaScript to execute, and it has no return type.
227225; Use case: Clicking buttons, scrolling, or triggering JS events where you don't care about the result.
228- ; 1. ExecuteScriptOnPage (Async-Void Trap)
226+ ; $NETWEBVIEW2_EXECUTEJS_MODE1_ASYNC - ExecuteScriptOnPage (Async-Void Trap)
229227; This is defined as public async void. In COM Interop (which AutoIt uses), an async void method returns control to the caller (AutoIt) the moment it hits the first internal await. The script runs in the background, but the result is never passed back to the COM interface.
230228; Use case: Fast execution where background processing is acceptable, but again, no return value.
231- ; 2. ExecuteScriptWithResult
229+ ; $NETWEBVIEW2_EXECUTEJS_MODE2_RESULT - ExecuteScriptWithResult
232230; This is the only method designed to return data. It implements a Message Pump (using Application.DoEvents()) to keep the interface responsive while waiting up to 5 seconds for the result.
233231; Key Features of ExecuteScriptWithResult:
234232; Blocking: It waits for the script to finish (Sync-like behavior for AutoIt).
@@ -238,7 +236,7 @@ EndFunc ;==>_NetWebView2_GetBridge
238236; Link ..........: https://github.com/ioa747/NetWebView2Lib/issues/45#issuecomment-3831184514
239237; Example .......: No
240238; ===============================================================================================================================
241- Func _NetWebView2_ExecuteScript($oWebV2M , $sJavaScript , $iMode = 0 )
239+ Func _NetWebView2_ExecuteScript($oWebV2M , $sJavaScript , $iMode = $NETWEBVIEW2_EXECUTEJS_MODE0_FIREANDFORGET )
242240 Local Const $s_Prefix = " [_NetWebView2_ExecuteScript]:" & " TYPE: " & $iMode
243241 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
244242 #forceref $oMyError
@@ -303,7 +301,7 @@ EndFunc ;==>_NetWebView2_CleanUp
303301; Example .......: No
304302; ===============================================================================================================================
305303Func _NetWebView2_LoadWait($oWebV2M , $iWaitMessage = $NETWEBVIEW2_MESSAGE__INIT_READY , $iTimeOut_ms = 0 )
306- Local Const $s_Prefix = " [_NetWebView2_LoadWait]: iStatus:" & $iWaitMessage
304+ Local Const $s_Prefix = " [_NetWebView2_LoadWait]: iStatus:" & $iWaitMessage & " TimeOut_ms= " & $iTimeOut_ms
307305 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
308306 #forceref $oMyError
309307
@@ -364,7 +362,7 @@ EndFunc ;==>_NetWebView2_LoadWait
364362; Example .......: No
365363; ===============================================================================================================================
366364Func _NetWebView2_Navigate($oWebV2M , $sURL , $iWaitMessage = $NETWEBVIEW2_MESSAGE__TITLE_CHANGED , $iTimeOut_ms = 0 )
367- Local Const $s_Prefix = " [_NetWebView2_LoadWait]: URL:" & $sURL & " WAIT:" & $iWaitMessage
365+ Local Const $s_Prefix = " [_NetWebView2_LoadWait]: URL:" & $sURL & " WAIT:" & $iWaitMessage & " TimeOut_ms= " & $iTimeOut_ms
368366 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
369367 #forceref $oMyError
370368
@@ -405,10 +403,11 @@ EndFunc ;==>_NetWebView2_GetSource
405403; #FUNCTION# ====================================================================================================================
406404; Name ..........: _NetWebView2_NavigateToString
407405; Description ...:
408- ; Syntax ........: _NetWebView2_NavigateToString($oWebV2M, $s_HTML[, $b_LoadWait = True])
406+ ; Syntax ........: _NetWebView2_NavigateToString($oWebV2M, $s_HTML[, $b_LoadWait = True[, $iTimeOut_ms = 5000] ])
409407; Parameters ....: $oWebV2M - an object.
410408; $s_HTML - a string value.
411409; $b_LoadWait - [optional] a boolean value. Default is True.
410+ ; $iTimeOut_ms - [optional] an integer value. Default is 5000.
412411; Return values .: None
413412; Author ........: mLipok, ioa747
414413; Modified ......:
@@ -417,15 +416,15 @@ EndFunc ;==>_NetWebView2_GetSource
417416; Link ..........:
418417; Example .......: No
419418; ===============================================================================================================================
420- Func _NetWebView2_NavigateToString($oWebV2M , $s_HTML , $b_LoadWait = True )
421- Local Const $s_Prefix = " [_NetWebView2_NavigateToString]:" & " HTML Size:" & StringLen ($s_HTML ) & " LoadWait:" & $b_LoadWait
419+ Func _NetWebView2_NavigateToString($oWebV2M , $s_HTML , $b_LoadWait = True , $iTimeOut_ms = 5000 )
420+ Local Const $s_Prefix = " [_NetWebView2_NavigateToString]:" & " HTML Size:" & StringLen ($s_HTML ) & " LoadWait:" & $b_LoadWait & " TimeOut_ms= " & $iTimeOut_ms
422421 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
423422 #forceref $oMyError
424423
425424 Local $iNavigation = $oWebV2M .NavigateToString($s_HTML )
426425 If @error Then Return SetError (@error , @extended , $iNavigation )
427426
428- If $b_LoadWait Then _NetWebView2_LoadWait($oWebV2M )
427+ If $b_LoadWait Then _NetWebView2_LoadWait($oWebV2M , $NETWEBVIEW2_MESSAGE__TITLE_CHANGED , $iTimeOut_ms )
429428 If @error Then __NetWebView2_Log(@ScriptLineNumber , $s_Prefix , 1 )
430429 Return SetError (@error , @extended , ' ' )
431430EndFunc ; ==>_NetWebView2_NavigateToString
@@ -935,7 +934,7 @@ EndFunc ;==>__NetWebView2_COMErrFunc
935934
936935; Handles native WebView2 events
937936Func __NetWebView2_Events__OnMessageReceived($oWebV2M , $hGUI , $sMsg )
938- Local Const $s_Prefix = " [WebViewEvents__OnMessageReceived]: "
937+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnMessageReceived]: GUI: " & $hGUI
939938
940939 Local $iSplitPos = StringInStr ($sMsg , " |" )
941940 Local $sCommand = $iSplitPos ? StringStripWS (StringLeft ($sMsg , $iSplitPos - 1 ), 3 ) : $sMsg
@@ -1105,7 +1104,7 @@ EndFunc ;==>__NetWebView2_Events__OnMessageReceived
11051104
11061105; Handles custom messages from JavaScript (window.chrome.webview.postMessage)
11071106Func __NetWebView2_JSEvents__OnMessageReceived($oWebV2M , $hGUI , $sMsg )
1108- Local Const $s_Prefix = " [JSEvents__OnMessageReceived]:"
1107+ Local Const $s_Prefix = " [JSEvents__OnMessageReceived]: GUI: " & $hGUI
11091108 Local $oMyError = ObjEvent (" AutoIt.Error" , __NetWebView2_COMErrFunc) ; Local COM Error Handler
11101109 #forceref $oMyError
11111110
@@ -1171,7 +1170,7 @@ Func __NetWebView2_JSEvents__OnMessageReceived($oWebV2M, $hGUI, $sMsg)
11711170EndFunc ; ==>__NetWebView2_JSEvents__OnMessageReceived
11721171
11731172Func __NetWebView2_Events__OnBrowserGotFocus($oWebV2M , $hGUI , $iReason )
1174- Local Const $s_Prefix = " [WebViewEvents__OnBrowserGotFocus]: REASON: " & $iReason
1173+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnBrowserGotFocus]: GUI: " & $hGUI & " REASON: " & $iReason
11751174 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
11761175 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__BROWSER_GOT_FOCUS )
11771176 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1180,7 +1179,7 @@ Func __NetWebView2_Events__OnBrowserGotFocus($oWebV2M, $hGUI, $iReason)
11801179EndFunc ; ==>__NetWebView2_Events__OnBrowserGotFocus
11811180
11821181Func __NetWebView2_Events__OnBrowserLostFocus($oWebV2M , $hGUI , $iReason )
1183- Local Const $s_Prefix = " [WebViewEvents__OnBrowserLostFocus]: REASON: " & $iReason
1182+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnBrowserLostFocus]: GUI: " & $hGUI & " REASON: " & $iReason
11841183 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
11851184 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__BROWSER_LOST_FOCUS )
11861185 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1189,7 +1188,7 @@ Func __NetWebView2_Events__OnBrowserLostFocus($oWebV2M, $hGUI, $iReason)
11891188EndFunc ; ==>__NetWebView2_Events__OnBrowserLostFocus
11901189
11911190Func __NetWebView2_Events__OnZoomChanged($oWebV2M , $hGUI , $iFactor )
1192- Local Const $s_Prefix = " [WebViewEvents__OnZoomChanged]: FACTOR: " & $iFactor
1191+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnZoomChanged]: GUI: " & $hGUI & " FACTOR: " & $iFactor
11931192 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
11941193 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__ZOOM_CHANGED )
11951194 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1198,7 +1197,7 @@ Func __NetWebView2_Events__OnZoomChanged($oWebV2M, $hGUI, $iFactor)
11981197EndFunc ; ==>__NetWebView2_Events__OnZoomChanged
11991198
12001199Func __NetWebView2_Events__OnURLChanged($oWebV2M , $hGUI , $sURL )
1201- Local Const $s_Prefix = " [WebViewEvents__OnURLChanged]: URL: " & $sURL
1200+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnURLChanged]: GUI: " & $hGUI & " URL: " & $sURL
12021201 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12031202 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__URL_CHANGED )
12041203 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1207,7 +1206,7 @@ Func __NetWebView2_Events__OnURLChanged($oWebV2M, $hGUI, $sURL)
12071206EndFunc ; ==>__NetWebView2_Events__OnURLChanged
12081207
12091208Func __NetWebView2_Events__OnTitleChanged($oWebV2M , $hGUI , $sTITLE )
1210- Local Const $s_Prefix = " [WebViewEvents__OnTitleChanged]: TITLE: " & $sTITLE
1209+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnTitleChanged]: GUI: " & $hGUI & " TITLE: " & $sTITLE
12111210 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12121211 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__TITLE_CHANGED )
12131212 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1216,7 +1215,7 @@ Func __NetWebView2_Events__OnTitleChanged($oWebV2M, $hGUI, $sTITLE)
12161215EndFunc ; ==>__NetWebView2_Events__OnTitleChanged
12171216
12181217Func __NetWebView2_Events__OnNavigationStarting($oWebV2M , $hGUI , $sURL )
1219- Local Const $s_Prefix = " [WebViewEvents__OnNavigationStarting]: URL: " & $sURL
1218+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnNavigationStarting]: GUI: " & $hGUI & " URL: " & $sURL
12201219 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12211220 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__NAV_STARTING )
12221221 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1225,7 +1224,7 @@ Func __NetWebView2_Events__OnNavigationStarting($oWebV2M, $hGUI, $sURL)
12251224EndFunc ; ==>__NetWebView2_Events__OnNavigationStarting
12261225
12271226Func __NetWebView2_Events__OnNavigationCompleted($oWebV2M , $hGUI , $bIsSuccess , $iWebErrorStatus )
1228- Local Const $s_Prefix = " [WebViewEvents__OnNavigationCompleted]: " & ($bIsSuccess ? " SUCCESS" : " ERROR (" & $iWebErrorStatus & " )" )
1227+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnNavigationCompleted]: GUI: " & $hGUI & " " & ($bIsSuccess ? " SUCCESS" : " ERROR (" & $iWebErrorStatus & " )" )
12291228 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12301229 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__NAVIGATION_COMPLETED )
12311230 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1234,23 +1233,23 @@ Func __NetWebView2_Events__OnNavigationCompleted($oWebV2M, $hGUI, $bIsSuccess, $
12341233EndFunc ; ==>__NetWebView2_Events__OnNavigationCompleted
12351234
12361235Func __NetWebView2_Events__OnContextMenuRequested($oWebV2M , $hGUI , $sLink , $iX , $iY , $sSelection )
1237- Local Const $s_Prefix = " [WebViewEvents__OnContextMenuRequested]: LINK: " & $sLink & " X: " & $iX & " Y: " & $iY & " SELECTION: " & $sSelection
1236+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnContextMenuRequested]: GUI: " & $hGUI & " LINK: " & $sLink & " X: " & $iX & " Y: " & $iY & " SELECTION: " & $sSelection
12381237 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12391238 If $_g_sNetWebView2_User_WebViewEvents Then
12401239 Call ($_g_sNetWebView2_User_WebViewEvents & ' OnContextMenuRequested' , $oWebV2M , $hGUI , $sLink , $iX , $iY , $sSelection )
12411240 EndIf
12421241EndFunc ; ==>__NetWebView2_Events__OnContextMenuRequested
12431242
12441243Func __NetWebView2_Events__OnContextMenu($oWebV2M , $hGUI , $sMenuData )
1245- Local Const $s_Prefix = " [WebViewEvents__OnContextMenu]: MENUDATA: " & $sMenuData
1244+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnContextMenu]: GUI: " & $hGUI & " MENUDATA: " & $sMenuData
12461245 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12471246 If $_g_sNetWebView2_User_WebViewEvents Then
12481247 Call ($_g_sNetWebView2_User_WebViewEvents & ' OnContextMenu' , $oWebV2M , $hGUI , $sMenuData )
12491248 EndIf
12501249EndFunc ; ==>__NetWebView2_Events__OnContextMenu
12511250
12521251Func __NetWebView2_Events__OnWebResourceResponseReceived($oWebV2M , $hGUI , $iStatusCode , $sReasonPhrase , $sRequestUrl )
1253- Local Const $s_Prefix = " [WebViewEvents__OnWebResourceResponseReceived ]: HTTP : " & $iStatusCode & " (" & $sReasonPhrase & " ) URL: " & $sRequestUrl
1252+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnWebResourceResponseReceived ]: GUI: " & $hGUI & " HTTPStatusCode : " & $iStatusCode & " (" & $sReasonPhrase & " ) URL: " & $sRequestUrl
12541253 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12551254 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__RESPONSE_RECEIVED )
12561255 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1259,7 +1258,7 @@ Func __NetWebView2_Events__OnWebResourceResponseReceived($oWebV2M, $hGUI, $iStat
12591258EndFunc ; ==>__NetWebView2_Events__OnWebResourceResponseReceived
12601259
12611260Func __NetWebView2_Events__OnDownloadStarting($oWebV2M , $hGUI , $sURL , $sDefaultPath )
1262- Local Const $s_Prefix = " [WebViewEvents__OnDownloadStarting]: URL: " & $sURL & " DEFAULT_PATH: " & $sDefaultPath
1261+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnDownloadStarting]: GUI: " & $hGUI & " URL: " & $sURL & " DEFAULT_PATH: " & $sDefaultPath
12631262 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12641263 __NetWebView2_LastMessageReceived($NETWEBVIEW2_MESSAGE__DOWNLOAD_STARTING )
12651264 If $_g_sNetWebView2_User_WebViewEvents Then
@@ -1268,7 +1267,7 @@ Func __NetWebView2_Events__OnDownloadStarting($oWebV2M, $hGUI, $sURL, $sDefaultP
12681267EndFunc ; ==>__NetWebView2_Events__OnDownloadStarting
12691268
12701269Func __NetWebView2_Events__OnDownloadStateChanged($oWebV2M , $hGUI , $sState , $sURL , $iTotal_Bytes , $iReceived_Bytes )
1271- Local Const $s_Prefix = " [WebViewEvents__OnDownloadStateChanged]: State: " & $sState & " URL: " & $sURL & " Total_Bytes: " & $iTotal_Bytes & " Received_Bytes: " & $iReceived_Bytes
1270+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnDownloadStateChanged]: GUI: " & $hGUI & " State: " & $sState & " URL: " & $sURL & " Total_Bytes: " & $iTotal_Bytes & " Received_Bytes: " & $iReceived_Bytes
12721271 Local $iPercent = 0
12731272 If $iTotal_Bytes > 0 Then $iPercent = Round (($iReceived_Bytes / $iTotal_Bytes ) * 100 )
12741273
@@ -1294,7 +1293,7 @@ Func __NetWebView2_Events__OnDownloadStateChanged($oWebV2M, $hGUI, $sState, $sUR
12941293EndFunc ; ==>__NetWebView2_Events__OnDownloadStateChanged
12951294
12961295Func __NetWebView2_Events__OnAcceleratorKeyPressed($oWebV2M , $hGUI , $oArgs )
1297- Local Const $s_Prefix = " [WebViewEvents__OnAcceleratorKeyPressed]: ARGS: OBJECT"
1296+ Local Const $s_Prefix = " [NetWebView2Lib:EVENT: OnAcceleratorKeyPressed]: GUI: " & $hGUI & " ARGS: OBJECT"
12981297 __NetWebView2_Log(@ScriptLineNumber , (StringLen ($s_Prefix ) > 150 ? StringLeft ($s_Prefix , 150 ) & " ..." : $s_Prefix ), 1 )
12991298 If $_g_sNetWebView2_User_WebViewEvents Then
13001299 Call ($_g_sNetWebView2_User_WebViewEvents & ' OnAcceleratorKeyPressed' , $oWebV2M , $hGUI , $oArgs )
0 commit comments