Conversation
Contributor
|
please consider to use: |
Owner
Author
You mean inside NetWebView2_Events OnMessageReceived? like Volatile Func __NetWebView2_Events__OnMessageReceived($oWebV2M, $hGUI, $sMsg)
...
...
Case "NAV_ERROR"
If $sData = "OperationCanceled" Then ; Check if the error is actually a user cancellation
__NetWebView2_Log(@ScriptLineNumber, $s_Prefix & " COMMAND:USER_ABORT (Navigation Canceled)", 1)
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__USER_ABORT)
Else
__NetWebView2_Log(@ScriptLineNumber, $s_Prefix & " COMMAND:" & $sCommand & " Data:" & $sData, 1)
__NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__NAV_ERROR)
$oWebV2M.Stop() ; We only stop if it is a real error.
EndIf
; 🚧 *******************************************
ConsoleWrite("> TEST NAV_ERR: " & $sMsg & @CRLF)
ConsoleWrite("> TEST NAV_ERR: __NetWebView2_LastMessage_KEEPER($oWebV2M)=" & __NetWebView2_LastMessage_KEEPER($oWebV2M) & " SLN=" & @ScriptLineNumber & @CRLF)
...
... |
ioa747
commented
Mar 18, 2026
| @@ -1628,9 +1628,17 @@ Volatile Func __NetWebView2_Events__OnMessageReceived($oWebV2M, $hGUI, $sMsg) | |||
| __NetWebView2_LastMessage_KEEPER($oWebV2M, $NETWEBVIEW2_MESSAGE__URL_CHANGED) | |||
|
|
|||
| Case "NAV_ERROR" | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Thanks for your effort and interest 💛 in improving the project. It's very appreciated.
Description
Event Object Refactoring (Navigation Interception)
This release refactors key events to use object-based arguments, enabling advanced control like navigation cancellation.
🔗 Linked GitHub Issues
Closes #<number>
📋 What is the current behavior?
🚀 What is the new behavior?
Type of changes
Breaking changes 🔥
OnNavigationStartingandOnFrameNavigationStartingnow pass anArgsobject instead of a raw URL string.How and where was this tested?
🖥️ Describe where you tested your changes
System:
Context:
NetJson.ParserNetWebView2.Manager - WebView2NetWebView2.Manager - Bridge🔬 Describe how you tested your changes
Checklist
Additional context
Screenshots
Note to reviewers
Version 2.2.0-alpha
Event Object Refactoring (Navigation Interception)
This release refactors key events to use object-based arguments, enabling advanced control like navigation cancellation.
OnNavigationStartingandOnFrameNavigationStartingnow pass anArgsobject instead of a raw URL string.IWebView2NavigationStartingEventArgs:Uri: [Property] The target URL.Cancel: [Property] Get/Set boolean to cancel the navigation.IsUserInitiated: [Property] Indicates if the navigation was user-triggered.IsRedirected: [Property] Indicates if it's a redirect.NavigationId: [Property] Unique identifier for the navigation.NetWebView2Lib.au3updated to handle the new object structure internally while maintaining logging compatibility.examples/020-NavigationInterception.au3demonstrating how to intercept links and open them in the default browser by canceling internal navigation.