Commit Graph

527 Commits

Author SHA1 Message Date
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
Andrey Lushnikov
3ebbf125ff
fix(coverage): report anonymous scripts with debugger:// urls (#2875)
Chrome DevTools shows anonymous scripts with yellow background and names
them with `debugger://VM<scriptId>` prefix.

This patch starts reporting the same debugger:// urls for anonymous
scripts in puppeteer's JS coverage. This might simplify debugging, e.g.
using `debugger;` statement to reveal the script in DevTools and later
matching it against the one in the coverage.
2018-07-11 21:05:16 -07:00
Andrey Lushnikov
254bc80811
chore: cleanup ElementHandle.isIntersectingViewport (#2874)
This patch:
- simplifies test reusing the `offscreenbuttons.html` asset
- aligns IntersectionObserver usage with the one we have for
  `ElementHandle._scrollIntoViewIfNeeded`.
2018-07-11 21:04:36 -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
Yaniv Efraim
cfc0571c1a feat: better timeout stack trace (#2843)
fixes #2653
2018-07-05 02:39:09 +03:00
Joel Einbinder
22fa00a7b3 fix: wait for the chromeProcess to exit, not close (#2838) 2018-07-05 02:36:49 +03:00
Andrey Lushnikov
5955affab0
fix(page.click): teach puppeteer click wrapped links (#2822)
This patch teaches Puppeteer to click elements that are
part of inline layout and that wrap on multiple lines.

Fixes #2798.
2018-06-29 12:03:02 -07:00
Andrey Lushnikov
871b204fd1
refactor: simplify EmulationManager (#2816)
EmualationManager used to be injecting touch hooks to properly
support touch emulation.

However, these are no longer necessary, since https://crbug.com/133915
is long fixed.
2018-06-28 18:48:44 -07:00
Andrey Lushnikov
f55d005cbe
fix(page): teach page.click() to click partially offscreen buttons (#2806)
Originally, we use `Element.scrollIntoViewIfNeeded` to make sure
button is on screen before trying to click it.

However, `Element.scrollIntoViewIfNeeded` doesn't work in certain
scenarios, e.g. when element is partially visible and horizontal
scrolling is required to make it fully visible.

This patch polyfills `element.scrollIntoViewIfNeeded` using
IntersectionObserver and `Element.scrollIntoView`.

Fixes #2804.
2018-06-26 18:00:55 -07:00
Andrey Lushnikov
6ca43cf761
docs(api.md): clarify docs about waitForNavigation (#2788) 2018-06-26 13:42:50 -07:00
Yaniv Efraim
aae73f5fd7 feat(worker): implement pageerror event from a worker (#2795)
Fixes #2761
2018-06-25 15:10:36 -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
Joel Einbinder
f197d2e208 fix: don't pass a reference to the page into frames (#2766) 2018-06-19 00:33:45 -07:00
Aleksey
b20cde67c6 fix(page): migrate exposeFunction from console.debug to Runtime.installBinding #2631
New way is faster and cleaner.
2018-06-18 13:41:03 -07:00
Joel Einbinder
73f9c48081 feat: nicer protocol error messages (#2742)
This patch:
- stops appending `undefined` to our protocol messages unnecessarily.
- rewrites `Cannot find execution context id` to `Execution context was destroyed, most likely because of a navigation.` when it occurs from a Puppeteer ExecutionContext. The error message is left alone if it occurs via a CDPSession.
2018-06-14 15:27:59 -07:00
Yaniv Efraim
9a650c818d feat(element-handle): remove throw in case of empty elementHandle (#2740)
Fixes #2708
2018-06-14 14:28:52 -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
Andrey Lushnikov
ddfdaf97c5
fix(page): fix race condition in WaitTask (#2739)
This patch eliminates a common race condition with WaitTask, that
happens when predicate function gets resolved right before the execution
context gets destroyed.
This situation results in a "Cannot find context with specified id undefined"
exception.

Credits go to @jakub300 for his wonderful [investigation](https://github.com/GoogleChrome/puppeteer/issues/1325#issuecomment-395472092).

Fixes #1325.
2018-06-14 11:39:51 -07:00
Joel Einbinder
ed7a26cc95 feat(tracing): enable high resolution JavaScript sampling (#2702)
I've been told that this will make our JavaScript tracing 💯x more accurate, at minimal performance loss. Let's turn it on for everyone always.

Fixes #1300.
2018-06-14 10:33:05 -07:00
Georgii Dolzhykov
9498b1057b fix(helpers): support thrown strings and numbers in getExceptionMessage (#2715)
Of course, strings aren't proper errors, but scripts sometimes do that, and Puppeteer loses such error messages.
2018-06-14 10:23:13 -07:00
Joel Einbinder
d481fd5147 fix(types): type FrameManager in Page.js (#2718) 2018-06-13 12:47:29 -07:00
Joel Einbinder
75ba86f41a
fix: emit all arguments from worker console logs (#2697)
Log.entryAdded doesn't report all the arguments from console logs. This PR switches to use Runtime.consoleAPICalled.

fixes #2640
2018-06-07 11:21:35 -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
Joel Einbinder
a058468948 feat: roll Chromium to r564778 (#2681)
This roll includes:
- https://chromium-review.googlesource.com/c/v8/v8/+/1086372 - [inspector] postpone API interrupts during creation of injected script

This fixes worker flakiness.

Fixes #2632
2018-06-06 09:48:56 -05:00
Andrey Lushnikov
d8023726c5
fix: disable OOPIF by default (#2661)
This patch disables OOPIF by default.

**NOTE**: this is a temporary bandaid for the time we're crafting
the full-fledged support for site isolation over DevTools protocol.

References #2548.
2018-06-01 15:20:37 -07:00
Andrey Lushnikov
9955a1e673
fix(browser): ensure first page is created when browser is launched (#2658)
It's impossible to launch chromium without initial page.
This patch makes sure that `puppeteer.launch()` always returns a browser
with at least one page user can connect to.
2018-06-01 13:57:50 -07:00
Andrey Lushnikov
0f8c7e76c2
feat(launcher): disable crash reporting by default (#2652)
This patch disables crash reporting since it's not needed for
automation purposes.

It also deals some troubles for us since crashpad is a separate
process on Windows which has a larger lifetime than chromium.
This, in turn, prevents us from cleaning up profile directory.
2018-05-31 18:17:50 -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
0b94fa70eb
chore: stop using console.assert everywhere (#2646)
Since Node 10, `console.assert` no longer throws an AssertionError.
(This is generally good since it aligns Node.js with Browsers.)

This patch migrates all usages of `console.assert` in our codebase.
- All the `lib/` and testing code is migrated onto a handmade `assert`
function. This is to make Puppeteer transpilation / bundling easier.
- All the tooling is switched to use Node's `assert` module.

Fixes #2547.
2018-05-31 16:53:51 -07:00
Andrey Lushnikov
35e3f12afa
fix(workers): swallow errors when auto-detaching from page subtargets (#2649)
Page subtargets (e.g. out-of-process iframes and others) sometimes
die before we send the 'detach' command.

This is harmless to us, but we shouldn't have an unhandled promise
rejection in this case.

Example crash: https://cirrus-ci.com/task/4884032470908928
2018-05-31 16:53:04 -07:00
Joel Einbinder
1c2adf61e9 fix(workers): workaround worker execution context flakiness (#2596)
Some of the worker tests were failing on the bots. After investigating, I found one race in the test, and one race upstream in Chromium which I filed upstream as https://crbug.com/846099. But I added a small hack here as a temporary workaround.

References #2632
2018-05-30 18:08:27 -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
Yaniv Efraim
7d64d40d66 chore(frame): minor refactor in FrameManager (#2597) 2018-05-25 17:29:11 -07:00
Yaniv Efraim
b8df8bdf4a feat(launcher): launch browser with 'about:blank' by default (#2594)
fixes #2402
2018-05-25 17:26:40 -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
debfe7e0b1
fix(page): respect timeout 0 in page.waitForFunction (#2563)
The in-page task should not set timeout when timeout is 0.

Fixes #2540.
2018-05-25 16:45:04 -07:00
Paul Irish
6a0627a411 fix(page): Don't report clientside error with a node stack attached (#2572)
This patch stops reporting node.js stacks as part of `pageerror` event.
2018-05-25 16:44:25 -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
Andrey Lushnikov
51645932b7
refactor: do not pass user options to browser constructor (#2562)
This patch starts explicitly passing allowed options to the `Browser`
class. This, for example, makes it impossible to pass `appMode` as
an option to the `pptr.connect`.
2018-05-16 18:09:59 -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
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
Joel Einbinder
1d225cfa17 fix: allow user gesture restricted code to be run in page.evaluate (#2503)
Fixes #2502
2018-05-04 21:45:16 +03: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
Yaniv Efraim
e236887bbb feat(Page): report 'Log' domain entries as 'console' events (#2400)
Fixes #1939
2018-04-28 00:40:09 -04:00
Andrey Lushnikov
58c46680f3
fix(Page): fix page.goto to return Response when page pushes new state (#2468)
]Fixes #2411.
2018-04-28 00:15:40 -04:00
Ran Yitzhaki
8fce3195d6 fix(Launcher): exit the process after killing chrome on SIGINT (#2428)
This is a fix for this issue https://github.com/facebook/jest/issues/5748

In the issue, `puppeteer.launch` method is called from jest `globalSetup` script which [is running on the same process as jest](6a77ee37ec/packages/jest-cli/src/run_jest.js (L242)).

Puppeteer catches `SIGINT` in order to kill chrome, but it also replaces the default behaviour of `SIGINT`, [which is to exit with status code 130](https://nodejs.org/dist/latest-v9.x/docs/api/all.html#process_signal_events). In jest's case, the process does not exit, which keeps the process hanging in a weird way.

This PR makes sure that the process exits after killing chrome.
2018-04-25 15:29:14 -07:00
Andrey Lushnikov
37cc9f567d
chore(deps): bump dependencies (#2397)
Fixes #2394
2018-04-17 14:51:03 -07:00
Yaniv Efraim
ed4be10ae3 Chore: replace depracated 'new Buffer' with 'Buffer.from' (#2396)
See [Buffer](https://nodejs.org/docs/latest-v9.x/api/buffer.html) for more details
2018-04-17 13:49:01 -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
Yaniv Efraim
98bb2615ad feat(Tracing): return a buffer from tracing.stop (#2360)
Fixes #2148
2018-04-12 08:26:50 -07:00
Andrey Lushnikov
f8cba455ba
fix(Network): explicitly throw on content request for redirect response (#2352)
DevTools protocol doesn't support returning body of redirect responses.
We should explicitly throw in this case.

References #1896.
2018-04-10 20:22:18 -07:00
Andrey Lushnikov
18f2ecdffd
fix(Launcher): launch chrome with --disable-dev-shm-usage by default (#2351)
Fixes #1834.
2018-04-10 20:05:27 -07:00
Andrey Lushnikov
a7d59b587e
fix(Page): Page.waitForNavigation should correctly handle mixed content (#2339)
This patch teaches Page.waitForNavigation to correctly handle navigation
to pages that have frames that might never load.

These frames include:
- frames which main resource loading was aborted due to mixed-content
  error
- frames that artificially called `window.stop()` to interrupt loading
  themselves

Fixes #1936.
2018-04-10 15:59:41 -07:00
Andrey Lushnikov
5089d2ec2e
fix(BrowserFetcher): ensure executable has proper permissions (#2342)
This patch ensures Chromium executable has permissions to be executed
by non-owner users.

Fixes #2283.
2018-04-10 14:11:59 -07:00
Andrey Lushnikov
fafd156d7b
fix(Page): support anchor navigation (#2338)
This patch fixes puppeteer navigation primitives to work with
same-document navigation.

Same-document navigation happens when document's URL is changed,
but document instance is not re-created. Some common scenarios
for same-document navigation are:
- History API
- anchor navigation

With this patch:
- pptr starts dispatching `framenavigated` event when frame's URL gets
changed due to same-document navigation
- `page.waitForNavigation` now works with same-document navigation
- `page.goBack()` and `page.goForward()` are handled correctly.

Fixes #257.
2018-04-09 23:38:20 -07:00
Andrey Lushnikov
c5902de5d8
fix(Page): fix Page.evaluate with Symbols in arrays (#2340)
Fixes #2295.
2018-04-09 22:02:35 -07:00
Andrey Lushnikov
c86c12e605
fix(Launcher): consume protocol errors when initiating browser.close() (#2332)
Handle errors properly while sending Browser.close()

Fixes #1429.
2018-04-09 14:49:02 -07:00
Andrey Lushnikov
57fa690724
fix(Connection): do not assert that methods always have callbacks. (#2330)
In certain cases, all callbacks could be rejected before we get a
response from transport. This is easily reproducible with `slowMo`
option.

Fixes #563.
2018-04-07 17:59:22 -07:00
JoelEinbinder
294f33b75c chore(types): type check the rest of the protocol (#2328)
This adds events and commands into generated `protocol.d.ts`.
2018-04-07 17:58:52 -07:00
JoelEinbinder
8c54f41552 chore(types): generate a d.ts file for protocol types (#2325)
This uses the `/json/protocol` endpoint to generate type definitions for the protocol.

Currently it is lacking protocol events and commands, but I will add those later.
2018-04-06 18:20:48 -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
Andrey Lushnikov
846c0800b1
feat(Page): Page.addScriptTag should throw when blocked by CSP (#2320)
This patch teaches Page.addScriptTag and Page.addStyleTag to throw
an error when blocked by CSP.

References #1229.
2018-04-06 13:17:55 -07:00
JoelEinbinder
2370618819 chore(types): upgrade to TypeScript 2.8.1 (#2304)
This converts `externs.d.ts` to export a global namespace instead of a UMD global.

See: https://github.com/Microsoft/TypeScript/issues/22969

Fixes #2279.
2018-04-04 14:06:21 -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
Yaniv Efraim
dde45faaeb feat(FrameManage): improve errors from frame.waitFor* methods (#2292)
This patch adds title for WaitTask, using it later in generating error messages and
making exceptions much more traceable.

Fixes #2037
2018-03-30 12:37:56 -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
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
JoelEinbinder
d46e157f19 feat(Page): page 'close' event (#2232)
This patch adds 'page.close' event.

References #952.
2018-03-28 13:11:51 -07:00
Georgii Dolzhykov
4e1f2e2eb2 fix(Launcher): killing a process can throw (#2102)
In case chrome process was terminated manually, killing the process
might throw 'no process with such pid' exception.
2018-03-15 17:40:24 -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
Pig Fang
7d387d8d75 chore(FrameManager): remove extra space (#2187) 2018-03-15 14:04:22 -07:00
Andrey Lushnikov
c082a82547
fix(Launcher): do not detach child process on windows (#2081)
Fixes #2053.
2018-03-15 11:50:16 -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
Juan Sebastian velez Posada
52d3bc05de feat(Page): introduce url at error message at page.goto (#2174)
Now the error message will come with the url where the error was
generated.

Fixes #2165.
2018-03-12 15:38:05 -07:00
JoelEinbinder
826fe42c48 fix(Network): response.ok should be true for file:// urls (#2152) 2018-03-12 11:34:33 -07:00
Meir017
cad71d9bd9 chore: removed duplicated jsdoc annotation in NetworkManager.js (#2132) 2018-03-07 12:35:15 +03:00
JoelEinbinder
ffe5b63dba chore: refactor Browser.js into seperate files (#2097)
This patch splits Browser.js into multiple separate files.
2018-02-26 12:10:06 -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
Frankie Bagnardi
56a475f86b feat: elHandle:screenshot captures full element (#1787)
feat: make ElementHandle.screenshot work with large elements

This patch increases the viewport size if the element is bigger than
viewport.

Fixes #1779
2018-02-23 14:13:08 -08:00
Andrey Lushnikov
fc2a10440f
fix(evaluate): throw error when page reloads during page.evaluate. (#2073)
Fixes #2021.
2018-02-22 19:10:17 -08:00
Yaniv Efraim
66887743ea fix(Launcher): fix dumpio bug (#2071)
This patch fixes `dumpio` launcher option.

Fixes #2046
2018-02-22 19:06:13 -08:00
Andrey Lushnikov
80078d9526
fix(Connection): swallow all the ws errors after connection's closed (#2077)
Since ws is closing asynchronously and can yield errors while closing,
we should keep swallowing ws errors after the `ws.close()` method
is called.
2018-02-22 16:23:20 -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
JoelEinbinder
d75fdb7098 fix(Browser): wait for the page to close in the browser in page.close (#2064)
Fixes #1491
2018-02-21 16:08:29 -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
Andrey Lushnikov
e8a085ccfb
feat(appMode): support pipes for appMode (#2032)
This patch starts using pipes as a transport to
the browser instance instead of websocket.
2018-02-14 17:51:29 -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
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
travch
f3ba436239 Fix: Remove key codes from _pressedKeys Set after keyboard.up() is called (#1928)
keyboard.down() and keyboard.up() both use the _pressedKeys Set, however keyboard.down() adds and searches for the key code, whereas keyboard.up() attempts to delete based on the key rather than the key code.

Fixes #1901
2018-02-12 17:25:38 -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
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
Alix Axel
bc6902623a fix: allow timeouts of be 0 (#1964)
This patch fixes timeouts for `puppeteer.launch` and `page.waitForFunction`
to be `0`.

Fixes #1960 .
2018-02-05 17:42:54 -05:00