playwright_navigate
Navigate to a specified URL using the Playwright framework, set viewport dimensions, and configure timeout and wait conditions for precise browser automation.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| height | No | Viewport height in pixels (default: 1080) | |
| timeout | No | Navigation timeout in milliseconds | |
| url | Yes | ||
| waitUntil | No | Navigation wait condition | |
| width | No | Viewport width in pixels (default: 1920) |
Implementation Reference
- src/toolsHandler.ts:86-107 (handler)The main handler logic for the 'playwright_navigate' tool. It uses Playwright's page.goto() to navigate to the specified URL with optional timeout and waitUntil options, returning success or error message.case "playwright_navigate": try { await page!.goto(args.url, { timeout: args.timeout || 30000, waitUntil: args.waitUntil || "load" }); return { content: [{ type: "text", text: `Navigated to ${args.url}`, }], isError: false, }; } catch (error) { return { content: [{ type: "text", text: `Navigation failed: ${(error as Error).message}`, }], isError: true, }; }