Commit 00e8639
authored
v1.4.2
## Version 1.4.2 - (2026-01-06)
### ⚡ Synchronous Execution & Enhanced Automation
This major update bridges the gap between the asynchronous nature of WebView2 and the procedural logic of AutoIt, introducing synchronous script results and specialized automation controls.
#### **Added**
- **Synchronous Scripting** (DispId 188):
- **ExecuteScriptWithResult(string script)**: **(188)** Executes JavaScript and returns the result directly to AutoIt in a single line. Includes a 5-second safety timeout and automatic JSON unescaping for clean string results.
- **Automation & Layout Controls** (DispIds 189, 191, 193):
- **AddInitializationScript(string script)**: **(187)** Injects a script that persists across navigations and refreshes, executing automatically on every new document.
- **SetAutoResize(bool enabled)**: **(189)** Enables "Smart Anchor" resizing using Win32 subclassing. Works with non-.NET parent containers (like AutoIt) and maintains top-left offsets. Sends "WINDOW_RESIZED" to AutoIt on completion.
- **ExecuteScriptOnPage(string script)**: **(191)** A dedicated method for immediate, high-priority script execution on the current page.
- **ClearCache()**: **(193)** Targeted removal of Disk Cache and Local Storage to ensure the browser always loads the freshest content.
- **Unified Context Menu Handling** (DispIds 190, 194):
- **`OnContextMenuRequested(link, x, y, selection)`**: **(190)** [Event] Provides a rich, simplified context event with direct access to the URL, coordinates, and selected text under the cursor.
- **`CustomMenuEnabled`**: **(194)** [Property] A Master switch to enable or disable custom menu interception.
- **Advanced Data Binding** (DispIds 185 - 186):
- **BindJsonToBrowser(variableName)**: **(185)** Securely binds internal JSON data to a JavaScript variable. Updated to ensure 100% COM compatibility with legacy registrations.
- **SyncInternalData(json, bindTo)**: **(186)** High-performance helper that parses raw JSON and binds it to a browser variable in a single atomic operation.
- **Integrated Base64 Support (JsonParser)** (DispIds 222 - 224):
- **EncodeB64 / DecodeB64**: **(222, 223)** Native Base64 processing directly within the JSON parser, eliminating the need for external Base64 libraries.
- **DecodeB64ToFile(b64, path)**: **(224)** Decodes a Base64 stream and saves it directly to disk (perfect for screenshots and binary downloads).
### Changed
- **Automation & Layout Controls** (DispIds 115, 116, 184):
- **InjectCss(string cssCode)**: **(115)** Inject CSS (Persistence to run on every refresh)
- **AddInitializationScript(string script)**: **(116)** Clear Injected CSS.
- **ClearInjectedCss()**: **(184)** Injects a script that persists across navigations and refreshes, executing automatically on every new document.
#### **Improvements**
- **Legacy Compatibility**: The context menu logic has been completely redesigned to support both the new parameter-based event (v1.4.2) and the legacy JSON event (v1.4.1) simultaneously.
- **Robustness**: JSON parsing now automatically trims whitespace, and all browser interactions include enhanced internal try-catch blocks. Added a Global COM Error Handler in the showcase demo for professional diagnostics.
- **Unified Messaging**: `WINDOW_RESIZED` now includes explicit dimensions (`Width|Height`) in the data payload for better reactive UI control.
- **Robust Auto-Resizing**: Replaced `Dock.Fill` with a Native Subclassing (`NativeWindow`) mechanism to intercept `WM_SIZE` messages directly from the OS, ensuring perfect synchronization even with non-WinForms parent handles.1 parent 47544ce commit 00e8639
9 files changed
Lines changed: 1397 additions & 60 deletions
File tree
- bin
- examples/GOG_Demo_v1.4.2
- src
- Properties
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments