视觉基线对比
browser_visual_diffDetect UI regressions by saving a page screenshot as a named baseline and comparing later captures with pixel-level diffs and configurable failure thresholds.
Instructions
Visual regression loop for UI review. action=save stores the current page screenshot as a named baseline (under ~/.aabrowser/baselines/, override with AA_BROWSER_BASELINE_DIR); action=compare captures again and returns a pixel-level diff (changed pixels, percent, bounding box, mean/max channel difference) plus a red diff image path. compare returns isError when the change exceeds maxDiffPercent, so it can be used as a visual assertion. action=list shows baselines; action=delete removes one. Use fullPage:true for long pages.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "browser_visual_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Baseline name: letters/digits/dot/underscore/hyphen, max 80 chars | |
| tabId | No | Tab id (default: active tab) | |
| action | Yes | Baseline operation | |
| fullPage | No | Capture the whole document instead of the viewport (default false) | |
| writeDiff | No | Write a red-highlighted diff PNG (default true) | |
| maxDiffPercent | No | Fail the comparison when changed pixels exceed this percent (default 0.5) | |
| pixelThreshold | No | Per-channel difference that counts as a changed pixel (0–255, default 16) |