Commit Graph

688 Commits

Author SHA1 Message Date
Andrey Lushnikov
59bcc2ee56 chore(docs): fix console example in docs/api.md 2017-10-05 17:34:13 -07:00
JoelEinbinder
d3976cb0a5 test: add failing test for storing data in custom userDataDir
Headless isn't closing gracefully, which sometimes causes data loss when Chrome closes before it finishes writing things to disk.

See https://crbug.com/771830

References #921
2017-10-05 17:08:35 -07:00
Benoît Zugmeyer
c225b93037 feat(Launcher): Allow environment variables definition when launching chromium (#912)
This patch adds `env` option to the `puppeteer.launch` method to define custom environment
variables to the launched chrome.
2017-10-05 14:34:35 -07:00
Sam Verschueren
97e40e6823 feat(Frame): Add addStyleTag API to frame - fixes #892 (#947)
This patch adds `Page.addStyleTag` and `Frame.addStyleTag` methods to the API.

Fixes #892.
2017-10-04 13:42:26 -07:00
JoelEinbinder
d87480b609 Node6: Remove parentheses around the body of async arrow functions (#942) 2017-10-02 18:25:11 -07:00
Andrey Lushnikov
dc4c8786e3 chore(doclint): fix doclint tests (#941)
Last commit 017429eef1 broke doclint
tests. Try bots didn't catch this because they were not running doclint
tests.

This patch:
- fixes doclint tests
- starts running doclint tests on travis
2017-10-02 15:14:57 -07:00
Andrey Lushnikov
017429eef1 chore(doclint): exclude constructors by default (#938)
Our API does not expose any classes; thus all the constructors
should be excluded from the API.
2017-10-02 14:28:51 -07:00
Andrey Lushnikov
6c9a99477b chore(doclint): support classes inheritance (#935)
This patch:
- gives meaningful names to doclint tests
- supports classes inheritance in documentation linter. When class A
  extends class B, all methods of class B are added to documentation of
  class A.

This is a prerequisite for Object Handles: ElementHandle will be
extending ObjectHandle.

References #382
2017-10-02 13:38:44 -07:00
Andrey Lushnikov
8bcf550bb6 chore(doclint): add basic tests for documentation parsers (#934)
This patch adds basic tests to verify javascript and markdown
documentation parsers.
2017-10-02 11:45:00 -07:00
Andrey Lushnikov
41fd4b529e chore(doclint): move doclint tests expectations into test folders (#932)
This makes for much easier work with doclint tests.
2017-10-02 11:37:16 -07:00
Vse Mozhet Byt
f9640a5498 chore(doc): add a note about using ElementHandle instances (#925) 2017-10-01 15:47:40 -07:00
mizdra
215b3497c7 fix(Page): remove event listeners to avoid MaxListenersExceededWarning
This patch starts to properly clean up event listeners on a failed navigation (Page.goto).
2017-09-30 00:50:13 -07:00
Adi Prasetyo
53531c9a92 feat(page): Allow Page.goto's timeout to be 0 to disable timeout (#887)
This patch allows passing 0 to disable timeout for the following methods:

- page.goto
- page.waitForNavigation
- page.goForward
- page.goBack

Fixes #782.
2017-09-30 00:29:38 -07:00
mizdra
bafd937fc3 chore(tests): fix a few typos in tests (#911) 2017-09-29 15:27:02 -07:00
Pavel Feldman
a6cf8237b8 feat(Launcher): introduce appMode option
The patch introduces a new appMode option to the launcher. This is an experimental
option, thus we don't document it.
2017-09-29 15:16:32 -07:00
Vse Mozhet Byt
1c292e9253 chore(doc): fix browser.wsEndpoint() return value format (#898) 2017-09-29 14:59:19 -07:00
Andrey Lushnikov
c46c41d89c fix(Launcher): Launcher should handle chrome process errors (#863)
Fixes #750
2017-09-29 12:21:24 -07:00
Andrey Lushnikov
cb280c526d fix(Launcher): Terminate chrome gracefully on Windows (#876)
This patch starts using taskkill program on windows to gracefully
terminate chrome.

Note: this slows down chrome shutdown on Windows in case of using
custom userDataDir. This is because chrome takes some time to shutdown
its operations and leave profile directory in a consistent state.

Fixes #839.
2017-09-29 11:41:11 -07:00
Andrey Lushnikov
f6255029bd feat(Console): Introduce ConsoleMessage type (#909)
This patch introduces ConsoleMessage type and starts dispatching
it for the 'console' event.

BREAKING CHANGE: this breaks the api of the 'console' event.

Fixes #744.
2017-09-29 11:27:22 -07:00
Andrey Lushnikov
cfece3451d fix(Network): Do not attempt to normalize malformed URLs. (#875)
This patch avoids throwing 'url malformed' error during generating
request hash for request interception.

Fixes #869.
2017-09-29 08:29:19 +09:00
Eric Bidelman
ec760ab5e3 chore: update yarn lock (#889) 2017-09-27 19:33:16 +09:00
Andrey Lushnikov
72161c475d [roll] Roll chromium to r503964 (#878)
This patch rolls chromium to r503964.

Note: since the plznavigate is not supported by puppeteer right now, the
patch also starts passing the `--disable-browser-side-navigation` flag.
This is a temporary work around for us.

References #877.
2017-09-27 10:37:31 +09:00
Jake Ginnivan
0164b7cc4e Added info on how to find the browserWSEndpoint (#780) 2017-09-26 07:04:09 -07:00
Andrey Lushnikov
9b0a06216e [docs] clarify env variables usage with npmrc 2017-09-26 11:15:18 +09:00
gordomium
2babcb0021 [feat] Support PUPPETEER_SKIP_CHROMIUM_DOWNLOAD in npmrc
This patch adds support for PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
variable in npm config.

This aligns the variable with the rest of supported environment variables.
2017-09-26 11:10:46 +09:00
Alix Axel
45f264024b [api] Introduce Page.select method (#779)
This patch adds `Page.select` method to select
values in a `select` tag.
2017-09-25 18:23:34 +09:00
Vse Mozhet Byt
acdb588964 doc: fix a link (#856) 2017-09-22 16:16:52 -07:00
Eric Bidelman
ccf8fb1681 readme: add try-puppeteer link (#849) 2017-09-21 18:01:48 -07:00
Eric Bidelman
c2b3fe91ed Remove --no-sandbox from Docker example (#838)
* Remove --no-sandbox from Docker example

* Update troubleshooting.md
2017-09-21 09:18:35 -07:00
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