fileforge_visual_action
Capture and compare page screenshots, baselines, visual diffs, and computed CSS, colors, and fonts across routes and viewports to spot visual changes.
Instructions
Capture and compare how pages look: screenshots of a page, element or region, baselines, visual diffs across routes and viewports, and computed CSS, colors and fonts. Use fileforge_responsive_action to find layout bugs. Files and baselines are saved locally. capture_screenshot needs the tab to be visible. Needs the extension.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Left edge in pixels. | |
| y | No | Top edge in pixels. | |
| ref | No | Ref of a stored result. | |
| run | No | Optional run ID for grouping comparison artifacts | |
| url | No | Optional page URL to include in metadata | |
| name | No | Baseline name | matrix |
| store | No | Save the result in ~/.fileforge and return a ref. | |
| tabId | No | Tab ID, or "active" for the active tab. | active |
| width | No | Width in pixels. | |
| action | Yes | What to do. Required parameters are in brackets. capture_screenshot: Capture a screenshot of a tab. The tab must be the visible one in its window; otherwise the call returns TAB_NOT_VISIBLE. capture_full_page: Capture a stitched full-page screenshot of a tab and store it as a local artifact. capture_element (selector): Capture a screenshot of a specific page element by selector and store it as a local artifact. capture_region (x, y, width, height): Capture a rectangular viewport or page region and store it as a local artifact. pick_and_capture_element: Start an in-page element picker, capture the chosen element, and store it as a local artifact. capture_matrix (url): Capture a URL across multiple viewport presets and return stored screenshot artifact refs. capture_baseline (url, name): Capture and store a baseline screenshot for later comparison. capture_route_baselines (baseUrl, routes): Capture and store baseline screenshots for multiple routes and viewports. compare_screenshot (url, name): Compare the current state of a URL against its stored baseline. compare_routes (baseUrl, routes): Compare multiple routes against their baselines. extract_css (selector): Extract computed CSS for an element. extract_colors: Extract the color palette from the page. detect_fonts: Detect fonts used on the page. measure_element (selector): Measure the size and position of an element. export_diff (ref): Export a visual diff bundle as a ZIP. | |
| active | No | Focus the tab while capturing. | |
| format | No | Output format. | png |
| height | No | Height in pixels. | |
| routes | No | Route paths to visit, such as "/pricing". | |
| baseUrl | No | Origin that routes are resolved against. | |
| padding | No | Extra pixels around the element. | |
| project | No | Project name that groups stored results. | default |
| filename | No | Output filename. | |
| fullPage | No | Capture the whole page, not just the viewport. | |
| keepOpen | No | Leave the tab open afterward. | |
| selector | No | CSS selector of the target element. | |
| settleMs | No | Milliseconds to wait after load before capturing. | |
| viewport | No | Optional viewport label or dimensions | desktop |
| maxHeight | No | Maximum capture height in pixels. | |
| threshold | No | Per-channel color difference to ignore. 0 counts every change. | |
| timeoutMs | No | Time limit in milliseconds. | |
| viewports | No | Viewport presets to use, such as "desktop" or "mobile". | |
| namePrefix | No | Prefix for baseline names. | |
| scrollWaitMs | No | Milliseconds to wait after each scroll. | |
| includeBase64 | No | Return the image as base64 as well as a file. | |
| coordinateSpace | No | Whether x and y are relative to the viewport or the page. | viewport |
| ignoreSelectors | No | CSS selectors to mask before comparing. | |
| hideFixedElements | No | Hide fixed elements while stitching the capture. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | False if the action failed or a check did not pass. | |
| ref | No | Stored result ID, for fileforge_result_action. | |
| data | No | The result. Its shape depends on the action. | |
| meta | No | Tool, action and context. | |
| error | No | Failure code and message. | |
| warnings | No | Notes about a call that still ran. |