Commit Graph

448 Commits

Author SHA1 Message Date
Joel Einbinder
25632133e2 feat: add option to specify the default viewport (#3005)
Fixes #1183.
2018-08-01 16:23:03 -07:00
Paul Shibanov
fd5d95bd99 docs(troubleshooting): update Chromium package supported on Alpine (#2997) 2018-07-31 15:07:59 -07:00
Andrey Lushnikov
c018ff1555
feat(browsercontext): add BrowserContext.pages() method (#3003) 2018-07-31 13:24:29 -07:00
Fred Chasen
12e3510eca feat(page): add 'preferCSSPageSize' to page.pdf options (#2928)
Fixes #1963.
2018-07-26 18:51:44 -07:00
Andrey Lushnikov
d09b3042fd
docs(api.md): elaborate on passing arguments in waitForFunction (#2921) 2018-07-26 16:26:37 -07:00
Pavel Pomerantsev
26cd16c724 docs(api.md): expand on testing Chrome Extensions (#2893)
Fixes #2823
2018-07-18 19:33:51 -07:00
Maxi Cilauro
e4e72c9e81 docs(api.md): fix typo (#2890) 2018-07-16 15:07:54 -07:00
Andrey Lushnikov
8802253e13
chore: bump version to v1.6.0-post (#2883) 2018-07-12 18:11:51 -07:00
Andrey Lushnikov
3762de7b91
chore: mark version v1.6.0 (#2882) 2018-07-12 17:26:57 -07:00
Matthew Shirley
726c8dc046 feat(page): introduce waitForRequest and waitForResponse methods (#2776)
This patch introduces `page.waitForRequest` and `page.waitForResponse` helper methods.

Fixes #2362
2018-07-12 14:36:31 -07:00
Pavel Pomerantsev
12bc1e1a62 feat(coverage): add an option to collect coverage of anonymous scripts (#2796)
This patch adds `reportAnonymousScripts` option to the `coverage.startJSCoverage` method. With this option, anonymous scripts are reported as well.

Fixes #2777
2018-07-11 18:38:34 -07:00
Bogdan Ponomarenko
96c558d544 feat(elementhandle): introduce elementHandle.isIntersectingViewport() method. (#2673)
This patch introduces  `elementHandle.isIntersectingViewport()` method returns
true if element is visible in the viewport.

Fixes #2629.
2018-07-11 17:51:04 -07:00
Matthew Haughton
eb53a8fdd0 docs(api.md): Fix selector description for pages & frames (#2841) 2018-07-05 03:01:40 +03:00
Kaveet Laxmidas
acb89dddba docs(api.md): add note on page.pdf() color rendering behavior (#2821)
Adds guidance for producing accurate colors in PDF output. page.pdf() can produce unexpected document colors unless forced to render exact colors.

Fixes #2685
2018-06-29 09:57:03 -07:00
Andrey Lushnikov
6ca43cf761
docs(api.md): clarify docs about waitForNavigation (#2788) 2018-06-26 13:42:50 -07:00
Vse Mozhet Byt
811415bc8c docs(api.md): fix a typo (#2789) 2018-06-21 10:37:07 -07:00
Vse Mozhet Byt
3b20839ab5 docs(api.md): update note about page.goto() returned value (#2787)
Fixes: #2765
2018-06-21 10:20:39 -07:00
Mickael van der Beek
1064aa4476 feat(request): add new error reasons for request.abort() (#2771)
As the title indicated, adds two allowed error codes that are specified in the Chrome Developer Tools Protocol specifications but missing from the Puppeteer enum:

https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ErrorReason
2018-06-19 10:46:17 -07:00
Yaniv Efraim
38f112f395 feat(target): add support for target.page for 'backgroud_page' (#2600)
This patch teaches `target.page()` method to attach to extension background pages.

Fixes #2438
2018-06-14 13:58:51 -07:00
蒋璇
eca661096b docs(api.md): fix keyboard.press note about modifier keys (#2711) 2018-06-14 10:25:27 -07:00
Konstantin Simon Maria Möllers
1875cb4877 docs(api.md): fix return type docs of ElementHandle.$x (#2723) 2018-06-13 20:49:24 -07:00
Joel Einbinder
147f98d1f0
chore: bump version to v1.5.0-post (#2699) 2018-06-07 13:04:00 -07:00
Joel Einbinder
194d580026
chore: mark version v1.5.0 (#2698) 2018-06-07 12:19:25 -07:00
Joel Einbinder
2ff0adcad8 feat: worker convenience methods (#2677)
This patch:
- adds `worker.evaluate` and `worker.evaluateHandle` methods as a shortcut to their execution context equivalents.
- makes the error messages a bit nicer when interacting with a closed worker (as opposed to a closed page).
- moves the worker tests into their own spec file.
2018-06-06 20:16:17 -05:00
Darío Kondratiuk
e03802688d docs(api.md): Fix CDPSession code example (#2654) 2018-06-01 11:26:40 -07:00
Andrey Lushnikov
724fa512cf
feat(network): introduce Request.isNavigationRequest() method (#2633)
This patch introduces `Request.isNavigationRequest()` method.

Fixes #2627, #1132.
2018-05-31 17:38:30 -07:00
Jan Potoms
f6356683cd feat(targets): add target.opener() (#2641)
This adds a `.opener` property to a target so that its origin can be tracked.
For now returns `null` when there's no `openerId`.

Fixes #1830
2018-05-31 17:06:29 -07:00
Andrey Lushnikov
754df58d4e
docs(api.md): fix table-of-contents (#2636)
This patch drops the markdown-toc module and instead rolls out
our own simple markdown table-of-contents generator.

As a side effect, it fixes links to `page.$` and `page.$$`.
2018-05-31 14:21:43 -07:00
Yotam Laufer
469b910a2d feat(page): allow screenshot to return a base64 string (#2586)
Fixes #2566
2018-05-30 14:27:08 -07:00
Robert Shilston
5ff67dbdfe docs(api.md): Add the word "network" (#2624) 2018-05-29 15:24:26 -07:00
Yaniv Efraim
f6393d876e docs(api.md): mention that page.$$eval and frame.$$eval return arrays (#2595)
Docs about `page.$$eval` and `frame.$$eval` are not accurate and might be confusing. `document.querySelectorAll` returns `NodeList`, while `frame.$$eval` is actually doing `Array.from(querySelectorAll(selector))`, which actually returns an array. 

This makes things this possible:

`await page.$$eval('div', divs => divs.map...)` 

This patch fixes docs to mention that $$eval is actually performing:

`Array.from(querySelectorAll(selector))`

Which will let the user understand that the element he receives is an array, and not a NodeList.
2018-05-25 17:28:13 -07:00
Vasyl Pahut
1e07925e26 feat(elementhandle): add elementHandle.$$eval method (#2589)
Fixes #2401
2018-05-25 16:56:51 -07:00
Alex Veligura
32f4c173c8 feat(page): add page.isClosed method (#2588)
Fixes #2501.
2018-05-25 16:53:57 -07:00
Andrey Lushnikov
b522ecaa65
docs(api.md): update puppeteer overview (#2584)
Puppeteer tip-of-tree includes both workers and browser contexts.
2018-05-25 16:47:15 -07:00
Darío Kondratiuk
17bc6515de docs(api.md): goForward should say "can not go forward" (#2578) 2018-05-21 14:37:58 -07:00
Joel Einbinder
93fe2b57d6 feat(Page): introduce workers (#2560)
This adds `page.workers()`, and two events `workercreated` and `workerdestroyed`. It also forwards logs from a worker into the page `console` event.

Only dedicated workers are supported for now, ServiceWorkers will probably work differently because they aren't necessarily associated with a single page.

Fixes #2350.
2018-05-21 14:31:11 -07:00
Matej Plavevski
de82b87cfa docs(documentation) capitalize and end sentences (#2537) 2018-05-16 14:55:27 -07:00
Rafal Jarmolkovič
23d25a6e12 feat(Target): Pass through "background_page" types (#2439) (#2493) 2018-05-16 14:36:34 -07:00
Andrey Lushnikov
3b03ff65c7
feat(BrowserContext): introduce Browser Contexts. (#2523)
This patch introduces Browser Contexts and methods to manage them:
- `browser.createIncognitoBrowserContext()` - to create new incognito
  context
- `browser.browserContext()` - to get all existing contexts
- `browserContext.dispose()` - to dispose incognito context.

Fixes #85.
2018-05-10 13:26:08 -07:00
Andrey Lushnikov
d02440d1ea
chore: bump version to v1.4.0-post (#2521) 2018-05-09 07:18:25 -07:00
Andrey Lushnikov
808bf8e558
chore: mark version v1.4.0 (#2517) 2018-05-08 21:46:32 -07:00
Denny Ku(kuni)
88b996877f feat(ElementHandle): introduce elementHandle.$eval (#2407)
This patch introduces `elementHandle.$eval` method.

References #2401.
2018-05-08 18:17:59 -07:00
Andrey Lushnikov
a310d57d84
feat(Page): add option to run 'beforeunload' when closing the page (#2478)
Today, `page.close()` method doesn't run page's beforeunload listeners.
This way users can be sure that `page.close()` actually closes the
page.

This patch adds an optional `runBeforeUnload` option to the
`page.close()` method that would run beforeunload listeners. Note:
running beforeunload handlers might cancel page closing.

Fixes #2386.
2018-05-03 01:51:45 +03:00
Andrey Lushnikov
f797f8c307
docs(api.md): add explanation to page.waitForNavigation (#2354)
Fixes #1860
2018-04-26 13:32:40 -07:00
Paul Shibanov
9ae64f237c docs(troubleshooting): newest Chromium package supported on Alpine (#2453) 2018-04-26 08:37:10 -07:00
Andrey Lushnikov
6d19db4df1
chore: enhance preprocessor commands to automate releases. (#2446)
Last release v1.3.0 had an error in the documentation, claiming
it wasn't released.

This patch makes sure we have a little bit of automation in place
to save us from this in future.
2018-04-25 17:11:45 -07:00
Andrey Lushnikov
457592308f
docs(api.md): upload new diagram
This patch fixes a typo in the diagram.
2018-04-18 11:54:51 -07:00
Arne Martin Aurlien
082b11aa57 Add Page.browser() method (#2387)
Call page.browser() to get the browser instance associated with a
page.

Fixes #2275
2018-04-17 10:37:17 -07:00
Andrey Lushnikov
d244fced43
chore: bump version to v1.3.0-post (#2371) 2018-04-13 11:22:51 -07:00
Andrey Lushnikov
6f4a52bb2a
docs(api.md): fix docs/api.md (#2370)
v1.3.0 **is** released.
2018-04-13 10:58:43 -07:00
Andrey Lushnikov
bc8bd1904e
chore: mark version v1.3.0 (#2367) 2018-04-12 21:12:00 -07:00
Yaniv Efraim
98bb2615ad feat(Tracing): return a buffer from tracing.stop (#2360)
Fixes #2148
2018-04-12 08:26:50 -07:00
Andrey Lushnikov
2b95774af9
docs(api.md): mention header/footer template limitations in page.pdf. (#2341)
References #2167.
2018-04-09 22:30:20 -07:00
Matt Gaunt
a052b9e774 docs(troubleshooting): Adding Travis CI mention (#2334) 2018-04-09 14:34:46 -07:00
Andrey Lushnikov
717d4a7ada
docs(api): warn about slow screenshots on OS X (#2326) 2018-04-07 18:01:31 -07:00
Andrey Lushnikov
35e34db198
feat(Page): introduce Page.setBypassCSP (#2324)
This patch introduces `page.setBypassCSP` method that allows clients
to ignore Content-Security-Policy for a given page.

Fixes #1229.
2018-04-06 16:35:50 -07:00
Ethan Lee
1fdd33886f docs(api.md): fix minor spelling errors (#2314) 2018-04-05 13:08:28 -07:00
JoelEinbinder
94c32e4bc8 feat(Launcher): introduce pipe option (#2288)
This patch introduces a new `pipe` option to the launcher to connect over a pipe.

In certain environments, exposing web socket for remote debugging is a security risk.
Pipe connection eliminates this risk.
2018-04-03 15:05:27 -07:00
Andrey Rublev
8b0fd0ae4a feat(install): support npm config for chromium revision (#2290)
This patch:
- adds `npm_config_puppeteer_chromium_revision` support
- clarifies api documentation about variables from npm config
2018-03-30 10:49:48 -07:00
Andrey Lushnikov
c4da19bd23
test(ElementHandle.boxModel): remake test to make it more readable (#2287)
This patch:
- re-makes test for EH.boxModel to make it more readable
- slightly changes wording in the `docs/api.md`.

References #1357.
2018-03-29 17:25:52 -07:00
Yaniv Efraim
41d5838297 feat(ElementHandle): add ElementHandle.boxModel method (#2256)
This patch introduces ElementHandle.boxModel to get element's
box model.

Fixes #1357
2018-03-29 13:52:28 -07:00
Glenn Vandamme
506103556b feat(install): introduce PUPPETEER_CHROMIUM_REVISION (#2246)
This patch introduces PUPPETEER_CHROMIUM_REVISION environment variable
to specify chromium revision to be downloaded during install step.
2018-03-29 10:46:00 -07:00
Yaniv Efraim
abb05e069d feat(page): add an option to disable timeout for waitForFunction (#2252)
This patch adds support for `timeout: 0` to disable timeout for the following functions:
- `page.waitForFunction`
- `page.waitForXPath`
- `page.waitForSelector`
and their `frame` counterparts.

Fixes #2200
2018-03-28 16:34:37 -07:00
Vse Mozhet Byt
9af02a0d86 docs(api.md): fix some links (#2253) 2018-03-28 13:18:59 -07:00
JoelEinbinder
d46e157f19 feat(Page): page 'close' event (#2232)
This patch adds 'page.close' event.

References #952.
2018-03-28 13:11:51 -07:00
Andrey Lushnikov
311f307153
chore: bump version to v1.2.0-post (#2205) 2018-03-16 11:01:49 -07:00
Andrey Lushnikov
f2fae9f35a
chore: mark version v1.2.0 (#2204) 2018-03-15 19:18:46 -07:00
Andrey Lushnikov
ec3025fe84
feat(Network): implement request.redirectChain() api (#2194)
The request.redirectChain() returns all the requests issued to fetch
the resource.

Fixes #1816.
2018-03-15 17:17:38 -07:00
Yaniv Efraim
625c7ebdda feat(FrameManager): add type=module to addScriptTag (#2090)
This patch adds a new "type" option to the `addScriptTag` method that
allows adding "module" tags to the page.

Fixes #2078
2018-03-14 13:07:48 -07:00
Joel Griffith
552be1ae87 docs(README): Add's page.removeListener to Page class examples (#2122)
This patch adds `page.removeListener` to Page class examples
2018-03-13 09:25:25 -07:00
jviala-ekino
5af70e8ce3 docs(api.md): fix typo (#2177) 2018-03-13 07:42:37 -07:00
Benjamin E. Coe
edc510c152 docs: add documentation referencing puppeteer-to-istanbul (#2135)
Fixes #1768.
2018-03-07 08:49:01 +03:00
Olivier Tassinari
c857aef589 docs(api.md): fix snippet to await page.setViewport() (#2113) 2018-03-02 00:06:22 +03:00
Glenn Vandamme
8578283e11 docs(api.md): Fix evaluateOnNewDocument sample syntax error (#2063) 2018-02-26 11:41:50 -08:00
Andrey Lushnikov
2a84f9f343
docs(api.md): add link to the v1.1.1 (#2096) 2018-02-23 23:02:28 -08:00
Andrey Lushnikov
3c6ed67c2e
chore: bump v1.1.1-post (#2095)
This patch bumps tip-of-tree version to v1.1.1-post so that puppeteer@next doesn't break once we release v1.1.1 with a fix for `dumpio`
2018-02-23 21:44:45 -08:00
Andrey Lushnikov
223b59254c
feat(ElementHandle): implement ElementHandle.contentFrame() (#2094)
This patch adds ElementHandle.contentFrame() method that allows
to get a reference to the Frame owned by the iframe.

Fixes #433.
2018-02-23 21:22:53 -08:00
Lisa Gagarina
090590a950 docs(api.md): Add more explanation for page.evaluateHandle() (#1867)
Fixes #2062
2018-02-21 17:11:24 -08:00
Andrey Lushnikov
85081805ea
chore: bump version to 1.1.0-post (#2043) 2018-02-16 11:24:21 -08:00
Andrey Lushnikov
fecbbac631
chore: mark version v1.1.0 (#2041) 2018-02-16 09:16:40 -08:00
Andrey Lushnikov
fc94f98247
feat(Targets): expose browser target (#2036)
This patch exposes "browser" target to the list of targets.
2018-02-15 13:24:24 -08:00
Vse Mozhet Byt
3656cc227f docs(api.md): fix nits in securityDetails description (#2023) 2018-02-14 16:37:40 -08:00
Andrey Lushnikov
43c0feb2f2
fix(Network): fulfill security details for response redirects (#2025)
This patch:
- starts fulfilling security details for redirect responses
- changes `response.securityDetails()` to return null if the response
  is served over non-secure connection
2018-02-14 16:08:20 -08:00
Andrey Lushnikov
ae22ef30b3
feat(ExecutionContext): introduce ExecutionContext.frame() (#1972)
This patch introduces ExecutionContext.frame() that returns Frame
associated with this Execution Context.

This allows to associate console messages with the originating frame,
if any.
2018-02-13 14:02:44 -08:00
Kiko Beats
885c93a927 docs(troubleshooting): Add AWS Lambda solution (#2003) 2018-02-13 13:47:06 -08:00
Tomáš Trnka
856c431914 feat(Network): introduce response.securityDetails() method (#1880)
This patch:
- introduces `SecurityDetails` class that exposes a set of fields that describe properties of secure connection
- introduces method `response.securityDetails()` that returns an instance of `SecurityDetails` object.
2018-02-13 11:26:18 -08:00
Drew Diamantoukos
b275e66594 chore: Spelling and Markdown Consistency (#1998)
- Adding missing language tags to markdown code blocks.
- Fixed various spelling mistakes my IDE complained to me about.
2018-02-08 22:59:46 -05:00
Andrew Collins
ac1b9a0eb0 feat(Page): add setCacheEnabled(enabled) to Page object (#1609)
This change adds in the `Page.setCacheEnabled(enabled)` method to toggle ignoring cache for each request.

Fixes #1556.
2018-02-08 00:58:48 -05:00
JoelEinbinder
cde6d6c4d0 docs: add the word the everywhere (#1988) 2018-02-07 17:20:28 -05:00
Andrey Lushnikov
a363a733b7
feat: Introduce BrowserFetcher class (#1983)
This patch introduces `BrowserFetcher` class that manages
downloaded versions of products.

This patch:
- shapes Downloader API to be minimal yet usable for our needs. This
  includes removing such methods as `Downloader.supportedPlatforms` and
  `Downloader.defaultRevision`.
- makes most of the fs-related methods in Downloader async. The only
  exception is the `Downloader.revisionInfo`: it has stay sync due to the
  `pptr.executablePath()` method being sync.
- updates `install.js` and `utils/check_availability.js` to use new API
- finally, renames `Downloader` into `BrowserFetcher`

Fixes #1748.
2018-02-07 12:31:53 -05:00
Andrey Lushnikov
ecc3adc279
feat(Response): add Response.fromCache / Response.fromServiceWorker (#1971)
This patch:
- introduces `test/assets/cached` folder and teaches server to cache
  all the assets from the folder
- introduces `test/assets/serviceworkers` folder that stores all the
  service workers and makes them register with unique URL prefix
- introduces `Response.fromCache()` and `Response.fromServiceWorker()`
  methods

Fixes #1551.
2018-02-05 17:59:07 -05:00
Alix Axel
660b65780f feat(Frame): add click(), focus(), hover(), tap() and type() (#1970)
This patch adds frame shortcuts to drive input:
- `Frame.click()`
- `Frame.focus()`
- `Frame.hover()`
- `Frame.tap()`
- `Frame.type()`
2018-02-05 17:58:03 -05:00
Michael Stillwell
48218fae8a docs(api.md): page.error event dispatchers error 2018-02-05 17:45:35 -05:00
Yaniv Efraim
2f1157b044 fix(Docs): fix Console example (#1961)
Fixes #1874
2018-02-05 17:44:22 -05:00
Eric Bidelman
1716a748aa docs(troubleshooting): add aws lambda resources (#1926) 2018-01-31 15:31:31 -08:00
Thibault Lenclos
4886d038d5 docs: fix typo in troubleshooting.md (#1909) 2018-01-26 23:00:18 -08:00
Andrey Lushnikov
ddc59b2472
docs(api.md): fix exposeFunction example (#1900) 2018-01-25 14:50:42 -08:00
Yaniv Efraim
189deb84c0 feat(Frame): add Frame.evaluateHandle (#1885)
This patch adds Frame.evaluateHandle method. The method is a shortcut
for frame.executionContext().evaluateHandle.

Fixes #1051
2018-01-24 21:16:01 -08:00
Bamboo
a39d96eae9 docs(api.md): fix sample code in API doc, request.url -> request.url() (#1889) 2018-01-24 21:09:37 -08:00
JoelEinbinder
f2b6016354 chore: switch to npm from yarn (#1878)
This patch:
- migrates CI to use NPM
- drops lockfiles (`yarn.lock`). Lockfiles are ignored by package
  managers when the package is installed as a dependency, so this makes CI closer to the 
  installation our clients run.
2018-01-22 17:11:10 -08:00