playwright-core 1.56.0-alpha-1758839353000 → 1.56.0-alpha-2025-09-26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client/network.js
CHANGED
|
@@ -51,6 +51,7 @@ class Request extends import_channelOwner.ChannelOwner {
|
|
|
51
51
|
this._redirectedTo = null;
|
|
52
52
|
this._failureText = null;
|
|
53
53
|
this._fallbackOverrides = {};
|
|
54
|
+
this._hasResponse = false;
|
|
54
55
|
this._redirectedFrom = Request.fromNullable(initializer.redirectedFrom);
|
|
55
56
|
if (this._redirectedFrom)
|
|
56
57
|
this._redirectedFrom._redirectedTo = this;
|
|
@@ -66,6 +67,8 @@ class Request extends import_channelOwner.ChannelOwner {
|
|
|
66
67
|
responseStart: -1,
|
|
67
68
|
responseEnd: -1
|
|
68
69
|
};
|
|
70
|
+
this._hasResponse = this._initializer.hasResponse;
|
|
71
|
+
this._channel.on("response", () => this._hasResponse = true);
|
|
69
72
|
}
|
|
70
73
|
static from(request) {
|
|
71
74
|
return request._object;
|
|
@@ -2271,8 +2271,10 @@ import_validatorPrimitives.scheme.RequestInitializer = (0, import_validatorPrimi
|
|
|
2271
2271
|
postData: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBinary),
|
|
2272
2272
|
headers: (0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("NameValue")),
|
|
2273
2273
|
isNavigationRequest: import_validatorPrimitives.tBoolean,
|
|
2274
|
-
redirectedFrom: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Request"]))
|
|
2274
|
+
redirectedFrom: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Request"])),
|
|
2275
|
+
hasResponse: import_validatorPrimitives.tBoolean
|
|
2275
2276
|
});
|
|
2277
|
+
import_validatorPrimitives.scheme.RequestResponseEvent = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
|
|
2276
2278
|
import_validatorPrimitives.scheme.RequestResponseParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
|
|
2277
2279
|
import_validatorPrimitives.scheme.RequestResponseResult = (0, import_validatorPrimitives.tObject)({
|
|
2278
2280
|
response: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Response"]))
|
|
@@ -30,6 +30,7 @@ var import_dispatcher = require("./dispatcher");
|
|
|
30
30
|
var import_frameDispatcher = require("./frameDispatcher");
|
|
31
31
|
var import_pageDispatcher = require("./pageDispatcher");
|
|
32
32
|
var import_tracingDispatcher = require("./tracingDispatcher");
|
|
33
|
+
var import_network2 = require("../network");
|
|
33
34
|
class RequestDispatcher extends import_dispatcher.Dispatcher {
|
|
34
35
|
constructor(scope, request) {
|
|
35
36
|
const postData = request.postDataBuffer();
|
|
@@ -46,11 +47,13 @@ class RequestDispatcher extends import_dispatcher.Dispatcher {
|
|
|
46
47
|
postData: postData === null ? void 0 : postData,
|
|
47
48
|
headers: request.headers(),
|
|
48
49
|
isNavigationRequest: request.isNavigationRequest(),
|
|
49
|
-
redirectedFrom: RequestDispatcher.fromNullable(scope, request.redirectedFrom())
|
|
50
|
+
redirectedFrom: RequestDispatcher.fromNullable(scope, request.redirectedFrom()),
|
|
51
|
+
hasResponse: !!request._existingResponse()
|
|
50
52
|
});
|
|
51
53
|
this.reportedThroughEvent = false;
|
|
52
54
|
this._type_Request = true;
|
|
53
55
|
this._browserContextDispatcher = scope;
|
|
56
|
+
this.addObjectListener(import_network2.Request.Events.Response, () => this._dispatchEvent("response", {}));
|
|
54
57
|
}
|
|
55
58
|
static from(scope, request) {
|
|
56
59
|
const result = scope.connection.existingDispatcher(request);
|
package/lib/server/network.js
CHANGED
|
@@ -121,6 +121,11 @@ class Request extends import_instrumentation.SdkObject {
|
|
|
121
121
|
this._updateHeadersMap();
|
|
122
122
|
this._isFavicon = url.endsWith("/favicon.ico") || !!redirectedFrom?._isFavicon;
|
|
123
123
|
}
|
|
124
|
+
static {
|
|
125
|
+
this.Events = {
|
|
126
|
+
Response: "response"
|
|
127
|
+
};
|
|
128
|
+
}
|
|
124
129
|
_setFailureText(failureText) {
|
|
125
130
|
this._failureText = failureText;
|
|
126
131
|
this._waitForResponsePromise.resolve(null);
|
|
@@ -172,6 +177,7 @@ class Request extends import_instrumentation.SdkObject {
|
|
|
172
177
|
_setResponse(response) {
|
|
173
178
|
this._response = response;
|
|
174
179
|
this._waitForResponsePromise.resolve(response);
|
|
180
|
+
this.emit(Request.Events.Response, response);
|
|
175
181
|
}
|
|
176
182
|
_finalRequest() {
|
|
177
183
|
return this._redirectedTo ? this._redirectedTo._finalRequest() : this;
|