Commit Graph

349 Commits

Author SHA1 Message Date
jrandolf
5a4eb38083
chore: move query selectors to injection script (#8980) 2022-09-19 13:22:10 +02:00
jrandolf
dda85944b8
chore: add licenses (#8978) 2022-09-19 12:49:13 +02:00
Alex Rudenko
cd09c3cee7
chore: refactor frame tree management (#8952)
This PR removes the strong references between
parent and child frames and stores the frame in a
lazy FrameTree with weak references.

Drive-by: fix --no-coverage flag in test runner
2022-09-16 05:35:51 +00:00
jrandolf
2a2af7134f
chore: incrementally erase cache on text change (#8961) 2022-09-15 18:48:55 +02:00
Alex Rudenko
fa084bcdcd
chore: extract CDPSession base class for easy mocking (#8950) 2022-09-15 13:50:12 +00:00
jrandolf
633e7cfdf9
feat: add text query handler (#8956) 2022-09-15 11:12:13 +00:00
Alex Rudenko
42cd6d04d6
chore: rerun tasks after the util handle has been evaluated (#8962) 2022-09-15 10:53:01 +02:00
jrandolf
64763e973b
chore: rename internal query handler (#8955) 2022-09-15 08:48:59 +02:00
jrandolf
7c4f41fadc
chore: use injections for wait tasks (#8943)
This PR refactors wait tasks to use injected scripts.
2022-09-15 08:22:20 +02:00
Alex Rudenko
db28203e64 chore: support WebDriver BiDi browser instances (#8932)
This PR adds a basic support for WebDriver BiDi that currently includes only the ability to establish a connection and shutdown the browser. Therefore, the implementation is marked as internal and won't show up in the changelog as it's barely useful at the moment.

The API classes are kept as classes instead of interfaces so that clients relying on instanceof checks still work.
2022-09-15 02:15:15 +02:00
Alex Rudenko
cfaaa5e2c0 fix: suppress init errors if the target is closed (#8947)
With #8520 Puppeteer is now aware of all targets it connects
to. In order to have a not flaky init, Puppeteer waits for
all existing targets to be configured during the connection process.
This does not work well in case of concurrent connections because
while one connection might initializing a target the other one
might be closed it. In general, that is expected because we
can only be eventually consistent about the target state but we
also should not crash the init if some targets have been closed.
This PR implements checks to see if the errors are caused by the
target or session closures and suppresses them if it's the case.
2022-09-15 02:15:00 +02:00
jrandolf
6fd05d963e
chore: use handle instead of globals for injection (#8946) 2022-09-13 14:06:40 +02:00
Alex Rudenko
27ccd0ae5e
docs: sort and group sidebar items (#8940)
Issues #8897, #8936
2022-09-12 13:00:37 +02:00
Connor Clark
7a2d9df146
docs: correct comment about anonymous script coverage urls (#8914) 2022-09-08 07:56:26 +02:00
smithc
0c577b9bf8
fix: add missing code coverage ranges that span only a single character (#8911) 2022-09-07 07:10:07 +00:00
Alex Rudenko
260e428227
fix: support scale for screenshot clips (#8908)
Closes #5329
2022-09-07 05:27:40 +00:00
Alex Rudenko
053d960fb5
fix: work around a race in waitForFileChooser (#8905)
Closes #6040
2022-09-06 17:03:56 +02:00
Alex Rudenko
6e7c6368d3
docs: fix example formatting in evaluateOnNewDocument (#8906) 2022-09-06 10:39:55 +00:00
Guillaume Gomez
32400954c5
fix: add Page.getDefaultTimeout getter (#8903)
Closes #8901
2022-09-05 17:43:39 +00:00
Alex Rudenko
7b42250c7b
fix: restore deferred promise debugging (#8895)
* fix: restore deferred promise debugging

* chore: strict types
2022-09-05 10:30:47 +02:00
jrandolf
2d50ec5b38
chore: add DeferredPromise to injection (#8883) 2022-09-01 18:44:59 +02:00
jrandolf
6b4a99fcfa
chore: migrate addStyleTag (#8879)
* chore: remove unnecessary type signature

* chore: fix tests

* chore: migrate `addStyleTag`

* chore: fix tests

* chore: fix tests
2022-09-01 17:52:08 +02:00
jrandolf
8f11237a67
chore: migrate addScriptTag (#8878) 2022-09-01 17:09:57 +02:00
Alex Rudenko
3732757450
fix: allow getting a frame from an elementhandle (#8875)
Libraries like pptr-testing-library and expect-puppeteer seem to
rely on it.
2022-08-31 19:57:02 +00:00
jrandolf
292216652b
chore: add injection framework (#8862)
* chore: add injection framework
2022-08-31 10:50:22 +02:00
jrandolf
9f5cb670e8
chore: consolidate deferred promise (#8863)
* fix: forward timeout waitForFileChooser

* chore: consolidate deferred promise

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2022-08-30 16:24:51 +02:00
Alex Maitland
8d95a9bc92
fix: typos in documentation (#8858)
- corder should be corner
2022-08-30 13:45:59 +02:00
jrandolf
1155c8eac8
fix!: remove root from WaitForSelectorOptions (#8848) 2022-08-26 12:55:30 +02:00
jrandolf
498fbf924c
chore: remove obsolete queryAllArray (#8847) 2022-08-25 21:29:56 +02:00
jrandolf
b49e742e30
chore: make execution context frame-independent (#8845) 2022-08-25 17:38:02 +02:00
jrandolf
2f33237d04
fix!: internalize execution context (#8844) 2022-08-25 17:02:44 +02:00
jrandolf
d070a73c46
chore: infer ElementHandle constructor params (#8843) 2022-08-25 17:01:30 +02:00
jrandolf
744a6e028a
chore: infer client from context in JSHandle (#8842) 2022-08-25 17:00:35 +02:00
jrandolf
5fba0dc932
chore: remove unnecessary constructor parameters (#8837) 2022-08-24 17:04:54 +02:00
Alex Rudenko
202ffce0aa
fix: remove deferred promise timeouts (#8835)
Issue #8832 makes a good point that we should not be making
implicit assumptions about the client's performance
when waiting for internal events. At the same time,
we want to be able to get the debug info if some promises
never resolve because of missing backend events.

This PR adds a variable to turn on timeouts for deferred
promises created using `createDebuggableDeferredPromise`.
We can use it in our tests to catch never-resolving
promises or when reproducing bug reports where Puppeteer
hangs indefinitely.

Closes #8832
2022-08-24 12:05:32 +02:00
Alex Rudenko
341b669a5e
fix: allow multiple navigations to happen in LifecycleWatcher (#8826)
There is no repro but it looks like sometimes the backend reports
two navigation requests. This PR changes the logic to allow that
instead of failing as it seems that failing is a bigger issue
than handling multiple navigation requests.

Closes #8811
2022-08-22 14:51:58 +00:00
jrandolf
b9b24cf963
chore: use deferred promises in web worker (#8824) 2022-08-22 14:03:45 +02:00
Alex Rudenko
2a0eefb99f
fix: handle service workers in extensions (#8807)
Closes #8800
2022-08-17 19:34:34 +02:00
jrandolf
51b2f0576d
chore: move Frame to Frame.ts (#8806) 2022-08-17 17:45:45 +02:00
jrandolf
bdcb748b98
chore: infrastructure for injecting scripts into DOMWorlds (#8801) 2022-08-17 14:39:41 +02:00
Alex Rudenko
3fad05d333
fix: custom sessions should not emit targetcreated events (#8788)
Closes #8787
2022-08-16 10:56:13 +00:00
jrandolf
65a5ce8464
fix: deprecate root in WaitForSelectorOptions (#8795) 2022-08-16 10:09:07 +02:00
jrandolf
8f612d5ff8
fix: deprecate waitForTimeout (#8793) 2022-08-16 08:24:25 +02:00
jrandolf
b5da718e2e
fix: deprecate ExecutionContext (#8792) 2022-08-16 08:22:45 +02:00
jrandolf
ddbe88b887
chore: add custom rule for formatting comments (#8777) 2022-08-12 14:15:26 +02:00
Alex Rudenko
23da97105c
chore: remove toStringTag (#8776) 2022-08-11 15:47:30 +02:00
jrandolf
a238f5758d
chore: refactor JSHandle and ExecutionContext (#8773) 2022-08-11 11:45:35 +02:00
Alex Rudenko
ee2540baef
fix: use targetFilter in puppeteer.launch (#8774)
Drive-by: adds Symbol.toStringTag to Target to simplify
debugging.

Closes #8772
2022-08-11 09:15:00 +00:00
jrandolf
d6a88a9768
chore: refactor FrameManager and fix docs (#8770) 2022-08-10 23:34:29 +02:00
Alex Rudenko
2580347b50
fix: resolve navigation flakiness (#8768)
Two main sources of flakiness addressed: 

1) we should dispose the lifecycle watcher after we waited for the navigation response (bad API? we need to refactor but I think it'd be valuable to stabilize tests first without too many changes).
2) we should wait for the navigation request's response if there is a navigation request in the watcher.

Closes #8644
2022-08-10 15:59:58 +00:00