Commit Graph

13 Commits

Author SHA1 Message Date
JoelEinbinder
e59172de83 chore: Use Typescript to lint JSDoc annotations ()
This patch starts using typescript to lint JSDoc annotations.

Note: this uses typescript's bleeding edge. We should migrate to stable once
it has all the necessary bugfixes.

References .
2017-10-09 22:31:40 -07:00
Adi Prasetyo
53531c9a92 feat(page): Allow Page.goto's timeout to be 0 to disable timeout ()
This patch allows passing 0 to disable timeout for the following methods:

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

Fixes .
2017-09-30 00:29:38 -07:00
Andrey Lushnikov
e5c17eecb9 Carefully manage unhandled rejections for navigation ()
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 
2017-09-11 16:43:37 -07:00
Andrey Lushnikov
0bea42bd8c Do not leave dangling promises when sending messages over protocol ()
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 .
2017-09-11 16:21:51 -07:00
Eric Bidelman
1f9b4fb4c8 Change let into const ()
This patch:
- changes `let` into `const` throughout codebase
- adds eslint check to prefer const over let
2017-08-21 16:39:04 -07:00
Andrey Lushnikov
fe06c896eb Roll chromium to 492629 ()
This patch
- rolls chromium to 492629
- migrates connection establishing to use browser target. This migration means
  that now we have a single websocket connection to browser (implemented
  in Connection class). A connection to a particular target is
  incapsulated in a new Session class.
2017-08-09 16:14:00 -07:00
Pavel Feldman
82fbb268db Do not count inflight requests explicitly - use set. () 2017-08-03 16:30:55 -07:00
Andrey Lushnikov
a43c315214 Implement browser 'ignoreHTTPSErrors' option. ()
This patch implements Browser 'ignoreHTTPSErrors' option.

Fixes .
2017-08-01 15:17:57 -07:00
JoelEinbinder
1a50403090 fix linter ()
This patch fixes broken travis, caused by impatient merge of f455e3a1e
2017-07-25 16:47:49 -07:00
Pavel Feldman
f455e3a1e4 Remove NetworkManager usage from NavigatorWatcher () 2017-07-25 16:06:53 -07:00
Andrey Lushnikov
c4904b4e10 Do not leak event listeners on navigation
This patch:
- introduces helper.addEventListener/helper.removeEventListeners
  to simplify event management
- moves NavigatorWatchdog over to the helper.addEventListener to
  stop leaking event listeners
2017-07-22 17:46:39 -07:00
Andrey Lushnikov
5757bc18f2 Rename 'maxTime' option of Page.navigate into 'timeout'
The motivation behind this rename is to name all the 'timeout' options
across methods similarly.

References .
2017-07-22 16:32:57 -07:00
Pavel Feldman
98c3894c84 Introduce Page.waitForNavigation ()
This patch introduces Page.waitForNavigation which allows to wait
for render-initiated navigation.

This patch also does a nice refactoring, replacing Navigator with NavigatorWatcher which
is not a part of a page state.

References 
2017-07-18 18:54:24 -07:00