← Back to Page domain
Page.navigate
Navigates current page to the given URL.
Domain: Page
stable
Parameters
| Name | Type | Description |
url | string | URL to navigate the page to. |
referrer (optional) | string | Referrer URL. |
transitionType (optional) | TransitionType | Intended transition type. |
frameId (optional) | FrameId | Frame id to navigate, if not specified navigates the top frame. |
referrerPolicy (optional) | ReferrerPolicy | Referrer-policy used for the navigation. |
Returns
| Name | Type | Description |
frameId | FrameId | Frame id that has navigated (or failed to navigate) |
loaderId | Network.LoaderId | Loader identifier. This is omitted in case of same-document navigation,
as the previously committed loaderId would not change. |
errorText | string | User friendly error message, present if and only if navigation has failed. |
isDownload | boolean | Whether the navigation resulted in a download. |
Example Request
{
"id": 1,
"method": "Page.navigate",
"params": {
"url": "https://example.com"
}
}
Example Response
{
"id": 1,
"result": {
"frameId": "ABC123DEF456",
"loaderId": "LOADER_001",
"errorText": "errorText-value",
"isDownload": true
}
}
Usage in Node.js
const result = await send('Page.navigate', {"url": "https://example.com"});
console.log(result);
// {"frameId": "ABC123DEF456", "loaderId": "LOADER_001", "errorText": "errorText-value", "isDownload": true}