https://
. |
-| options | { referer?: string; referrerPolicy?: string; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; } | _(Optional)_ navigation options. waitUntil
is useful to define when the navigation should be considered successful - see the docs for [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) for more details. |
+| Parameter | Type | Description |
+| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
+| url | string | URL to navigate the frame to. The URL should include scheme, e.g. https://
|
+| options | { referer?: string; referrerPolicy?: string; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; } | _(Optional)_ Options to configure waiting behavior. |
**Returns:**
@@ -37,9 +37,9 @@ A promise which resolves to the main resource response. In case of multiple redi
## Exceptions
-This method will throw an error if:
+If:
-- there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the `timeout` is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load.
+- there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the timeout is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load.
This method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [HTTPResponse.status()](./puppeteer.httpresponse.status.md).
diff --git a/docs/api/puppeteer.frame.md b/docs/api/puppeteer.frame.md
index 4f23be6fd91..1254fbc1e7e 100644
--- a/docs/api/puppeteer.frame.md
+++ b/docs/api/puppeteer.frame.md
@@ -85,7 +85,7 @@ console.log(text);
| [evaluate(pageFunction, args)](./puppeteer.frame.evaluate.md) | | Behaves identically to [Page.evaluate()](./puppeteer.page.evaluate.md) except it's run within the the context of this frame. |
| [evaluateHandle(pageFunction, args)](./puppeteer.frame.evaluatehandle.md) | | Behaves identically to [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md) except it's run within the context of this frame. |
| [focus(selector)](./puppeteer.frame.focus.md) | | Focuses the first element that matches the selector
. |
-| [goto(url, options)](./puppeteer.frame.goto.md) | | Navigates a frame to the given url. |
+| [goto(url, options)](./puppeteer.frame.goto.md) | | Navigates the frame to the given url
. |
| [hover(selector)](./puppeteer.frame.hover.md) | | Hovers the pointer over the center of the first element that matches the selector
. |
| [isDetached()](./puppeteer.frame.isdetached.md) | | Istrue
if the frame has been detached. Otherwise, false
. |
| [isOOPFrame()](./puppeteer.frame.isoopframe.md) | | Is true
if the frame is an out-of-process (OOP) frame. Otherwise, false
. |
diff --git a/docs/api/puppeteer.frame.waitfornavigation.md b/docs/api/puppeteer.frame.waitfornavigation.md
index d8f96604c5d..418ebf3a716 100644
--- a/docs/api/puppeteer.frame.waitfornavigation.md
+++ b/docs/api/puppeteer.frame.waitfornavigation.md
@@ -12,24 +12,23 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist
```typescript
class Frame {
- abstract waitForNavigation(options?: {
- timeout?: number;
- waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
- }): Promiseoptional
| string | If provided, it will take preference over the referer header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md). | |
+| referrerPolicy | optional
| string | If provided, it will take preference over the referer-policy header value set by [page.setExtraHTTPHeaders()](./puppeteer.page.setextrahttpheaders.md). | |
diff --git a/docs/api/puppeteer.page.goto.md b/docs/api/puppeteer.page.goto.md
index f75be4f13c3..1494c64a22e 100644
--- a/docs/api/puppeteer.page.goto.md
+++ b/docs/api/puppeteer.page.goto.md
@@ -4,51 +4,45 @@ sidebar_label: Page.goto
# Page.goto() method
+Navigates the page to the given `url`.
+
#### Signature:
```typescript
class Page {
- goto(
- url: string,
- options?: WaitForOptions & {
- referer?: string;
- referrerPolicy?: string;
- }
- ): Promisehttps://
|
-| options | [WaitForOptions](./puppeteer.waitforoptions.md) & { referer?: string; referrerPolicy?: string; } | _(Optional)_ Navigation Parameter |
+| Parameter | Type | Description |
+| --------- | ----------------------------------------- | ---------------------------------------------------------------------------------- |
+| url | string | URL to navigate page to. The URL should include scheme, e.g. https://
|
+| options | [GoToOptions](./puppeteer.gotooptions.md) | _(Optional)_ Options to configure waiting behavior. |
**Returns:**
Promise<[HTTPResponse](./puppeteer.httpresponse.md) \| null>
-Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
+A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
-## Remarks
+## Exceptions
-The argument `options` might have the following properties:
-
-- `timeout` : Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) or [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) methods.
-
-- `waitUntil`:When to consider navigation succeeded, defaults to `load`. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:url
. |
| [hover(selector)](./puppeteer.page.hover.md) | | This method fetches an element with selector
, scrolls it into view if needed, and then uses [Page.mouse](./puppeteer.page.md) to hover over the center of the element. If there's no element matching selector
, the method throws an error. |
| [isClosed()](./puppeteer.page.isclosed.md) | | Indicates that the page has been closed. |
| [isDragInterceptionEnabled()](./puppeteer.page.isdraginterceptionenabled.md) | | true
if drag events are being intercepted, false
otherwise. |
@@ -124,7 +124,7 @@ page.off('request', logRequest);
| [metrics()](./puppeteer.page.metrics.md) | | Object containing metrics as key/value pairs. |
| [pdf(options)](./puppeteer.page.pdf.md) | | Generates a PDF of the page with the print
CSS media type. |
| [queryObjects(prototypeHandle)](./puppeteer.page.queryobjects.md) | | This method iterates the JavaScript heap and finds all objects with the given prototype. |
-| [reload(options)](./puppeteer.page.reload.md) | | |
+| [reload(options)](./puppeteer.page.reload.md) | | Reloads the page. |
| [removeExposedFunction(name)](./puppeteer.page.removeexposedfunction.md) | | The method removes a previously added function via $[Page.exposeFunction()](./puppeteer.page.exposefunction.md) called name
from the page's window
object. |
| [removeScriptToEvaluateOnNewDocument(identifier)](./puppeteer.page.removescripttoevaluateonnewdocument.md) | | Removes script that injected into page by Page.evaluateOnNewDocument. |
| [screenshot(options)](./puppeteer.page.screenshot.md) | | Captures screenshot of the current page. |
diff --git a/docs/api/puppeteer.page.reload.md b/docs/api/puppeteer.page.reload.md
index f483a097aef..bb00e2a2835 100644
--- a/docs/api/puppeteer.page.reload.md
+++ b/docs/api/puppeteer.page.reload.md
@@ -4,6 +4,8 @@ sidebar_label: Page.reload
# Page.reload() method
+Reloads the page.
+
#### Signature:
```typescript
@@ -14,20 +16,12 @@ class Page {
## Parameters
-| Parameter | Type | Description |
-| --------- | ----------------------------------------------- | ----------------------------------------------------------------------------- |
-| options | [WaitForOptions](./puppeteer.waitforoptions.md) | _(Optional)_ Navigation parameters which might have the following properties: |
+| Parameter | Type | Description |
+| --------- | ----------------------------------------------- | --------------------------------------------------- |
+| options | [WaitForOptions](./puppeteer.waitforoptions.md) | _(Optional)_ Options to configure waiting behavior. |
**Returns:**
Promise<[HTTPResponse](./puppeteer.httpresponse.md) \| null>
-Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
-
-## Remarks
-
-The argument `options` might have the following properties:
-
-- `timeout` : Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) or [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) methods.
-
-- `waitUntil`: When to consider navigation succeeded, defaults to `load`. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:optional
| number | Maximum wait time in milliseconds. Pass 0 to disable the timeout.
The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) or [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) methods.
|30000
|
-| waitUntil | optional
| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\] | | |
+| Property | Modifiers | Type | Description | Default |
+| --------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
+| timeout | optional
| number | Maximum wait time in milliseconds. Pass 0 to disable the timeout.
The default value can be changed by using the [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md) or [Page.setDefaultNavigationTimeout()](./puppeteer.page.setdefaultnavigationtimeout.md) methods.
|30000
|
+| waitUntil | optional
| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\] | When to consider waiting succeeds. Given an array of event strings, waiting is considered to be successful after all events have been fired. | 'load'
|
diff --git a/packages/puppeteer-core/src/api/Frame.ts b/packages/puppeteer-core/src/api/Frame.ts
index 989ea15b7b8..e2d4f0815aa 100644
--- a/packages/puppeteer-core/src/api/Frame.ts
+++ b/packages/puppeteer-core/src/api/Frame.ts
@@ -54,6 +54,45 @@ import {
} from './locators/locators.js';
import {type Realm} from './Realm.js';
+/**
+ * @public
+ */
+export interface WaitForOptions {
+ /**
+ * Maximum wait time in milliseconds. Pass 0 to disable the timeout.
+ *
+ * The default value can be changed by using the
+ * {@link Page.setDefaultTimeout} or {@link Page.setDefaultNavigationTimeout}
+ * methods.
+ *
+ * @defaultValue `30000`
+ */
+ timeout?: number;
+ /**
+ * When to consider waiting succeeds. Given an array of event strings, waiting
+ * is considered to be successful after all events have been fired.
+ *
+ * @defaultValue `'load'`
+ */
+ waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
+}
+
+/**
+ * @public
+ */
+export interface GoToOptions extends WaitForOptions {
+ /**
+ * If provided, it will take preference over the referer header value set by
+ * {@link Page.setExtraHTTPHeaders | page.setExtraHTTPHeaders()}.
+ */
+ referer?: string;
+ /**
+ * If provided, it will take preference over the referer-policy header value
+ * set by {@link Page.setExtraHTTPHeaders | page.setExtraHTTPHeaders()}.
+ */
+ referrerPolicy?: string;
+}
+
/**
* @public
*/
@@ -278,7 +317,7 @@ export abstract class Frame extends EventEmitter