patchright-core 1.52.5 → 1.55.1
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/ThirdPartyNotices.txt +65 -123
- package/bin/reinstall_chrome_beta_mac.sh +1 -1
- package/bin/reinstall_chrome_stable_mac.sh +1 -1
- package/bin/reinstall_msedge_beta_mac.sh +1 -1
- package/bin/reinstall_msedge_dev_mac.sh +1 -1
- package/bin/reinstall_msedge_stable_mac.sh +1 -1
- package/browsers.json +14 -14
- package/index.js +1 -1
- package/lib/androidServerImpl.js +4 -2
- package/lib/browserServerImpl.js +47 -12
- package/lib/cli/program.js +116 -50
- package/lib/cli/programWithTestStub.js +1 -1
- package/lib/client/android.js +30 -34
- package/lib/client/browser.js +54 -17
- package/lib/client/browserContext.js +67 -71
- package/lib/client/browserType.js +25 -34
- package/lib/client/channelOwner.js +20 -24
- package/lib/client/connection.js +6 -10
- package/lib/client/electron.js +8 -3
- package/lib/client/elementHandle.js +18 -21
- package/lib/client/fetch.js +5 -3
- package/lib/client/frame.js +54 -32
- package/lib/client/input.js +3 -1
- package/lib/client/jsHandle.js +4 -0
- package/lib/client/localUtils.js +0 -1
- package/lib/client/locator.js +30 -26
- package/lib/client/network.js +5 -12
- package/lib/client/page.js +32 -32
- package/lib/client/playwright.js +6 -16
- package/lib/client/selectors.js +18 -38
- package/lib/client/timeoutSettings.js +12 -8
- package/lib/client/tracing.js +24 -20
- package/lib/client/waiter.js +2 -2
- package/lib/client/webSocket.js +4 -22
- package/lib/generated/bindingsControllerSource.js +28 -0
- package/lib/generated/clockSource.js +1 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/pollingRecorderSource.js +1 -1
- package/lib/generated/storageScriptSource.js +28 -0
- package/lib/generated/utilityScriptSource.js +1 -1
- package/lib/generated/webSocketMockSource.js +12 -50
- package/lib/inProcessFactory.js +9 -6
- package/lib/outofprocess.js +0 -2
- package/lib/protocol/validator.js +421 -345
- package/lib/protocol/validatorPrimitives.js +18 -4
- package/lib/remote/playwrightConnection.js +29 -166
- package/lib/remote/playwrightServer.js +233 -35
- package/lib/server/android/android.js +97 -83
- package/lib/server/android/backendAdb.js +0 -2
- package/lib/server/bidi/bidiBrowser.js +139 -73
- package/lib/server/bidi/bidiChromium.js +23 -22
- package/lib/server/bidi/bidiExecutionContext.js +2 -1
- package/lib/server/bidi/bidiFirefox.js +17 -14
- package/lib/server/bidi/bidiInput.js +22 -22
- package/lib/server/bidi/bidiNetworkManager.js +8 -11
- package/lib/server/bidi/bidiPage.js +42 -86
- package/lib/server/bidi/third_party/bidiProtocol.js +5 -133
- package/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/lib/server/{dispatchers/selectorsDispatcher.js → bidi/third_party/bidiProtocolPermissions.js} +20 -18
- package/lib/server/browser.js +30 -21
- package/lib/server/browserContext.js +203 -165
- package/lib/server/browserType.js +109 -107
- package/lib/server/chromium/chromium.js +84 -69
- package/lib/server/chromium/chromiumSwitches.js +13 -20
- package/lib/server/chromium/crBrowser.js +74 -40
- package/lib/server/chromium/crConnection.js +8 -9
- package/lib/server/chromium/crCoverage.js +11 -8
- package/lib/server/chromium/crDragDrop.js +25 -20
- package/lib/server/chromium/crExecutionContext.js +2 -1
- package/lib/server/chromium/crInput.js +32 -29
- package/lib/server/chromium/crNetworkManager.js +43 -31
- package/lib/server/chromium/crPage.js +98 -72
- package/lib/server/chromium/crServiceWorker.js +13 -18
- package/lib/server/chromium/videoRecorder.js +10 -18
- package/lib/server/clock.js +51 -39
- package/lib/server/codegen/csharp.js +10 -5
- package/lib/server/codegen/java.js +1 -1
- package/lib/server/codegen/javascript.js +1 -1
- package/lib/server/codegen/jsonl.js +2 -1
- package/lib/server/codegen/language.js +22 -1
- package/lib/server/codegen/languages.js +4 -4
- package/lib/server/codegen/python.js +1 -1
- package/lib/server/cookieStore.js +3 -1
- package/lib/server/debugController.js +105 -71
- package/lib/server/debugger.js +6 -23
- package/lib/server/deviceDescriptorsSource.json +237 -127
- package/lib/server/dialog.js +50 -6
- package/lib/server/dispatchers/androidDispatcher.js +77 -62
- package/lib/server/dispatchers/artifactDispatcher.js +18 -18
- package/lib/server/dispatchers/browserContextDispatcher.js +141 -91
- package/lib/server/dispatchers/browserDispatcher.js +55 -88
- package/lib/server/dispatchers/browserTypeDispatcher.js +18 -9
- package/lib/server/dispatchers/cdpSessionDispatcher.js +4 -4
- package/lib/server/dispatchers/debugControllerDispatcher.js +12 -21
- package/lib/server/dispatchers/dialogDispatcher.js +4 -4
- package/lib/server/dispatchers/dispatcher.js +78 -53
- package/lib/server/dispatchers/electronDispatcher.js +19 -20
- package/lib/server/dispatchers/elementHandlerDispatcher.js +83 -93
- package/lib/server/dispatchers/frameDispatcher.js +98 -101
- package/lib/server/dispatchers/jsHandleDispatcher.js +21 -16
- package/lib/server/dispatchers/jsonPipeDispatcher.js +4 -4
- package/lib/server/dispatchers/localUtilsDispatcher.js +53 -59
- package/lib/server/dispatchers/networkDispatchers.js +41 -35
- package/lib/server/dispatchers/pageDispatcher.js +156 -107
- package/lib/server/dispatchers/playwrightDispatcher.js +37 -25
- package/lib/server/dispatchers/streamDispatcher.js +15 -8
- package/lib/server/dispatchers/tracingDispatcher.js +22 -13
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +46 -35
- package/lib/server/dispatchers/writableStreamDispatcher.js +16 -10
- package/lib/server/dom.js +198 -266
- package/lib/server/download.js +3 -3
- package/lib/server/electron/electron.js +96 -103
- package/lib/server/electron/loader.js +1 -1
- package/lib/server/fetch.js +22 -41
- package/lib/server/fileUploadUtils.js +1 -1
- package/lib/server/firefox/ffBrowser.js +79 -55
- package/lib/server/firefox/ffExecutionContext.js +2 -1
- package/lib/server/firefox/ffInput.js +23 -23
- package/lib/server/firefox/ffNetworkManager.js +8 -6
- package/lib/server/firefox/ffPage.js +39 -36
- package/lib/server/firefox/firefox.js +9 -10
- package/lib/server/frameSelectors.js +63 -20
- package/lib/server/frames.js +495 -555
- package/lib/server/har/harRecorder.js +1 -1
- package/lib/server/har/harTracer.js +4 -2
- package/lib/server/helper.js +3 -7
- package/lib/server/index.js +0 -3
- package/lib/server/input.js +47 -54
- package/lib/server/instrumentation.js +8 -14
- package/lib/server/javascript.js +8 -16
- package/lib/server/launchApp.js +48 -30
- package/lib/server/localUtils.js +45 -38
- package/lib/server/network.js +44 -10
- package/lib/server/page.js +232 -177
- package/lib/server/pageBinding.js +6 -7
- package/lib/server/playwright.js +4 -14
- package/lib/server/progress.js +57 -49
- package/lib/server/recorder/recorderApp.js +298 -95
- package/lib/server/recorder/recorderRunner.js +23 -24
- package/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/lib/server/recorder/recorderUtils.js +67 -10
- package/lib/server/recorder.js +284 -146
- package/lib/server/registry/index.js +83 -48
- package/lib/server/registry/nativeDeps.js +175 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +1 -1
- package/lib/server/screenshotter.js +84 -83
- package/lib/server/selectors.js +12 -12
- package/lib/server/socksClientCertificatesInterceptor.js +198 -136
- package/lib/server/trace/recorder/snapshotter.js +12 -19
- package/lib/server/trace/recorder/tracing.js +36 -27
- package/lib/server/trace/viewer/traceViewer.js +11 -20
- package/lib/server/transport.js +20 -22
- package/lib/server/utils/comparators.js +2 -2
- package/lib/server/utils/debug.js +3 -8
- package/lib/server/utils/debugLogger.js +8 -0
- package/lib/server/utils/hostPlatform.js +3 -1
- package/lib/server/utils/network.js +35 -25
- package/lib/server/utils/nodePlatform.js +1 -1
- package/lib/server/utils/processLauncher.js +4 -1
- package/lib/server/utils/wsServer.js +11 -17
- package/lib/server/webkit/webkit.js +5 -2
- package/lib/server/webkit/wkBrowser.js +51 -28
- package/lib/server/webkit/wkExecutionContext.js +2 -1
- package/lib/server/webkit/wkInput.js +25 -25
- package/lib/server/webkit/wkInterceptableRequest.js +1 -1
- package/lib/server/webkit/wkPage.js +80 -59
- package/lib/server/webkit/wkProvisionalPage.js +1 -1
- package/lib/server/webkit/wkWorkers.js +7 -7
- package/lib/utils/isomorphic/ariaSnapshot.js +13 -7
- package/lib/utils/isomorphic/cssParser.js +1 -2
- package/lib/utils/isomorphic/locatorGenerators.js +18 -0
- package/lib/utils/isomorphic/manualPromise.js +1 -2
- package/lib/utils/isomorphic/mimeType.js +1 -2
- package/lib/utils/isomorphic/multimap.js +1 -2
- package/lib/utils/isomorphic/oldUtilityScriptSerializers.js +248 -0
- package/lib/utils/isomorphic/protocolFormatter.js +78 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +318 -0
- package/lib/utils/isomorphic/selectorParser.js +3 -4
- package/lib/utils/isomorphic/stringUtils.js +3 -24
- package/lib/utils/isomorphic/time.js +9 -4
- package/lib/utils/isomorphic/timeoutRunner.js +3 -4
- package/lib/utils/isomorphic/traceUtils.js +2 -3
- package/lib/utils/isomorphic/urlMatch.js +21 -7
- package/lib/utils/isomorphic/utilityScriptSerializers.js +208 -205
- package/lib/utils.js +8 -2
- package/lib/utilsBundleImpl/index.js +160 -150
- package/lib/vite/htmlReport/index.html +17 -17
- package/lib/vite/recorder/assets/{codeMirrorModule-CXVeovup.js → codeMirrorModule-DzQ0k89p.js} +1 -1
- package/lib/vite/recorder/assets/{index-eHBmevrY.css → index-CI4HQ-Zb.css} +1 -1
- package/lib/vite/recorder/assets/index-D7C7daHH.js +184 -0
- package/lib/vite/recorder/index.html +3 -3
- package/lib/vite/traceViewer/assets/{codeMirrorModule-_GLjJL-7.js → codeMirrorModule-Di48jgWx.js} +1 -1
- package/lib/vite/traceViewer/assets/defaultSettingsView-szBn8781.js +256 -0
- package/lib/vite/traceViewer/defaultSettingsView.DVJHpiGt.css +1 -0
- package/lib/vite/traceViewer/index.BFsek2M6.css +1 -0
- package/lib/vite/traceViewer/index.DQvXoPLL.js +2 -0
- package/lib/vite/traceViewer/index.html +6 -6
- package/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/lib/vite/traceViewer/uiMode.dBV3oN9h.js +5 -0
- package/lib/vite/traceViewer/uiMode.html +4 -4
- package/lib/zipBundleImpl.js +4 -4
- package/package.json +1 -1
- package/types/protocol.d.ts +712 -107
- package/types/types.d.ts +128 -17
- package/lib/generated/consoleApiSource.js +0 -28
- package/lib/protocol/debug.js +0 -211
- package/lib/server/recorder/contextRecorder.js +0 -286
- package/lib/server/recorder/recorderCollection.js +0 -116
- package/lib/server/recorder/recorderFrontend.js +0 -16
- package/lib/server/storageScript.js +0 -154
- package/lib/server/timeoutSettings.js +0 -89
- package/lib/utils/isomorphic/builtins.js +0 -86
- package/lib/vite/recorder/assets/index-BsWQsSGl.js +0 -184
- package/lib/vite/traceViewer/assets/defaultSettingsView-DtCQiGHe.js +0 -265
- package/lib/vite/traceViewer/defaultSettingsView.QdHITyLI.css +0 -1
- package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
- package/lib/vite/traceViewer/index.cFZzK9RN.js +0 -2
- package/lib/vite/traceViewer/uiMode.XVPIqBeS.js +0 -5
|
@@ -37,7 +37,6 @@ var localUtils = __toESM(require("../localUtils"));
|
|
|
37
37
|
var import_userAgent = require("../utils/userAgent");
|
|
38
38
|
var import_deviceDescriptors = require("../deviceDescriptors");
|
|
39
39
|
var import_jsonPipeDispatcher = require("../dispatchers/jsonPipeDispatcher");
|
|
40
|
-
var import_progress = require("../progress");
|
|
41
40
|
var import_socksInterceptor = require("../socksInterceptor");
|
|
42
41
|
var import_transport = require("../transport");
|
|
43
42
|
var import_network = require("../utils/network");
|
|
@@ -45,6 +44,7 @@ var import_urlMatch = require("../../utils/isomorphic/urlMatch");
|
|
|
45
44
|
class LocalUtilsDispatcher extends import_dispatcher.Dispatcher {
|
|
46
45
|
constructor(scope, playwright) {
|
|
47
46
|
const localUtils2 = new import_instrumentation.SdkObject(playwright, "localUtils", "localUtils");
|
|
47
|
+
localUtils2.logName = "browser";
|
|
48
48
|
const deviceDescriptors = Object.entries(import_deviceDescriptors.deviceDescriptors).map(([name, descriptor]) => ({ name, descriptor }));
|
|
49
49
|
super(scope, localUtils2, "LocalUtils", {
|
|
50
50
|
deviceDescriptors
|
|
@@ -53,70 +53,66 @@ class LocalUtilsDispatcher extends import_dispatcher.Dispatcher {
|
|
|
53
53
|
this._stackSessions = /* @__PURE__ */ new Map();
|
|
54
54
|
this._type_LocalUtils = true;
|
|
55
55
|
}
|
|
56
|
-
async zip(params) {
|
|
57
|
-
return await localUtils.zip(this._stackSessions, params);
|
|
56
|
+
async zip(params, progress) {
|
|
57
|
+
return await localUtils.zip(progress, this._stackSessions, params);
|
|
58
58
|
}
|
|
59
|
-
async harOpen(params,
|
|
60
|
-
return await localUtils.harOpen(this._harBackends, params);
|
|
59
|
+
async harOpen(params, progress) {
|
|
60
|
+
return await localUtils.harOpen(progress, this._harBackends, params);
|
|
61
61
|
}
|
|
62
|
-
async harLookup(params,
|
|
63
|
-
return await localUtils.harLookup(this._harBackends, params);
|
|
62
|
+
async harLookup(params, progress) {
|
|
63
|
+
return await localUtils.harLookup(progress, this._harBackends, params);
|
|
64
64
|
}
|
|
65
|
-
async harClose(params,
|
|
66
|
-
|
|
65
|
+
async harClose(params, progress) {
|
|
66
|
+
localUtils.harClose(this._harBackends, params);
|
|
67
67
|
}
|
|
68
|
-
async harUnzip(params,
|
|
69
|
-
return await localUtils.harUnzip(params);
|
|
68
|
+
async harUnzip(params, progress) {
|
|
69
|
+
return await localUtils.harUnzip(progress, params);
|
|
70
70
|
}
|
|
71
|
-
async tracingStarted(params,
|
|
72
|
-
return await localUtils.tracingStarted(this._stackSessions, params);
|
|
71
|
+
async tracingStarted(params, progress) {
|
|
72
|
+
return await localUtils.tracingStarted(progress, this._stackSessions, params);
|
|
73
73
|
}
|
|
74
|
-
async traceDiscarded(params,
|
|
75
|
-
return await localUtils.traceDiscarded(this._stackSessions, params);
|
|
74
|
+
async traceDiscarded(params, progress) {
|
|
75
|
+
return await localUtils.traceDiscarded(progress, this._stackSessions, params);
|
|
76
76
|
}
|
|
77
|
-
async addStackToTracingNoReply(params,
|
|
78
|
-
|
|
77
|
+
async addStackToTracingNoReply(params, progress) {
|
|
78
|
+
localUtils.addStackToTracingNoReply(this._stackSessions, params);
|
|
79
79
|
}
|
|
80
|
-
async connect(params,
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
async connect(params, progress) {
|
|
81
|
+
const wsHeaders = {
|
|
82
|
+
"User-Agent": (0, import_userAgent.getUserAgent)(),
|
|
83
|
+
"x-playwright-proxy": params.exposeNetwork ?? "",
|
|
84
|
+
...params.headers
|
|
85
|
+
};
|
|
86
|
+
const wsEndpoint = await urlToWSEndpoint(progress, params.wsEndpoint);
|
|
87
|
+
const transport = await import_transport.WebSocketTransport.connect(progress, wsEndpoint, { headers: wsHeaders, followRedirects: true, debugLogHeader: "x-playwright-debug-log" });
|
|
88
|
+
const socksInterceptor = new import_socksInterceptor.SocksInterceptor(transport, params.exposeNetwork, params.socksProxyRedirectPortForTest);
|
|
89
|
+
const pipe = new import_jsonPipeDispatcher.JsonPipeDispatcher(this);
|
|
90
|
+
transport.onmessage = (json) => {
|
|
91
|
+
if (socksInterceptor.interceptMessage(json))
|
|
92
|
+
return;
|
|
93
|
+
const cb = () => {
|
|
94
|
+
try {
|
|
95
|
+
pipe.dispatch(json);
|
|
96
|
+
} catch (e) {
|
|
97
|
+
transport.close();
|
|
98
|
+
}
|
|
88
99
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (params.slowMo)
|
|
104
|
-
setTimeout(cb, params.slowMo);
|
|
105
|
-
else
|
|
106
|
-
cb();
|
|
107
|
-
};
|
|
108
|
-
pipe.on("message", (message) => {
|
|
109
|
-
transport.send(message);
|
|
110
|
-
});
|
|
111
|
-
transport.onclose = (reason) => {
|
|
112
|
-
socksInterceptor?.cleanup();
|
|
113
|
-
pipe.wasClosed(reason);
|
|
114
|
-
};
|
|
115
|
-
pipe.on("close", () => transport.close());
|
|
116
|
-
return { pipe, headers: transport.headers };
|
|
117
|
-
}, params.timeout || 0);
|
|
100
|
+
if (params.slowMo)
|
|
101
|
+
setTimeout(cb, params.slowMo);
|
|
102
|
+
else
|
|
103
|
+
cb();
|
|
104
|
+
};
|
|
105
|
+
pipe.on("message", (message) => {
|
|
106
|
+
transport.send(message);
|
|
107
|
+
});
|
|
108
|
+
transport.onclose = (reason) => {
|
|
109
|
+
socksInterceptor?.cleanup();
|
|
110
|
+
pipe.wasClosed(reason);
|
|
111
|
+
};
|
|
112
|
+
pipe.on("close", () => transport.close());
|
|
113
|
+
return { pipe, headers: transport.headers };
|
|
118
114
|
}
|
|
119
|
-
async globToRegex(params,
|
|
115
|
+
async globToRegex(params, progress) {
|
|
120
116
|
const regex = (0, import_urlMatch.resolveGlobToRegexPattern)(params.baseURL, params.glob, params.webSocketUrl);
|
|
121
117
|
return { regex };
|
|
122
118
|
}
|
|
@@ -124,21 +120,19 @@ class LocalUtilsDispatcher extends import_dispatcher.Dispatcher {
|
|
|
124
120
|
async function urlToWSEndpoint(progress, endpointURL) {
|
|
125
121
|
if (endpointURL.startsWith("ws"))
|
|
126
122
|
return endpointURL;
|
|
127
|
-
progress
|
|
123
|
+
progress.log(`<ws preparing> retrieving websocket url from ${endpointURL}`);
|
|
128
124
|
const fetchUrl = new URL(endpointURL);
|
|
129
125
|
if (!fetchUrl.pathname.endsWith("/"))
|
|
130
126
|
fetchUrl.pathname += "/";
|
|
131
127
|
fetchUrl.pathname += "json";
|
|
132
|
-
const json = await (0, import_network.fetchData)({
|
|
128
|
+
const json = await (0, import_network.fetchData)(progress, {
|
|
133
129
|
url: fetchUrl.toString(),
|
|
134
130
|
method: "GET",
|
|
135
|
-
timeout: progress?.timeUntilDeadline() ?? 3e4,
|
|
136
131
|
headers: { "User-Agent": (0, import_userAgent.getUserAgent)() }
|
|
137
132
|
}, async (params, response) => {
|
|
138
133
|
return new Error(`Unexpected status ${response.statusCode} when connecting to ${fetchUrl.toString()}.
|
|
139
134
|
This does not look like a Playwright server, try connecting via ws://.`);
|
|
140
135
|
});
|
|
141
|
-
progress?.throwIfAborted();
|
|
142
136
|
const wsUrl = new URL(endpointURL);
|
|
143
137
|
let wsEndpointPath = JSON.parse(json).wsEndpointPath;
|
|
144
138
|
if (wsEndpointPath.startsWith("/"))
|
|
@@ -32,7 +32,7 @@ var import_pageDispatcher = require("./pageDispatcher");
|
|
|
32
32
|
var import_tracingDispatcher = require("./tracingDispatcher");
|
|
33
33
|
class RequestDispatcher extends import_dispatcher.Dispatcher {
|
|
34
34
|
static from(scope, request) {
|
|
35
|
-
const result =
|
|
35
|
+
const result = scope.connection.existingDispatcher(request);
|
|
36
36
|
return result || new RequestDispatcher(scope, request);
|
|
37
37
|
}
|
|
38
38
|
static fromNullable(scope, request) {
|
|
@@ -42,7 +42,7 @@ class RequestDispatcher extends import_dispatcher.Dispatcher {
|
|
|
42
42
|
const postData = request.postDataBuffer();
|
|
43
43
|
const frame = request.frame();
|
|
44
44
|
const page = request.frame()?._page;
|
|
45
|
-
const pageDispatcher = page ?
|
|
45
|
+
const pageDispatcher = page ? scope.connection.existingDispatcher(page) : null;
|
|
46
46
|
const frameDispatcher = frame ? import_frameDispatcher.FrameDispatcher.from(scope, frame) : null;
|
|
47
47
|
super(pageDispatcher || frameDispatcher || scope, request, "Request", {
|
|
48
48
|
frame: import_frameDispatcher.FrameDispatcher.fromNullable(scope, request.frame()),
|
|
@@ -58,11 +58,11 @@ class RequestDispatcher extends import_dispatcher.Dispatcher {
|
|
|
58
58
|
this._type_Request = true;
|
|
59
59
|
this._browserContextDispatcher = scope;
|
|
60
60
|
}
|
|
61
|
-
async rawRequestHeaders(params) {
|
|
62
|
-
return { headers: await this._object.rawRequestHeaders() };
|
|
61
|
+
async rawRequestHeaders(params, progress) {
|
|
62
|
+
return { headers: await progress.race(this._object.rawRequestHeaders()) };
|
|
63
63
|
}
|
|
64
|
-
async response() {
|
|
65
|
-
return { response: ResponseDispatcher.fromNullable(this._browserContextDispatcher, await this._object.response()) };
|
|
64
|
+
async response(params, progress) {
|
|
65
|
+
return { response: ResponseDispatcher.fromNullable(this._browserContextDispatcher, await progress.race(this._object.response())) };
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
class ResponseDispatcher extends import_dispatcher.Dispatcher {
|
|
@@ -80,27 +80,27 @@ class ResponseDispatcher extends import_dispatcher.Dispatcher {
|
|
|
80
80
|
this._type_Response = true;
|
|
81
81
|
}
|
|
82
82
|
static from(scope, response) {
|
|
83
|
-
const result =
|
|
83
|
+
const result = scope.connection.existingDispatcher(response);
|
|
84
84
|
const requestDispatcher = RequestDispatcher.from(scope, response.request());
|
|
85
85
|
return result || new ResponseDispatcher(requestDispatcher, response);
|
|
86
86
|
}
|
|
87
87
|
static fromNullable(scope, response) {
|
|
88
88
|
return response ? ResponseDispatcher.from(scope, response) : void 0;
|
|
89
89
|
}
|
|
90
|
-
async body() {
|
|
91
|
-
return { binary: await this._object.body() };
|
|
90
|
+
async body(params, progress) {
|
|
91
|
+
return { binary: await progress.race(this._object.body()) };
|
|
92
92
|
}
|
|
93
|
-
async securityDetails() {
|
|
94
|
-
return { value: await this._object.securityDetails() || void 0 };
|
|
93
|
+
async securityDetails(params, progress) {
|
|
94
|
+
return { value: await progress.race(this._object.securityDetails()) || void 0 };
|
|
95
95
|
}
|
|
96
|
-
async serverAddr() {
|
|
97
|
-
return { value: await this._object.serverAddr() || void 0 };
|
|
96
|
+
async serverAddr(params, progress) {
|
|
97
|
+
return { value: await progress.race(this._object.serverAddr()) || void 0 };
|
|
98
98
|
}
|
|
99
|
-
async rawResponseHeaders(params) {
|
|
100
|
-
return { headers: await this._object.rawResponseHeaders() };
|
|
99
|
+
async rawResponseHeaders(params, progress) {
|
|
100
|
+
return { headers: await progress.race(this._object.rawResponseHeaders()) };
|
|
101
101
|
}
|
|
102
|
-
async sizes(params) {
|
|
103
|
-
return { sizes: await this._object.sizes() };
|
|
102
|
+
async sizes(params, progress) {
|
|
103
|
+
return { sizes: await progress.race(this._object.sizes()) };
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
class RouteDispatcher extends import_dispatcher.Dispatcher {
|
|
@@ -110,12 +110,15 @@ class RouteDispatcher extends import_dispatcher.Dispatcher {
|
|
|
110
110
|
request: scope
|
|
111
111
|
});
|
|
112
112
|
this._type_Route = true;
|
|
113
|
+
this._handled = false;
|
|
113
114
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
_checkNotHandled() {
|
|
116
|
+
if (this._handled)
|
|
117
|
+
throw new Error("Route is already handled!");
|
|
118
|
+
this._handled = true;
|
|
117
119
|
}
|
|
118
|
-
async continue(params,
|
|
120
|
+
async continue(params, progress) {
|
|
121
|
+
this._checkNotHandled();
|
|
119
122
|
await this._object.continue({
|
|
120
123
|
url: params.url,
|
|
121
124
|
method: params.method,
|
|
@@ -124,14 +127,17 @@ class RouteDispatcher extends import_dispatcher.Dispatcher {
|
|
|
124
127
|
isFallback: params.isFallback
|
|
125
128
|
});
|
|
126
129
|
}
|
|
127
|
-
async fulfill(params,
|
|
130
|
+
async fulfill(params, progress) {
|
|
131
|
+
this._checkNotHandled();
|
|
128
132
|
await this._object.fulfill(params);
|
|
129
133
|
}
|
|
130
|
-
async abort(params,
|
|
134
|
+
async abort(params, progress) {
|
|
135
|
+
this._checkNotHandled();
|
|
131
136
|
await this._object.abort(params.errorCode || "failed");
|
|
132
137
|
}
|
|
133
|
-
async redirectNavigationRequest(params) {
|
|
134
|
-
|
|
138
|
+
async redirectNavigationRequest(params, progress) {
|
|
139
|
+
this._checkNotHandled();
|
|
140
|
+
this._object.redirectNavigationRequest(params.url);
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
class WebSocketDispatcher extends import_dispatcher.Dispatcher {
|
|
@@ -157,22 +163,22 @@ class APIRequestContextDispatcher extends import_dispatcher.Dispatcher {
|
|
|
157
163
|
this.adopt(tracing);
|
|
158
164
|
}
|
|
159
165
|
static from(scope, request) {
|
|
160
|
-
const result =
|
|
166
|
+
const result = scope.connection.existingDispatcher(request);
|
|
161
167
|
return result || new APIRequestContextDispatcher(scope, request);
|
|
162
168
|
}
|
|
163
169
|
static fromNullable(scope, request) {
|
|
164
170
|
return request ? APIRequestContextDispatcher.from(scope, request) : void 0;
|
|
165
171
|
}
|
|
166
|
-
async storageState(params) {
|
|
167
|
-
return this._object.storageState(params.indexedDB);
|
|
172
|
+
async storageState(params, progress) {
|
|
173
|
+
return await this._object.storageState(progress, params.indexedDB);
|
|
168
174
|
}
|
|
169
|
-
async dispose(params,
|
|
170
|
-
metadata.potentiallyClosesScope = true;
|
|
175
|
+
async dispose(params, progress) {
|
|
176
|
+
progress.metadata.potentiallyClosesScope = true;
|
|
171
177
|
await this._object.dispose(params);
|
|
172
178
|
this._dispose();
|
|
173
179
|
}
|
|
174
|
-
async fetch(params,
|
|
175
|
-
const fetchResponse = await this._object.fetch(
|
|
180
|
+
async fetch(params, progress) {
|
|
181
|
+
const fetchResponse = await this._object.fetch(progress, params);
|
|
176
182
|
return {
|
|
177
183
|
response: {
|
|
178
184
|
url: fetchResponse.url,
|
|
@@ -183,14 +189,14 @@ class APIRequestContextDispatcher extends import_dispatcher.Dispatcher {
|
|
|
183
189
|
}
|
|
184
190
|
};
|
|
185
191
|
}
|
|
186
|
-
async fetchResponseBody(params) {
|
|
192
|
+
async fetchResponseBody(params, progress) {
|
|
187
193
|
return { binary: this._object.fetchResponses.get(params.fetchUid) };
|
|
188
194
|
}
|
|
189
|
-
async fetchLog(params) {
|
|
195
|
+
async fetchLog(params, progress) {
|
|
190
196
|
const log = this._object.fetchLog.get(params.fetchUid) || [];
|
|
191
197
|
return { log };
|
|
192
198
|
}
|
|
193
|
-
async disposeAPIResponse(params) {
|
|
199
|
+
async disposeAPIResponse(params, progress) {
|
|
194
200
|
this._object.disposeResponse(params.fetchUid);
|
|
195
201
|
}
|
|
196
202
|
}
|