Skip to content
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

Merged
merged 2 commits into from Jan 29, 2019

Conversation

aslushnikov
Copy link
Contributor

Method page.setDefaultTimeout overrides default 30 seconds timeout
for all page.waitFor* methods, including navigation and waiting
for selectors.

Drive-by: teach page.setContent respect page.setDefaultNavigationTimeout.

Fix #3319.

@aslushnikov aslushnikov changed the title Default timeouts feat(page): introduce page.setDefaultTimeout Jan 28, 2019
Method `page.setDefaultTimeout` overrides default 30 seconds timeout
for all `page.waitFor*` methods, including navigation and waiting
for selectors.

Fix puppeteer#3319.
lib/Page.js Outdated Show resolved Hide resolved
@@ -59,7 +60,14 @@ class FrameManager extends EventEmitter {
* @param {number} timeout
*/
setDefaultNavigationTimeout(timeout) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldgo away

lib/FrameManager.js Outdated Show resolved Hide resolved
docs/api.md Outdated Show resolved Hide resolved
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:
Copy link
Contributor Author

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 Show resolved Hide resolved
docs/api.md Outdated Show resolved Hide resolved
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

methods.

@aslushnikov aslushnikov merged commit a064a63 into puppeteer:master Jan 29, 2019
@aslushnikov aslushnikov deleted the default-timeouts branch January 29, 2019 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants