You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **NOTE**[`page.setDefaultNavigationTimeout`](#pagesetdefaultnavigationtimeouttimeout) and [`page.setDefaultTimeout`](#pagesetdefaulttimeouttimeout) take priority over [`browserContext.setDefaultNavigationTimeout`](#browsercontextsetdefaultnavigationtimeouttimeout).
> **NOTE**[`page.setDefaultNavigationTimeout`](#pagesetdefaultnavigationtimeouttimeout) takes priority over [`page.setDefaultTimeout`](#pagesetdefaulttimeouttimeout), [`browserContext.setDefaultTimeout`](#browsercontextsetdefaulttimeouttimeout) and [`browserContext.setDefaultNavigationTimeout`](#browsercontextsetdefaultnavigationtimeouttimeout).
@@ -1782,27 +1779,6 @@ await page.waitForFunction(selector => !!document.querySelector(selector), {}, s
1782
1779
1783
1780
Shortcut for [page.mainFrame().waitForFunction(pageFunction[, options[, ...args]])](#framewaitforfunctionpagefunction-options-args).
1784
1781
1785
-
#### page.waitForLoadState([options])
1786
-
-`options` <[Object]> Navigation parameters which might have the following properties:
1787
-
-`timeout` <[number]> Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout), [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout), [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
1788
-
-`waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
1789
-
-`'commit'` - navigation is committed, new url is displayed in the browser address bar.
1790
-
-`'load'` - consider navigation to be finished when the `load` event is fired.
1791
-
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
1792
-
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
1793
-
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
1794
-
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
1795
-
1796
-
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
1797
-
If navigation is already at a required state, resolves immediately.
awaitpage.waitForLoadState(); // The promise resolves after navigation has finished.
1802
-
```
1803
-
1804
-
Shortcut for [page.mainFrame().waitForLoadState([options])](#framewaitforloadstateoptions).
1805
-
1806
1782
#### page.waitForNavigation([options])
1807
1783
-`options` <[Object]> Navigation parameters which might have the following properties:
1808
1784
-`timeout` <[number]> Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout), [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout), [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
@@ -1895,8 +1871,29 @@ This method returns all of the dedicated [WebWorkers](https://developer.mozilla.
1895
1871
1896
1872
Event object passed to the listeners of [`browserContext.on('page')`](#event-page) and [`page.on('popup')`](#event-popup) events. Provides access to the newly created page.
1897
1873
1898
-
#### pageEvent.page()
1899
-
- returns: <[Promise]<[Page]>> Promise which resolves to the created page.
1874
+
#### pageEvent.page([options])
1875
+
-`options` <[Object]>
1876
+
-`timeout` <[number]> Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout), [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout), [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
1877
+
-`waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider the page to be loaded, defaults to `load`. Events can be either:
1878
+
-`'commit'` - navigation is committed, new url is displayed in the browser address bar.
1879
+
-`'load'` - consider navigation to be finished when the `load` event is fired.
1880
+
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
1881
+
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
1882
+
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
1883
+
- returns: <[Promise]<[Page]>> Promise which resolves to the created page once it loads, according to `waitUntil` option.
1884
+
1885
+
This resolves when the page reaches a required load state, `load` by default. The earliest moment that page is available is when it has committed navigation to the initial url (corresponds to `{waitUntil: 'commit'}` option). For example, when opening a popup with `window.open('http://example.com')`, this method will wait until the network request to "http://example.com" is done and its response has started loading in the popup. Passing different `waitUntil` options will also wait for the particular load state to happen, e.g. default `load` waits until the load event fires.
1886
+
1887
+
```js
1888
+
const [, popup] =awaitPromise.all([
1889
+
// Click opens a popup window.
1890
+
page.click('button'),
1891
+
// Resolves after popup has fired 'DOMContentLoaded' event.
> **NOTE** Some pages will never fire `load` event. In this case, default `pageEvent.page()` without options will timeout - try using `pageEvent.page({ waitUntil: 'domcontentloaded' })` instead.
1900
1897
1901
1898
### class: Frame
1902
1899
@@ -1968,7 +1965,6 @@ An example of getting text from an iframe element:
-`options` <[Object]> Navigation parameters which might have the following properties:
2503
-
-`timeout` <[number]> Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout), [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout), [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
2504
-
-`waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
2505
-
-`'commit'` - navigation is committed, new url is displayed in the browser address bar.
2506
-
-`'load'` - consider navigation to be finished when the `load` event is fired.
2507
-
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
2508
-
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
2509
-
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
2510
-
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
2511
-
2512
-
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
2513
-
If navigation is already at a required state, resolves immediately.
awaitframe.waitForLoadState(); // The promise resolves after navigation has finished.
2518
-
```
2519
-
2520
2497
#### frame.waitForNavigation([options])
2521
2498
-`options` <[Object]> Navigation parameters which might have the following properties:
2522
2499
-`timeout` <[number]> Maximum navigation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultNavigationTimeout(timeout)](#browsercontextsetdefaultnavigationtimeouttimeout), [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout), [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
0 commit comments