Commit graph

31 commits

Author SHA1 Message Date
Andrey Lushnikov 182a71f254 cherry-pick(#23695): chore: miscellaneous trace viewer fixes
- properly annotate continued requests
- nest `attach` steps inside the related `expect` step
- fix primary-id-to-non-primary-id mapping
- make sure images in trace are not draggable

Fixes #23693

---------

Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-06-14 09:37:55 -07:00
Pavel Feldman 7579572688
chore: unflake the network status test (#23551) 2023-06-06 16:55:53 -07:00
Pavel Feldman 5a14619bab
chore: render route markers in the trace network panel (#23476)
Fixes https://github.com/microsoft/playwright/issues/23040


![net](https://github.com/microsoft/playwright/assets/883973/5191163e-63f9-4999-9197-d10dcd09a665)
2023-06-02 13:00:27 -07:00
Dmitry Gozman d458e84f5b
feat(route): match pattern on the server side (#20410)
This avoids client-side roundtrip for requests that are not handled by
any route.

Fixes #19607.
2023-01-27 10:43:19 -08:00
Yury Semikhatsky 72a24973f3
fix: ignore timing data when request served from memory cache (#17595)
`Response.timing` contains stale data when the request is served from
memory cache, in that we should ignore it and return -1 where we don't
know the value.

Fixes https://github.com/microsoft/playwright-java/issues/1080
2022-09-26 17:12:47 -07:00
Pavel Feldman df143031e7
chore: move protocol and trace types into the top-level packages (#17486) 2022-09-20 18:41:51 -07:00
Yury Semikhatsky 01d83f1d5e
fix(har): record request overrides to har (#17027) 2022-09-04 10:52:20 -07:00
Max Schmitt 7e2aec7454
chore: align more ESLint rules with VSCode formatting (#16647) 2022-08-18 20:12:33 +02:00
Pavel Feldman 5fd6ce4de0
chore: allow aborting in-flight routes on context reuse (#15460) 2022-07-07 13:07:09 -07:00
Ross Wollman 6cb3236acd
feat(chromium): Service Worker Network Instrumentation and Inspection (#14716)
Adds Chromium support for Service Worker Networking (interception/routing, Request/Response events, and HAR).

Resolves #1090.
Depends on #14714 and #14714.
Supercedes #14321.
Follow up #14711.

Landed upstream patches:
- https://chromium-review.googlesource.com/c/chromium/src/+/3510917
- https://chromium-review.googlesource.com/c/chromium/src/+/3526571
- https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3566669
- https://chromium-review.googlesource.com/c/chromium/src/+/3544685
- https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3610924
- https://chromium-review.googlesource.com/c/chromium/src/+/3689949
2022-07-01 12:49:43 -07:00
Dmitry Gozman ff2647cfa3
fix(network): remove races from sizes calculation (#15208)
- Do not resolve raw headers upon `loadingFinished`, since they may still come later in
  `responseReceivedExtraInfo`.
- Introduce separate promises for `encodedBodySize`, `transferSize` and `responseHeadersSize`.
- Make sure we resolve each of them either with data available
  from the browser, or a fallback calculation.
- Set raw response headers for redirects on WebKit.
- Do not stall on cached responses in Chromium, they have erroneously set `hasExtraInfo` flag.
- Use `transferSize` that is available in Firefox protocol.
2022-06-29 18:11:22 -07:00
Dmitry Gozman 660516d22a
fix(network): make allHeaders wait until all headers are available (#15094)
fix(network): make allHeaders wait until all header are available

Before, calling `allHeaders()` from `page.on('request')` would yield
provisional headers instead.

With these changes:
- In Firefox, all headers are available immediately.
- In Chromium, all headers are available upon requestWillBeSentExtraInfo.
- In WebKit, all headers are available upon responseReceived.
- In all browsers, intercepted requests use "provisional" headers
  as all headers, since there is no network stack to change the headers.

Drive-by: migrated Chromium to `hasExtraInfo` flags that simplifies
the logic quite a bit.
2022-06-24 13:51:09 -07:00
Dmitry Gozman 6af6fab84a
fix(har): internal redirect in renderer-initiated navigations (#15000)
fix(har): internal redirect in renderer-initiated navigations
2022-06-21 11:01:01 -07:00
Yury Semikhatsky ed6b14f0f4
fix(har): restart redirected navigation (#14939) 2022-06-17 21:17:30 -07:00
Dmitry Gozman 06c8d8e31c
chore: use channels types instead of a copy in server (#14874)
This is to avoid duplicating types for no reason.
2022-06-14 22:02:15 -07:00
Ross Wollman fccee89b41
feat: add Response.fromServiceWorker flag (#14715)
Resolves #14666.

Relates #1090.
Supercedes #14321.
2022-06-08 17:34:19 -04:00
Pavel Feldman e79b90f454
chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
Pavel Feldman 40d5e3a3c9
chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
Pavel Feldman dbafe3bb4e
chore: use utils via index export (1) (#13398) 2022-04-07 13:26:50 -07:00
Pavel Feldman 5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Yury Semikhatsky 7d7fe3c618
fix(route): remove cors option, compare origin (#13231) 2022-03-31 19:21:21 -07:00
Yury Semikhatsky 5734c18ef8
feat(route): add cors header in route.fulfill (#12943) 2022-03-25 14:56:57 -07:00
Ross Wollman 39376cccd8
fix: allow unnamed cookies (#12991)
Fixes #12808.
2022-03-23 15:50:43 -07:00
Max Schmitt b2e3357613
chore: throw error if setCookies expires value is not valid (#12470) 2022-03-02 23:10:40 +01:00
Yury Semikhatsky 2d7ec26dc2
fix(fetch): send secure cookies for http://localhost requests (#12450) 2022-03-02 09:33:30 -08:00
Yury Semikhatsky d305a2ab3f
fix: throw in route.continue if it is called twice (#11701) 2022-01-27 14:58:02 -08:00
Max Schmitt 0b120c7f03
fix: use HTTP/2.0 instead of h2 as Response.httpVersion (#10812) 2021-12-10 11:24:52 -08:00
Dmitry Gozman b8b6c7a220
fix(chromium): websocket handshake comes twice (#10518)
Sometimes we get "Network.webSocketWillSendHandshakeRequest" in Chromium.
Perhaps websocket is restarted because of chrome.webRequest extensions api?
Or maybe the handshake response was a redirect?

This reports websocket twice and triggers an assert.
2021-11-24 10:46:32 -08:00
Max Schmitt c5b19351f6
chore: rename Fetch Request/Response to API (#10087) 2021-11-05 16:27:49 +01:00
Yury Semikhatsky 5abb5d74ea
chore: delete legacy response interception code (#9995) 2021-11-02 17:48:38 -07:00
Joel Einbinder c89d5a50dd
chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
Renamed from src/server/network.ts (Browse further)