Commit Graph

14 Commits

Author SHA1 Message Date
Jack Franklin
4fdb1e3cab
chore: add Prettier (#5825) 2020-05-07 12:54:55 +02:00
Andrey Lushnikov
d68033aeca
chore(examples): indent all examples (#1783)
Indented examples are easier to read.
2018-01-11 13:42:01 -08: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
Eric Bidelman
1ee47d868b Doc polish. Example consistency (#233) 2017-08-10 18:31:54 -07:00
Andrey Lushnikov
e1d8a3781e Rename Page.navigate into Page.goto (#232)
Fixes #228.
2017-08-10 00:02:10 -07:00
Andrey Lushnikov
29adc5dc80 [examples] get rid of old examples
This patch:
- removes old phantom-js examples
- adds an example to load page without images

References #178
2017-08-08 00:44:15 -07:00
JoelEinbinder
e6d8fca7cd Lint examples, again #178 (#190) 2017-08-02 15:03:26 -07:00
JoelEinbinder
0218960713 Revert "lint examples #178 (#182)" (#183)
This reverts commit 8c220654e8.
2017-08-02 01:26:02 -07:00
JoelEinbinder
8c220654e8 lint examples #178 (#182)
This patch enables lint in `examples/` folder.
2017-08-02 01:13:44 -07:00
Eric Bidelman
f185ab749f Fix readme example 2017-06-21 14:11:52 -07:00
Andrey Lushnikov
7bf3684039 Update examples/screenshot.js to use Page.saveScreenshot 2017-05-12 11:12:32 -07:00
Andrey Lushnikov
2cda8c18d1 Puppeteer: staging commit. 2017-05-11 00:06:41 -07:00