Commit Graph

509 Commits

Author SHA1 Message Date
Andrey Lushnikov
bc4aefaf9f Bump version to 0.12.0-alpha 2017-09-21 15:08:39 +09:00
Andrey Lushnikov
433b17b5d2 Mark version 0.11.0 2017-09-21 14:43:21 +09:00
Vse Mozhet Byt
715296443c Document headless mode restriction for PDF (#836)
Fixes: https://github.com/GoogleChrome/puppeteer/issues/830
2017-09-20 16:51:25 -07:00
Adi Prasetyo
611f51bda5 [doc] Fix thal link (#806)
This patch adds missing protocol to the link in example's README.md
2017-09-18 06:53:36 -07:00
cohesively
aa58f25bc1 doc: add await to browser.close in usage examples (#797)
browser.close returns a promise after f398e69, so it should be awaited.
2017-09-15 21:27:14 -07:00
JoelEinbinder
e2cad568d6 page.waitFor should send ...args to page.waitForFunction (#775)
This lets the user pass `...args` into `page.waitFor`. It also clarifies that the docs that `options` is not optional if `...args` are specified.

Fixes #770
2017-09-15 14:28:15 -07:00
Andrey Lushnikov
d562db3140 Assert that all extra HTTP header values are strings (#781)
Since protocol ignores all HTTP headers that don't have string
value, this patch starts validating header key-values before
sending them over the protocol.

Fixes #713.
2017-09-14 19:08:48 -07:00
Andrey Lushnikov
86b05dadd5 disable extensions and google translate by default (#774)
This patch teaches `puppeteer.launch` to run chromium with disabled
chrome extensions and google translate services.

References #760
2017-09-14 19:07:22 -07:00
Adi Prasetyo
a20df0df62 [Doc] add link to environment variable wiki page (#792) 2017-09-14 11:44:18 -07:00
Andrey Lushnikov
166c909ab2 [tests] fix a few tests to avoid unhandled promise rejection (#778)
A few tests were not waiting for navigation to complete.
2017-09-13 22:52:43 -07:00
JoelEinbinder
f398e69dbb [api] Launcher: Close gracefully when a userDataDir is specified (#700)
This patch:
- makes `browser.close()` return a promise that resolves when browser gets closed
- starts closing chrome gracefully if a custom `userDataDir` is supplied

Fixes #527
2017-09-13 21:27:14 -07:00
Andrey Lushnikov
d7e673645a [api] add Puppeteer.executablePath() method (#771)
This patch adds Puppeteer.executablePath() method to query the path
of bundled chromium.

Fixes #745
2017-09-13 17:39:18 -07:00
JoelEinbinder
89e923d5f0 Fix cookies test on windows (#772)
The `username` and `password` cookies showed up in the wrong order on Windows, causing the test to fail.
2017-09-13 17:30:25 -07:00
Andrey Lushnikov
010872012f Cleanup tests (#769)
This patch:
- cleans up a bunch of try-catch statements in favor of a concise pattern
- renames "Browser" test suite into "Puppeteer" test suite
2017-09-13 12:06:57 -07:00
Jon Tewksbury
9779085b7c Add info about deploying puppeteer to Heroku (#762) 2017-09-12 09:54:30 -07:00
Andrey Lushnikov
9292a56eaf [api] Teach page.evaluate to accept element handles as parameters (#725)
This patch:
- teaches `page.evaluate` to accept ElementHandles as parameters
- removes `ElementHandle.evaluate` method since it's not needed any
  more

References #382
2017-09-11 19:20:02 -07:00
Andrey Lushnikov
69e707a2b7 Build node6 before running tests for it (#757)
Fix #756
2017-09-11 18:03:51 -07:00
Andrey Lushnikov
a71f287c6b Fix evaluation in case of first "undefind" argument (#732)
It turns out that [undefined, 1].join(',') results in ",1" instead
of "undefined,1". This causes a syntax error when trying to pass undefined
as a first argument to `page.evaluate` method.

Fixes #572.
2017-09-11 16:59:38 -07:00
Andrey Lushnikov
e5c17eecb9 Carefully manage unhandled rejections for navigation (#741)
Currently, navigation watcher throws exception if timeout
is exceeded.

Due to the way it is used in `page.navigate`, the promise
get's rejected before it is awaited, which is considered to
be "unhandled promise rejection".

Fixes #738
2017-09-11 16:43:37 -07:00
Andrey Lushnikov
0db6165d73 [api] Implement page.authenticate method (#729)
This patch implements `page.authenticate` which should cover all
cases of HTTP authentication.

Fixes #426.
2017-09-11 16:32:13 -07:00
Andrey Lushnikov
0bea42bd8c Do not leave dangling promises when sending messages over protocol (#742)
It's very bad to have 'unhandled promise rejection' that can't be
handled in user code. These errors will exit node process in a near
future.

This patch avoids 'unhandled promise rejection' while sending protocol
messages.

This patch:
- introduces `puppeteer:error` debug scope and starts using it for all
  swalloed errors.
- makes sure that every `client.send` method is either awaited or its
  errors are handled.
- starts return promises from Request.continue() and Request.abort().
- starts swallow errors from Request.contine() and Request.abort().

The last is the most important part of the patch. Since
`Request.continue()` might try to continue canceled request, we should
disregard the error.

Fixes #627.
2017-09-11 16:21:51 -07:00
Eric Bidelman
f11e09d0d4 resources.md -> readme.md so it renders on /examples (#753)
* resources.md -> index.md so it renders on /examples

* Rename index.md to README.md
2017-09-11 11:41:48 -07:00
Alessio Occhipinti
568b7bd47d Proposal: adding RESOURCES.md for examples (#743)
* Create RESOURCES.md

* Update RESOURCES.md
2017-09-11 11:34:06 -07:00
Eric Bidelman
30541cc087 block-images example: use reuters.com (#747)
Due to https://github.com/GoogleChrome/puppeteer/issues/746. The screenshot news.google.com isn't "full page", so that may be confusing to folks.
2017-09-11 10:16:57 -07:00
Andrey Lushnikov
c4a3d44221 Roll chromium to r499413 (#731)
The new chromium:
- supports executionContextId in Runtime.callFunctionOn protocol method
- supports passing objects as arguments in Runtime.callFuntionOn
  protocol method

This roll also fixes #487.
2017-09-09 09:48:09 -07:00
Andrey Lushnikov
d791583ae5 [tests] Skip flaky test (#730)
Reference #673
2017-09-08 23:42:06 -07:00
Andrey Lushnikov
b8bb80a089 support npm proxy configuration for the installation script (#692)
This patch starts supporting NPM proxy configuration in the installation script.
If both NPM proxy and environment proxy are set, NPM proxy settings are preferred.

Fixes #648
2017-09-08 23:37:22 -07:00
Eric Bidelman
8d2a427eee Docker example (#721) 2017-09-08 15:25:43 -07:00
Andrey Lushnikov
113bdafbf0 Bump version to 0.11.0-alpha 2017-09-08 13:37:47 -07:00
Eric Bidelman
272fb4d993 block-images example: switch from bbc to news.google.com (#708) 2017-09-07 12:35:52 -07:00
Eric Bidelman
d2d951d74a Better issue template (#712) 2017-09-07 12:34:52 -07:00
Eric Bidelman
eb862532f1 Issue template (#710)
* Issue template

* Update issue_template.md
2017-09-07 11:24:49 -07:00
Andrey Lushnikov
e12ce802cd Output path as chromium gets successfully downloaded (#689)
Fixes #679.
2017-09-05 18:41:21 -07:00
Eric Bidelman
51a507b236 readme: add PUPPETEER_SKIP_CHROMIUM_DOWNLOAD note (#671) 2017-09-05 11:14:58 -07:00
Andrey Lushnikov
2817130fe0 Mark version 0.10.2 2017-09-01 21:02:08 -07:00
Andrey Lushnikov
9d0ad79b47 fail installation when puppeteer errors downloading chromium (#654)
This patch starts failing npm installation when puppeteer errors downloading chromium.
2017-09-01 20:59:28 -07:00
JoelEinbinder
64124df62f [api] add touchScreen.tap (#639)
This patch:
- adds `page.touchscreen` namespace, similar to `page.mouse` and `page.keyboard`.
- adds tapping to multiple layers:
  - `page.touchscreen.tap`
  - `page.tap` - convenience method which accepts selector
  - `elementHandle.tap`

Fixes #568 and #569.
2017-09-01 19:03:51 -07:00
Abdulaziz Homaily
e95fb96279 Throw an error when Chromium download is failed (#619)
This patch teaches ChromiumDownloader to throw an error if
downloading failed.
2017-09-01 09:47:57 -07:00
JoelEinbinder
42fa3af659 Remove promise jsdoc (#641)
This patch removes unnecessary "promise" return types in jsdoc for async functions.
2017-08-31 17:58:07 -07:00
Andrey Lushnikov
62ececb1c7 Implement page.$eval (#638)
This patch:
- implements page.$eval and frame.$eval
- drops elementHandle.attribute() method in favor of the page.$eval

References #625
2017-08-31 15:38:01 -07:00
Andrey Lushnikov
bf66696770 correct license to be a valid SPDX license expression 2017-08-31 11:16:28 -07:00
Gregory Linford
a052cdb464 Update package.json with Apache License 2.0 (#632)
The license used is Apache License 2.0, so I think it makes sense to update the package.json file with the correct string as a some software use this field to approve or not packages.
2017-08-31 09:57:29 -07:00
Lucas Hill
ce01e84381 [doc] Clarify networkIdleInflight default in docs. (#630) 2017-08-30 23:08:46 -07:00
Andrey Lushnikov
9d7929cd36 Add environment variable to skip download (#606)
This patch:
- starts skipping chromium download if `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` env variable is set
- adds description of support env variables to the `docs/api.md`.

References #603
2017-08-30 21:40:15 -07:00
Paul Irish
3365562b2b Add DEBUG=* debugging guide to readme (#622) 2017-08-30 18:41:45 -04:00
Andrey Lushnikov
66676c0235 Kill child process group (#621) 2017-08-30 14:16:03 -07:00
Andrey Lushnikov
223a1066bb Drop deasync: this is a left-over from phantomShim (#607) 2017-08-29 23:34:00 -07:00
Andrey Lushnikov
c9b0a6c060 Fix launcher to not leak event listeners (#605)
This patch fixes launcher to not leak event listeners.
2017-08-29 22:49:50 -07:00
Andrey Lushnikov
11ce8b249f Implement Request.resourceType getter (#590)
This patch plumbs `resourceType` parameter of RequestWillBeSent
and requestIntercepted methods.
2017-08-29 16:27:59 -07:00
JoelEinbinder
8f74cc8a90 [api] Add "step" option to mouse.move method (#601)
This patch adds "step" option to the mouse.move method, that optionally tweens mouse movement over multiple steps.

References #423.
2017-08-29 14:13:38 -07:00