patchright-core 1.52.4 → 1.55.0
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 +57 -35
- 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 +32 -28
- 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 +423 -346
- 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 +45 -33
- package/lib/server/chromium/crPage.js +98 -73
- 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 +99 -102
- 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 +65 -22
- package/lib/server/frames.js +516 -544
- 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 +9 -17
- 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 +233 -178
- 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 +148 -37
- 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
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var contextRecorder_exports = {};
|
|
30
|
-
__export(contextRecorder_exports, {
|
|
31
|
-
ContextRecorder: () => ContextRecorder,
|
|
32
|
-
generateFrameSelector: () => generateFrameSelector
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(contextRecorder_exports);
|
|
35
|
-
var import_events = require("events");
|
|
36
|
-
var import_recorderCollection = require("./recorderCollection");
|
|
37
|
-
var recorderSource = __toESM(require("../../generated/pollingRecorderSource"));
|
|
38
|
-
var import_utils = require("../../utils");
|
|
39
|
-
var import_timeoutRunner = require("../../utils/isomorphic/timeoutRunner");
|
|
40
|
-
var import_browserContext = require("../browserContext");
|
|
41
|
-
var import_languages = require("../codegen/languages");
|
|
42
|
-
var import_frames = require("../frames");
|
|
43
|
-
var import_page = require("../page");
|
|
44
|
-
var import_throttledFile = require("./throttledFile");
|
|
45
|
-
var import_language = require("../codegen/language");
|
|
46
|
-
class ContextRecorder extends import_events.EventEmitter {
|
|
47
|
-
constructor(context, params, delegate) {
|
|
48
|
-
super();
|
|
49
|
-
this._pageAliases = /* @__PURE__ */ new Map();
|
|
50
|
-
this._lastPopupOrdinal = 0;
|
|
51
|
-
this._lastDialogOrdinal = -1;
|
|
52
|
-
this._lastDownloadOrdinal = -1;
|
|
53
|
-
this._throttledOutputFile = null;
|
|
54
|
-
this._orderedLanguages = [];
|
|
55
|
-
this._listeners = [];
|
|
56
|
-
this._context = context;
|
|
57
|
-
this._params = params;
|
|
58
|
-
this._delegate = delegate;
|
|
59
|
-
this._recorderSources = [];
|
|
60
|
-
const language = params.language || context.attribution.playwright.options.sdkLanguage;
|
|
61
|
-
this.setOutput(language, params.outputFile);
|
|
62
|
-
const languageGeneratorOptions = {
|
|
63
|
-
browserName: context._browser.options.name,
|
|
64
|
-
launchOptions: { headless: false, ...params.launchOptions, tracesDir: void 0 },
|
|
65
|
-
contextOptions: { ...params.contextOptions },
|
|
66
|
-
deviceName: params.device,
|
|
67
|
-
saveStorage: params.saveStorage
|
|
68
|
-
};
|
|
69
|
-
this._collection = new import_recorderCollection.RecorderCollection(this._pageAliases);
|
|
70
|
-
this._collection.on("change", (actions) => {
|
|
71
|
-
this._recorderSources = [];
|
|
72
|
-
for (const languageGenerator of this._orderedLanguages) {
|
|
73
|
-
const { header, footer, actionTexts, text } = (0, import_language.generateCode)(actions, languageGenerator, languageGeneratorOptions);
|
|
74
|
-
const source = {
|
|
75
|
-
isRecorded: true,
|
|
76
|
-
label: languageGenerator.name,
|
|
77
|
-
group: languageGenerator.groupName,
|
|
78
|
-
id: languageGenerator.id,
|
|
79
|
-
text,
|
|
80
|
-
header,
|
|
81
|
-
footer,
|
|
82
|
-
actions: actionTexts,
|
|
83
|
-
language: languageGenerator.highlighter,
|
|
84
|
-
highlight: []
|
|
85
|
-
};
|
|
86
|
-
source.revealLine = text.split("\n").length - 1;
|
|
87
|
-
this._recorderSources.push(source);
|
|
88
|
-
if (languageGenerator === this._orderedLanguages[0])
|
|
89
|
-
this._throttledOutputFile?.setContent(source.text);
|
|
90
|
-
}
|
|
91
|
-
this.emit(ContextRecorder.Events.Change, {
|
|
92
|
-
sources: this._recorderSources,
|
|
93
|
-
actions
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
context.on(import_browserContext.BrowserContext.Events.BeforeClose, () => {
|
|
97
|
-
this._throttledOutputFile?.flush();
|
|
98
|
-
});
|
|
99
|
-
this._listeners.push(import_utils.eventsHelper.addEventListener(process, "exit", () => {
|
|
100
|
-
this._throttledOutputFile?.flush();
|
|
101
|
-
}));
|
|
102
|
-
this.setEnabled(params.mode === "recording");
|
|
103
|
-
}
|
|
104
|
-
static {
|
|
105
|
-
this.Events = {
|
|
106
|
-
Change: "change"
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
setOutput(codegenId, outputFile) {
|
|
110
|
-
const languages = (0, import_languages.languageSet)();
|
|
111
|
-
const primaryLanguage = [...languages].find((l) => l.id === codegenId);
|
|
112
|
-
if (!primaryLanguage)
|
|
113
|
-
throw new Error(`
|
|
114
|
-
===============================
|
|
115
|
-
Unsupported language: '${codegenId}'
|
|
116
|
-
===============================
|
|
117
|
-
`);
|
|
118
|
-
languages.delete(primaryLanguage);
|
|
119
|
-
this._orderedLanguages = [primaryLanguage, ...languages];
|
|
120
|
-
this._throttledOutputFile = outputFile ? new import_throttledFile.ThrottledFile(outputFile) : null;
|
|
121
|
-
this._collection?.restart();
|
|
122
|
-
}
|
|
123
|
-
languageName(id) {
|
|
124
|
-
for (const lang of this._orderedLanguages) {
|
|
125
|
-
if (!id || lang.id === id)
|
|
126
|
-
return lang.highlighter;
|
|
127
|
-
}
|
|
128
|
-
return "javascript";
|
|
129
|
-
}
|
|
130
|
-
async install() {
|
|
131
|
-
this._context.on(import_browserContext.BrowserContext.Events.Page, (page) => this._onPage(page));
|
|
132
|
-
for (const page of this._context.pages())
|
|
133
|
-
this._onPage(page);
|
|
134
|
-
this._context.on(import_browserContext.BrowserContext.Events.Dialog, (dialog) => this._onDialog(dialog.page()));
|
|
135
|
-
await this._context.exposeBinding(
|
|
136
|
-
"__pw_recorderPerformAction",
|
|
137
|
-
false,
|
|
138
|
-
(source, action) => this._performAction(source.frame, action)
|
|
139
|
-
);
|
|
140
|
-
await this._context.exposeBinding(
|
|
141
|
-
"__pw_recorderRecordAction",
|
|
142
|
-
false,
|
|
143
|
-
(source, action) => this._recordAction(source.frame, action)
|
|
144
|
-
);
|
|
145
|
-
await this._context.extendInjectedScript(recorderSource.source);
|
|
146
|
-
}
|
|
147
|
-
setEnabled(enabled) {
|
|
148
|
-
this._collection.setEnabled(enabled);
|
|
149
|
-
}
|
|
150
|
-
dispose() {
|
|
151
|
-
import_utils.eventsHelper.removeEventListeners(this._listeners);
|
|
152
|
-
}
|
|
153
|
-
async _onPage(page) {
|
|
154
|
-
const frame = page.mainFrame();
|
|
155
|
-
page.on("close", () => {
|
|
156
|
-
this._collection.addRecordedAction({
|
|
157
|
-
frame: this._describeMainFrame(page),
|
|
158
|
-
action: {
|
|
159
|
-
name: "closePage",
|
|
160
|
-
signals: []
|
|
161
|
-
},
|
|
162
|
-
startTime: (0, import_utils.monotonicTime)()
|
|
163
|
-
});
|
|
164
|
-
this._pageAliases.delete(page);
|
|
165
|
-
});
|
|
166
|
-
frame.on(import_frames.Frame.Events.InternalNavigation, (event) => {
|
|
167
|
-
if (event.isPublic)
|
|
168
|
-
this._onFrameNavigated(frame, page);
|
|
169
|
-
});
|
|
170
|
-
page.on(import_page.Page.Events.Download, () => this._onDownload(page));
|
|
171
|
-
const suffix = this._pageAliases.size ? String(++this._lastPopupOrdinal) : "";
|
|
172
|
-
const pageAlias = "page" + suffix;
|
|
173
|
-
this._pageAliases.set(page, pageAlias);
|
|
174
|
-
if (page.opener()) {
|
|
175
|
-
this._onPopup(page.opener(), page);
|
|
176
|
-
} else {
|
|
177
|
-
this._collection.addRecordedAction({
|
|
178
|
-
frame: this._describeMainFrame(page),
|
|
179
|
-
action: {
|
|
180
|
-
name: "openPage",
|
|
181
|
-
url: page.mainFrame().url(),
|
|
182
|
-
signals: []
|
|
183
|
-
},
|
|
184
|
-
startTime: (0, import_utils.monotonicTime)()
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
clearScript() {
|
|
189
|
-
this._collection.restart();
|
|
190
|
-
if (this._params.mode === "recording") {
|
|
191
|
-
for (const page of this._context.pages())
|
|
192
|
-
this._onFrameNavigated(page.mainFrame(), page);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
runTask(task) {
|
|
196
|
-
}
|
|
197
|
-
_describeMainFrame(page) {
|
|
198
|
-
return {
|
|
199
|
-
pageAlias: this._pageAliases.get(page),
|
|
200
|
-
framePath: []
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
async _describeFrame(frame) {
|
|
204
|
-
return {
|
|
205
|
-
pageAlias: this._pageAliases.get(frame._page),
|
|
206
|
-
framePath: await generateFrameSelector(frame)
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
testIdAttributeName() {
|
|
210
|
-
return this._params.testIdAttributeName || this._context.selectors().testIdAttributeName() || "data-testid";
|
|
211
|
-
}
|
|
212
|
-
async _createActionInContext(frame, action) {
|
|
213
|
-
const frameDescription = await this._describeFrame(frame);
|
|
214
|
-
const actionInContext = {
|
|
215
|
-
frame: frameDescription,
|
|
216
|
-
action,
|
|
217
|
-
description: void 0,
|
|
218
|
-
startTime: (0, import_utils.monotonicTime)()
|
|
219
|
-
};
|
|
220
|
-
await this._delegate.rewriteActionInContext?.(this._pageAliases, actionInContext);
|
|
221
|
-
return actionInContext;
|
|
222
|
-
}
|
|
223
|
-
async _performAction(frame, action) {
|
|
224
|
-
await this._collection.performAction(await this._createActionInContext(frame, action));
|
|
225
|
-
}
|
|
226
|
-
async _recordAction(frame, action) {
|
|
227
|
-
this._collection.addRecordedAction(await this._createActionInContext(frame, action));
|
|
228
|
-
}
|
|
229
|
-
_onFrameNavigated(frame, page) {
|
|
230
|
-
const pageAlias = this._pageAliases.get(page);
|
|
231
|
-
this._collection.signal(pageAlias, frame, { name: "navigation", url: frame.url() });
|
|
232
|
-
}
|
|
233
|
-
_onPopup(page, popup) {
|
|
234
|
-
const pageAlias = this._pageAliases.get(page);
|
|
235
|
-
const popupAlias = this._pageAliases.get(popup);
|
|
236
|
-
this._collection.signal(pageAlias, page.mainFrame(), { name: "popup", popupAlias });
|
|
237
|
-
}
|
|
238
|
-
_onDownload(page) {
|
|
239
|
-
const pageAlias = this._pageAliases.get(page);
|
|
240
|
-
++this._lastDownloadOrdinal;
|
|
241
|
-
this._collection.signal(pageAlias, page.mainFrame(), { name: "download", downloadAlias: this._lastDownloadOrdinal ? String(this._lastDownloadOrdinal) : "" });
|
|
242
|
-
}
|
|
243
|
-
_onDialog(page) {
|
|
244
|
-
const pageAlias = this._pageAliases.get(page);
|
|
245
|
-
++this._lastDialogOrdinal;
|
|
246
|
-
this._collection.signal(pageAlias, page.mainFrame(), { name: "dialog", dialogAlias: this._lastDialogOrdinal ? String(this._lastDialogOrdinal) : "" });
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
async function generateFrameSelector(frame) {
|
|
250
|
-
const selectorPromises = [];
|
|
251
|
-
while (frame) {
|
|
252
|
-
const parent = frame.parentFrame();
|
|
253
|
-
if (!parent)
|
|
254
|
-
break;
|
|
255
|
-
selectorPromises.push(generateFrameSelectorInParent(parent, frame));
|
|
256
|
-
frame = parent;
|
|
257
|
-
}
|
|
258
|
-
const result = await Promise.all(selectorPromises);
|
|
259
|
-
return result.reverse();
|
|
260
|
-
}
|
|
261
|
-
async function generateFrameSelectorInParent(parent, frame) {
|
|
262
|
-
const result = await (0, import_timeoutRunner.raceAgainstDeadline)(async () => {
|
|
263
|
-
try {
|
|
264
|
-
const frameElement = await frame.frameElement();
|
|
265
|
-
if (!frameElement || !parent)
|
|
266
|
-
return;
|
|
267
|
-
const utility = await parent._utilityContext();
|
|
268
|
-
const injected = await utility.injectedScript();
|
|
269
|
-
const selector = await injected.evaluate((injected2, element) => {
|
|
270
|
-
return injected2.generateSelectorSimple(element);
|
|
271
|
-
}, frameElement);
|
|
272
|
-
return selector;
|
|
273
|
-
} catch (e) {
|
|
274
|
-
}
|
|
275
|
-
}, (0, import_utils.monotonicTime)() + 2e3);
|
|
276
|
-
if (!result.timedOut && result.result)
|
|
277
|
-
return result.result;
|
|
278
|
-
if (frame.name())
|
|
279
|
-
return `iframe[name=${(0, import_utils.quoteCSSAttributeValue)(frame.name())}]`;
|
|
280
|
-
return `iframe[src=${(0, import_utils.quoteCSSAttributeValue)(frame.url())}]`;
|
|
281
|
-
}
|
|
282
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
283
|
-
0 && (module.exports = {
|
|
284
|
-
ContextRecorder,
|
|
285
|
-
generateFrameSelector
|
|
286
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var recorderCollection_exports = {};
|
|
20
|
-
__export(recorderCollection_exports, {
|
|
21
|
-
RecorderCollection: () => RecorderCollection
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(recorderCollection_exports);
|
|
24
|
-
var import_events = require("events");
|
|
25
|
-
var import_recorderRunner = require("./recorderRunner");
|
|
26
|
-
var import_recorderUtils = require("./recorderUtils");
|
|
27
|
-
var import_debug = require("../utils/debug");
|
|
28
|
-
var import_time = require("../../utils/isomorphic/time");
|
|
29
|
-
class RecorderCollection extends import_events.EventEmitter {
|
|
30
|
-
constructor(pageAliases) {
|
|
31
|
-
super();
|
|
32
|
-
this._actions = [];
|
|
33
|
-
this._enabled = false;
|
|
34
|
-
this._pageAliases = pageAliases;
|
|
35
|
-
}
|
|
36
|
-
restart() {
|
|
37
|
-
this._actions = [];
|
|
38
|
-
this.emit("change", []);
|
|
39
|
-
}
|
|
40
|
-
setEnabled(enabled) {
|
|
41
|
-
this._enabled = enabled;
|
|
42
|
-
}
|
|
43
|
-
async performAction(actionInContext) {
|
|
44
|
-
await this._addAction(actionInContext, async () => {
|
|
45
|
-
await (0, import_recorderRunner.performAction)(this._pageAliases, actionInContext);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
addRecordedAction(actionInContext) {
|
|
49
|
-
if (["openPage", "closePage"].includes(actionInContext.action.name)) {
|
|
50
|
-
this._actions.push(actionInContext);
|
|
51
|
-
this._fireChange();
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this._addAction(actionInContext).catch(() => {
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
async _addAction(actionInContext, callback) {
|
|
58
|
-
if (!this._enabled)
|
|
59
|
-
return;
|
|
60
|
-
if (actionInContext.action.name === "openPage" || actionInContext.action.name === "closePage") {
|
|
61
|
-
this._actions.push(actionInContext);
|
|
62
|
-
this._fireChange();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this._actions.push(actionInContext);
|
|
66
|
-
this._fireChange();
|
|
67
|
-
await callback?.().catch();
|
|
68
|
-
actionInContext.endTime = (0, import_time.monotonicTime)();
|
|
69
|
-
}
|
|
70
|
-
signal(pageAlias, frame, signal) {
|
|
71
|
-
if (!this._enabled)
|
|
72
|
-
return;
|
|
73
|
-
if (signal.name === "navigation" && frame._page.mainFrame() === frame) {
|
|
74
|
-
const timestamp = (0, import_time.monotonicTime)();
|
|
75
|
-
const lastAction = this._actions[this._actions.length - 1];
|
|
76
|
-
const signalThreshold = (0, import_debug.isUnderTest)() ? 500 : 5e3;
|
|
77
|
-
let generateGoto = false;
|
|
78
|
-
if (!lastAction)
|
|
79
|
-
generateGoto = true;
|
|
80
|
-
else if (lastAction.action.name !== "click" && lastAction.action.name !== "press" && lastAction.action.name !== "fill")
|
|
81
|
-
generateGoto = true;
|
|
82
|
-
else if (timestamp - lastAction.startTime > signalThreshold)
|
|
83
|
-
generateGoto = true;
|
|
84
|
-
if (generateGoto) {
|
|
85
|
-
this.addRecordedAction({
|
|
86
|
-
frame: {
|
|
87
|
-
pageAlias,
|
|
88
|
-
framePath: []
|
|
89
|
-
},
|
|
90
|
-
action: {
|
|
91
|
-
name: "navigate",
|
|
92
|
-
url: frame.url(),
|
|
93
|
-
signals: []
|
|
94
|
-
},
|
|
95
|
-
startTime: timestamp,
|
|
96
|
-
endTime: timestamp
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (this._actions.length) {
|
|
102
|
-
this._actions[this._actions.length - 1].action.signals.push(signal);
|
|
103
|
-
this._fireChange();
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
_fireChange() {
|
|
108
|
-
if (!this._enabled)
|
|
109
|
-
return;
|
|
110
|
-
this.emit("change", (0, import_recorderUtils.collapseActions)(this._actions));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
-
0 && (module.exports = {
|
|
115
|
-
RecorderCollection
|
|
116
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var recorderFrontend_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(recorderFrontend_exports);
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var storageScript_exports = {};
|
|
20
|
-
__export(storageScript_exports, {
|
|
21
|
-
collect: () => collect,
|
|
22
|
-
restore: () => restore
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(storageScript_exports);
|
|
25
|
-
async function collect(serializersSource, builtins, isFirefox, recordIndexedDB) {
|
|
26
|
-
const { serializeAsCallArgument } = serializersSource(builtins);
|
|
27
|
-
async function collectDB(dbInfo) {
|
|
28
|
-
if (!dbInfo.name)
|
|
29
|
-
throw new Error("Database name is empty");
|
|
30
|
-
if (!dbInfo.version)
|
|
31
|
-
throw new Error("Database version is unset");
|
|
32
|
-
function idbRequestToPromise(request) {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
request.addEventListener("success", () => resolve(request.result));
|
|
35
|
-
request.addEventListener("error", () => reject(request.error));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function isPlainObject(v) {
|
|
39
|
-
const ctor = v?.constructor;
|
|
40
|
-
if (isFirefox) {
|
|
41
|
-
const constructorImpl = ctor?.toString();
|
|
42
|
-
if (constructorImpl?.startsWith("function Object() {") && constructorImpl?.includes("[native code]"))
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return ctor === Object;
|
|
46
|
-
}
|
|
47
|
-
function trySerialize(value) {
|
|
48
|
-
let trivial = true;
|
|
49
|
-
const encoded = serializeAsCallArgument(value, (v) => {
|
|
50
|
-
const isTrivial = isPlainObject(v) || Array.isArray(v) || typeof v === "string" || typeof v === "number" || typeof v === "boolean" || Object.is(v, null);
|
|
51
|
-
if (!isTrivial)
|
|
52
|
-
trivial = false;
|
|
53
|
-
return { fallThrough: v };
|
|
54
|
-
});
|
|
55
|
-
if (trivial)
|
|
56
|
-
return { trivial: value };
|
|
57
|
-
return { encoded };
|
|
58
|
-
}
|
|
59
|
-
const db = await idbRequestToPromise(indexedDB.open(dbInfo.name));
|
|
60
|
-
const transaction = db.transaction(db.objectStoreNames, "readonly");
|
|
61
|
-
const stores = await Promise.all([...db.objectStoreNames].map(async (storeName) => {
|
|
62
|
-
const objectStore = transaction.objectStore(storeName);
|
|
63
|
-
const keys = await idbRequestToPromise(objectStore.getAllKeys());
|
|
64
|
-
const records = await Promise.all(keys.map(async (key) => {
|
|
65
|
-
const record = {};
|
|
66
|
-
if (objectStore.keyPath === null) {
|
|
67
|
-
const { encoded: encoded2, trivial: trivial2 } = trySerialize(key);
|
|
68
|
-
if (trivial2)
|
|
69
|
-
record.key = trivial2;
|
|
70
|
-
else
|
|
71
|
-
record.keyEncoded = encoded2;
|
|
72
|
-
}
|
|
73
|
-
const value = await idbRequestToPromise(objectStore.get(key));
|
|
74
|
-
const { encoded, trivial } = trySerialize(value);
|
|
75
|
-
if (trivial)
|
|
76
|
-
record.value = trivial;
|
|
77
|
-
else
|
|
78
|
-
record.valueEncoded = encoded;
|
|
79
|
-
return record;
|
|
80
|
-
}));
|
|
81
|
-
const indexes = [...objectStore.indexNames].map((indexName) => {
|
|
82
|
-
const index = objectStore.index(indexName);
|
|
83
|
-
return {
|
|
84
|
-
name: index.name,
|
|
85
|
-
keyPath: typeof index.keyPath === "string" ? index.keyPath : void 0,
|
|
86
|
-
keyPathArray: Array.isArray(index.keyPath) ? index.keyPath : void 0,
|
|
87
|
-
multiEntry: index.multiEntry,
|
|
88
|
-
unique: index.unique
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
return {
|
|
92
|
-
name: storeName,
|
|
93
|
-
records,
|
|
94
|
-
indexes,
|
|
95
|
-
autoIncrement: objectStore.autoIncrement,
|
|
96
|
-
keyPath: typeof objectStore.keyPath === "string" ? objectStore.keyPath : void 0,
|
|
97
|
-
keyPathArray: Array.isArray(objectStore.keyPath) ? objectStore.keyPath : void 0
|
|
98
|
-
};
|
|
99
|
-
}));
|
|
100
|
-
return {
|
|
101
|
-
name: dbInfo.name,
|
|
102
|
-
version: dbInfo.version,
|
|
103
|
-
stores
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
localStorage: Object.keys(localStorage).map((name) => ({ name, value: localStorage.getItem(name) })),
|
|
108
|
-
indexedDB: recordIndexedDB ? await Promise.all((await indexedDB.databases()).map(collectDB)).catch((e) => {
|
|
109
|
-
throw new Error("Unable to serialize IndexedDB: " + e.message);
|
|
110
|
-
}) : void 0
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
async function restore(serializersSource, builtins, originState) {
|
|
114
|
-
const { parseEvaluationResultValue } = serializersSource(builtins);
|
|
115
|
-
for (const { name, value } of originState.localStorage || [])
|
|
116
|
-
localStorage.setItem(name, value);
|
|
117
|
-
await Promise.all((originState.indexedDB ?? []).map(async (dbInfo) => {
|
|
118
|
-
const openRequest = indexedDB.open(dbInfo.name, dbInfo.version);
|
|
119
|
-
openRequest.addEventListener("upgradeneeded", () => {
|
|
120
|
-
const db2 = openRequest.result;
|
|
121
|
-
for (const store of dbInfo.stores) {
|
|
122
|
-
const objectStore = db2.createObjectStore(store.name, { autoIncrement: store.autoIncrement, keyPath: store.keyPathArray ?? store.keyPath });
|
|
123
|
-
for (const index of store.indexes)
|
|
124
|
-
objectStore.createIndex(index.name, index.keyPathArray ?? index.keyPath, { unique: index.unique, multiEntry: index.multiEntry });
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
function idbRequestToPromise(request) {
|
|
128
|
-
return new Promise((resolve, reject) => {
|
|
129
|
-
request.addEventListener("success", () => resolve(request.result));
|
|
130
|
-
request.addEventListener("error", () => reject(request.error));
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
const db = await idbRequestToPromise(openRequest);
|
|
134
|
-
const transaction = db.transaction(db.objectStoreNames, "readwrite");
|
|
135
|
-
await Promise.all(dbInfo.stores.map(async (store) => {
|
|
136
|
-
const objectStore = transaction.objectStore(store.name);
|
|
137
|
-
await Promise.all(store.records.map(async (record) => {
|
|
138
|
-
await idbRequestToPromise(
|
|
139
|
-
objectStore.add(
|
|
140
|
-
record.value ?? parseEvaluationResultValue(record.valueEncoded),
|
|
141
|
-
record.key ?? parseEvaluationResultValue(record.keyEncoded)
|
|
142
|
-
)
|
|
143
|
-
);
|
|
144
|
-
}));
|
|
145
|
-
}));
|
|
146
|
-
})).catch((e) => {
|
|
147
|
-
throw new Error("Unable to restore IndexedDB: " + e.message);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
-
0 && (module.exports = {
|
|
152
|
-
collect,
|
|
153
|
-
restore
|
|
154
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var timeoutSettings_exports = {};
|
|
20
|
-
__export(timeoutSettings_exports, {
|
|
21
|
-
DEFAULT_LAUNCH_TIMEOUT: () => DEFAULT_LAUNCH_TIMEOUT,
|
|
22
|
-
DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
|
|
23
|
-
TimeoutSettings: () => TimeoutSettings
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(timeoutSettings_exports);
|
|
26
|
-
var import_debug = require("./utils/debug");
|
|
27
|
-
const DEFAULT_TIMEOUT = 3e4;
|
|
28
|
-
const DEFAULT_LAUNCH_TIMEOUT = 3 * 60 * 1e3;
|
|
29
|
-
class TimeoutSettings {
|
|
30
|
-
constructor(parent) {
|
|
31
|
-
this._parent = parent;
|
|
32
|
-
}
|
|
33
|
-
setDefaultTimeout(timeout) {
|
|
34
|
-
this._defaultTimeout = timeout;
|
|
35
|
-
}
|
|
36
|
-
setDefaultNavigationTimeout(timeout) {
|
|
37
|
-
this._defaultNavigationTimeout = timeout;
|
|
38
|
-
}
|
|
39
|
-
defaultNavigationTimeout() {
|
|
40
|
-
return this._defaultNavigationTimeout;
|
|
41
|
-
}
|
|
42
|
-
defaultTimeout() {
|
|
43
|
-
return this._defaultTimeout;
|
|
44
|
-
}
|
|
45
|
-
navigationTimeout(options) {
|
|
46
|
-
if (typeof options.timeout === "number")
|
|
47
|
-
return options.timeout;
|
|
48
|
-
if (this._defaultNavigationTimeout !== void 0)
|
|
49
|
-
return this._defaultNavigationTimeout;
|
|
50
|
-
if ((0, import_debug.debugMode)())
|
|
51
|
-
return 0;
|
|
52
|
-
if (this._defaultTimeout !== void 0)
|
|
53
|
-
return this._defaultTimeout;
|
|
54
|
-
if (this._parent)
|
|
55
|
-
return this._parent.navigationTimeout(options);
|
|
56
|
-
return DEFAULT_TIMEOUT;
|
|
57
|
-
}
|
|
58
|
-
timeout(options) {
|
|
59
|
-
if (typeof options.timeout === "number")
|
|
60
|
-
return options.timeout;
|
|
61
|
-
if ((0, import_debug.debugMode)())
|
|
62
|
-
return 0;
|
|
63
|
-
if (this._defaultTimeout !== void 0)
|
|
64
|
-
return this._defaultTimeout;
|
|
65
|
-
if (this._parent)
|
|
66
|
-
return this._parent.timeout(options);
|
|
67
|
-
return DEFAULT_TIMEOUT;
|
|
68
|
-
}
|
|
69
|
-
static timeout(options) {
|
|
70
|
-
if (typeof options.timeout === "number")
|
|
71
|
-
return options.timeout;
|
|
72
|
-
if ((0, import_debug.debugMode)())
|
|
73
|
-
return 0;
|
|
74
|
-
return DEFAULT_TIMEOUT;
|
|
75
|
-
}
|
|
76
|
-
static launchTimeout(options) {
|
|
77
|
-
if (typeof options.timeout === "number")
|
|
78
|
-
return options.timeout;
|
|
79
|
-
if ((0, import_debug.debugMode)())
|
|
80
|
-
return 0;
|
|
81
|
-
return DEFAULT_LAUNCH_TIMEOUT;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
-
0 && (module.exports = {
|
|
86
|
-
DEFAULT_LAUNCH_TIMEOUT,
|
|
87
|
-
DEFAULT_TIMEOUT,
|
|
88
|
-
TimeoutSettings
|
|
89
|
-
});
|