Back to Puppeteer

Page.goBack() method

docs/api/puppeteer.page.goback.md

19.2.2792 B
Original Source

Page.goBack() method

This method navigate to the previous page in history.

Signature

typescript
class Page {
  abstract goBack(options?: WaitForOptions): Promise<HTTPResponse | null>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

options

</td><td>

WaitForOptions

</td><td>

(Optional) Navigation parameters

</td></tr> </tbody></table>

Returns:

Promise<HTTPResponse | 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. If the navigation is same page, returns null. If no history entry is found throws.