Andrey Lushnikov
2d82e0891a
chore: bump dependencies ( #2559 )
...
This patch bumps dependencies so that `npm audit` doesn't yell
at us.
Drive-by: fix browsercontext test to run nicely in parallel mode.
2018-05-16 15:35:51 -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
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
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
yujiosaka
e9dc3ae74f
test(server): Fix mismatch between args and annotations ( #2426 )
2018-04-23 10:01:16 -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
Andrey Lushnikov
6eb6ce0ec9
test: make sure page.goto works when subframes return 204. ( #2361 )
...
References #1879 .
2018-04-16 16:53:10 -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
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
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
Andrey Lushnikov
45d97e572a
feat(Chromium): roll Chromium to r549031 ( #2327 )
...
This roll includes:
- https://crrev.com/549003 - DevTools: make pptr tests pass with DCHECKs.
The patch fixes a browser crash that happens during browser close.
As a result, cookies were not saved properly (and thus the flaky test we
had).
Fixes #1537 .
2018-04-06 21:53:25 -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
Andrey Lushnikov
4663b43a62
test: add test on Page.evaluateOnNewDocument with CSP ( #2319 )
...
This patch adds a test that Page.evaluateOnNewDocument works
with CSP: there's been some concerns on the bugtracker before.
References #1229
2018-04-05 23:40:14 -07:00
Andrey Lushnikov
98093f0763
feat(Chromium): roll Chromium to r548153 ( #2312 )
...
This roll includes:
- https://crrev.com/547982 - v8 roll that includes [fixed
Runtime.callFunctionOn](1637818671
) method
The upstream fix makes it possible to run frame.waitFor* functions on
pages with strict CSP.
References #1229 .
2018-04-04 13:56:24 -07:00
Andrey Lushnikov
f925158733
test: add test for page.waitForFunction with script CSP ( #2305 )
...
This patch adds a test to fixate page.waitForFunction behavior
for pages with CSP.
References #1229 .
2018-04-03 15:21:08 -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
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
Yaniv Efraim
ebe17371b0
chore: break page.spec.js to smaller files ( #2257 )
...
Break some large chunks into smaller files. This change will remove ~600 lines from `page.spec.js`
2018-03-29 10:42:23 -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
Yaniv Efraim
47481967c5
test: Break 'page.spec.js' to smaller files ( #2218 )
...
This patch breaks huge `page.spec.js` into a bunch of smaller files.
2018-03-19 20:00:12 -07:00
Yaniv Efraim
38c6873fbb
test: break test.js into smaller files ( #2193 )
...
This patch breaks test.js into smaller files:
- `page.spec.js`
- `puppeteer.spec.js`
Fixes #2082
2018-03-16 15:33:31 -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
Andrey Lushnikov
c4b1ac99b0
test: another attempt to fix sw test #2201
2018-03-15 16:58:02 -07:00
Andrey Lushnikov
150e5a9bbf
test: eliminate racy pattern in multiple tests ( #2202 )
...
This patch eliminates a race pattern we've been using in a bunch
of tests.
2018-03-15 16:53:34 -07:00
JoelEinbinder
309cafb876
feat(Chromium): roll chromium to r543305 ( #2196 )
...
This roll contains a [fix](https://chromium-review.googlesource.com/c/chromium/src/+/963302 ) for boundingBox not forcing a layout, and the patch contains a corresponding test.
2018-03-15 16:37:10 -07:00
Andrey Lushnikov
4b7fbf8ee0
test: fix serviceWorker test flakiness ( #2195 )
...
This patch starts waiting on serviceWorker registration.
2018-03-14 17:55:12 -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
0defecf197
fix(test): add missing test for making sure chrome is closed ( #2109 )
2018-03-07 09:01:43 +03:00