New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(page): introduce page.setDefaultTimeout #3854
Conversation
Method `page.setDefaultTimeout` overrides default 30 seconds timeout for all `page.waitFor*` methods, including navigation and waiting for selectors. Fix puppeteer#3319.
b31751b
to
e42d929
Compare
lib/FrameManager.js
Outdated
@@ -59,7 +60,14 @@ class FrameManager extends EventEmitter { | |||
* @param {number} timeout | |||
*/ | |||
setDefaultNavigationTimeout(timeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldgo away
docs/api.md
Outdated
@@ -1667,12 +1668,37 @@ await page.setCookie(cookieObject1, cookieObject2); | |||
#### page.setDefaultNavigationTimeout(timeout) | |||
- `timeout` <[number]> Maximum navigation time in milliseconds | |||
|
|||
This setting will change the default maximum navigation time of 30 seconds for the following methods: | |||
This setting will change the default maximum navigation time of 30 seconds for the following methods and related shortcuts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting will change the default maximum navigation time of 30 seconds for the following methods and related shortcuts:
docs/api.md
Outdated
@@ -1396,7 +1397,7 @@ Shortcut for [page.mainFrame().focus(selector)](#framefocusselector). | |||
|
|||
#### page.goBack([options]) | |||
- `options` <[Object]> Navigation parameters which might have the following properties: | |||
- `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 [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) method. | |||
- `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 [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
methods.
Method
page.setDefaultTimeout
overrides default 30 seconds timeoutfor all
page.waitFor*
methods, including navigation and waitingfor selectors.
Drive-by: teach
page.setContent
respectpage.setDefaultNavigationTimeout
.Fix #3319.