screenshot
Capture web page screenshots across multiple viewport breakpoints using Puppeteer. Automate page interactions, optimize images, and manage browser sessions for precise visual analysis.
Instructions
Capture screenshots of web pages at multiple viewport breakpoints using Puppeteer
Input Schema
Name | Required | Description | Default |
---|---|---|---|
actions | No | Array of page interactions to perform before taking screenshots | |
breakpoints | No | Viewport breakpoints (optional, defaults to mobile: 375px, tablet: 768px, desktop: 1280px) | |
cookies | No | Cookies to inject into the browser session before navigation | |
headless | No | Run browser in headless mode | |
imageFormat | No | Image format (JPEG recommended for smaller file sizes) | jpeg |
maxWidth | No | Maximum width for image optimization (images wider than this will be clipped) | |
quality | No | JPEG quality (1-100, only applies when imageFormat is 'jpeg') | |
sessionId | No | Session identifier for persistent browser state (maintains cookies, login data, localStorage, etc.) | |
timeout | No | Navigation timeout in milliseconds | |
url | Yes | URL to capture screenshots from | |
userDataDir | No | Custom user data directory path for browser session storage | |
waitFor | No | Wait condition before capturing screenshot | networkidle0 |
Input Schema (JSON Schema)
{
"properties": {
"actions": {
"description": "Array of page interactions to perform before taking screenshots",
"items": {
"properties": {
"duration": {
"default": 1000,
"description": "Duration in milliseconds (for wait action)",
"type": "number"
},
"selector": {
"description": "CSS selector for element-based actions",
"type": "string"
},
"text": {
"description": "Text to type (for type action)",
"type": "string"
},
"timeout": {
"default": 5000,
"description": "Timeout in milliseconds (for waitForElement action)",
"type": "number"
},
"type": {
"description": "Type of action to perform",
"enum": [
"click",
"type",
"scroll",
"wait",
"hover",
"select",
"clear",
"navigate",
"waitForElement"
],
"type": "string"
},
"url": {
"description": "URL to navigate to (for navigate action)",
"type": "string"
},
"value": {
"description": "Value to select (for select action)",
"type": "string"
},
"x": {
"description": "X coordinate (for scroll action)",
"type": "number"
},
"y": {
"description": "Y coordinate (for scroll action)",
"type": "number"
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
},
"breakpoints": {
"description": "Viewport breakpoints (optional, defaults to mobile: 375px, tablet: 768px, desktop: 1280px)",
"items": {
"properties": {
"width": {
"description": "Viewport width in pixels",
"type": "number"
}
},
"required": [
"width"
],
"type": "object"
},
"type": "array"
},
"cookies": {
"description": "Cookies to inject into the browser session before navigation",
"items": {
"properties": {
"domain": {
"description": "Cookie domain (optional, defaults to URL domain)",
"type": "string"
},
"expires": {
"description": "Cookie expiration timestamp (optional)",
"type": "number"
},
"httpOnly": {
"description": "HttpOnly flag (optional)",
"type": "boolean"
},
"name": {
"description": "Cookie name",
"type": "string"
},
"path": {
"description": "Cookie path (optional, defaults to '/')",
"type": "string"
},
"sameSite": {
"description": "SameSite policy (optional)",
"enum": [
"Strict",
"Lax",
"None"
],
"type": "string"
},
"secure": {
"description": "Secure flag (optional)",
"type": "boolean"
},
"value": {
"description": "Cookie value",
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"headless": {
"default": true,
"description": "Run browser in headless mode",
"type": "boolean"
},
"imageFormat": {
"default": "jpeg",
"description": "Image format (JPEG recommended for smaller file sizes)",
"enum": [
"png",
"jpeg"
],
"type": "string"
},
"maxWidth": {
"default": 1280,
"description": "Maximum width for image optimization (images wider than this will be clipped)",
"type": "number"
},
"quality": {
"default": 80,
"description": "JPEG quality (1-100, only applies when imageFormat is 'jpeg')",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"sessionId": {
"description": "Session identifier for persistent browser state (maintains cookies, login data, localStorage, etc.)",
"type": "string"
},
"timeout": {
"default": 30000,
"description": "Navigation timeout in milliseconds",
"type": "number"
},
"url": {
"description": "URL to capture screenshots from",
"type": "string"
},
"userDataDir": {
"description": "Custom user data directory path for browser session storage",
"type": "string"
},
"waitFor": {
"default": "networkidle0",
"description": "Wait condition before capturing screenshot",
"enum": [
"load",
"domcontentloaded",
"networkidle0",
"networkidle2"
],
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}