browser_set_viewport
Set the browser viewport size for responsive testing. Changes the visible area dimensions, triggering any responsive CSS breakpoints. Common uses: testing mobile layouts, matching specific device sizes.
When to use browser_set_viewport
Use browser_set_viewport when you need to automate a browser task. It is part of Owl Browser's Viewport & Page Info toolset and runs inside a self-hosted, source-level stealth engine, so every call inherits the same undetectable browser fingerprint as the rest of your automation — no separate anti-detect setup required.
Usage Example
Parameters
Required
context_idstringrequiredThe unique identifier of the browser context (e.g., 'ctx_000001')
widthintegerrequiredViewport width in pixels. Common sizes: 1920 (desktop), 1366 (laptop), 768 (tablet), 375 (mobile). Minimum 100 (values below are clamped). On Linux/Docker each dimension is capped at 2048 and total area at 4,000,000 px (requests above are scaled down proportionally)
heightintegerrequiredViewport height in pixels. Common sizes: 1080 (desktop), 768 (laptop), 1024 (tablet), 812 (mobile). Minimum 100 (values below are clamped). On Linux/Docker each dimension is capped at 2048 and total area at 4,000,000 px (requests above are scaled down proportionally)
Response
Returns a JSON object with the operation result.
{
"success": true,
"result": <value>
}Frequently Asked Questions
What does browser_set_viewport do?
Set the browser viewport size for responsive testing. Changes the visible area dimensions, triggering any responsive CSS breakpoints. Common uses: testing mobile layouts, matching specific device sizes. It belongs to Owl Browser's Viewport & Page Info category and is available through the REST API, the Python SDK (browser.set_viewport()), the Node.js SDK, and the MCP server.
What parameters does browser_set_viewport accept?
browser_set_viewport accepts 3 required parameters (context_id, width, height) and 0 optional parameters. All parameters are sent as JSON in a POST request to /api/execute/browser_set_viewport.
Is browser_set_viewport detectable by anti-bot systems like Cloudflare or DataDome?
No. browser_set_viewport executes inside Owl Browser's Chromium engine, which applies fingerprint spoofing at the C++ source level rather than through JavaScript patches. Every tool call shares the same consistent, human-like fingerprint, so anti-bot systems such as Cloudflare, DataDome, and Akamai see an ordinary browser.
Related Tools
browser_get_page_infoGet comprehensive information about the current page including URL, title, document state, can go back/forward status, and viewport dimensions. Useful for verifying navigation state.
browser_reset_viewportReset the browser viewport to its original default size (from the VM profile screen dimensions, typically 1920x1080). Use this to undo any viewport changes made by browser_set_viewport.
browser_create_contextCreate a new isolated browser context with its own cookies, storage, and optional proxy configuration. Each context acts as an independent browser session. Use this to create multiple isolated browsing sessions, configure proxy/Tor connections, load browser profiles with saved fingerprints, and enable/disable LLM features. Returns a context_id to use with other browser tools.
browser_navigateNavigate the browser to a specified URL. This is a non-blocking operation that starts navigation and returns immediately. Use browser_wait_for_network_idle or browser_wait_for_selector to wait for the page to fully load. Supports HTTP, HTTPS, file, and data URLs. When wait_until is set (load, networkidle, fullscroll, domcontentloaded) and the page declares WebMCP tools, the response includes a webmcp_tools array containing the full tool definitions (name, description, inputSchema). Use browser_webmcp_call_tool to execute any of these tools directly.
browser_observeAgent-native page observation. Returns the compacted OwlMark render (text-only structural view of the page), a handle table of interactive elements with stable tokens, page metadata, and a token estimate. Pass a handle token (e.g. 'b3') or 'pm:N' to browser_click/browser_type. Requires the context to be created with render_mode 'agent' or 'both'. ~20-100x fewer tokens than a screenshot for AI agent page understanding.
browser_clickClick on an element using CSS selector, XY coordinates, or natural language description. Supports semantic element finding using AI - describe what you want to click (e.g., 'login button', 'search icon') and the system will locate the right element. Simulates a real mouse click with proper event dispatch. Optionally hold the mouse button for press-and-hold interactions using hold_ms.