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** Use [Page.waitForLoadState](#pagewaitforloadstateoptions) to wait until the page gets to a particular state (you should not need it in most cases).
328
+
> **NOTE** Use [`page.waitForLoadState([state[, options]])`](#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
> **NOTE** Use [Page.waitForLoadState](#pagewaitforloadstateoptions) to wait until the page gets to a particular state (you should not need it in most cases).
783
+
784
+
> **NOTE** Use [`page.waitForLoadState([state[, options]])`](#pagewaitforloadstatestate-options) to wait until the page gets to a particular state (you should not need it in most cases).
Shortcut for [page.mainFrame().waitForFunction(pageFunction, arg, options]])](#framewaitforfunctionpagefunction-arg-options).
1707
1708
1708
-
#### page.waitForLoadState([options])
1709
-
-`options` <[Object]> Navigation parameters which might have the following properties:
1710
-
-`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.
1711
-
-`waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
1712
-
-`'load'` - consider navigation to be finished when the `load` event is fired.
1713
-
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
1714
-
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
1715
-
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
1716
-
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
1709
+
#### page.waitForLoadState([state[, options]])
1710
+
-`state` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> Load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the method resolves immediately.
1711
+
-`'load'` - wait for the `load` event to be fired.
1712
+
-`'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
1713
+
-`'networkidle0'` - wait until there are no more than 0 network connections for at least `500` ms.
1714
+
-`'networkidle2'` - wait until there are no more than 2 network connections for at least `500` ms.
1715
+
-`options` <[Object]>
1716
+
-`timeout` <[number]> Maximum waiting 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.
1717
+
- returns: <[Promise]> Promise which resolves when the required load state has been reached.
1717
1718
1718
-
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
1719
-
If navigation is already at a required state, resolves immediately.
1719
+
This resolves when the page reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.
-`options` <[Object]> Navigation parameters which might have the following properties:
2374
-
-`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.
2375
-
-`waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> When to consider navigation succeeded, defaults to `load`. Events can be either:
2376
-
-`'load'` - consider navigation to be finished when the `load` event is fired.
2377
-
-`'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired.
2378
-
-`'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms.
2379
-
-`'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms.
2380
-
- returns: <[Promise]> Promise which resolves when the load state has been achieved.
2381
+
#### frame.waitForLoadState([state[, options]])
2382
+
-`state` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"> Load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the method resolves immediately.
2383
+
-`'load'` - wait for the `load` event to be fired.
2384
+
-`'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
2385
+
-`'networkidle0'` - wait until there are no more than 0 network connections for at least `500` ms.
2386
+
-`'networkidle2'` - wait until there are no more than 2 network connections for at least `500` ms.
2387
+
-`options` <[Object]>
2388
+
-`timeout` <[number]> Maximum waiting 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.
2389
+
- returns: <[Promise]> Promise which resolves when the required load state has been reached.
2381
2390
2382
-
This resolves when the page reaches a required load state, `load` by default. The navigation can be in progress when it is called.
2383
-
If navigation is already at a required state, resolves immediately.
2391
+
This resolves when the frame reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately.
0 commit comments