-
-
Notifications
You must be signed in to change notification settings - Fork 213
BrowserPage.goto()
David Ortner edited this page Jan 17, 2025
·
4 revisions
Navigates the main frame to a URL. The promise is resolved after the content has been loaded into the window.
goto(url: string, options?: IGoToOptions): void;
Parameter | Type | Description |
---|---|---|
url | string | URL |
options? | IGoToOptions | Options (Optional) |
void
import { Browser } from "happy-dom";
const browser = new Browser();
const page = browser.newPage();
// Navigates to URL
await page.goto('https://example.com', {
referrer: 'https://github.com/capricorn86/happy-dom/',
referrerPolicy: 'origin-when-cross-origin'
});
await browser.close();
Help Packages