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
@@ -1703,6 +1704,26 @@ await page.waitForFunction(selector => !!document.querySelector(selector), {}, s
1703
1704
1704
1705
Shortcut for [page.mainFrame().waitForFunction(pageFunction[, options[, ...args]])](#framewaitforfunctionpagefunction-options-args).
1705
1706
1707
+
#### page.waitForLoadState([options])
1708
+
-`options` <[Object]> Navigation parameters which might have the following properties:
1709
+
-`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.
1710
+
-`waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
1711
+
-`'load'` - consider navigation to be finished when the `load` event is fired.
1712
+
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
1713
+
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
1714
+
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
1715
+
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
1716
+
1717
+
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
1718
+
If navigation is already at a required state, resolves immediately.
awaitpage.waitForLoadState(); // The promise resolves after navigation has finished.
1723
+
```
1724
+
1725
+
Shortcut for [page.mainFrame().waitForLoadState([options])](#framewaitforloadstateoptions).
1726
+
1706
1727
#### page.waitForNavigation([options])
1707
1728
-`options` <[Object]> Navigation parameters which might have the following properties:
1708
1729
-`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.
@@ -1887,6 +1908,7 @@ An example of getting text from an iframe element:
-`options` <[Object]> Navigation parameters which might have the following properties:
2401
+
-`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.
2402
+
-`waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
2403
+
-`'load'` - consider navigation to be finished when the `load` event is fired.
2404
+
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
2405
+
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
2406
+
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
2407
+
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
2408
+
2409
+
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
2410
+
If navigation is already at a required state, resolves immediately.
awaitframe.waitForLoadState(); // The promise resolves after navigation has finished.
2415
+
```
2416
+
2377
2417
#### frame.waitForNavigation([options])
2378
2418
-`options` <[Object]> Navigation parameters which might have the following properties:
2379
2419
-`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