Commit Graph

2391 Commits

Author SHA1 Message Date
TASNEEM KOUSHAR
c65b10c524
chore: remove more ts-doc warnings (#7422) 2021-07-19 10:39:40 +01:00
Mathias Bynens
dd470c7a22
feat(api): make page.isDragInterceptionEnabled a method (#7419)
Having it be a getter is surprising and inconsistent, since the other `page.is*` APIs are just methods.

Issue: #7150
2021-07-13 11:37:39 +02:00
TASNEEM KOUSHAR
2a403d1973
chore(docs): fix tsdoc warnings
* fix: added script

* fix: updated script

* fix: updated script

* fix: added comment

* fix: added comments

* fix: connection method to public

* fix: removed incorrect tags

* fix: some of the warnings
2021-07-12 10:42:44 +01:00
Yusuke Iwaki
d70f60e061
feat: add channel parameter for puppeteer.launch (#7389)
This change adds a new `channel` parameter to `puppeteer.launch`. When specified, Puppeteer will search for the locally installed release channel of Google Chrome and use it to launch. Available values are `chrome`, `chrome-beta`, `chrome-canary`, `chrome-dev`. This parameter is mutually exclusive with `executablePath`.
2021-07-09 12:43:42 +00:00
TASNEEM KOUSHAR
d541e975ae
chore: documentation improvements 2021-07-09 09:12:01 +01:00
TASNEEM KOUSHAR
ea3df80ed1
fix: add script to remove html comments from docs markdown (#7394) 2021-07-06 10:55:42 +01:00
Ben Allfree
b5e6474374
feat: add cooperative request intercepts (#6735)
With this change,`request.respond`, `request.abort`, and `request.continue` can accept an optional `priority` to activate Cooperative Intercept Mode. In Cooperative Mode, all intercept handlers are guaranteed to run and all async handlers are awaited. The interception is resolved to the highest-priority resolution. See _Cooperative Intercept Mode and Legacy Intercept Mode_ in `docs/api.md` for details.
2021-07-02 17:58:32 +00:00
Maksim Sadym
859135adb6
chore: use proper cssLayoutMetrics (#7390) 2021-07-01 13:23:38 +02:00
Rowan Merewood
7200b1a6fb
feat: add support for useragentdata (#7378)
Adds userAgentData to setUserAgent that supports specifying user agent
data for the new navigator.userAgentData and Client Hints headers.
2021-06-29 18:29:55 +02:00
Jan Scheffler
558b35567c
chore: bump version to v10.1.0-post (#7386) 2021-06-29 07:44:38 +00:00
Jan Scheffler
6b13a17ed9
chore(release): mark v10.1.0 (#7331) 2021-06-29 09:26:24 +02:00
TASNEEM KOUSHAR
e5eed1efaf
chore: add more comments to page class 2021-06-25 13:40:53 +01:00
Yash Ladha
e94a6b73d3
chore: add type to resolve function (#7352) 2021-06-24 08:30:21 +00:00
Brian Misiak
e3699e248b
feat: add a streaming version for page.pdf
Co-authored-by: Jan Scheffler <janscheffler@chromium.org>
2021-06-23 14:51:38 +02:00
Jack Franklin
edc18b46f9
chore: add documentation to page.ts (#7355)
Co-authored-by: Tasneem Koushar <imatasneemkoushar@gmail.com>
2021-06-23 09:23:36 +01:00
Yash Ladha
083b297a67
fix: remove redundant await while fetching target (#7351)
This patch removes the redundant `await` from the block while fetching the target. The value in the map is a `Target` instance, which itself is not an async resource.
2021-06-23 08:24:37 +02:00
Jan Scheffler
4ce4110628
feat: add page.emulateCPUThrottling (#7343) 2021-06-22 11:43:11 +00:00
Diego Fernandez
7e74a9d606
docs: add download location to the FAQ (#7339)
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2021-06-21 07:21:05 +02:00
Julian Descottes
bba3f41286
chore: synchronize Bug 1710839: update comment about firefox preference remote.enabled (#7324) 2021-06-14 10:41:25 +02:00
Ikko Ashimine
f984beb152
chore: fix typo in connection.spec.js (#7326)
recieved -> received
2021-06-14 07:44:36 +02:00
Jack Franklin
c07e6d4fa9
chore(docs): ensure old docs are removed when generating (#7308)
I lost time today due to some old docs files lingering for code that is now gone. To avoid that happening, let's remove the directories before generating.

As part of this work I also changed the API Extractor to not output to `temp/X.api.json` and instead `docs-api-json/X.api.json` to make it clearer what that folder is for.
2021-06-10 08:30:40 +00:00
Dan Park
a91b8aca37 feat: add drag-and-drop support (#7150)
This commit adds drag-and-drop support, leveraging new additions to the CDP Input domain (Input.setInterceptDrags, Input.dispatchDragEvent, and Input.dragIntercepted).
2021-06-07 13:50:34 +02:00
TASNEEM KOUSHAR
0295b1c773
chore(docs): comments for page methods
* fix: modified comment for method product, platform and newPage

* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: added comments for some of the method

* fix: added proper comments

* fix: added comment for some methods in page.ts

* fix: rectified the comments

* fix: changed some of the comments

* fix: added comments for 3 more methods of class page

* fix: added comments for 3 more methods of class page

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
2021-06-03 08:34:22 +01:00
TASNEEM KOUSHAR
1108b63d82
chore(docs): add comments to page.ts
* fix: modified comment for method product, platform and newPage

* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: added comments for some of the method

* fix: added proper comments

* fix: added comment for some methods in page.ts

* fix: rectified the comments

* fix: changed some of the comments

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
2021-06-02 13:47:20 +01:00
Robin Richtsfeld
af83207176
docs(requestinterception): remove outdated NOTE (#7304) 2021-06-01 11:29:38 +02:00
Jan Scheffler
f2ab11c640
chore: bump version to v10.0.0-post (#7302) 2021-05-31 16:07:51 +02:00
Jan Scheffler
9df7b71e3b
chore(release): mark v10.0.0 (#7299) 2021-05-31 14:34:04 +02:00
Jan Scheffler
e7add91d76
chore: fix puppeteer version in chromium roll (#7300) 2021-05-31 12:08:52 +00:00
Rodrigo Bermúdez Schettino
1854192abb
chore: update ws dependency to a non-vulnerable version (#7296)
Issue: https://github.com/advisories/GHSA-6fc8-4gx4-v693
2021-05-31 11:24:48 +02:00
Darío Kondratiuk
b4509d31cc
test: fix page.browserContext test title (#7292) 2021-05-27 13:51:41 +00:00
Darío Kondratiuk
ad523c87fa
test: move network emulation tests to the emulation spec file (#7293) 2021-05-27 13:17:12 +00:00
Jan Scheffler
f863f4bfe0
feat(chromium): roll to Chromium 92.0.4512.0 (r884014) (#7288) 2021-05-26 16:44:29 +00:00
Darío Kondratiuk
2c9ff4feaf
test: fix typo in page test (#7277) 2021-05-26 14:52:54 +00:00
TASNEEM KOUSHAR
9e0acebb75
chore: add documentation for missing methods
* fix: modified comment for method product, platform and newPage

* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: corrected comments for JSONValue, asElement, evaluateHandle

* fix: added comments for some of the method

* fix: added proper comments

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-26 15:37:38 +01:00
Jack Franklin
ea2b0d1f62
chore: improve type inference of evaluate (#7267)
This commit updates the JSHandle class to take a generic representing
the underlying object that it's wrapping. We can then define
`ElementHandle` as a class that extends `JSHandle<Element>` and begin
to get better type inference.

Prior to this commit the following code would have `d` set to `any`:

```
const div: page.$<HTMLDivElement>('div')
const text = await div.evaluate(d => d.innerText)
```

You could work around this in two ways:

```
const text = await div.evaluate<(d: HTMLDivElement) => string>(d => d.innerText)
const text = await div.evaluate((d: HTMLDivElement) => d.innerText)
```

But both of these have two issues:

1. Requires the user to type extra information.
2. There's no type checking: in the code above I could type `d` as
   `number` and TS would be happy.

With the change here to `evaluate` the user can now type the original
code:

```
const div: page.$<HTMLDivElement>('div')
const text = await div.evaluate(d => d.innerText)
```

And TypeScript will know that `d` is an `HTMLDivElement`.

This change brings us inline with the approach that @types/puppeteer
takes. If we land this and it works, we can do the same with
`evaluateHandle` to hopefully make a similar improvement there.

BREAKING: because this changes the types, which were previously `any`,
this is technically a breaking change as users using TS could start
getting errors after this change is released.
2021-05-26 13:46:17 +00:00
Jack Franklin
457651d0a3
chore: add github-retry to unit tests (#7276)
* chore: add github-retry to unit tests

* chore: add timeout_minutes
2021-05-26 14:30:16 +01:00
Maksim Sadym
cb038cd401
test: close browser in case of test failed (#7271) 2021-05-26 11:17:56 +02:00
Darío Kondratiuk
89a85b428d
test: reorder describes in JS coverage spec (#7075)
Just some code reorder. We had a describe between it calls. I'm moving that describe to the end

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-25 08:14:44 +01:00
TASNEEM KOUSHAR
b75039746a
fix: added comments for browsercontext, startCSSCoverage, and startJSCoverage. (#7264)
* fix: modified comment for method product, platform and newPage

* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage
2021-05-25 07:47:25 +01:00
TASNEEM KOUSHAR
159d283545
fix: modified comment for method product, platform and newPage (#7262) 2021-05-24 14:14:51 +01:00
Jack Franklin
8340cb7c34
chore: set module to esnext in tsconfig.json (#7256)
The main `tsconfig.json` file is only used for API Extractor, and by VSCode to provide type information. It is _not_ used to compile Puppeteer for shipping. Therefore we can specify `module: "esnext"` in here so that VSCode knows we can use all the latest and greatest module features (primarily, dynamic imports). In `tsconfig.cjs.json` and `tsconfig.esm.json` we set the `module` setting for CJS/ESM respectively.
2021-05-21 10:05:41 +00:00
Robin Richtsfeld
d01aa6c84a
feat(requestinterception): remove cacheSafe flag (#7217) 2021-05-20 14:09:56 +02:00
Mathias Bynens
97c9fe2520
chore: drop support for Node.js 10 (#7200)
This is a prerequisite for shipping Puppeteer as JavaScript modules.

Issue: #6753

BREAKING CHANGE: Node.js 10 is no longer supported.
2021-05-17 11:34:58 +02:00
Robin Richtsfeld
e0b35d7d1d
test: remove console.log in unit test (#7216)
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2021-05-17 07:32:53 +00:00
Jack Franklin
4796382f01
chore: enforce pinned dependencies (#7238)
* chore: enforce pinned dependencies

Because we don't check our `package-lock.json` in, we can end up with
different versions installed locally vs CI, or even two devs having
different versions. Let's pin and enforce we pin every version to
avoid this.
2021-05-14 12:02:36 +01:00
Jack Franklin
3204f2780f
chore: fix eslint warnings around type defs (#7230)
This PR updates some code to remove constant ESLint warnings. It also
upgrades those warnings to errors - so that they have to be resolved
as part of the PR, rather than landing as a warning and causing noise.

Fixes #7229.
2021-05-12 17:43:05 +01:00
Jack Franklin
523aa0aafa
chore: upgrade and pin prettier dependencies (#7232)
We're seeing odd failures with Prettier on some CI branches; my hunch is that they are installing different versions of the package and therefore getting formatting conflicts. This PR updates them all and pins them to specific versions - something we should probably consider generally, or remove our `package-lock.json` from the gitignore.
2021-05-12 16:48:30 +02:00
Mathias Bynens
d9ace6c664
chore: disable markdownlint for api.md (#7228)
api.md is autogenerated anyhow, and this avoids the recent CI failures.

Issue: #7227
2021-05-12 14:47:27 +02:00
Kiko Beats
4959d46b8a
chore: drop Firefox workaround (#7226)
The Firefox issue is already resolved.
2021-05-12 13:11:31 +02:00
Tim van der Lippe
778ac92469
docs: mention lowercasing of HTTP headers (#7224) 2021-05-10 16:27:50 +02:00