browser4-cli 4.14.0-rc.2 → 4.14.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -90,6 +90,8 @@ Choosing the right tool for your task:
90
90
 
91
91
  Use `snapshot -i --boxes` to see clickable/typeable elements with refs like `e15`, then `click <ref>`, `fill <ref> "<text>"`, `type`/`press`, `select`, `hover`/`drag`/`scroll`, and `wait` to drive the page. All interaction commands accept CSS selectors too. Chain multiple steps efficiently with `batch`.
92
92
 
93
+ Content embedded in `<iframe>`s (payment forms, editors, widgets) is reached with the built-in frame switching: `frames` lists the frame tree, `frame "<iframe selector>"` scopes subsequent element commands into that frame (same-origin iframes fully supported), and `frame main` returns to the main document — no manual `contentDocument` eval needed.
94
+
93
95
  Typical interactive flow:
94
96
 
95
97
  ```bash
@@ -100,6 +102,10 @@ browser4-cli fill e3 "user@example.com"
100
102
  browser4-cli fill e4 "secret" --submit
101
103
  browser4-cli wait --load networkidle
102
104
  browser4-cli snapshot -i
105
+ # iframe-heavy page:
106
+ browser4-cli frame "#pay-frame"
107
+ browser4-cli fill "#card-number" "4111 1111 1111 1111"
108
+ browser4-cli frame main
103
109
  ```
104
110
 
105
111
  ### How to Extract Data
@@ -534,6 +540,30 @@ browser4-cli loop --shell "curl -s https://api.example.com/health" -i 60
534
540
  browser4-cli loop --list
535
541
  ```
536
542
 
543
+ #### Network inspection, HAR recording & request routing
544
+
545
+ Inspect what the page actually loaded (XHR/fetch calls, status codes, headers,
546
+ response bodies), record a HAR 1.2 archive importable by Chrome DevTools, and
547
+ route (mock/abort) matching requests. See
548
+ [`skills/browser4-cli/references/network.md`](skills/browser4-cli/references/network.md)
549
+ for the full guide.
550
+
551
+ | Command | Description |
552
+ |---|---|
553
+ | `network requests` | List tracked requests. Supports `--filter`, `--type`, `--method`, `--status` (`200`, `2xx`, `400-499`), `--clear`. |
554
+ | `network request <id>` | Full detail of one request: headers, timing, and the response body (fetched on demand). |
555
+ | `network har start [--content <mode>]` | Start a HAR recording. Content mode: `none`, `text`, or `all` (binary base64). |
556
+ | `network har stop [path]` | Stop recording and print the HAR JSON, or write it to a `.har` file when a path is given. |
557
+ | `network route <pattern> --body <text>\|--abort` | Intercept matching requests (mock response or fail them) via CDP Fetch. Supports `--content-type`, `--resource-type`. |
558
+ | `network unroute [pattern]` | Remove routes; without a pattern, disable interception entirely. |
559
+
560
+ ```bash
561
+ browser4-cli network requests --filter api --status 2xx
562
+ browser4-cli network har start --content text
563
+ browser4-cli network har stop ./capture.har
564
+ browser4-cli network route "**/api/users" --body '{"users":[]}' --content-type application/json
565
+ ```
566
+
537
567
  #### Swarm and crawl for scale
538
568
 
539
569
  The `co` prefix is accepted as an alias for `swarm`.
@@ -754,7 +784,7 @@ The `coding` domain exposes **47 tools** in four groups:
754
784
 
755
785
  Browser4 includes a lightweight **MockSite** server that serves static HTML pages for testing and demos. Start it from the repository root:
756
786
 
757
- **Windows:** `./bin/test.ps1 mock-site -Dmock.site.port=18080`
787
+ **Windows (pwsh — PowerShell 7+):** `./bin/test.ps1 mock-site -Dmock.site.port=18080`
758
788
  **Linux/macOS:** `./bin/test.sh mock-site -Dmock.site.port=18080`
759
789
 
760
790
  Key demo pages are served at `http://localhost:18080/generated/`. For the full page listing, environment variables, Python fallback, and Maven-based launch, see [MockSite](docs/mocksite.md). For the test taxonomy and tagging system, see [Test Taxonomy](docs/TESTING.md).
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser4-cli",
3
- "version": "4.14.0-rc.2",
3
+ "version": "4.14.0-rc.4",
4
4
  "description": "Browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "files": [