function navigate
navigate(
page: { goto(url: string): Promise<unknown>; },
url: string,
arg_2?: { backoffMs?: number; }
): Promise<void>

Opens the session's page, going again when the OS was briefly out of socket buffers.

Every other failure is the caller's on the first attempt: a refused connection or a crashed page is not something waiting fixes, and retrying it would only delay the error that says so.

import { navigate } from './navigate.ts';

let calls = 0;
const page = {
  goto: async () => {
    if (++calls === 1) throw new Error('page.goto: net::ERR_NO_BUFFER_SPACE at http://localhost:1234/');
    return null;
  },
};

await navigate(page, 'http://localhost:1234/', { backoffMs: 0 });
calls; // 2 — the second attempt got through

Parameters

page: { goto(url: string): Promise<unknown>; }
url: string
optional
arg_2: { backoffMs?: number; }

Return Type

Promise<void>

Usage

import { navigate } from "lib/repl/navigate.ts";