Skip to main content
Navigates to a specified URL with enhanced reliability features including automatic retries with exponential backoff, intelligent timeout handling, and optional AI-powered loading verification. This function handles common navigation challenges by automatically retrying failed requests, detecting navigation hangs, and ensuring the page reaches a truly idle state. This method can also use AI vision to verify the page is fully loaded by checking for loading spinners, blank content, or incomplete states.
export declare function goToUrl(input: {
  page: Page;
  url: string;
  timeoutInMs?: number;
  retries?: number;
  throwOnTimeout?: boolean;
  waitForLoadState?: "load" | "domcontentloaded" | "networkidle" | "commit";
  waitForLoadingStateUsingAi?: boolean;
  model?: string;
  apiKey?: string;
}): Promise<void>;

Examples

import { goToUrl } from "@intuned/browser";
import { BrowserContext, Page } from "playwright";

interface Params {}

export default async function handler(
  params: Params,
  page: Page,
  context: BrowserContext
) {
  await goToUrl({
    page,
    url: "https://sandbox.intuned.dev/",
  });
  // At this point, goToUrl has waited for the page to be loaded and the network requests to be settled.
}

Arguments

input
Object
required
The input object containing the page and url.

Returns: Promise<void>

Promise that resolves when navigation completes. If the operation fails and throwOnTimeout is false, resolves without error