Module

x/puppeteer/mod.ts>Frame#waitForNavigation

A port of puppeteer running on Deno
Latest
method Frame.prototype.waitForNavigation
import { Frame } from "https://dotland.deno.dev/x/puppeteer@16.2.0/mod.ts";

Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate.

Usage of the History API to change the URL is considered a navigation.

Examples

Example 1

const [response] = await Promise.all([
  // The navigation promise resolves after navigation has finished
  frame.waitForNavigation(),
  // Clicking the link will indirectly cause a navigation
  frame.click('a.my-link'),
]);

Parameters

optional
options: { timeout?: number; waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[]; }
  • options to configure when the navigation is consided finished.

Returns

Promise<HTTPResponse | null>

a promise that resolves when the frame navigates to a new URL.