Commit Graph

2377 Commits

Author SHA1 Message Date
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
Ikko Ashimine
25ad7402e9
chore: fix typo in WebWorker.ts (#7219)
recieve → receive
2021-05-10 07:49:57 +02:00
Patrick Hulce
cb285a2379
feat: expose other sessions from connection (#6863) 2021-05-07 08:31:39 +00:00
Peng-Yu Chen
2605309f74
feat(launcher): add new launcher option waitForInitialPage (#7105)
The existing behavior is expected to be unchanged as the value defaults to true.
Adding such option would allow user to skip the initial wait.

Issue: #3630
2021-05-06 20:30:04 +00:00
Robin Richtsfeld
c9978d20d5
fix(requestinterception): fix font loading issue (#7060)
See https://github.com/puppeteer/puppeteer/pull/6996#issuecomment-811546501 and https://github.com/puppeteer/puppeteer/pull/6996#issuecomment-813797393 for context.

Issue: #7038
2021-05-06 08:36:34 +02:00
Jan Scheffler
8126101980
chore: disable flaky test on Firefox (#7207) 2021-05-05 12:21:14 +00:00
Jan Scheffler
476e9259fe
chore: bump version to v9.1.1-post (#7206) 2021-05-05 09:57:19 +00:00
Jan Scheffler
d615dd3d2c
chore(release): mark v9.1.1 (#7205) 2021-05-05 10:38:53 +02:00
Jan Scheffler
bcc85a0969
fix: make targetFilter synchronous (#7203) 2021-05-05 09:50:50 +02:00
Jan Scheffler
8816645c71
chore: bump version to v9.1.0-post (#7202) 2021-05-03 12:40:47 +00:00
Jan Scheffler
1d473bc79f
chore(release): mark v9.1.0 (#7201) 2021-05-03 14:08:44 +02:00
Jan Scheffler
ec3fc2e035
feat: add option to filter targets (#7192)
* feat: add option to filter targets

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
2021-05-03 13:48:31 +02:00
Jan Scheffler
a293b96952 chore: disable flaky test on Firefox
Issue: #7182
2021-05-03 10:48:29 +02:00
Jan Scheffler
ad6b736039
fix: change rm -rf to rimraf (#7168)
Currently, `npm clean-lib` fails on windows with `cmd` because it does not now about `rm`.
This change uses the already installed `rimraf` to do the job instead.
2021-04-27 10:32:15 +02:00
Henrik Skupin
49a54cfc93
chore: enable firefox reconnection spec (#7114) 2021-04-22 09:55:49 +02:00