Commit graph

60 commits

Author SHA1 Message Date
Pavel Feldman 2ede4bce12
chore: further unify launching and connection (#2320) 2020-05-21 09:43:10 -07:00
Pavel Feldman f9b437a49e
chore: pull common functionality into the BrowserTypeBase (#2312) 2020-05-20 16:30:04 -07:00
Dmitry Gozman 48440f7ed7
test: unflake fixtures test (#2313)
Drive-by: ensure we call onkill before manually exiting the process.
2020-05-20 14:58:27 -07:00
Pavel Feldman e558f0516b
chore: print the launch error message to console (#2304) 2020-05-20 00:10:10 -07:00
Dmitry Gozman 7efc22c062
fix(chromium): websocket wrapper leaks child sessions (#2291)
When a parent session is detached, we do not always get Target.detachedFromTarget
for child sessions. This is especially true when the socket disconnects, leaving
all child sessions in the maps.

Flakily reproducible by browserType.connect multiclient tests.
2020-05-19 15:02:13 -07:00
Dmitry Gozman 481643409e
feat(debug): persist devtools preferences in Chromium (#2266)
We store devtools-preferences.json file in the downloaded browser directory.
2020-05-19 14:55:11 -07:00
Dmitry Gozman 82cab094e8
feat(logging): add logging to websocket transport (#2289) 2020-05-18 19:00:38 -07:00
Dmitry Gozman e8e761f77f
chore: use internal BrowserOptions to unify browsers (#2230) 2020-05-14 13:22:33 -07:00
Yury Semikhatsky f10e8c4d47
chore(chromium): nicer error when running as root without --no-sandbox (#2214) 2020-05-12 16:43:15 -07:00
Dmitry Gozman a2bee2ca73
fix(launch): handle timeout and exceptions during launch (#2185) 2020-05-11 15:00:13 -07:00
Dmitry Gozman 8c083486a0
fix(launch): handle websocket connect exceptions (#2184) 2020-05-11 13:49:57 -07:00
Dmitry Gozman ae8d97cdf9
feat(persistent context): ensure initial about:blank (#2161)
We declare only the initial about:blank to be a supported usecase, so that
we can support options for the default context in the future.
2020-05-10 15:23:53 -07:00
Pavel Feldman 710c156d48
fix(chromium): disable same site by default and improved controls (#2097) 2020-05-04 13:43:44 -07:00
Pavel Feldman 2cdf297245
chore: remove uncompiled download-browser (#2018) 2020-04-28 17:06:01 -07:00
Pavel Feldman 2fcc2b5552
chore(chromium): resize browser frame when emulating viewport (#1924) 2020-04-23 10:38:58 -07:00
Pavel Feldman 5b085fdf03
feat(logger): introduce context-level logger (#1896) 2020-04-20 23:24:53 -07:00
Pavel Feldman 1f43ae692f
feat(logging): introduce logger sink api (#1861) 2020-04-20 07:52:26 -07:00
Yury Semikhatsky c359116a3b
fix: create _defaultContext only in persistent mode (#1854) 2020-04-18 19:58:11 -07:00
Pavel Feldman 022bc67c07
chore(chromium): allow passing --remote-debugging-port for debugging (#1857) 2020-04-18 19:06:42 -07:00
Andrey Lushnikov e15fc08d46
chore: migrate node types to 10.17.17 (#1690) 2020-04-07 07:40:57 -07:00
Pavel Feldman 75571e8eb8
feat(downloads): support downloads on cr and wk (#1632) 2020-04-02 17:56:14 -07:00
Joel Einbinder 3d6d9db44a
fix: wait for the process to close when closing the browser (#1629) 2020-04-02 16:57:12 -07:00
Pavel Feldman e241c1bef8
chore: remove web mode (#1625) 2020-04-01 14:42:47 -07:00
Joel Einbinder 6053784188
feat: add missing slowMo to launchPersistentContext (#1597)
`slowMo` was missing in `launchPersistentContext`, and I refactored the types a bit.
2020-03-31 16:34:59 -07:00
Andrey Lushnikov 950d427927
fix: catch websocket error events (#1595) 2020-03-30 18:18:38 -07:00
Pavel Feldman 1f08b72a27
test: add web socket leak test coverage (#1586) 2020-03-30 13:49:52 -07:00
Pavel Feldman 5499b1844d
feat(websocket): wrap firefox web socket too (#1580) 2020-03-28 10:14:59 -07:00
Pavel Feldman 48516ed7ed
feat(websocket): use proxy web socket on chromium (#1573) 2020-03-27 15:18:34 -07:00
Pavel Feldman 00cb4e370f
chore: move transport to object messages (#1567) 2020-03-26 23:30:55 -07:00
Joel Einbinder 825555cddf
types: better types (#1166)
This generates typescript definitions based on the api.md, instead of autogenerating them from the typescript source code.

Now types
 - only include the public api
 - work with older versions of typescript
 - include descriptions
 - are more consistent
 - are more complete

#6
2020-03-20 01:30:35 -07:00
Andrey Lushnikov f5ecbff16e
devops: remake downloading logic (#1419)
This patch:
- removes `browserType.downloadBrowserIfNeeded()` method. The method
  turned out to be ill-behaving and cannot not be used as we'd like to (see #1085)
- adds a `browserType.setExecutablePath` method to set a browser
  exectuable.

With this patch, we take the following approach towards managing browser downloads:
- `playwright-core` doesn't download any browsers. In `playwright-core`, `playwright.chromium.executablePath()` returns `null` (same for firefox and webkit).
- clients of `playwright-core` (e.g. `playwright` and others) download browsers one way or another.
They can then configure `playwright` with executable paths and re-export the `playwright` object to their clients.
- `playwright`, `playwright-firefox`, `playwright-chromium` and `playwright-webkit` download 
browsers. Once browsers are downloaded, their executable paths are saved to a `.downloaded-browsers.json` file. This file is read in `playwright/index.js` to configure browser executable paths and re-export the API.
- special case is `install-from-github.js` that also cleans up old browsers.
2020-03-19 11:43:35 -07:00
Dmitry Gozman 9b86c631c8
api: make BrowserContext.pages() synchronous (#1369)
Returns all pages which have been initialized already.

References #1348.
2020-03-13 11:33:33 -07:00
Pavel Feldman 9aa56a6b9e
api(browserType): remove devices, errors (#1368) 2020-03-12 17:58:00 -07:00
Pavel Feldman b43f33f4d3
api(review): misc changes to API. (#1356) 2020-03-11 18:10:48 -07:00
Yury Semikhatsky 9bd3711394
fix(context): reliably fire BrowserContext.Close event when browser is closing (#1277) 2020-03-09 16:53:33 -07:00
Dmitry Gozman e5f82af47c
api(popups): emit PageEvent immediately, and resolve page() once initialized (#1229)
This way we do not miss any popups, even immediately closed ones.
2020-03-05 15:18:27 -08:00
Yury Semikhatsky e770d706a1
fix(chromium): do not create default page and context in headless (#1247) 2020-03-05 14:46:12 -08:00
Yury Semikhatsky 665888d579
feat(popups): auto-attach to all pages in Chromium (#1226) 2020-03-05 10:45:32 -08:00
Yury Semikhatsky 31e26a2208
fix(api): fire BrowserContext.Page event in WebKit and Firefox (#1186) 2020-03-02 18:32:56 -08:00
Yury Semikhatsky a57978a5f0
api(chromium): remove Target from public API (#1163) 2020-03-02 13:58:22 -08:00
Yury Semikhatsky f242e0c74f
fix: make Transport.send() synchronous (#1177) 2020-03-02 13:51:32 -08:00
Andrey Lushnikov 08fbc92752
feat: support PLAYWRIGHT_DOWNLOAD_HOST (#1179)
This patch starts respecting `PLAYWRIGHT_DOWNLOAD_HOST` env variable
in `playwright` package and it's vendored flavors (`playwright-firefox`,
`playwright-chromium` and `playwright-webkit`).

Fixes #1045
2020-03-02 13:45:10 -08:00
Pavel Feldman dc161df063
fix(launch): throw upon page argument when non-persistent (#1144) 2020-02-27 14:09:24 -08:00
Andrey Lushnikov 4ebf419259
fix(yarn): download browsers to package directories (#1133)
This patch makes it so all our packages, like `playwright` and
browser-specific flavors, download browsers to their
directories rather then using directory of `playwright-core`.

This way yarn@1 caches are not busted: they didn't expect that directory
content might change after packages's explicit install step
is failed, there's that was what we were doing.

Fixes #1085
2020-02-26 15:13:31 -08:00
Dmitry Gozman dcdc7db158
feat(chromium): use no-startup-window to not create default context (#1106) 2020-02-25 11:43:17 -08:00
Dmitry Gozman 6acc439450
feat(api): move targets from CRBrowser to CRBrowserContext (#1089)
This makes them work for default context.
2020-02-24 14:35:51 -08:00
Andrey Lushnikov f8f818f676 Revert "Revert "feat: do not wait for first page in non-persistent mode (#939)""
Apparently a good fix is coming: https://github.com/microsoft/playwright/pull/993/
Pavel want to re-revert.
2020-02-13 13:54:01 -08:00
Andrey Lushnikov 71892b4aaa Revert "feat: do not wait for first page in non-persistent mode (#939)"
This reverts commit a567123596.

Reason for revert: WK-Win fails to start if we start talking over the
pipe too early.
2020-02-13 13:44:58 -08:00
Dmitry Gozman a567123596
feat: do not wait for first page in non-persistent mode (#939) 2020-02-13 10:51:17 -08:00
Andrey Lushnikov d735de5347
feat: do not let users pass userDataDir to browserType.launch() (#974)
We now have a separate method for this - `browserType.launchPersistent`.
This will probably save our users quite some time.
2020-02-12 19:32:23 -08:00