@dyyz1993/agent-browser 0.11.0 → 0.11.2
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/bin/agent-browser-linux-x64 +0 -0
- package/dist/cli/help.js +1 -1
- package/dist/openapi.js +1 -1
- package/dist/stream-server-standalone.js +3 -3
- package/dist/viewer-script.js +54 -54
- package/package.json +1 -1
- package/skills/agent-browser/SKILL.md +279 -229
- package/skills/agent-browser/references/mobile-viewer.md +188 -0
- package/skills/agent-browser/references/viewer-mode.md +148 -0
- package/skills/agent-browser/templates/api-interception.sh +3 -1
- package/skills/agent-browser/templates/data-extraction.sh +8 -4
- package/skills/agent-browser/templates/form-automation.sh +18 -23
- package/skills/agent-browser/templates/network-intercept-crawl.sh +1 -0
- package/skills/agent-browser/templates/recorder-workflow.sh +51 -0
- package/skills/agent-browser/templates/viewer-remote.sh +41 -0
- package/bin/agent-browser-darwin-arm64 +0 -0
- package/scripts/check_goods_container.js +0 -35
- package/scripts/check_page_content.js +0 -36
- package/scripts/click_applause_rate.js +0 -30
- package/scripts/e2e-test-recorder.ts +0 -584
- package/scripts/explore_jd_page.js +0 -31
- package/scripts/extract_all_jd_data.js +0 -80
- package/scripts/extract_jd_product_detail.js +0 -62
- package/scripts/extract_jd_products_correct_links.js +0 -78
- package/scripts/extract_jd_products_final.js +0 -80
- package/scripts/extract_jd_reviews.js +0 -48
- package/scripts/extract_jd_seafood_final.js +0 -78
- package/scripts/extract_multiple_products.js +0 -77
- package/scripts/extract_products_no_scroll.js +0 -68
- package/scripts/extract_products_simple.js +0 -68
- package/scripts/find_applause_rate.js +0 -26
- package/scripts/find_jd_links.js +0 -28
- package/scripts/find_main_content.js +0 -20
- package/scripts/find_product_cards.js +0 -38
- package/scripts/find_root_content.js +0 -26
- package/scripts/find_unique_products.js +0 -55
- package/scripts/get_jd_product_detail.js +0 -16
- package/scripts/get_jd_products.js +0 -23
- package/scripts/get_jd_seafood_products.js +0 -44
- package/scripts/get_product_details_from_images.js +0 -54
- package/scripts/scroll_and_get_products.js +0 -47
- package/scripts/scroll_deep_and_find.js +0 -45
- package/scripts/verify-baidu-enter.ts +0 -116
- package/scripts/verify-form.sh +0 -67
- package/scripts/verify-login.sh +0 -65
- package/scripts/verify-recording.sh +0 -80
- package/scripts/verify-upload.sh +0 -41
- package/skills/agent-browser/references/profiling.md +0 -120
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Profiling
|
|
2
|
-
|
|
3
|
-
Capture Chrome DevTools performance profiles during browser automation for performance analysis.
|
|
4
|
-
|
|
5
|
-
**Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.
|
|
6
|
-
|
|
7
|
-
## Contents
|
|
8
|
-
|
|
9
|
-
- [Basic Profiling](#basic-profiling)
|
|
10
|
-
- [Profiler Commands](#profiler-commands)
|
|
11
|
-
- [Categories](#categories)
|
|
12
|
-
- [Use Cases](#use-cases)
|
|
13
|
-
- [Output Format](#output-format)
|
|
14
|
-
- [Viewing Profiles](#viewing-profiles)
|
|
15
|
-
- [Limitations](#limitations)
|
|
16
|
-
|
|
17
|
-
## Basic Profiling
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Start profiling
|
|
21
|
-
agent-browser profiler start
|
|
22
|
-
|
|
23
|
-
# Perform actions
|
|
24
|
-
agent-browser navigate https://example.com
|
|
25
|
-
agent-browser click "#button"
|
|
26
|
-
agent-browser wait 1000
|
|
27
|
-
|
|
28
|
-
# Stop and save
|
|
29
|
-
agent-browser profiler stop ./trace.json
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Profiler Commands
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Start profiling with default categories
|
|
36
|
-
agent-browser profiler start
|
|
37
|
-
|
|
38
|
-
# Start with custom trace categories
|
|
39
|
-
agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
|
|
40
|
-
|
|
41
|
-
# Stop profiling and save to file
|
|
42
|
-
agent-browser profiler stop ./trace.json
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Categories
|
|
46
|
-
|
|
47
|
-
The `--categories` flag accepts a comma-separated list of Chrome trace categories. Default categories include:
|
|
48
|
-
|
|
49
|
-
- `devtools.timeline` -- standard DevTools performance traces
|
|
50
|
-
- `v8.execute` -- time spent running JavaScript
|
|
51
|
-
- `blink` -- renderer events
|
|
52
|
-
- `blink.user_timing` -- `performance.mark()` / `performance.measure()` calls
|
|
53
|
-
- `latencyInfo` -- input-to-latency tracking
|
|
54
|
-
- `renderer.scheduler` -- task scheduling and execution
|
|
55
|
-
- `toplevel` -- broad-spectrum basic events
|
|
56
|
-
|
|
57
|
-
Several `disabled-by-default-*` categories are also included for detailed timeline, call stack, and V8 CPU profiling data.
|
|
58
|
-
|
|
59
|
-
## Use Cases
|
|
60
|
-
|
|
61
|
-
### Diagnosing Slow Page Loads
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
agent-browser profiler start
|
|
65
|
-
agent-browser navigate https://app.example.com
|
|
66
|
-
agent-browser wait --load networkidle
|
|
67
|
-
agent-browser profiler stop ./page-load-profile.json
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Profiling User Interactions
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
agent-browser navigate https://app.example.com
|
|
74
|
-
agent-browser profiler start
|
|
75
|
-
agent-browser click "#submit"
|
|
76
|
-
agent-browser wait 2000
|
|
77
|
-
agent-browser profiler stop ./interaction-profile.json
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### CI Performance Regression Checks
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
#!/bin/bash
|
|
84
|
-
agent-browser profiler start
|
|
85
|
-
agent-browser navigate https://app.example.com
|
|
86
|
-
agent-browser wait --load networkidle
|
|
87
|
-
agent-browser profiler stop "./profiles/build-${BUILD_ID}.json"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Output Format
|
|
91
|
-
|
|
92
|
-
The output is a JSON file in Chrome Trace Event format:
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
{
|
|
96
|
-
"traceEvents": [
|
|
97
|
-
{ "cat": "devtools.timeline", "name": "RunTask", "ph": "X", "ts": 12345, "dur": 100, ... },
|
|
98
|
-
...
|
|
99
|
-
],
|
|
100
|
-
"metadata": {
|
|
101
|
-
"clock-domain": "LINUX_CLOCK_MONOTONIC"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
The `metadata.clock-domain` field is set based on the host platform (Linux or macOS). On Windows it is omitted.
|
|
107
|
-
|
|
108
|
-
## Viewing Profiles
|
|
109
|
-
|
|
110
|
-
Load the output JSON file in any of these tools:
|
|
111
|
-
|
|
112
|
-
- **Chrome DevTools**: Performance panel > Load profile (Ctrl+Shift+I > Performance)
|
|
113
|
-
- **Perfetto UI**: https://ui.perfetto.dev/ -- drag and drop the JSON file
|
|
114
|
-
- **Trace Viewer**: `chrome://tracing` in any Chromium browser
|
|
115
|
-
|
|
116
|
-
## Limitations
|
|
117
|
-
|
|
118
|
-
- Only works with Chromium-based browsers (Chrome, Edge). Not supported on Firefox or WebKit.
|
|
119
|
-
- Trace data accumulates in memory while profiling is active (capped at 5 million events). Stop profiling promptly after the area of interest.
|
|
120
|
-
- Data collection on stop has a 30-second timeout. If the browser is unresponsive, the stop command may fail.
|