You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Version 1.4.1 - (2026-01-03)
### 🚀 Data Intelligence & JSON Manipulation
This update transforms the `NetJson.Parser` into a full-featured JSON management suite, allowing for complex data merging and structure inspection directly from AutoIt.
#### **Added**
- **Advanced JSON Methods** (DispIds 214 - 221):
- `Merge(string jsonContent)`: **(214)** Performs a deep merge of a new JSON string into the existing structure. Uses `Union` strategy for arrays to prevent duplicates.
- `MergeFromFile(string filePath)`: **(215)** Efficiently reads a JSON file from disk and merges it directly into the current session.
- `GetTokenType(string path)`: **(216)** Returns the .NET/Newtonsoft type of a specific node (e.g., _Object, Array, String, Integer, Boolean_). Essential for dynamic data validation.
- `RemoveToken(string path)`: **(217)** Allows dynamic deletion of specific keys or array elements, providing full CRUD (Create, Read, Update, Delete) capabilities
- **`Search(string query)`**: **(218)** Executes a JSONPath query and returns a JSON array of all matching tokens. Enables powerful filtering and deep searching with a single call.
- **`Flatten()`**: **(219)** Flattens the JSON structure into a single-level object with dot-notated paths.
- **`CloneTo(string parserName)`**: **(220)** Clones the current JSON data to another named parser instance.
- **`FlattenToTable(string colDelim, string rowDelim)`**: **(221)** Flattens the JSON structure into a table-like string with specified delimiters.
- **Web Content Extraction** (DispId 200):
- **`GetInnerText()`**: **(200)** Retrieves the entire visible text content (`innerText`) of the document. The result is returned asynchronously via the `OnMessageReceived` event with the `Inner_Text|` prefix. This enables powerful web scraping and content analysis without manual DOM parsing.
#### **Improvements**
- **Enhanced Error Handling**: All new JSON and Web methods are wrapped in try-catch blocks to prevent COM crashes when dealing with malformed data or invalid DOM states.
- **Memory Efficiency**: `MergeFromFile` utilizes local C# file streams, reducing the memory overhead for the calling AutoIt script when handling large configuration files.
- **Unified Messaging**: Content extraction now follows the standardized `Command|Data` format, making it easier to route messages in the AutoIt event loop.
A powerful bridge that allows **AutoIt** to use the modern **Microsoft Edge WebView2** (Chromium) engine via a C# COM wrapper. This project enables you to render modern HTML5, CSS3, and JavaScript directly inside your AutoIt applications with a 100% event-driven architecture.
4
4
5
5
---
6
-
7
-
## 🚀 Key Features
6
+
### 🚀 Key Features
8
7
9
8
***Chromium Engine**: Leverage the speed and security of modern Microsoft Edge.
10
9
***Bi-directional Communication**: Send messages from JS to AutoIt (`postMessage`) and execute JS from AutoIt (`ExecuteScript`).
@@ -16,19 +15,17 @@ A powerful bridge that allows **AutoIt** to use the modern **Microsoft Edge WebV
16
15
-**Advanced Cookie & CDP Control**: Full cookie manipulation and raw access to Chrome DevTools Protocol.
17
16
-**Kiosk & Security Mode**: Enhanced methods to restrict user interaction for production environments.
18
17
19
-
20
18
---
21
19
22
-
## 🛠 Prerequisites
20
+
###🛠 Prerequisites
23
21
24
22
1.**.NET Framework 4.8** or higher.
25
23
2.**Microsoft Edge WebView2 Runtime**.
26
24
27
25
**The registration script will check for this and provide a download link if missing.*
28
26
29
-
30
27
---
31
-
## 📦 Deployment \& Installation
28
+
###📦 Deployment \& Installation
32
29
33
30
1.**Extract** NetWebView2Lib folder to a permanent location.
34
31
2.**Run**:
@@ -40,12 +37,122 @@ A powerful bridge that allows **AutoIt** to use the modern **Microsoft Edge WebV
40
37
41
38
1.**Run `\Example\*`** to see the bridge in action.
42
39
40
+
---
41
+
### 🛠️ Migration Note (Important)
42
+
43
+
Due to changes in the COM Dispatch IDs (DispIds) for better organization, it is **highly recommended** to run the included `RegCleaner.au3` before registering the new version. This ensures that any stale registry entries from previous builds are purged, preventing "Object action failed" errors.
43
44
44
45
---
46
+
### ⚖️ License
47
+
48
+
This project is provided "as-is". You are free to use, modify, and distribute it for both personal and commercial projects.
45
49
46
-
## 📖 NetWebView2Lib Version 1.4.0 - Reference (Quick View)
This version introduces significant architectural improvements, focusing on deep integration with WebView2 settings and a more robust event-driven system.
57
+
58
+
### ✨ Key Highlights
59
+
60
+
***Comprehensive Settings Control**: Direct access to browser behaviors via new properties. Toggle DevTools, Context Menus, Script Dialogs, and Browser Accelerators (`AreDevToolsEnabled`, `AreDefaultContextMenusEnabled`, etc.) directly from your AutoIt script.
61
+
62
+
* 🎯 **Permanent JS Injection**: Introducing `AddInitializationScript`. Injected JavaScript (like bridges or libraries) now persists across page navigations and refreshes automatically, managed via a new Script ID tracking system.
63
+
64
+
***Custom Context Menus**: Intercept right-clicks with the new `OnContextMenu` event. Receive rich JSON metadata including coordinates, element tags, selected text, and source URLs to build native-looking custom menus.
65
+
66
+
***Focus & Lifecycle Management**: Navigation is now fully observable through `OnNavigationStarting` and `OnNavigationCompleted`.
67
+
68
+
***Integrated Utilities**: Added native methods for `Encode/DecodeURI` and `Base64` (UTF-8) to handle data transfers between AutoIt and JavaScript seamlessly.
69
+
70
+
***Enhanced State Sync**: Real-time events for Title, URL, and Zoom changes to keep your AutoIt GUI perfectly in sync with the browser state.
it is a showcase of **Bi-directional Intelligence**.
80
+
It demonstrates how AutoIt can "read" the DOM state via COM events to provide a context-specific user interface.
81
+
82
+
#### 1. Context-Aware Menu (The "Right-Click" Magic)
83
+
84
+
The demo intercepts the native context menu and replaces it with a dynamic AutoIt menu. The options change based on the **HTML element** under your cursor:
85
+
86
+
-**📥 Table Intelligence**:
87
+
88
+
-**Action**: Right-click anywhere inside a `<table>`.
89
+
90
+
-**What happens**: The library detects the `tagName`, calculates the table's index via coordinates, and offers an **Export to CSV** option. It uses the `bridge.js` to scrape the data directly from the browser's memory.
91
+
92
+
-**📋 Form Automation**:
93
+
94
+
-**Action**: Right-click on an `<input>`, `<textarea>`, or `<form>`.
95
+
96
+
-**What happens**:
97
+
98
+
-**Map Form to JSON**: Automatically crawls the form and generates a JSON file with all current values.
99
+
100
+
-**Fill Form from JSON**: Lets you select a previously saved JSON file to instantly re-populate the form.
101
+
102
+
-**🔍 Smart Selection**:
103
+
104
+
-**Action**: Highlight any text on the page and right-click.
105
+
106
+
-**What happens**: The menu offers a Google Search for that specific string, using the new native `EncodeURI` method to handle special characters.
107
+
108
+
109
+
#### 2. Advanced Utilities
110
+
111
+
-**📸 Full Page Screenshot**: Unlike standard screen captures, this utility renders the **entire document** (including the parts you need to scroll to see) and saves it as a high-quality PNG.
112
+
113
+
-**⚡ Persistent Bridge**: Notice that even if you navigate to a new website or refresh, the "Table Export" and "Form Mapping" still work. This is thanks to the new `AddInitializationScript` which ensures our `bridge.js` is part of every page's DNA.
114
+
115
+
---
47
116
48
-
## Properties
117
+
#### ⚙️ How it Works: The "Context-JSON" Bridge
118
+
119
+
The secret behind this intelligent menu is the seamless communication between the Browser's DOM and AutoIt's COM interface.
120
+
121
+
#### The Workflow:
122
+
123
+
1.**The Trigger**: When you right-click, the `bridge.js` (injected via `AddInitializationScript`) intercepts the event.
124
+
125
+
2.**Data Gathering**: It instantly gathers metadata about the element under the mouse (Coordinates, Tag Type, Selected Text, Image Sources, etc.).
126
+
127
+
3.**The Dispatch**: This metadata is packed into a **JSON string** and sent to AutoIt via the `OnContextMenu` event.
128
+
129
+
4.**The Decision**: AutoIt receives the JSON, parses it using `NetJson.Parser`, and decides which menu items to show.
130
+
131
+
132
+
#### Why JSON?
133
+
134
+
-**Structure**: It allows passing multiple data points (X, Y, Tag, URL) in a single, organized string.
135
+
136
+
-**Performance**: By prefixing with `JSON:`, we bypass complex string encoding, making the communication near-instant.
137
+
138
+
-**Flexibility**: You can easily add more data points to the `bridge.js` without ever changing the core DLL.
139
+
140
+
141
+
---
142
+
143
+
#### 💡 Pro Tip for Developers:
144
+
145
+
> "You can extend this! If you want to detect specifically if a user clicked on a **Video** or a **PDF link**, just update the `bridge.js` to include those tags.
0 commit comments