Commit Graph

859 Commits

Author SHA1 Message Date
Andrey Lushnikov
44d1e834a4
fix(Navigation): correctly wait for navigation in Page.goto (#1355)
This patch:
- starts persisting lifecycle state for every frame
- migrates NavigationWatcher to rely on these lifecycle events
- refactors Page.goto to properly return navigation errors

Fixes #1218.
2017-11-10 15:33:14 -08:00
Robin
9b907b9ada docs(api): javascript -> JavaScript (#1338) 2017-11-10 13:35:22 -08:00
Andrey Lushnikov
9c1935b651
feat(Chromium): roll chromium to r515411 (#1346)
This roll includes the following revisions:
- crrev.com/515281 DevTools: fix crash on intercepting request that
  posts a blob
- crrev.com/515368 DevTools: wait for navigation to be committed
  upon Page.navigate on the browser side.

Fixes #894, References #1218
2017-11-10 00:35:16 -08:00
Andy() {/** ... */}
7075c4cd4f docs(troubleshooting): fix typo (#1327)
This patch fixes typo from `6MB` to `64MB`
2017-11-09 10:26:49 -08:00
Alix Axel
7d18275fb9 Test: add tests to cover clicking checkbox (#1125)
This patch adds tests to make sure clicking both checkbox and its label
works.

These are regression tests to cover the upstream fix, rolled in #1299.
2017-11-07 20:38:22 -08:00
Tomas Alabes
73f5b806a3 fix(install): support for npm no_proxy (#1314)
This patch adds support for npm `no_proxy` configuration for the installation script.
2017-11-07 20:16:22 -08:00
JoelEinbinder
b7566c1a83 docs: document osx keyboard shortcuts not working (#1311)
Fixes #776
2017-11-07 16:22:58 -08:00
Andrey Lushnikov
cbe3dc58a2
Revert "feat(Page): teach Page.setContent to wait for resources to load (#1152)" (#1312)
This reverts commit 80ee469429.

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.
2017-11-07 14:18:05 -08:00
JoelEinbinder
b58d319926 fix(Page.click): throw a meaningful message for invisible elements (#1309)
This patch starts throwing a meaningful error message when trying to click the hidden
node.

References #1294
2017-11-07 13:54:40 -08:00
JoelEinbinder
3cb0f1af34 fix: make exposeFunction work for frames (#1295)
This patch fixes page.exposeFunction method so that it
adds exposed binding to all existing frames.

Fixes #690
2017-11-07 13:26:23 -08:00
Eric Bidelman
8c9332b62e docs(Readme): add loading extensions example (#1308)
This patch adds a tips-and-tricks section to the `readme.md` that explains
how to load extension to puppeteer.
2017-11-07 13:19:54 -08:00
Schelkun
77f585298f feat(Page): introduce Page bringToFront method (#1252)
This patch introduces Page.bringToFront method to activate tabs.

Fixes #1244
2017-11-07 13:17:36 -08:00
Eric Bidelman
9de34499ef
Additional Docker tips (#1235)
* block-images - use news.google.com

Address insecure content errors as seen on https://github.com/ebidel/try-puppeteer/issues/7.

* docs(troubleshooting.md): addition Docker tips

Fixes #809

* add dumb-init
2017-11-07 10:27:02 -08:00
Andrey Lushnikov
a467d35a5f chore(doclint): do not attempt to lint non-documentation markdown 2017-11-07 03:33:25 -08:00
Robert Sköld
cc5e8a9bd4 fix(Page.type): Add assertion to page.type() (#1301)
This patch starts throwing a nice error when `page.type` is called
with non-existent selector.
2017-11-07 03:07:51 -08:00
JoelEinbinder
2f7c77875e feat: roll chromium to r514418 (#1299)
Rolls Chromium to [r514418](https://crrev.com/514418).

This roll includes:
- https://crrev.com/514020 - DevTools: Convert DOM.getBoxModel to use CSS pixels
- https://crrev.com/513738 - Headless: use cookie encryption to match non-headless mode

Fixes #1082, fixes #1126, fixes #921
2017-11-07 01:23:29 -08:00
Xingan Wang
8e445734c6 feat(Frame): reject error for addScriptTag/addStyleTag (#1287)
fix #1221
2017-11-06 22:04:40 -08:00
Alessio Occhipinti
bdd5718630 docs(examples): added pupperender (#1293)
* doc(examples): added pupperender

* review fixes

* review fixes 2
2017-11-06 13:13:27 -08:00
Andrey Lushnikov
5e154dc835
fix(Page.select): assert all values are of type "string". (#1280)
This patch starts asserting that all values are of type "string".

The alternative approach to cast values to strings
might yield a hard-to-debug errors.

Fixes #1276.
2017-11-03 19:20:12 -07:00
Adi Prasetyo
03fefb53f8 feat(browser): add browser.disconnected event (#960)
This patch adds a 'disconnected' event for the browser. The event is issued
when the "browser" loses connection to the chrome process.

References #952
2017-11-03 18:46:17 -07:00
Andrey Lushnikov
88ba52a363
refactor: use Page.getFrameTree instead of Page.getResourceTree (#1275)
This patch starts using Page.getFrameTree instead of
Page.getResourceTree.

The resource tree is experimental, whereas the frame tree is not.
2017-11-03 18:37:21 -07:00
Vse Mozhet Byt
7bc55ab7fd docs(api.md): fix return values of page.add*Tag() (#1269) 2017-11-03 09:32:17 -07:00
Xingan Wang
e0f5b93923 feat(Frame): addStyleTag and addScriptTag now return ElementHandles.
This patch teaches `page.addStyleTag` and `page.addScriptTag` to return ElementHandles
to the added tags.

Fixes #1179.
2017-11-03 00:05:38 -07:00
Andrey Lushnikov
f08f33458f
test: validate headless reading cookies written by headful (#1266)
This test ensures that Chrome Headless can successfully read cookies written
by Chrome Headful.

References #921
2017-11-03 00:02:41 -07:00
Vse Mozhet Byt
cee3081a41 docs(api.md): fix return value of frame.select() (#1251) 2017-11-02 21:46:49 -07:00
Andrey Lushnikov
ac55e69676
feat(Chromium): roll chromium to r513435. (#1259)
This roll brings in a bunch of important patches:
- crrev.com/512647 Changed headless browser profile dir to use Default profile path
- crrev.com/512760 DevTools: stop idleness detector when pending navigation commits
- crrev.com/512905 DevTools: introduce Page.getFrameTree
- crrev.com/513373 DevTools: report loaderId in the lifecycle events
- crrev.com/513419 DevTools: introduce Page.setLifecycleEventsEnabled
- crrev.com/513422 DevTools: return loaderId from Page.navigate

Fixes #921 

BREAKING CHANGE:

Headless user profile structure is changing. Custom profiles set with --user-data-dir flag will no longer be read in Chrome 63 and will have to be recreated.

Alternatively, you can migrate old headless profile to a new structure. if you stored your profile in `<profile>` folder, you would run the following bash commands:

```bash
cd <profile>
mkdir Default
mv * Default
```

Full headless-dev PSA announcement: https://groups.google.com/a/chromium.org/forum/#!msg/headless-dev/asX8WgktXIE/zTUfmHDcAQAJ
2017-11-02 13:26:21 -07:00
Suvrat Jain
fede2643ac feat(Frame): introduce Frame.select
This patch adds `Frame.select` method that does the same functionality as
former `Page.select`, but on a per-frame level.

The `Page.select` method becomes a shortcut for the ÷main frame's select.

Fixes #1139
2017-11-01 22:06:04 -07:00
Andrey Lushnikov
bc7f211474
docs(contributing): define semantic commit message rules (#1233)
Semantic commit messages drastically simplify preparation of releases.
2017-11-01 14:05:19 -07:00
Andrey Lushnikov
f5bb333cd0
fix: support PlzNavigate in puppeteer. (#1239)
This patch migrates puppeteer to support PlzNavigate chromium
project.

As a consequence of this patch, we no longer wait for both
requestWillBeSent and requestIntercepted events to happen. This should
resolve a ton of request interception bugs that "hanged" the loading.

Fixes #877.
2017-11-01 14:04:10 -07:00
Andrey Lushnikov
b9266c74f8
feat(Page): rename Page.getMetrics into Page.metrics (#1240)
BREAKING CHANGE: method page.getMetrics() got renamed into
page.metrics().
2017-11-01 13:39:31 -07:00
Andrey Lushnikov
9f071bf411
fix(Navigation): do not race with security error for navigation (#1237)
Currently, NavigationWatcher listens to lifecycle events from Page
domain and security events from Security domain.

However, the events are dispatched from different processes in browser:
- Page's lifecycle events are dispatched from renderer process
- Security events are dispatched from browser process

This makes for the undefined order between events and results in
NavigationWatcher reporting different failuer messages, based on
the event order.

This patch stops relying on security errors in navigation watcher and
instead switches to request failure codes for the main resource.

Fixes #1195
2017-11-01 13:28:00 -07:00
AlexChung1995
e70f98ddb9 feat(Page.select): return selected options from Page.select (#1099)
This patch teaches Page.select to return an array of actually selected options.
If no option is selected, an empty array will be returned.
2017-10-31 21:47:52 -07:00
Manoj Patel
9f19641a3d chore: Fix typo in comment for Events (#1234) 2017-10-31 16:10:18 -07:00
Michael Stillwell
0bb2157743 Explain how to run examples (#1226)
* Explain how to run examples

* Update README.md

* Update README.md
2017-10-31 14:06:20 -07:00
Andrey Lushnikov
c9a26e11f1
fix(ElementHandle): teach ElementHandle to work with shadowdom (#1227)
Elements in shadow dom erroneously considered that they were detached
from document.

This patch starts using `Element.isConnected` instead of
`document.contains()` call.

Fixes #1061.
2017-10-31 12:02:16 -07:00
Andrey Lushnikov
557aa940ec
chore(license): fix license (#1220)
This patch fixes LICENSE. It basically gets the one from Lighthouse
project.

Fixes #1044.
2017-10-31 12:01:50 -07:00
burningTyger
6dec7cf6e4 typo in api.md (#1216)
more then -> more than
2017-10-31 11:30:29 -07:00
Tim
23382df0d0 Adding simple guide to run puppeteer on Heroku (#1199)
* Adding simple guide to run puppeteer on Heroku

* Update troubleshooting.md

* Update troubleshooting.md
2017-10-30 14:14:27 -07:00
Eric Bidelman
3bf18f26a2 chore(examples): use news.google.com for block-images.js (#1192)
Addresses insecure content errors on try-puppeteer

ebidel/try-puppeteer#7
2017-10-27 12:06:46 -07:00
Ilya Radchenko
380bb6a87f docs: use debug namespace instead of all namespaces (#1174)
This changes the debugging instructions to be specific to puppeteer, preventing new users (or those that copy-paste) from getting logs from other libraries that use the `debug` module.
2017-10-27 02:15:15 -07:00
Andrey Lushnikov
d9acf1ead5 test: remove irrelevant test (#1172)
Since the migration on lifecycle events, the websockets are no longer
taken into account to detect navigation success with networkidle events.
2017-10-27 02:14:25 -07:00
JoelEinbinder
e11dbd7be6 docs: add more keyboard examples for typing (#1176)
This adds more examples for using `keyboard.type` and `keyboard.press`. It adds warnings about Shift affecting or not affecting the text generated by certain methods.

fixes #723
2017-10-27 02:12:56 -07:00
Andrew Apicello
f9b017efaa chore(examples): update search example (#1181)
The search bar was not fully loaded and therefore "puppeteer" could not be entered into the submit field.

This patch starts waiting for the input element to be rendered to ensure this
element is loaded before attempting to populate it.
2017-10-27 02:10:35 -07:00
Adam Stankiewicz
5ffbd0d221 feat(ElementHandle): add ElementHandle.$ and ElementHandle.$$ (#1151)
This patch adds `ElementHandle.$` and `ElementHandle.$$` methods to query nested
elements.

Fixes #508
2017-10-27 02:08:58 -07:00
Jonathan Knapp
9e39f5f8a6 docs(troubleshooting): Add new buildpack url that adds additional fonts (#1161)
The jontewks buildpack worked great for running Chrome headless, but it did not include support for Chinese characters and the PDF rendering I was attempting was not usable. This fix brings in a few custom fonts to allow PDF generation to utilize the fonts.

The idea came from https://github.com/dscout/wkhtmltopdf-buildpack/pull/14/files
2017-10-26 14:57:58 -07:00
JoelEinbinder
655b94db47 fix(touch): requestAnimationFrame before sending tap (#1142)
This patch adds a work-around for the upstream bug, issuing double-raf before emulating touch event.

References #673
2017-10-26 14:53:50 -07:00
Andrey Lushnikov
d1f044e18f test: disable ignoreHTTPSErrors test (#1164)
Reference #1163
2017-10-25 14:40:45 -07:00
Andrey Lushnikov
ab9b34cd5d fix(Launcher): force-kill chrome on process exit and interruption (#1155)
This patch starts force-killing chromium regardless of custom userdata
directory when the node process exits.

References #1047
2017-10-24 16:05:12 -07:00
Andrey Lushnikov
b9ab6fe4bb fix(interception): Disable newtork caching when intercepting (#1154)
Request interception might not work properly if caching is enabled.
2017-10-24 15:14:25 -07:00
Andrey Lushnikov
ce005d480c feat(Chromium): Roll chromium to r511134 (#1153)
This roll includes:
- crrev.com/510651 that changes request interception methods in protocol
- s/Page.setRequestInterceptionEnabled/Page.setRequestInterception

BREAKING CHANGE

Page.setRequestInterceptionEnabled is renamed into
Page.setRequestInterception.
2017-10-24 14:45:03 -07:00