Commit Graph

674 Commits

Author SHA1 Message Date
Andrey Lushnikov
65b7e8ecc0
docs(api.md): add notes on race condition in page.setViewport (#4319)
Fixes #2755.
2019-06-10 18:07:24 -07:00
Michael Oryl
4bcdfc97dd docs(api.md): clarify frame/page.goto()'s handling of HTTP error statuses (#4553)
The documentation for frame.goto() and page.goto() were updated to make
it clear that the method will not throw an error if the HTTP requests
results in any valid HTTP status code being returned by the remote
server.
2019-06-09 18:32:06 -07:00
Andrey Lushnikov
f52738ec1e
docs(api.md): clarify on HTTP error responses (#4507) 2019-06-03 14:54:30 -07:00
Andrey Lushnikov
084cf02119
chore: bump version to v1.17.0-post (#4468) 2019-05-24 03:24:53 +03:00
Andrey Lushnikov
1840ef01cc
chore: mark version v1.17.0 (#4467) 2019-05-24 03:13:14 +03:00
Jake Causon
90a1032300 fix(network): stringify response headers for intercepted requests (#4436)
Stringifying the headers was the behaviour before v1.15

References #4379
2019-05-20 11:05:32 +03:00
Andrey Lushnikov
04906494c4
chore: bump version to v1.16.0-post (#4422) 2019-05-14 01:47:47 +03:00
Andrey Lushnikov
9f2635c4ac
chore: mark version v1.16.0 (#4421) 2019-05-14 01:15:35 +03:00
Joel Einbinder
a3cb16308c feat: root option in page.accessibility.snapshot() (#4318)
Going from `AXNode` -> `ElementHandle` is turning out to be controversial.

This patch instead adds a way to go from `ElementHandle` -> `AXNode`. If the API looks good, I'll add it into Firefox as well.

References #3641
2019-05-09 23:39:42 -07:00
Joel Einbinder
1516e0df21 feat(workers): create workers from service workers and shared workers (#4397)
This allows users to easily evaluate javascript inside service workers and shared workers by creating a Worker object for them.
2019-05-09 17:29:18 -07:00
Andrey Lushnikov
ef24c69c62
fix(tracing): start without options (#4388) 2019-05-09 17:15:33 -07:00
Tony Brix
511dcf9d32 feat(browser): Add browser.isConnected() (#4403)
Add `browser.isConnected()` to the public api to be able to tell when the browser is connected

fixes https://github.com/smooth-code/jest-puppeteer/pull/237#issuecomment-490260041
2019-05-09 16:24:52 -07:00
Andrey Lushnikov
e2e6b88934
feat(chromium): roll Chromium to r654752 (#4358)
This roll includes:
- https://crrev.com/653809 - FrameLoader: ignore failing provisional loads entirely
- https://crrev.com/654750 - DevTools: make sure Network.requestWillBeSent is emitted on time for sync xhrs

The FrameLoader patch is the reason behind the test change. It's
actually desirable to fail frame navigation if the frame detaches - and
that's consistent with Firefox.

Fixes #4337
2019-04-28 20:19:01 -07:00
Joel Einbinder
d64f700203 fix(docs): screen readers aren't the only kind of assistive technology (#4349)
The docs incorrectly implied that screen readers were the only assistive technology to do filtering on the tree.
@alice
2019-04-26 13:40:08 -07:00
Andrey Lushnikov
1e29e5bc0f
chore: bump version to v1.15.0-post (#4347) 2019-04-26 00:44:58 -07:00
Andrey Lushnikov
b9f4a95175
chore: mark version v1.15.0 (#4346) 2019-04-25 19:25:16 -07:00
Andrey Lushnikov
e3abb0aa32
feat(puppeteer): introduce puppeteer.errors and puppeteer.devices (#4312)
These getters are introduced as a more convenient substitute for
a `require('puppeteer/Errors')` and
`require('puppeteer/DeviceDescriptors')`.

This way we can make cross-browser story nicer - a single require
of `puppeteer` or `puppeteer-firefox` fully defines Puppeteer
environment.
2019-04-19 15:33:06 -07:00
John Youngblood
66ff4928eb docs(api.md): Working link to Linux differences (#4232)
A link on line 525 is pointing to a undefined branch (`lkcr`) in `chromium.googlesource.com/chromium/src/`. Change it to point to `lkgr` instead, since it's the closest defined branch in name.
2019-04-02 19:15:20 -07:00
Andrey Lushnikov
0adffcc2cb
docs: add table-of-contents to troubleshooting (#4234)
Drive-by: teach our table-of-contents generator to ignore comments
inside fenced blocks and to de-linkify titles.
2019-04-02 19:08:22 -07:00
Andrey Lushnikov
2c6df6ddd1
chore: bump version to v1.14.0-post (#4224) 2019-03-28 22:50:12 -07:00
Andrey Lushnikov
3fa91cace3
chore: mark version v1.14.0 (#4222) 2019-03-28 22:33:38 -07:00
Andrey Lushnikov
0d0e620405
docs(api.md): update ElementHandle example (#4169)
Fix #4150
2019-03-19 12:53:47 -07:00
Vse Mozhet Byt
854b1c0912 feat(executioncontext): support bigints transferring (#4016)
Refs: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-UnserializableValue
2019-03-15 10:20:48 -07:00
Andrey Lushnikov
27cf8594c2
docs(api.md): add note regarding puppeteer.executablePath() (#4092)
References #4091
2019-03-14 11:32:44 -07:00
Andrey Lushnikov
808d1bb597
docs(api.md): add links to CDP guide and pptr.dev (#4159) 2019-03-13 13:17:10 -07:00
Andrey Lushnikov
1623bef264
test: improve test coverage for Request.continue (#4096)
Drive-by: add clarification to docs/api.md regarding
chaning "URL".

References #4030
2019-03-05 14:57:15 -08:00
Andrey Lushnikov
7462bdafa1
chore: bump version to v1.13.0-post (#4115) 2019-03-04 23:45:18 -08:00
Andrey Lushnikov
77a969419e
chore: mark version v1.13.0 (#4114) 2019-03-04 18:39:45 -08:00
Andrey Lushnikov
e3b76b2beb
feat(firefox): support consoleMessage.location() (#4002) 2019-02-13 19:56:56 -08:00
Andrey Lushnikov
e1000009a5
docs(api.md): update versions (#3916) 2019-02-05 12:46:31 -08:00
Andrey Lushnikov
a760d79c86
chore: bump version to v1.12.2-post (#3915) 2019-02-05 12:00:15 -08:00
Andrey Lushnikov
b0afb17b68
chore: mark version v1.12.2 (#3914) 2019-02-05 11:38:04 -08:00
Andrey Lushnikov
b0e8084650
chore: bump version to v1.12.1-post (#3886) 2019-02-01 12:47:56 -08:00
Andrey Lushnikov
a1abd6c1fc
chore: mark version v1.12.1 (#3885)
References #3878.
2019-02-01 12:30:21 -08:00
Andrey Lushnikov
718cdf123e
chore: bump version to v1.12.0-post (#3876) 2019-01-31 19:47:16 -08:00
Andrey Lushnikov
7f05a084f1
chore: mark version v1.12.0 (#3875) 2019-01-31 19:33:54 -08:00
Andrey Lushnikov
a064a6341b
feat(page): introduce page.setDefaultTimeout (#3854)
Method `page.setDefaultTimeout` overrides default 30 seconds timeout
for all `page.waitFor*` methods, including navigation and waiting
for selectors.

Fix #3319.
2019-01-28 17:16:12 -08:00
Joel Einbinder
f2c968fdb8 chore(types): generate our own d.ts file from api.md (#3744)
Generate `//index.d.ts` file with precise typescript definitions for all of the
Puppeteer API.
2019-01-28 15:12:45 -08:00
Andrey Lushnikov
2061dd4718
fix(page): teach waitForSelector to return null (#3846)
`page.waitForSelector` should return `null` if waiting for `hidden:
true` and there's no matching node in DOM.

Before this patch, `page.waitForSelector` would return some JSHandle
pointing to boolean value.
2019-01-28 14:24:53 -05:00
Dan Dascalescu
7446550fdb docs(api.md): fix typo (#3848) 2019-01-27 00:37:02 -05:00
Denny
7585e6db9e docs(api.md): expand puppeteer-core explanation (#3830) 2019-01-22 23:25:14 -05:00
Andrey Lushnikov
d346cb57b4
chore: cleanup puppeteer.connect({browserURL}) (#3766)
This patch:
- renames `browserUrl` into `browserURL`
- cleans up some code
- adds tests for error handling

References #3537
2019-01-14 14:30:03 -08:00
Łukasz Fiszer
15af75f9a2 feat(launcher): add browserUrl option to puppeteer.connect (#3558)
The `browserURL` option allows to connect to a browser that exposed it's remote debugging protocol on a known port.

Fixes #3537
2019-01-14 13:23:34 -08:00
Andrey Lushnikov
89fc2adff5
fix(page): consoleMessage.location() should work with workers (#3752)
This patch:
- refactors consoleMessage.location() implementation to
make it work for workers
- re-writes tests to avoid 5 second delay
2019-01-10 18:05:28 -08:00
Tom P
0c867631b0 feat(page): introduce consoleMessage.location() (#3365)
This patch adds a new consoleMessage.location() method that returns console message origins.

Fixes #3029
2019-01-10 16:51:13 -08:00
Andrey Lushnikov
1e66d332b8
docs(api.md): better documentation for PUPPETEER_DOWNLOAD_HOST (#3669)
Fix #3635.
2018-12-17 13:31:32 -08:00
Andrey Lushnikov
8aaca4eb1e
feat(page): introduce "Popup" event (#3661)
This patch adds a new "popup" event for page.
"Popup" event is fired whenever page opens another page with
given opener.
2018-12-12 17:09:42 -08:00
Andrey Lushnikov
c90392bdf5
feat: introduce page.browserContext() (#3655) 2018-12-12 15:08:31 -08:00
Andrey Lushnikov
45c4477e9f
chore: bump version to v1.11.0-post (#3613) 2018-11-29 22:38:54 -08:00
Andrey Lushnikov
00b15994a4
chore: mark version v1.11.0 (#3610) 2018-11-29 22:11:44 -08:00
Joel Einbinder
a0cbaf39ab chore(types): lint the api docs with typescript (#3577) 2018-11-21 14:49:08 -08:00
Andrey Lushnikov
927d0f443b
feat(page): support waitUntil option for page.setContent (#3557)
This patch teaches `page.setContent` to await resources in
the new document.

**NOTE**: This patch changes behavior: currently, `page.setContent`
awaits the `"domcontentloaded"` event; with this patch, we can now await
other lifecycle events, and switched default to the `"load"` event.

The change is justified since current behavior made `page.setContent`
unusable for its main designated usecases, pushing our client
to use [dataURL workaround](https://github.com/GoogleChrome/puppeteer/issues/728#issuecomment-334301491).

Fixes #728
2018-11-20 15:32:46 -08:00
Vse Mozhet Byt
86e09593bf docs(api.md): mark optional arguments in signatures (#3565)
Some `[]` marks were missing.
2018-11-19 12:36:28 -08:00
Nazanin Delam
f6bfa3231a docs(api.md): fixes #3517 (#3561)
Add required to height and width properties in setViewport function
2018-11-19 12:35:16 -08:00
Joel Einbinder
568734386d fix(types): fix parameters where they disagree with the api (#3525) 2018-11-12 12:59:21 -08:00
Vse Mozhet Byt
59e7e8c244 docs(api.md): update returned value description (#3514) 2018-11-08 18:33:22 -08:00
Joel Einbinder
79ec7a3fe5 fix(types): fix return types where JSDoc and api.md disagree (#3512) 2018-11-07 22:48:43 -08:00
Andrey Lushnikov
60a8d4115d
chore: bump version to v1.10.0-post (#3483) 2018-11-02 11:08:44 -07:00
Andrey Lushnikov
e9d89a2e21
chore: mark version v1.10.0 (#3482) 2018-11-01 20:09:04 -07:00
Joel Einbinder
9ba3261571 feat(accessibility): snapshot the accessibility tree (#3470)
This adds `page.accessibility.snapshot()`. It serializes and returns the accessibility tree for the page. By default, uninteresting nodes are filtered out of the snapshot.

fixes #2033
2018-11-01 18:54:51 -07:00
Andrey Lushnikov
e0610079b6
docs(api.md): update compatibility table 2018-11-01 16:41:20 -07:00
Andrey Lushnikov
8e93eab784
docs(api.md): add example to override request headers (#3475)
References #3458.
2018-11-01 15:44:04 -07:00
Andrea Giammarchi
9800b2c3c2 docs(api.md): Fix missing await in extension example (#3447)
The extensions example did not `await puppeteer.launch(...)` throwing errors right after awaiting `browser.targets()`.
2018-10-26 18:38:00 -07:00
Ola Flisbäck
cf8c62e835 docs(api.md): Fix ElementHandle example (#3401)
This patch fixes an ElementHandle example by
adding a missing parenthesis.
2018-10-16 17:24:46 -07:00
Joel Einbinder
6ac66c3547 feat: browser.waitForTarget (#3356)
This adds `browser.waitForTarget` and `browserContext.waitForTarget`. It also fixes a flaky test that was incorrectly expecting targets to appear instantly.
2018-10-09 14:16:53 -07:00
Justin Lee
90d1fe8f6f docs(api): fixed grammatical error (it's -> its) #3352
Fixed incorrect use of "it's".
2018-10-04 16:09:08 -07:00
Andrey Lushnikov
af4209ff98
chore: bump version to v1.9.0-post (#3351) 2018-10-04 14:53:00 -07:00
Andrey Lushnikov
f6c05e6efd
chore: mark version v1.9.0 (#3350) 2018-10-04 14:37:40 -07:00
Raymond Tan
c9657f8819 docs(api.md): minor grammar and consistency fixes (#3320) 2018-10-02 13:38:41 -07:00
Andrey Lushnikov
4e48dfc7a1
feat(launcher): add experimental "transport" option to pptr.connect (#3265)
This patch:
- adds experimental "transport" option to pptr.connect
- uses "transport" option to make sure Puppeteer-Web works with
  Target.exposeDevToolsProtocol

Drive-by: add `browser.target()` to access browser target.
2018-09-20 11:55:23 -07:00
Andrey Lushnikov
5acf953104
feat(frame): introduce Frame.goto and Frame.waitForNavigation (#3276)
This patch introduces API to manage frame navigations.
As a drive-by, the `response.frame()` method is added as a shortcut
for `response.request().frame()`.

Fixes #2918.
2018-09-20 11:31:19 -07:00
xcatliu
ad49f792a4 docs(api.md): Fix description of SecurityDetails class (#3277) 2018-09-20 07:48:30 -07:00
xcatliu
27477a1d79 docs(api.md): Fix typo (#3273) 2018-09-19 05:58:04 -07:00
Andrey Lushnikov
f5d388af7d
docs(api.md): add example for Mouse class (#3244)
Fixes #3221.
2018-09-14 19:48:47 +01:00
Andrey Lushnikov
f49687f747
docs(api.md): add frame example (#3237)
Add an example on how to work with frame's API.

Fixes #3232.
2018-09-13 19:25:15 +01:00
Divyansh Tripathi
c967aebc84 docs(api.md): add an include statement for puppeteer-core (#3213)
Fix #3204
2018-09-07 10:46:59 +01:00
Matt Zeunert
c5511ecb81 docs(api.md): Clarify how to call page.setCookie (#3215)
Fixes #3109
2018-09-07 10:46:12 +01:00
Andrey Lushnikov
78e9d5c422
chore: bump version to v1.8.0-post (#3212) 2018-09-06 22:03:42 +01:00
Andrey Lushnikov
aeb6a9991e
chore: mark version v1.8.0 (#3211) 2018-09-06 21:49:44 +01:00
Andrey Lushnikov
28d92116b7
feat(puppeteer): support convenience env variables (#3190)
We had (and still have) a ton of pull requests to support
PUPPETEER_EXECUTABLE_PATH and PUPPETEER_CHROMIUM_REVISION in puppeteer launcher.

We were hesitant before since env variables are not scoped
and thus don't make a good interface for a library. Now, since we
determined `puppeteer-core` as a library and `puppeteer` as our end-user
product, it's safe to satisfy our user needs.

This patch:
- teaches PUPPETEER_EXECUTABLE_PATH and PUPPETEER_CHROMIUM_REVISION
  env variables to control how Puppeteer launches browser
- makes sure these variables play no role in `puppeteer-core` package.
2018-09-05 22:59:14 +01:00
Andrey Lushnikov
7f9e276733
feat(network): introduce Response.statusText() (#3193)
Fixes #317.
2018-09-05 21:03:24 +01:00
Jonathan
3364659cca docs(api.md): Added cutoff values for scale option in page.pdf function (#3201)
Added the cutoff values for the scale option in the page.pdf function call. Numbers based on chrome's warning message.
2018-09-05 18:12:21 +01:00
Vse Mozhet Byt
e07567f268 docs(api.md): fix a typo (#3196) 2018-09-04 22:38:55 +01:00
Andrey Lushnikov
1ba2b8540d
feat(network): introduce Response.remoteAddress() (#3192)
Closes #2171.
2018-09-04 20:39:59 +01:00
Andrey Lushnikov
2de5a42d1f
docs(api.md): expand on puppeteer-core vs puppeteer (#3189) 2018-09-04 17:32:57 +01:00
Andrey Lushnikov
93f267b4bb
docs(api.md): re-factor api.md heading (#3185)
- drop the "all previous releases" part, only have last 5 releases per chromium versions
- link to Chinese translation of the documentation
2018-09-04 16:54:02 +01:00
avimar
cbce839986 docs(api.md): small typo (#3188) 2018-09-04 16:34:44 +01:00
Ali Ahmad
464f3b4ca2 feat(page): Add 'referer' as a parameter to Page.goto() (#3128)
If referer is passed to the options object its value will be used as the referer instead of the value set by `Page.setExtraHTTPHeaders()`.

This is the correct way to set referer header: otherwise, the `referer` header will override all the document subrequests.

Fixes #3090.
2018-09-03 20:06:58 +01:00
Andrey Lushnikov
17029281a9
feat(page): Introduce page.setGeolocation method (#3160)
Fixes #1077
2018-08-31 18:04:12 +01:00
Andrew Leedham
10009973fb docs(api.md): page.hover typo (#3165) 2018-08-31 11:59:49 +01:00
Andrey Lushnikov
50d6c2d3c6
feat(browsercontext): implement BrowserContext.overridePermissions (#3159)
Introduce an API to manage permissions per browser context:
- BrowserContext.overridePermissions(origin, permissions)
- BrowserContext.clearPermissionOverrides()

Fixes #846.
2018-08-30 23:36:09 +01:00
Andrey Lushnikov
3ae85e4649
docs: mention puppeteer-core (#3061) 2018-08-09 19:31:14 -07:00
Andrey Lushnikov
af361c8ed6
chore: bump version to v1.7.0-post (#3060) 2018-08-09 19:24:25 -07:00
Andrey Lushnikov
66caee4c60
chore: mark version v1.7.0 (#3059) 2018-08-09 18:53:24 -07:00
Andrey Lushnikov
be7626fa5e
fix: revert ExecutionContext reporting. (#3058)
It turned out that almost any usecase requires helper methods to access
DOM inside the ExecutionContext.

Instead of exposing execution contexts as-is, we should introduce
IsolatedWorld as a first-class citizen that will hold execution contexts
inside.
2018-08-09 18:14:21 -07:00
Joel Einbinder
28ccf5d795 docs(api.md): some grammar/wording (#3057) 2018-08-09 17:49:06 -07:00
Andrey Lushnikov
204c7ec8c4
feat: introduce puppeteer/Errors (#3056)
This patch adds a new require, `puppeteer/Errors`, that
holds all the Puppeteer-specific error classes.

Currently, the only custom error class we use is `TimeoutError`. We'll
expand in future with `CrashError` and some others.

Fixes #1694.
2018-08-09 16:51:12 -07:00
Andrey Lushnikov
231a2be971
feat: expose frame's execution contexts (#3048)
This patch exposes frame's execution contexts, making it possible
to debug extension's content scripts.

This is a resurrected #2812.
2018-08-09 14:57:08 -07:00
Vse Mozhet Byt
b84404c94e docs(api.md): fix a typo (#3055) 2018-08-09 14:45:15 -07:00
Andrey Lushnikov
40466cb3a4
feat(launcher): ignoreDefaultArgs to accept array of options (#3049)
If `ignoreDefaultArgs` is given an array of options, than
these options will be excluded from the default command-line
flags.
2018-08-08 19:10:10 -07:00
Andrey Lushnikov
d822401449
docs(api.md): clarify coordinate system in mouse (#3041) 2018-08-07 14:24:38 -07:00
Andrey Lushnikov
608f5b79fe
docs(api.md): clarification note on request interception (#3042)
Fixes #3040.
2018-08-07 14:24:27 -07:00
Joel Einbinder
6825088644 feat(launcher): allow options to be passed into puppeteer.defaultArgs (#2950) 2018-08-07 13:22:04 -07:00
Joel Einbinder
25632133e2 feat: add option to specify the default viewport (#3005)
Fixes #1183.
2018-08-01 16:23:03 -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
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
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
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
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
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
Abel Toledano
b61e67d001 feat: add slowMo option to puppeteer.connect (#1864)
This patch introduces a `slowMo` option to the `puppeteer.connect` method. The option
is similar to the one in `puppeteer.launch` and is used to slow down the connection.
2018-01-22 16:45:46 -08:00
Ram Dobson
cb684ebbc4 feat(Page): introduce Page.waitForXPath (#1767)
This patch:
- introduces `page.waitForXPath` method
- introduces `frame.waitForXPath` method
- amends `page.waitFor` to treat strings that start with `//` as xpath queries.

Fixes #1757.
2018-01-22 15:16:20 -08:00
Sakamoto, Kazunori
102f10cbc7 docs(api.md): Fix sample code in API doc (#1821)
Because `Request.url` is changed to `Request.url()`.
2018-01-18 21:39:50 -08:00
Sony AK
d2715d1c6f docs(api.md): fix typo on api docs (#1849) 2018-01-18 21:19:43 -08:00
Eric Bidelman
e031264231 docs(api): fix coverage example and typo (#1854) 2018-01-18 21:19:13 -08:00
Ian Hunter
59f6d42610 feat: add Page.Events.DOMContentLoaded (#1730)
Fixes #1580
2018-01-16 23:22:44 -08:00
futpib
25b35c5789 docs(api.md): fix missing await in examples (#1801)
`frame.executionContext()` returns a Promise, so running examples without `await` results in exceptions
2018-01-16 16:59:00 -08:00
Alix Axel
31a1f9ad70 docs(api.md): added page.click + waitForNavigation example (#1792)
Fixes #1421.
2018-01-12 11:41:26 -08:00
Andrey Lushnikov
aed7019146
chore: bump version to 1.0.0-post (#1789) 2018-01-11 21:09:37 -08:00
Andrey Lushnikov
12b57e31f3
chore: mark version v1.0.0 (#1786) 2018-01-11 15:15:23 -08:00
Andrey Lushnikov
5368051610
feat: expose raw devtools protocol connection (#1770)
feat: expose raw devtools protocol connection

This patch introduces `target.createCDPSession` method that
allows directly communicating with the target over the
Chrome DevTools Protocol.

Fixes #31.
2018-01-10 19:33:22 -08:00
Radu Aron
ec8e40f1cb feat(Page): Add global navigation timeout setting (#1728)
This patch introduces `page.setDefaultNavigationTimeout` method to override the 
default 30 seconds navigation timeout.

Fixes #1514
2018-01-10 13:04:01 -08:00
Octavian Cioaca
3985dee54e docs(API): add more explicit examples for page.evaluate (#1711) 2018-01-09 23:05:52 -08:00
yujiosaka
c29822d663 feat: Attribute network requests to frames (#1646)
This patch introduces `request.frame()` method that returns the frame that
initiated request.

Fixes #1579
2018-01-09 18:47:21 -08:00
Kamakura Masaya
8c392b7ee8 docs(api.md): add missing parentheses after page.mainFrame (#1738) 2018-01-08 17:20:02 -08:00
yujiosaka
8e9c54a789 feat: introduce browser.userAgent() (#1716)
The patch introduces browser.userAgent() method to retrieve
default browser user agent.

Fixes #1706.
2018-01-05 10:14:30 -08:00
JoelEinbinder
05b1aca21e feat: support JSHandles for page.waitFor* calls (#1712)
This patch:
- teaches page.waitFor* methods to accept JSHandles
- starts returning JSHandles from page.waitFor* calls. 

BREAKING CHANGE: this patch starts allocating `JSHandle`/`ElementHandle` instances for every call to `page.waitFor*` functions. These handles should be disposed manually to avoid memory consumption.

Fixes #1703, fixes #1654, fixes #1724.
2018-01-04 14:49:13 -08:00
Andrey Lushnikov
0a498bae3a
docs: update api.md
This patch clarifies when the "disconnected" event is emitted
and emphasizes the difference between Chromium and browser.

References #1589.
2018-01-04 02:27:57 -08:00
Andrey Lushnikov
24354a4879
feat: implement CSS Coverage (#1714)
This patch adds two new methods to the `page.coverage` namespace:
- `page.coverage.startCSSCoverage()` - to initiate css coverage
- `page.coverage.stopCSSCoverage()` - to stop css coverage

The coverage format is consistent with the JavaScript coverage.
2018-01-03 18:21:40 -08:00
JoelEinbinder
f183664d0f feat: rename page.xpath into page.$x, return an array of elements (#1713)
Fixes #1705.
2018-01-03 15:37:08 -08:00
Andrey Lushnikov
d062381978
feat: Implement JavaScript Coverage (#1673)
This patch introduces a new `page.coverage` namespace with two methods:
- `page.coverage.startJSCoverage` to initiate JavaScript coverage
  recording
- `page.coverage.stopJSCoverage` to stop JavaScript coverage and get
  results
2018-01-02 19:53:53 -08:00
Andrey Lushnikov
83fb29d4e7
docs: use less confusing synonym
This change was suggested in #1636.
2017-12-27 19:35:14 -08:00
JoelEinbinder
bf3e0cca57 docs: add missing session cookie property to api.md (#1672)
The session value is returned from the protocol, but not accepted as a cookie parameter.

Fixes #980.
2017-12-27 19:58:57 -07:00
JoelEinbinder
8a40cd5eef feat(Launcher): allow the default arguments to be overridden (#1623)
This patch:
- adds `puppeteer.defaultArgs()` method to get default arguments that are used to launch chrome
- adds `ignoreDefaultArgs` option to `puppeteer.launch` to avoid using default puppeteer arguments

Fixes #872
2017-12-19 17:51:21 -08:00
Audrius Jakumavicius
f8040cb2a2 feat(pdf): add headerTemplate and footerTemplate to available PDF options (#1625)
This patch allows specifying header and footer templates for PDF printing.

Fixes #373.
2017-12-19 16:54:34 -08:00
JoelEinbinder
60ba8c3af9 feat: add page.xpath (#1620)
This patch adds xpath support with the following methods:
- page.xpath
- frame.xpath
- elementHandle.xpath

Fixes #537
2017-12-19 16:23:45 -08:00
Andrey Lushnikov
b73737302a
fix: convert all getters to methods (#1621)
The patch converts all the getters in the codebase into the methods.
For example, the `request.url` getter becomes the `request.url()`
method.

This is done in order to unify the API and make it more predictable.
The general rule for all further changes would be:
- there are no getters/fields exposed in the api
- the only exceptions are "namespaces", e.g. `page.keyboard`

Fixes #280.

BREAKING CHANGE:
This patch ditches getters and replaces them with methods throughout
the API. The following methods were added instead of the fields:
- dialog.type()
- consoleMessage.args()
- consoleMessage.text()
- consoleMessage.type()
- request.headers()
- request.method()
- request.postData()
- request.resourceType()
- request.url()
- response.headers()
- response.ok()
- response.status()
- response.url()
2017-12-18 17:05:57 -08:00
Karl Brown
63f7e38077 docs(README.md): Update docs to more clearly differentiate between Chromium and Chrome (#1574)
This patch clarifies the documentation to more clearly note that Puppeteer works with both Chromium (by default)
and Chrome.

Fixes #1516
2017-12-14 19:09:48 -08:00
Andrey Lushnikov
4eaf52fa1d
feat(Browser): introduce browser.process() variable (#1581)
This patch adds a `browser.process()` getter to expose the child process
with running browser.

Fixes #1539.
2017-12-11 12:11:12 -08:00
Trent Willis
696f59e890 docs(api.md): Note that Browser and Page extend from EventEmitter (#1541)
Adds notes to the API documentation that Browser and Page classes
are EventEmitters. Provides an example of using `.once` for Page.

Fixes #1231
2017-12-05 23:53:27 -08:00
Slohmes
5a6488883a feat(Tracing): allow custom tracing categories (#1439)
This patch adds `categories` option to the `page.tracing.start` method
that allows to override default tracing categories. 

References #1300, #854
2017-12-03 18:36:34 -08:00
Trent Willis
770c17b2ea feat(Frame): implement frame.content and frame.setContent methods (#1447)
This refactors the page.content and page.setContent methods to be defined on the Frame class. This allows access from the Page still but also on all frames.

Fixes #754
2017-11-23 05:44:33 +03:00
Andrey Lushnikov
3b60ad1c39
doc(api.md): ElementHandle.boundingBox() returns a promise (#1437) 2017-11-21 10:13:44 +03:00
Andrey Lushnikov
6512ce768d
fix(Frame): postpone evaluations until execution context gets created (#1415)
In Blink, frames don't necesserily have execution context all the time.
DevTools Protocol precisely reports this situation, which results in
Puppeteer's frame.executionContext() being null occasionally.

However, from puppeteer point of view every frame will have at least a
default executions context, sooner or later:

- frame's execution context might be created naturally to run frame's
  javascript
- if frame has no javascript, devtools protocol will issue execution
  context creation

This patch builds up on this assumption and makes frame.executionContext()
to be a promise.
As a result, all the evaluations await for the execution context to be created first.

Fixes #827, #1325

BREAKING CHANGE: this patch changes frame.executionContext() method to return a promise.
To migrate onto a new behavior, await the context first before using it.
2017-11-18 16:27:52 -08:00
Md. Abu Taher
48ccf1e9f4 doc(api.md): add evaluateOnNewDocument examples (#1202)
Fixes #1201.
2017-11-17 10:34:20 -08:00
Andrey Lushnikov
90ca007367
fix(Launcher): handle SIGHUP signal (#1405)
The SIGHUP signal is sent whenever the controlling terminal is closed.

On Windows, SIGHUP is emulated by libuv, and will be the only signal we
receive before the application will be terminated.

This patch starts handling SIGHUP in the same way we handle SIGTERM.

Fixes #1367.
2017-11-16 19:28:32 -08:00
Andrey Lushnikov
cc0c461ea8
fix(Launcher): handle SIGTERM by default (#1402)
SIGTERM signal is widely used to notify application that it will be shut down.

This patch starts listening to SIGTERM event to gracefully retire
chromium instance.

References #1047.
2017-11-16 14:26:32 -08:00
Sean Tan
d8ac8fcfb0 docs(api.md): fix return signatures that contains null (#1364) 2017-11-15 10:53:17 -08:00
Andrey Lushnikov
99103cbb97
chore: bump version to 1.0.0rc (#1389) 2017-11-14 15:58:11 -08:00
Andrey Lushnikov
0467c346b1 chore: mark version 0.13.0 2017-11-10 18:16:20 -08:00
Robin
9b907b9ada docs(api): javascript -> JavaScript (#1338) 2017-11-10 13:35:22 -08:00
JoelEinbinder
b7566c1a83 docs: document osx keyboard shortcuts not working (#1311)
Fixes #776
2017-11-07 16:22:58 -08:00
Andrey Lushnikov
cbe3dc58a2
Revert "feat(Page): teach Page.setContent to wait for resources to load (#1152)" (#1312)
This reverts commit 80ee469429.

Lifecycle events are not ready yet to support the setContent scenario.
The prerequisite for this is
https://chromium-review.googlesource.com/c/chromium/src/+/747805 that
might not land soon due to technical concerns.
2017-11-07 14:18:05 -08:00
JoelEinbinder
b58d319926 fix(Page.click): throw a meaningful message for invisible elements (#1309)
This patch starts throwing a meaningful error message when trying to click the hidden
node.

References #1294
2017-11-07 13:54:40 -08:00
Schelkun
77f585298f feat(Page): introduce Page bringToFront method (#1252)
This patch introduces Page.bringToFront method to activate tabs.

Fixes #1244
2017-11-07 13:17:36 -08:00
Adi Prasetyo
03fefb53f8 feat(browser): add browser.disconnected event (#960)
This patch adds a 'disconnected' event for the browser. The event is issued
when the "browser" loses connection to the chrome process.

References #952
2017-11-03 18:46:17 -07:00
Vse Mozhet Byt
7bc55ab7fd docs(api.md): fix return values of page.add*Tag() (#1269) 2017-11-03 09:32:17 -07:00
Xingan Wang
e0f5b93923 feat(Frame): addStyleTag and addScriptTag now return ElementHandles.
This patch teaches `page.addStyleTag` and `page.addScriptTag` to return ElementHandles
to the added tags.

Fixes #1179.
2017-11-03 00:05:38 -07:00
Vse Mozhet Byt
cee3081a41 docs(api.md): fix return value of frame.select() (#1251) 2017-11-02 21:46:49 -07:00
Suvrat Jain
fede2643ac feat(Frame): introduce Frame.select
This patch adds `Frame.select` method that does the same functionality as
former `Page.select`, but on a per-frame level.

The `Page.select` method becomes a shortcut for the ÷main frame's select.

Fixes #1139
2017-11-01 22:06:04 -07:00
Andrey Lushnikov
f5bb333cd0
fix: support PlzNavigate in puppeteer. (#1239)
This patch migrates puppeteer to support PlzNavigate chromium
project.

As a consequence of this patch, we no longer wait for both
requestWillBeSent and requestIntercepted events to happen. This should
resolve a ton of request interception bugs that "hanged" the loading.

Fixes #877.
2017-11-01 14:04:10 -07:00
Andrey Lushnikov
b9266c74f8
feat(Page): rename Page.getMetrics into Page.metrics (#1240)
BREAKING CHANGE: method page.getMetrics() got renamed into
page.metrics().
2017-11-01 13:39:31 -07:00
AlexChung1995
e70f98ddb9 feat(Page.select): return selected options from Page.select (#1099)
This patch teaches Page.select to return an array of actually selected options.
If no option is selected, an empty array will be returned.
2017-10-31 21:47:52 -07:00
burningTyger
6dec7cf6e4 typo in api.md (#1216)
more then -> more than
2017-10-31 11:30:29 -07:00
JoelEinbinder
e11dbd7be6 docs: add more keyboard examples for typing (#1176)
This adds more examples for using `keyboard.type` and `keyboard.press`. It adds warnings about Shift affecting or not affecting the text generated by certain methods.

fixes #723
2017-10-27 02:12:56 -07:00