Commit graph

72 commits

Author SHA1 Message Date
Max Schmitt c4eb2d4b1e
chore: move sdkLanguage over to the protocol init call (#8329) 2021-08-20 21:32:21 +02:00
Dmitry Gozman 0742cb9076
chore: move working with browser channels to Registry Executables (#7581) 2021-07-13 19:03:49 -07:00
Dmitry Gozman 57c5e4d8cf
chore: replace Registry api with Executable list (#7544) 2021-07-13 15:57:40 -07:00
Dmitry Gozman 65606c093a
chore: simplify Registry api (#7451) 2021-07-09 16:10:23 -07:00
Max Schmitt 894ff15e65
Revert "chore(eval): merge internal evaluate functions (#7517)" (#7535)
This reverts commit 7a5ef0d157.
2021-07-09 16:19:42 +02:00
Joel Einbinder 7a5ef0d157
chore(eval): merge internal evaluate functions (#7517) 2021-07-08 23:55:01 -07:00
Max Schmitt 08da9d207e
chore: move processLauncher into src/utils (#7504) 2021-07-07 21:14:16 +02:00
Pavel Feldman 8fb0454488
fix(trace-viewer): fall back to stable channels (#7429) 2021-07-01 15:26:55 -07:00
Yury Semikhatsky c0cd2d4579
feat: response interception (#7122) 2021-06-18 11:04:48 -07:00
Dmitry Gozman 6eeafc171b
fix(chromium): fix a race when intialization does not finish before page close (#6975)
This is exposed by the flaky "should report new window downloads" test.
In this test a new page is created, initialized and closed before initialization
finishes. If `lifecycleEventsEnabled` fails with "Target closed error",
we correctly ignore the initialization failure, but a single usage of the
failed promise with `.then` fails anyway.
2021-06-08 17:28:16 -07:00
Joel Einbinder 8960584b78
fix(chromium): drag and drop works in chromium (#6207)
Waiting for #6203 to percolate to the cdn. But this all works locally.

Fixes #1094
2021-06-07 10:27:34 -07:00
Yury Semikhatsky a96491cbbb
feat(downloads): subscribe to download events in Browser domain instead of Page (#6082) 2021-06-04 09:54:29 -07:00
Dmitry Gozman 837ee08a53
fix(waitForSelector): retry when context is gone during node adoption (#6851)
There is a small window after finishing the "rerunnable task" where
we adopt the node to the main world and navigation could destroy the context.
2021-06-02 20:17:24 -07:00
Max Schmitt ba29e99ace
feat: added reduced motion media query emulation (#6646) 2021-05-22 01:56:09 +02:00
Yury Semikhatsky b94643786b
fix: wait for ffmpeg to finish writing even if page was closed (#6648) 2021-05-18 22:29:39 -07:00
Pavel Feldman d08c50d277
feat(screencast): scale fixes (#6475) 2021-05-11 13:21:01 -07:00
Pavel Feldman 85e2db2416
chore: push dispatcher guid into object, reuse it in trace (#6250) 2021-04-20 23:03:56 -07:00
Yury Semikhatsky f3b44d18be
fix(screencast): wait for ffmpeg to finish before reporting video (#6167) 2021-04-09 14:09:45 -07:00
Yury Semikhatsky 53d50f9b72
fix(screencast): properly stop screencast on context closure (#6146) 2021-04-08 14:01:05 -07:00
Pavel Feldman d9546fd098
chore: read all traces from the folder (#6134) 2021-04-08 07:59:05 -07:00
Pavel Feldman d0db4f6737
feat: include screencast in trace (#6128) 2021-04-07 14:32:12 -07:00
Pavel Feldman 0dfde2e975
fix(screenshot): never throw page is navigating (#6103) 2021-04-06 16:01:38 -07:00
Yury Semikhatsky 561cb23e8d
fix: dispatch popup event on the client end (#6044) 2021-04-02 11:15:07 -07:00
Dmitry Gozman 9d9599c6a6
api(video): implement video.saveAs and video.delete (#6005)
These methods are safe to call while the page is still open, or when it is
already closed. Works in remotely connected browser as well.

Also makes video.path() to throw for remotely connected browser.

Under the hood migrated Download and Video to use the common Artifact object.
2021-03-31 10:38:05 -07:00
Dmitry Gozman 98f1f715c5
chore: ensure we emit Page event before resoliving pageOrError (#6012)
Internal callers of pageOrError should be able to rely on the
Page being already reported.
2021-03-30 17:35:42 -07:00
Pavel Feldman f1c0d09765
feat(size): emulate window.screen size (#5967) 2021-03-29 14:10:58 -07:00
Dmitry Gozman 6b3f4cd12b
chore: calculate video size in a single place (#5942) 2021-03-24 10:56:20 -07:00
Dmitry Gozman 8e97607389
fix(viedo): do not stall video in popups (#5941)
There are two problems, exposed by existing tests:

- We do not send Page.startScreeencast before Runtime.runIfWaitingForDebugger
  because we launch video recorder in between. This stalls when the page is busy
  immediately after resuming, e.g. with alert().
  Fixed by starting video recorder in advance.

- We wait for the first frame that may not come - for example, context-wide interception
  is blocking essential resource and first frame.
  Fixed by only waiting for the first frame before reporting the video, not the page.
2021-03-24 09:36:46 -07:00
Yury Semikhatsky 67c29e8155
chore: add missing await to floating promises (#5813) 2021-03-22 09:59:39 -07:00
Pavel Feldman 2367039a2c
chore(stable): throw user-friendly message when ffmpeg is missing (#5865) 2021-03-17 19:19:44 -07:00
Pavel Feldman 7011e5737a
chore(evaluate): explicitly annotate methods that wait for signals (#5859) 2021-03-17 10:47:07 -07:00
Dmitry Gozman ff243f1af5
fix(addInitScript): make it work on new pages without navigations (#5675) 2021-03-02 16:03:48 -08:00
Joel Einbinder d8f637c239
chore(typescript): enable esModuleInterop (#5409) 2021-02-11 06:36:15 -08:00
Pavel Feldman 2e01fbdbec
chore: introduce instrumentation api (#5385) 2021-02-09 14:44:48 -08:00
Pavel Feldman 0652f3251f
chore: introduce sdk object base class (#5370) 2021-02-09 09:00:00 -08:00
Andrey Lushnikov d499cf08d1
refactor: remove browserPaths in favor of Registry class (#5318)
This patch introduces a new Registry class that incapsulates
all logic regarding browsers and their paths.

Fixes #5278
2021-02-08 16:02:49 -08:00
Dmitry Gozman de30ee0aa8
fix(oopifs): account for various races between processes (#5320)
Consider the following situation (one among many possible).
- FrameA has an oopif child FrameB;
- FrameA navigates to same-process origin (e.g. about:blank);
- at the same time, FrameC is attached to the FrameB in the
  FrameB's process.

In this case, we get `frameNavigated` event for FrameA, immediately
followed by `frameAttached` event for FrameC. Since we detach all
FrameA's child frames on navigation, including the oopif FrameB,
there is no parent frame for FrameC to attach to.

In general, multiple processes coming from oopif may send their
events in wildly different order, and their view about the frame
tree may not always correspond to the "up to date" frame tree as
seen from the main frame's process. We try to keep our frame tree
aligned with what main process thinks, and ignore events that
reference frames absent in this tree.

Drive-by: handle filechooser exceptions because of async processing.
2021-02-05 11:30:44 -08:00
Andrey Lushnikov cb1b64289c
devops: downloading ffmpeg during install step (#5249)
This patch starts downloading FFMPEG like we download our browsers
instead of bundling it in the NPM package.

With this patch, NPM size is reduced from 8.8MB to 1.7MB.

Consequences:
- `npx playwright` is drastically faster now
- playwright driver for language bindings is way smaller
- projects that bundle Playwright can pass Apple Notorization

Fixes #5193
2021-02-03 09:19:11 -08:00
Dmitry Gozman 4cad34509f
fix(oopifs): do not emulate focus in oopifs (#5270)
- We don't need this, since it should propagate from the main frame.
- Forcing focus in oopif immediately focuses it and blurs currently
  focused frame. This leads to undesired side effects, e.g. selects
  being closed.
2021-02-03 08:47:52 -08:00
Dmitry Gozman 9e09bd369d
fix(oopifs): ignore target closure when broadcasting across oopifs (#5246) 2021-02-02 10:21:42 -08:00
Pavel Feldman bf8c30a88b
feat(ui): extract recorder sidebar into a window (#5223) 2021-01-31 16:37:13 -08:00
Pavel Feldman 975519150e
chore: centralize playwright creation, bind context listeners to instance (#5217) 2021-01-29 16:00:56 -08:00
Pavel Feldman 2e290be40b
chore: remove source maps in pwdebug mode (#5148) 2021-01-25 16:36:57 -08:00
Dmitry Gozman afaec552dd
feat(trace): show dialogs, navigations and misc events (#5025) 2021-01-15 18:30:55 -08:00
Yury Semikhatsky 0a2fe62cb7
fix(extensions): do not enable screencast for background pages (#4919) 2021-01-06 15:08:28 -08:00
Joel Einbinder ea833daa89
chore: fix internal binding (#4598) 2020-12-08 08:38:29 -08:00
Joel Einbinder 3624e3e315
chore: add internal method for utility context bindings (#4566)
* internal binding extracted from dnd patch

* refactor it into the page

* dgozman comments 1
2020-12-02 13:43:16 -08:00
Dmitry Gozman aea106b28e
chore: simplify server screencast code (#4501)
Currently, we always throw from FrameSession._stopScreencast
when not running with video, and immediately catch it in
CRPage.didClose (thanks to debugger to point that).

Overall, we have code prepared for start/stop API, which
we never did, so it makes sense to simplify code a bit,
and throw if something goes wrong.
2020-11-19 19:26:53 -08:00
Dmitry Gozman 38fadcaded
fix(chromium): use frameDetached reason (#4468)
This fixes the local -> remote frame swap when
Page.frameDetached arrives before Target.attachedToTarget.

Instead of error-prone logic we do currently, new CDP exposes
frame detach reason that we can use.
2020-11-17 10:24:13 -08:00
Pavel Feldman b0d174fd9a
revert: lifecycle refactoring, it breaks setContent (#4420) 2020-11-12 16:13:55 -08:00