> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# goToUrl

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.

```typescript theme={null}
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

```typescript Without options theme={null}
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.
}
```

```typescript With options theme={null}
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://intunedhq.com",
    waitForLoadState: "domcontentloaded", // Faster than "load" state. The function automatically waits for the page to settle.
    throwOnTimeout: true,
    timeoutInMs: 10000,
    retries: 3,
  });
  // At this point, DOM content is loaded and goToUrl has waited for network requests to settle.
}
```

```typescript With AI Loading Detection theme={null}
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://intunedhq.com",
    waitForLoadingStateUsingAi: true,
    model: "gpt-5.4-mini",
  });
  // The page is loaded and ready to use.
  // If the AI check fails, the method won't throw even if throwOnTimeout is true.
  // It only throws if the page times out reaching the default load state and throwOnTimeout is true.
}
```

## Arguments

**input** `Object` *required*

The input object containing the page and url.

**properties**

**input.page** `Page` *required*

The Playwright page object to navigate.

**input.url** `string` *required*

The URL to navigate to.

**input.timeoutInMs** `number`

Maximum time in milliseconds to wait for navigation. Defaults to 30000.

**input.retries** `number`

Number of retry attempts with exponential backoff (factor: 2). Defaults to 3.

**input.waitForLoadState** `'load'|'domcontentloaded'|'networkidle'|'commit'`

When to consider navigation succeeded. Defaults to `"load"`

**input.throwOnTimeout** `boolean`

Whether to throw an error if navigation times out. When true, the function
throws an error on navigation timeout. Defaults to false.

**input.waitForLoadingStateUsingAi** `boolean`

When true, uses AI vision to verify the page is fully loaded by checking for
loading spinners, blank content, or incomplete states. Retries up to 3 times
with 5-second delays. Defaults to false Check
[isPageLoaded](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/ai/functions/isPageLoaded.md) for more details on the AI
loading verification.

**input.model** `string`

AI model to use for loading verification. Defaults to
`"gpt-5-mini-2025-08-07"`

**input.apiKey** `string`

Optional API key for the AI check.

## Returns: `Promise<void>`

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.