Commit Graph

495 Commits

Author SHA1 Message Date
Alex Rudenko
d2f6db2073 fix: use loaderId to reduce test flakiness (#8717) 2022-08-02 13:18:50 +00:00
Alex Rudenko
c064114636 chore: refactor init to make sure it works with paused targets (#8710) 2022-08-02 13:18:49 +00:00
Alex Rudenko
96d9608d1d fix: disable AcceptCHFrame (#8706)
Closes: #8479
2022-08-02 13:18:49 +00:00
Alex Rudenko
f52b37a3aa docs: fix a typo in waitForSelector (#8701) 2022-08-02 13:18:48 +00:00
Alex Rudenko
6f81b23728 fix: address flakiness in frame handling (#8688)
When we attach to a frame, we send a call to get
the page frame tree from CDP. Based on the tree data
we look up the parent frame if parentId is provided.
The problem is that the call to get the page frame
tree could take arbitrary time and the calls for the
parent and child frames might happen at the same time.
So the situation where the frame tree for the child frame
is resolved before the parent frame is known is fairly
common.

This PR addresses the issue by awaiting for the parent
frame id before attempting to register a child frame.
2022-08-02 13:18:47 +00:00
Alex Rudenko
2cbfdeb0ca feat: use CDP's auto-attach mechanism (#8520)
* feat: use CDP's auto-attach mechanism

In this PR, we refactor Puppeteer to make use of the CDP's auto-attach mechanism. This allows the backend to pause
new targets and give Puppeteer a chance to configure them properly. This fixes the flakiness related to dealing with
OOPIFs and should fix some other issues related to the network interception and navigations. If those are not fixed completely by this PR, the PR serves a solid base for fixing them.

Closes https://github.com/puppeteer/puppeteer/issues/8507, https://github.com/puppeteer/puppeteer/issues/7990
Unlocks https://github.com/puppeteer/puppeteer/issues/3667

BREAKING CHANGE: With Chromium, Puppeteer will now attach to page/iframe targets immediately to allow reliable configuration of targets.
2022-08-02 13:18:07 +00:00
release-please[bot]
a654607c74
chore(main): release 15.5.0 (#8683)
* chore(main): release 15.5.0

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-21 14:25:48 +00:00
Alex Rudenko
f1b8ad3269
feat(chromium): roll to Chromium 105.0.5173.0 (r1022525) (#8682) 2022-07-21 13:16:47 +00:00
release-please[bot]
a43965a4b6
chore(main): release 15.4.2 (#8681)
* chore(main): release 15.4.2

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-21 12:22:40 +00:00
Alex Rudenko
2abb9f0c14
fix: taking a screenshot with null viewport should be possible (#8680)
Closes #8673
2022-07-21 10:34:18 +02:00
release-please[bot]
d734c14813
chore(main): release 15.4.1 (#8678)
* chore(main): release 15.4.1

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-21 09:35:51 +02:00
jrandolf
34ab5ca503
fix: import URL (#8670) 2022-07-21 08:20:51 +02:00
release-please[bot]
f0c28085c0
chore(main): release 15.4.0 (#8668)
* chore(main): release 15.4.0

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-13 15:52:23 +02:00
Alex Rudenko
af08c5c903
feat: expose the page getter on Frame (#8657)
* feat: expose the page getter on Frame

Closes #8654

* test: add a test
2022-07-11 21:06:35 +02:00
release-please[bot]
dd27559090
chore(main): release 15.3.2 (#8647)
* chore(main): release 15.3.2

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-08 09:58:30 +02:00
Asen Bozhilov
b47f066c2c
fix(page): fix page.#scrollIntoViewIfNeeded method (#8631)
This patch fixes page.#scrollIntoViewIfNeeded, so that it works with devtools protocol.
Now it blocks the main thread and waits until the scrolling action finishes in Chrome.
Fallbacks to the old implementation if `DOM.scrollIntoViewIfNeeded` is not supported for Firefox.

Issues: #8627, #1805
2022-07-08 06:53:45 +00:00
Alex Rudenko
1de0383abf
fix: cache dynamic imports (#8652) 2022-07-07 21:09:07 +02:00
Alex Rudenko
d0c4291995
fix: expose a RemoteObject getter (#8642)
Closes #8639
2022-07-07 13:04:28 +00:00
release-please[bot]
ec8c750383
chore(main): release 15.3.1 (#8635)
* chore(main): release 15.3.1

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-06 09:24:46 +02:00
jrandolf
5ff205dc8b
fix: extends ElementHandle to Nodes (#8552)
* fix: extends `ElementHandle` to `Node`s (#8552)
2022-07-06 09:05:37 +02:00
release-please[bot]
01c76b7eb1
chore(main): release 15.3.0 (#8606)
* chore(main): release 15.3.0

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-01 17:02:54 +02:00
jrandolf
066f440ba7
feat: add documentation (#8593) 2022-07-01 11:52:39 +00:00
release-please[bot]
51ae338acd
chore(main): release 15.2.0 (#8585)
* chore(main): release 15.2.0

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-29 14:25:40 +02:00
Alex Rudenko
468ea8fca1
chore: expose Connection methods relevant for extension (#8594) 2022-06-28 14:48:29 +02:00
Levi Pesin
79e11985ba
feat: add fromSurface option to page.screenshot (#8496) 2022-06-27 12:37:37 +00:00
jrandolf
e499515fd6
chore: add type tests (#8588) 2022-06-27 10:57:31 +02:00
jrandolf
7001322cd1
feat: export public types only (#8584) 2022-06-27 09:24:23 +02:00
Pablo Matías Gomez
9787a1d8df
fix: clean up tmp profile dirs when browser is closed (#8580)
* fix: clean up tmp profile dirs when browser is closed
2022-06-27 07:40:30 +02:00
release-please[bot]
5849c9beb4
chore(main): release 15.1.1 (#8577)
* chore(main): release 15.1.1

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-25 13:33:44 +02:00
Randolf J
e0198a79e0 fix: export ElementHandle 2022-06-25 13:28:50 +02:00
release-please[bot]
5fda494543
chore(main): release 15.1.0 (#8573)
* chore(main): release 15.1.0

* chore: freeze version on docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-24 18:42:31 +02:00
Alex Rudenko
fb7d31e369
feat(chromium): roll to Chromium 104.0.5109.0 (r1011831) (#8569)
* feat(chromium): roll to Chromium 104.0.5109.0 (r1011831)

* test: update a11y test expectations
2022-06-24 14:13:31 +00:00
release-please[bot]
a23cac77f5
chore(main): release 15.0.2 (#8571)
* chore(main): release 15.0.2

* chore: freeze version on docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-24 15:30:28 +02:00
Alex Rudenko
383e855847
fix: CSS coverage should work with empty stylesheets (#8570)
Closes #8535
2022-06-24 14:17:16 +02:00
release-please[bot]
d15f2239b9
chore(main): release 15.0.1 (#8565)
* chore(main): release 15.0.1

* chore: freeze version on docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-24 09:42:02 +02:00
jrandolf
8100cbb295
fix: infer unioned handles (#8562) 2022-06-24 06:40:08 +00:00
release-please[bot]
9705797a02
chore(main): release 15.0.0 (#8555)
* chore(main): release 15.0.0

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-06-23 13:38:28 +02:00
jrandolf
ec79f3a58a
feat: add experimental client to HTTPRequest (#8556) 2022-06-23 13:20:42 +02:00
jrandolf
ebcb8a2760
chore: split JSHandle.ts (#8551) 2022-06-23 11:31:43 +02:00
jrandolf
26c3acbb07
feat!: type inference for evaluation types (#8547)
This PR greatly improves the types within Puppeteer:

- **Almost everything** is auto-deduced.
  - Parameters don't need to be specified in the function. They are deduced from the spread.
  - Return types don't need to be specified. They are deduced from the function. (More on this below)
  - Selections based on tag names correctly deduce element type, similar to TypeScript's mechanism for `getElementByTagName`.
- [**BREAKING CHANGE**] We've removed the ability to declare return types in type arguments for the following reasons:
  1. Setting them will indubitably break auto-deduction.
  2. You can just use `as ...` in TypeScript to coerce the correct type (given it makes sense).
- [**BREAKING CHANGE**] `waitFor` is officially gone.

To migrate to these changes, there are only four things you may need to change:
- If you set a return type using the `ReturnType` type parameter, remove it and use `as ...` and `HandleFor` (if necessary).
 `evaluate<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluate(a, b) => {...}, a, b)) as ReturnType`
 `evaluateHandle<ReturnType>(a: number, b: number) => {...}, a, b)`
 `(await evaluateHandle(a, b) => {...}, a, b)) as HandleFor<ReturnType>`
- If you set any type parameters in the *parameters* of an evaluation function, remove them.  
 `evaluate(a: number, b: number) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
- If you set any type parameters in the method's declaration, remove them.
 `evaluate<(a: number, b: number) => void>((a, b) => {...}, a, b)`
 `evaluate(a, b) => {...}, a, b)`
2022-06-23 11:29:46 +02:00
jrandolf
347101883f
chore: split Launcher.ts (#8544) 2022-06-23 00:13:39 +02:00
jrandolf
70c7f64a58
chore: freeze revisions (#8543) 2022-06-22 15:56:43 +02:00
jrandolf
84712cbc28
chore: use Google's TS style guide's format config (#8542) 2022-06-22 15:25:44 +02:00
release-please[bot]
3d1ec573fb
chore(main): release 14.4.1 (#8523) 2022-06-17 15:29:28 +02:00
James Diefenderfer
6cd5cd0439
fix: avoid instanceof Object check in isErrorLike (#8527) 2022-06-17 15:26:18 +02:00
jrandolf
ce0dd25349
chore: use braces in function bodies (#8525) 2022-06-15 12:42:21 +02:00
jrandolf
570087ea94
chore: use strict typing in tests (#8524)
* The testing tsconfig.json inherits from the base TS config.
  * A lot of type assertions have been inserted...a lot.
* All testing utilities have migrated to TS.
* text-diff is being replaced with diff for TS compatibility.
* ProtocolError has been added to PuppeteerErrors and PuppeteerErrors is no longer a record (it's been frozen).
* Fixes a small bug where null was an allowable media type in emulation (should be undefined).
2022-06-15 12:09:22 +02:00
jrandolf
80373f7a12
chore: use composite builds for tests (#8522) 2022-06-15 12:05:25 +02:00
Randolf J
cba58a12c4 fix: export devices, errors, and more
This commits exports `devices`, `errors`, and `networkConditions`.
2022-06-14 20:56:14 +02:00
jrandolf
e6442dd767
chore: use curly (#8519) 2022-06-14 13:55:35 +02:00