Skip to content

Conversation

@aslushnikov
Copy link
Contributor

This patch adds "options" parameter to the page.setContent method. The
parameter is the same as a navigation parameter and allows to specify
maximum timeout to wait for resources to be loaded, as well as to
describe events that should be emitted before the setContent operation
would be considered successful.

Fixes #728.

This patch adds "options" parameter to the `page.setContent` method. The
parameter is the same as a navigation parameter and allows to specify
maximum timeout to wait for resources to be loaded, as well as to
describe events that should be emitted before the setContent operation
would be considered successful.

Fixes puppeteer#728.
docs/api.md Outdated
- returns: <[Promise]>
- `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.
- `waitUntil` <[string]|[Array]<[string]>> When to consider setting content complete, defaults to `load`. Given an array of event strings, setting content is considered to be successful after all events have been fired. Events Can be either:
Copy link
Contributor

Choose a reason for hiding this comment

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

small typo here and other places
Can can

@vsemozhetbyt
Copy link
Contributor

The entry in TOC needs updating:

* [page.setContent(html)](#pagesetcontenthtml)

to

* [page.setContent(html, options)](#pagesetcontenthtml-options)

@aslushnikov aslushnikov merged commit 80ee469 into puppeteer:master Oct 24, 2017
ithinkihaveacat pushed a commit to ithinkihaveacat/puppeteer that referenced this pull request Oct 31, 2017
…eteer#1152)

This patch adds "options" parameter to the `page.setContent` method. The
parameter is the same as a navigation parameter and allows to specify
maximum timeout to wait for resources to be loaded, as well as to
describe events that should be emitted before the setContent operation
would be considered successful.

Fixes puppeteer#728.
aslushnikov added a commit to aslushnikov/puppeteer that referenced this pull request Nov 7, 2017
…ad (puppeteer#1152)"

This reverts commit 80ee469.

Lifecycle events are not ready yet to support the setContent scenario.
The prerequisite for this to work is
https://chromium-review.googlesource.com/c/chromium/src/+/747805 which
might not land soon due to technical concerns.
aslushnikov added a commit that referenced this pull request Nov 7, 2017
…ad (#1152)" (#1312)

This reverts commit 80ee469.

Lifecycle events are not ready yet to support the setContent scenario.
The prerequisite for this is
https://chromium-review.googlesource.com/c/chromium/src/+/747805 that
might not land soon due to technical concerns.
@aslushnikov aslushnikov deleted the fix-setcontent branch January 25, 2018 21:53
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.

3 participants