Commit Graph

922 Commits

Author SHA1 Message Date
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
376018854b
feat(Chromium): roll Chromium to r554716 (#2477)
This roll includes:
- https://crrev.com/553657 - headless: create incognito profiles with
Target.createBrowserContext

References #85, #2473
2018-05-01 03:39:16 +03:00
Yaniv Efraim
afee0104be docs(README): add a debugging section (#2467) 2018-04-30 21:01:35 +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
Yaniv Efraim
a2a9100248 docs(examples): add a link for jest-puppeteer (#2466) 2018-04-27 23:02:37 -04:00
Yaniv Efraim
eb1826bc49 feat(DeviceDescriptors): add pixel2/pixel2 xl (#2464)
fixes #2448
2018-04-27 14:45:02 -07:00
Andrey Lushnikov
f797f8c307
docs(api.md): add explanation to page.waitForNavigation (#2354)
Fixes #1860
2018-04-26 13:32:40 -07:00
Andrey Lushnikov
eded38c82a
test: verify file url interception works as expected (#2451)
This was fixed upstream: https://crrev.com/550319
Rolled into pptr: https://github.com/GoogleChrome/puppeteer/pull/2393

Fixes #1506.
2018-04-26 13:32:23 -07:00
Andrey Lushnikov
8a62b10fd0
chore: testrunner's ".not" should print appropriate message (#2459)
When failing, the ".not" matchers should print their name
with ".not" prefix.
2018-04-26 11:13:22 -07:00
Paul Shibanov
9ae64f237c docs(troubleshooting): newest Chromium package supported on Alpine (#2453) 2018-04-26 08:37:10 -07:00
Andrey Lushnikov
b96815aa72
test: verify Page.goto fails when server returns 204 (#2452)
Fixed upstream: https://crrev.com/551261
Rolled into pptr: https://github.com/GoogleChrome/puppeteer/pull/2393

Fixes #1879.
2018-04-25 20:20:11 -07:00
Andrey Lushnikov
d9bb7ee8a0
chore: add a bunch of non-needed files to .npmignore (#2450)
There's no need to publish these files. This saves ~22kb
in published size.
2018-04-25 20:19:40 -07:00
Andrey Lushnikov
0820d48f80
chore: link to the latest-released API from the README.md (#2449)
This patch adds a preprocessor command to link to the latest-released
API from the README.md.

Fixes #1923.
2018-04-25 18:18:08 -07:00
Andrey Lushnikov
13a41495aa
chore(doclint): remove SourceFactory (#2447)
SourceFactory was meant to cache Sources so that they could be used
in different preprocessor tasks.

This turned out to be over-engineering. This patch kills the layer.
2018-04-25 18:07:20 -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
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
84d7b4963e
feat(Chromium): roll Chromium to r553380 (#2442)
This roll includes:
- https://crrev.com/552071 - DevTools: introduce Page.close() protocol method
- https://crrev.com/553193 - Introduce BrowserContext::UniqueId
- https://crrev.com/553268 - DevTools(Protocol): expose BrowserContextId in TargetInfo
- https://crrev.com/553323 - DevTools: implement Target.createBrowserContext for non-headless mode

References #85, #2386.
2018-04-25 00:43:01 -07:00
yujiosaka
e9dc3ae74f test(server): Fix mismatch between args and annotations (#2426) 2018-04-23 10:01:16 -07:00
Yaniv Efraim
6ac7f75611 health: fix tests to work under Node 9 (#2419) 2018-04-19 14:16:02 -07:00
Andrey Lushnikov
6bc9877571 chore(CI): disable email notifications (#2412) 2018-04-19 13:27:37 -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
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
Andrey Lushnikov
b40e381f65
feat(Chromium): roll Chromium to r551292 (#2393)
This roll includes:
- https://crrev.com/551261 - DevTools: page.navigate should fail when server returned HTTP 204
- https://crrev.com/550319 - DevTools: fix resource mimetype for request interception of file:// urls

References #1879
References #1506
2018-04-17 11:48:01 -07:00
Andrey Lushnikov
62fa3bc81e
docs(README): add FAQ entry on where to ask questions (#2392) 2018-04-17 10:57:21 -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
6eb6ce0ec9
test: make sure page.goto works when subframes return 204. (#2361)
References #1879.
2018-04-16 16:53:10 -07:00
Eric Bidelman
9a22f64257 docs(readme) : full md link for d.g.c./web docs (#2379) 2018-04-16 11:31:19 -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
04991ad025
test: consolidate network tests in one file (#2355) 2018-04-11 15:25:42 -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
0b64242f85
test: add missing rm function to test.js (#2349)
This was missing while we were splitting the tests.

Fixes #2236.
2018-04-10 18:05:10 -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
beea6f9c82
chore(testrunner): fix typo in readme 2018-04-10 12:25:14 -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
2b95774af9
docs(api.md): mention header/footer template limitations in page.pdf. (#2341)
References #2167.
2018-04-09 22:30: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
5d106f79d8
test: flatten tests (#2337)
Today, we have tests split into multiple files, with files pulling
tests from some other files.

This patch starts explicitly gathering all tests from the same
`test.js` file.

Drive-By: move one test from `browser.spec.js` into `puppeteer.spec.js`
since it starts browser itself.
2018-04-09 16:38:00 -07:00
Andrey Lushnikov
06d61919ef
test: refactor utils.waitForEvents into utils.waitEvent (#2336)
This simplifies waiting for events in tests.
2018-04-09 15:46:05 -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
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
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