v2.0.0-stable
Current Version: Version 2.0.0-stable
Patch: Enriched Verbose Logging
Diagnostic Visibility & Traceability
This patch significantly enhances the Verbose diagnostic mode with a new format and comprehensive event logging.
- New Log Format: Introduced a high-visibility prefix and instance tracking.
- Format:
+++[NetWebView2Lib][HANDLE:0x...][HH:mm:ss.fff] Message - Traceability: The
ParentWindowHandleis now included in every log line, allowing developers to distinguish logs between multiple concurrent WebView2 instances.
- Format:
- Enriched Event Logging: Added diagnostic traces to all critical lifecycle events:
- Navigation:
NavigationStarting(Target URI),NavigationCompleted(Success/Error Status),SourceChanged(New URL). - Interaction:
ContextMenuRequested(Location & Target Kind),WebMessageReceived(Raw payload). - Networking:
WebResourceRequested(URI & Context),WebResourceResponseReceived(Status Code & Reason),BasicAuthenticationRequested(URI). - State:
GotFocus,LostFocus(including True vs. Internal check),ProcessFailed(Kind & Reason),NewWindowRequested(Target URI).
- Navigation:
- API Method Logging: Added traces for key API calls:
Navigate,ExecuteScript(with content truncation),PostWebMessage.AddExtension,RemoveExtension(with Path/ID logging).
- Default Folder Sync: Renamed the default failure report folder from
CrashestoFailureReportFolderto align with official WebView2 parameter naming conventions. - Indentation & Integrity: Standardized the logging calls within event lambdas to maintain clean source code.
Patch: Compiler Scope & Null Check Optimization
Maintenance & Code Health
- Fixed
CS0136: Resolved variable redeclaration scope conflicts in theWebResourceResponseReceivedevent handler. - Improved Null Safety: Refactored the response handler to proactively check for
e.Responseavailability, preventing potential exceptions. - Simplified Cleanup (
IDE0031): Implemented the null-conditional operator (?.) in theCleanup()method for more concise and modern C# syntax.
Version 2.0.0-stable
COM Standardizing & Consistency (Major Release)
This release establishes a consistent naming convention for COM objects while ensuring 100% backward compatibility for legacy scripts.
- Standardized Naming (Architecture):
- Renamed internal classes and ProgIDs to follow the
NetWebView2Lib.WebView2{Subsystem}pattern. - WebView2Manager: New ProgID
NetWebView2Lib.WebView2Manager(formerlyNetWebView2.Manager). - WebView2Bridge: New ProgID
NetWebView2Lib.WebView2Bridge(formerlyNetWebView2Lib.WebViewBridge). - WebView2Parser: New ProgID
NetWebView2Lib.WebView2Parser(formerlyNetJson.Parser).
- Renamed internal classes and ProgIDs to follow the
- Compatibility Layer:
- Implemented inheritance-based compatibility. Creating objects using old ProgIDs still works perfectly but uses the new logic internally.
- AutoIt UDF Sync:
NetWebView2Lib.au3updated to use the new standardized ProgIDs by default. This ensures thatObjName()reports the consistent professional naming for new projects using the UDF.
- Project Structure:
- Renamed C# core files for consistency:
WebView2Manager.cs,WebView2Bridge.cs,WebView2Parser.cs.
- Renamed C# core files for consistency:
- IFrame HTML Extraction: High-performance extraction of HTML from cross-origin iframes.
- SDK Resilience (Reflection): Added reflection-based fallback for
CoreWebView2Frame.Urito maintain compatibility across different WebView2 SDK versions. - SDK Locking Policy (Standardization):
- NuGet Version: Locked to 1.0.2739.15 (Release Date: August 26, 2024).
- Rationale: This version ensures maximum compatibility across the "Evergreen" cycle on most Windows installations while providing all necessary features (Frames, Basic Auth, Process Failure events).
- Runtime Requirement: Requires WebView2 Runtime 128.0.2739.15 or higher.
- Runtime Validation:
Register_web2.au3now performs a strict check for the minimum required runtime version.
- DispId Normalization: Resolved DispId conflict for
Verbosemode (now DispId 228).