Commit Graph

10 Commits

Author SHA1 Message Date
Andrey Lushnikov
d68033aeca
chore(examples): indent all examples (#1783)
Indented examples are easier to read.
2018-01-11 13:42:01 -08:00
Eric Bidelman
cb1cb695a5 chore(search) - search developers.google.com for "Headess chrome" articles (#1586)
Adds back a search demo. I chose developers.google.com b/c the protocol viewer uses shadow dom. Gets a bit confusing.

Fixes #1578
2017-12-14 19:13:27 -08:00
Andrey Lushnikov
ea5da00755
chore: remove search.js example (#1564)
The example is violating the TOS of google.com

Fix #1557
2017-12-08 19:04:09 -08: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
Andrey Lushnikov
ce8a952044 refactor: migrate NavigatorWatcher to lifecycle events (#1141)
This patch:
- migrates navigation watcher to use protocol-issued lifecycle events.
- removes `networkIdleTimeout` and `networkIdleInflight` options for
  `page.goto` method
- adds a new `networkidle0` value to the waitUntil option of navigation
  methods

References #728.

BREAKING CHANGE:

As an implication of this new approach, the `networkIdleTimeout` and
`networkIdleInflight` options are no longer supported. Interested
clients should implement the behavior themselves using the `request` and
`response` events.
2017-10-23 18:10:59 -07:00
Sashiyama Yoshiki
fbee98aa51 chore(examples): add missing argument to search example (#1066)
Fixes #1059.
2017-10-17 15:07:16 -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
Vse Mozhet Byt
60ace82875 add 'use strict'; to examples (#530)
This patch:
- adds 'use strict'; to examples
- enforces 'use strict' in examples with .eslintrc.js
2017-08-24 17:33:41 -07:00
Andrey Lushnikov
13e8580a34 Use puppeteer.launch instead of browser constructor (#255)
This patch:
- split browser launching logic from Browser into `lib/Launcher.js`
- introduce `puppeteer` namespace which currently has a single `launch`
  method to start a browser

With this patch, the browser is no longer created with the `new
Browser(..)` command. Instead, it should be "launched" via the
`puppeteer.launch` method:

```js
const puppeteer = require('puppeteer');
puppeteer.launch().then(async browser => {
  ...
});
```

With this approach browser instance lifetime matches the lifetime of
actual browser process. This helps us:
- remove proxy streams, e.g. browser.stderr and browser.stdout
- cleanup browser class and make it possible to connect to remote
  browser
- introduce events on the browser instance, e.g. 'page' event. In case
  of lazy-launching browser, we should've launch browser when an event
  listener is added, which is unneded comlpexity.
2017-08-14 18:08:06 -07:00
JoelEinbinder
53baed6af6 Google search example (#220)
Add google search example.

References #178
2017-08-11 01:41:42 -07:00