@checkly/playwright-core 1.51.16 → 1.51.17-beta
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/checkly/checklyFileSystem.js +44 -0
- package/lib/checkly/secretsFilter.js +12 -2
- package/lib/escapeRegExp.js +30 -0
- package/lib/generated/bindingsControllerSource.js +7 -0
- package/lib/generated/clockSource.js +1 -2
- package/lib/generated/consoleApiSource.js +1 -2
- package/lib/generated/injectedScriptSource.js +1 -2
- package/lib/generated/pollingRecorderSource.js +1 -2
- package/lib/generated/storageScriptSource.js +7 -0
- package/lib/generated/utilityScriptSource.js +1 -2
- package/lib/generated/webSocketMockSource.js +1 -2
- package/lib/secretsFilter.js +131 -0
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiProtocolCore.js +152 -0
- package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/har/harRecorder.js +4 -2
- package/lib/server/pageBinding.js +88 -0
- package/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/lib/server/registry/index.d.ts +86 -0
- package/lib/server/trace/recorder/tracing.js +10 -20
- package/lib/server/utils/fileUtils.js +65 -2
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/utils/isomorphic/builtins.js +90 -0
- package/lib/utils/isomorphic/protocolFormatter.js +68 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +321 -0
- package/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/lib/vite/traceViewer/sw.bundle.js +7888 -3
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
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 bidiCommands_d_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(bidiCommands_d_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2024 Google Inc.
|
|
20
|
+
* Modifications copyright (c) Microsoft Corporation.
|
|
21
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22
|
+
*/
|
|
@@ -0,0 +1,152 @@
|
|
|
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 bidiProtocolCore_exports = {};
|
|
20
|
+
__export(bidiProtocolCore_exports, {
|
|
21
|
+
BrowsingContext: () => BrowsingContext,
|
|
22
|
+
ErrorCode: () => ErrorCode,
|
|
23
|
+
Input: () => Input,
|
|
24
|
+
Log: () => Log,
|
|
25
|
+
Network: () => Network,
|
|
26
|
+
Script: () => Script,
|
|
27
|
+
Session: () => Session
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(bidiProtocolCore_exports);
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright 2024 Google Inc.
|
|
33
|
+
* Modifications copyright (c) Microsoft Corporation.
|
|
34
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
35
|
+
*/
|
|
36
|
+
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
37
|
+
ErrorCode2["InvalidArgument"] = "invalid argument";
|
|
38
|
+
ErrorCode2["InvalidSelector"] = "invalid selector";
|
|
39
|
+
ErrorCode2["InvalidSessionId"] = "invalid session id";
|
|
40
|
+
ErrorCode2["InvalidWebExtension"] = "invalid web extension";
|
|
41
|
+
ErrorCode2["MoveTargetOutOfBounds"] = "move target out of bounds";
|
|
42
|
+
ErrorCode2["NoSuchAlert"] = "no such alert";
|
|
43
|
+
ErrorCode2["NoSuchElement"] = "no such element";
|
|
44
|
+
ErrorCode2["NoSuchFrame"] = "no such frame";
|
|
45
|
+
ErrorCode2["NoSuchHandle"] = "no such handle";
|
|
46
|
+
ErrorCode2["NoSuchHistoryEntry"] = "no such history entry";
|
|
47
|
+
ErrorCode2["NoSuchIntercept"] = "no such intercept";
|
|
48
|
+
ErrorCode2["NoSuchNode"] = "no such node";
|
|
49
|
+
ErrorCode2["NoSuchRequest"] = "no such request";
|
|
50
|
+
ErrorCode2["NoSuchScript"] = "no such script";
|
|
51
|
+
ErrorCode2["NoSuchStoragePartition"] = "no such storage partition";
|
|
52
|
+
ErrorCode2["NoSuchUserContext"] = "no such user context";
|
|
53
|
+
ErrorCode2["NoSuchWebExtension"] = "no such web extension";
|
|
54
|
+
ErrorCode2["SessionNotCreated"] = "session not created";
|
|
55
|
+
ErrorCode2["UnableToCaptureScreen"] = "unable to capture screen";
|
|
56
|
+
ErrorCode2["UnableToCloseBrowser"] = "unable to close browser";
|
|
57
|
+
ErrorCode2["UnableToSetCookie"] = "unable to set cookie";
|
|
58
|
+
ErrorCode2["UnableToSetFileInput"] = "unable to set file input";
|
|
59
|
+
ErrorCode2["UnderspecifiedStoragePartition"] = "underspecified storage partition";
|
|
60
|
+
ErrorCode2["UnknownCommand"] = "unknown command";
|
|
61
|
+
ErrorCode2["UnknownError"] = "unknown error";
|
|
62
|
+
ErrorCode2["UnsupportedOperation"] = "unsupported operation";
|
|
63
|
+
return ErrorCode2;
|
|
64
|
+
})(ErrorCode || {});
|
|
65
|
+
var Session;
|
|
66
|
+
((Session2) => {
|
|
67
|
+
let UserPromptHandlerType;
|
|
68
|
+
((UserPromptHandlerType2) => {
|
|
69
|
+
UserPromptHandlerType2["Accept"] = "accept";
|
|
70
|
+
UserPromptHandlerType2["Dismiss"] = "dismiss";
|
|
71
|
+
UserPromptHandlerType2["Ignore"] = "ignore";
|
|
72
|
+
})(UserPromptHandlerType = Session2.UserPromptHandlerType || (Session2.UserPromptHandlerType = {}));
|
|
73
|
+
})(Session || (Session = {}));
|
|
74
|
+
var BrowsingContext;
|
|
75
|
+
((BrowsingContext2) => {
|
|
76
|
+
let ReadinessState;
|
|
77
|
+
((ReadinessState2) => {
|
|
78
|
+
ReadinessState2["None"] = "none";
|
|
79
|
+
ReadinessState2["Interactive"] = "interactive";
|
|
80
|
+
ReadinessState2["Complete"] = "complete";
|
|
81
|
+
})(ReadinessState = BrowsingContext2.ReadinessState || (BrowsingContext2.ReadinessState = {}));
|
|
82
|
+
})(BrowsingContext || (BrowsingContext = {}));
|
|
83
|
+
((BrowsingContext2) => {
|
|
84
|
+
let UserPromptType;
|
|
85
|
+
((UserPromptType2) => {
|
|
86
|
+
UserPromptType2["Alert"] = "alert";
|
|
87
|
+
UserPromptType2["Beforeunload"] = "beforeunload";
|
|
88
|
+
UserPromptType2["Confirm"] = "confirm";
|
|
89
|
+
UserPromptType2["Prompt"] = "prompt";
|
|
90
|
+
})(UserPromptType = BrowsingContext2.UserPromptType || (BrowsingContext2.UserPromptType = {}));
|
|
91
|
+
})(BrowsingContext || (BrowsingContext = {}));
|
|
92
|
+
((BrowsingContext2) => {
|
|
93
|
+
let CreateType;
|
|
94
|
+
((CreateType2) => {
|
|
95
|
+
CreateType2["Tab"] = "tab";
|
|
96
|
+
CreateType2["Window"] = "window";
|
|
97
|
+
})(CreateType = BrowsingContext2.CreateType || (BrowsingContext2.CreateType = {}));
|
|
98
|
+
})(BrowsingContext || (BrowsingContext = {}));
|
|
99
|
+
var Network;
|
|
100
|
+
((Network2) => {
|
|
101
|
+
let SameSite;
|
|
102
|
+
((SameSite2) => {
|
|
103
|
+
SameSite2["Strict"] = "strict";
|
|
104
|
+
SameSite2["Lax"] = "lax";
|
|
105
|
+
SameSite2["None"] = "none";
|
|
106
|
+
})(SameSite = Network2.SameSite || (Network2.SameSite = {}));
|
|
107
|
+
})(Network || (Network = {}));
|
|
108
|
+
((Network2) => {
|
|
109
|
+
let InterceptPhase;
|
|
110
|
+
((InterceptPhase2) => {
|
|
111
|
+
InterceptPhase2["BeforeRequestSent"] = "beforeRequestSent";
|
|
112
|
+
InterceptPhase2["ResponseStarted"] = "responseStarted";
|
|
113
|
+
InterceptPhase2["AuthRequired"] = "authRequired";
|
|
114
|
+
})(InterceptPhase = Network2.InterceptPhase || (Network2.InterceptPhase = {}));
|
|
115
|
+
})(Network || (Network = {}));
|
|
116
|
+
var Script;
|
|
117
|
+
((Script2) => {
|
|
118
|
+
let ResultOwnership;
|
|
119
|
+
((ResultOwnership2) => {
|
|
120
|
+
ResultOwnership2["Root"] = "root";
|
|
121
|
+
ResultOwnership2["None"] = "none";
|
|
122
|
+
})(ResultOwnership = Script2.ResultOwnership || (Script2.ResultOwnership = {}));
|
|
123
|
+
})(Script || (Script = {}));
|
|
124
|
+
var Log;
|
|
125
|
+
((Log2) => {
|
|
126
|
+
let Level;
|
|
127
|
+
((Level2) => {
|
|
128
|
+
Level2["Debug"] = "debug";
|
|
129
|
+
Level2["Info"] = "info";
|
|
130
|
+
Level2["Warn"] = "warn";
|
|
131
|
+
Level2["Error"] = "error";
|
|
132
|
+
})(Level = Log2.Level || (Log2.Level = {}));
|
|
133
|
+
})(Log || (Log = {}));
|
|
134
|
+
var Input;
|
|
135
|
+
((Input2) => {
|
|
136
|
+
let PointerType;
|
|
137
|
+
((PointerType2) => {
|
|
138
|
+
PointerType2["Mouse"] = "mouse";
|
|
139
|
+
PointerType2["Pen"] = "pen";
|
|
140
|
+
PointerType2["Touch"] = "touch";
|
|
141
|
+
})(PointerType = Input2.PointerType || (Input2.PointerType = {}));
|
|
142
|
+
})(Input || (Input = {}));
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
BrowsingContext,
|
|
146
|
+
ErrorCode,
|
|
147
|
+
Input,
|
|
148
|
+
Log,
|
|
149
|
+
Network,
|
|
150
|
+
Script,
|
|
151
|
+
Session
|
|
152
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
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 bidiProtocolPermissions_exports = {};
|
|
20
|
+
__export(bidiProtocolPermissions_exports, {
|
|
21
|
+
Permissions: () => Permissions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(bidiProtocolPermissions_exports);
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2024 Google Inc.
|
|
27
|
+
* Modifications copyright (c) Microsoft Corporation.
|
|
28
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
29
|
+
*/
|
|
30
|
+
var Permissions;
|
|
31
|
+
((Permissions2) => {
|
|
32
|
+
let PermissionState;
|
|
33
|
+
((PermissionState2) => {
|
|
34
|
+
PermissionState2["Granted"] = "granted";
|
|
35
|
+
PermissionState2["Denied"] = "denied";
|
|
36
|
+
PermissionState2["Prompt"] = "prompt";
|
|
37
|
+
})(PermissionState = Permissions2.PermissionState || (Permissions2.PermissionState = {}));
|
|
38
|
+
})(Permissions || (Permissions = {}));
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
Permissions
|
|
42
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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 protocol_d_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(protocol_d_exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
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 protocol_d_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(protocol_d_exports);
|
|
@@ -11,6 +11,8 @@ var _harTracer = require("./harTracer");
|
|
|
11
11
|
var _crypto = require("../utils/crypto");
|
|
12
12
|
var _manualPromise = require("../../utils/isomorphic/manualPromise");
|
|
13
13
|
var _zipBundle = require("../../zipBundle");
|
|
14
|
+
var _fileUtils = require("../utils/fileUtils");
|
|
15
|
+
var _secretsFilter = require("../../checkly/secretsFilter");
|
|
14
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
17
|
/**
|
|
16
18
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -48,7 +50,7 @@ class HarRecorder {
|
|
|
48
50
|
waitForContentOnStop: true,
|
|
49
51
|
urlFilter: urlFilterRe !== null && urlFilterRe !== void 0 ? urlFilterRe : options.urlGlob
|
|
50
52
|
});
|
|
51
|
-
this._zipFile = content === 'attach' || expectsZip ? new _zipBundle.yazl.ZipFile() : null;
|
|
53
|
+
this._zipFile = content === 'attach' || expectsZip ? (0, _secretsFilter.shouldEnableSecretScrubbing)() ? new (new _fileUtils.SecretSerializedFS((0, _secretsFilter.secretsFilter)()).createScrubbingZipFile(_zipBundle.yazl.ZipFile))() : new _zipBundle.yazl.ZipFile() : null;
|
|
52
54
|
this._tracer.start({
|
|
53
55
|
omitScripts: false
|
|
54
56
|
});
|
|
@@ -56,7 +58,7 @@ class HarRecorder {
|
|
|
56
58
|
onEntryStarted(entry) {
|
|
57
59
|
this._entries.push(entry);
|
|
58
60
|
}
|
|
59
|
-
onEntryFinished(
|
|
61
|
+
onEntryFinished(_entry) {}
|
|
60
62
|
onContentBlob(sha1, buffer) {
|
|
61
63
|
if (!this._zipFile || this._writtenZipEntries.has(sha1)) return;
|
|
62
64
|
this._writtenZipEntries.add(sha1);
|
|
@@ -0,0 +1,88 @@
|
|
|
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 pageBinding_exports = {};
|
|
20
|
+
__export(pageBinding_exports, {
|
|
21
|
+
createPageBindingScript: () => createPageBindingScript,
|
|
22
|
+
deliverBindingResult: () => deliverBindingResult,
|
|
23
|
+
takeBindingHandle: () => takeBindingHandle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(pageBinding_exports);
|
|
26
|
+
var import_builtins = require("../utils/isomorphic/builtins");
|
|
27
|
+
var import_utilityScriptSerializers = require("../utils/isomorphic/utilityScriptSerializers");
|
|
28
|
+
function addPageBinding(playwrightBinding, bindingName, needsHandle, utilityScriptSerializersFactory, builtins2) {
|
|
29
|
+
const { serializeAsCallArgument } = utilityScriptSerializersFactory(builtins2);
|
|
30
|
+
const binding = globalThis[playwrightBinding];
|
|
31
|
+
globalThis[bindingName] = (...args) => {
|
|
32
|
+
const me = globalThis[bindingName];
|
|
33
|
+
if (needsHandle && args.slice(1).some((arg) => arg !== void 0))
|
|
34
|
+
throw new Error(`exposeBindingHandle supports a single argument, ${args.length} received`);
|
|
35
|
+
let callbacks = me["callbacks"];
|
|
36
|
+
if (!callbacks) {
|
|
37
|
+
callbacks = new builtins2.Map();
|
|
38
|
+
me["callbacks"] = callbacks;
|
|
39
|
+
}
|
|
40
|
+
const seq = (me["lastSeq"] || 0) + 1;
|
|
41
|
+
me["lastSeq"] = seq;
|
|
42
|
+
let handles = me["handles"];
|
|
43
|
+
if (!handles) {
|
|
44
|
+
handles = new builtins2.Map();
|
|
45
|
+
me["handles"] = handles;
|
|
46
|
+
}
|
|
47
|
+
const promise = new Promise((resolve, reject) => callbacks.set(seq, { resolve, reject }));
|
|
48
|
+
let payload;
|
|
49
|
+
if (needsHandle) {
|
|
50
|
+
handles.set(seq, args[0]);
|
|
51
|
+
payload = { name: bindingName, seq };
|
|
52
|
+
} else {
|
|
53
|
+
const serializedArgs = [];
|
|
54
|
+
for (let i = 0; i < args.length; i++) {
|
|
55
|
+
serializedArgs[i] = serializeAsCallArgument(args[i], (v) => {
|
|
56
|
+
return { fallThrough: v };
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
payload = { name: bindingName, seq, serializedArgs };
|
|
60
|
+
}
|
|
61
|
+
binding(JSON.stringify(payload));
|
|
62
|
+
return promise;
|
|
63
|
+
};
|
|
64
|
+
globalThis[bindingName].__installed = true;
|
|
65
|
+
}
|
|
66
|
+
function takeBindingHandle(arg) {
|
|
67
|
+
const handles = globalThis[arg.name]["handles"];
|
|
68
|
+
const handle = handles.get(arg.seq);
|
|
69
|
+
handles.delete(arg.seq);
|
|
70
|
+
return handle;
|
|
71
|
+
}
|
|
72
|
+
function deliverBindingResult(arg) {
|
|
73
|
+
const callbacks = globalThis[arg.name]["callbacks"];
|
|
74
|
+
if ("error" in arg)
|
|
75
|
+
callbacks.get(arg.seq).reject(arg.error);
|
|
76
|
+
else
|
|
77
|
+
callbacks.get(arg.seq).resolve(arg.result);
|
|
78
|
+
callbacks.delete(arg.seq);
|
|
79
|
+
}
|
|
80
|
+
function createPageBindingScript(playwrightBinding, name, needsHandle) {
|
|
81
|
+
return `(${addPageBinding.toString()})(${JSON.stringify(playwrightBinding)}, ${JSON.stringify(name)}, ${needsHandle}, (${import_utilityScriptSerializers.source}), (${import_builtins.builtins})())`;
|
|
82
|
+
}
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
createPageBindingScript,
|
|
86
|
+
deliverBindingResult,
|
|
87
|
+
takeBindingHandle
|
|
88
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
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 recorderSignalProcessor_exports = {};
|
|
20
|
+
__export(recorderSignalProcessor_exports, {
|
|
21
|
+
RecorderSignalProcessor: () => RecorderSignalProcessor
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(recorderSignalProcessor_exports);
|
|
24
|
+
var import_debug = require("../utils/debug");
|
|
25
|
+
var import_time = require("../../utils/isomorphic/time");
|
|
26
|
+
var import_recorderUtils = require("./recorderUtils");
|
|
27
|
+
class RecorderSignalProcessor {
|
|
28
|
+
constructor(actionSink) {
|
|
29
|
+
this._lastAction = null;
|
|
30
|
+
this._delegate = actionSink;
|
|
31
|
+
}
|
|
32
|
+
addAction(actionInContext) {
|
|
33
|
+
this._lastAction = actionInContext;
|
|
34
|
+
this._delegate.addAction(actionInContext);
|
|
35
|
+
}
|
|
36
|
+
signal(pageAlias, frame, signal) {
|
|
37
|
+
const timestamp = (0, import_time.monotonicTime)();
|
|
38
|
+
if (signal.name === "navigation" && frame._page.mainFrame() === frame) {
|
|
39
|
+
const lastAction = this._lastAction;
|
|
40
|
+
const signalThreshold = (0, import_debug.isUnderTest)() ? 500 : 5e3;
|
|
41
|
+
let generateGoto = false;
|
|
42
|
+
if (!lastAction)
|
|
43
|
+
generateGoto = true;
|
|
44
|
+
else if (lastAction.action.name !== "click" && lastAction.action.name !== "press" && lastAction.action.name !== "fill")
|
|
45
|
+
generateGoto = true;
|
|
46
|
+
else if (timestamp - lastAction.startTime > signalThreshold)
|
|
47
|
+
generateGoto = true;
|
|
48
|
+
if (generateGoto) {
|
|
49
|
+
this.addAction({
|
|
50
|
+
frame: {
|
|
51
|
+
pageGuid: frame._page.guid,
|
|
52
|
+
pageAlias,
|
|
53
|
+
framePath: []
|
|
54
|
+
},
|
|
55
|
+
action: {
|
|
56
|
+
name: "navigate",
|
|
57
|
+
url: frame.url(),
|
|
58
|
+
signals: []
|
|
59
|
+
},
|
|
60
|
+
startTime: timestamp,
|
|
61
|
+
endTime: timestamp
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
(0, import_recorderUtils.generateFrameSelector)(frame).then((framePath) => {
|
|
67
|
+
const signalInContext = {
|
|
68
|
+
frame: {
|
|
69
|
+
pageGuid: frame._page.guid,
|
|
70
|
+
pageAlias,
|
|
71
|
+
framePath
|
|
72
|
+
},
|
|
73
|
+
signal,
|
|
74
|
+
timestamp
|
|
75
|
+
};
|
|
76
|
+
this._delegate.addSignal(signalInContext);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
RecorderSignalProcessor
|
|
83
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2017 Google Inc. All rights reserved.
|
|
3
|
+
* Modifications copyright (c) Microsoft Corporation.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { writeDockerVersion } from './dependencies';
|
|
18
|
+
export declare const registryDirectory: string;
|
|
19
|
+
type BrowsersJSON = {
|
|
20
|
+
comment: string;
|
|
21
|
+
browsers: {
|
|
22
|
+
name: string;
|
|
23
|
+
revision: string;
|
|
24
|
+
browserVersion?: string;
|
|
25
|
+
installByDefault: boolean;
|
|
26
|
+
revisionOverrides?: {
|
|
27
|
+
[os: string]: string;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
export type BrowserInfo = {
|
|
32
|
+
browserName: string;
|
|
33
|
+
browserVersion: number;
|
|
34
|
+
browserPath: string;
|
|
35
|
+
referenceDir: string;
|
|
36
|
+
};
|
|
37
|
+
export type BrowserName = 'chromium' | 'firefox' | 'webkit' | '_bidiFirefox' | '_bidiChromium';
|
|
38
|
+
type InternalTool = 'ffmpeg' | 'winldd' | 'firefox-beta' | 'chromium-tip-of-tree' | 'chromium-headless-shell' | 'chromium-tip-of-tree-headless-shell' | 'android';
|
|
39
|
+
type BidiChannel = 'moz-firefox' | 'moz-firefox-beta' | 'moz-firefox-nightly' | 'bidi-chrome-canary' | 'bidi-chrome-stable' | 'bidi-chromium';
|
|
40
|
+
type ChromiumChannel = 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary' | 'msedge' | 'msedge-beta' | 'msedge-dev' | 'msedge-canary';
|
|
41
|
+
export interface Executable {
|
|
42
|
+
type: 'browser' | 'tool' | 'channel';
|
|
43
|
+
name: BrowserName | InternalTool | ChromiumChannel | BidiChannel;
|
|
44
|
+
browserName: BrowserName | undefined;
|
|
45
|
+
installType: 'download-by-default' | 'download-on-demand' | 'install-script' | 'none';
|
|
46
|
+
directory: string | undefined;
|
|
47
|
+
downloadURLs?: string[];
|
|
48
|
+
browserVersion?: string;
|
|
49
|
+
executablePathOrDie(sdkLanguage: string): string;
|
|
50
|
+
executablePath(sdkLanguage: string): string | undefined;
|
|
51
|
+
_validateHostRequirements(sdkLanguage: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export declare class Registry {
|
|
54
|
+
private _executables;
|
|
55
|
+
constructor(browsersJSON: BrowsersJSON);
|
|
56
|
+
private _createChromiumChannel;
|
|
57
|
+
private _createBidiFirefoxChannel;
|
|
58
|
+
private _createBidiChromiumChannel;
|
|
59
|
+
executables(): Executable[];
|
|
60
|
+
findExecutable(name: BrowserName): Executable;
|
|
61
|
+
findExecutable(name: string): Executable | undefined;
|
|
62
|
+
defaultExecutables(): Executable[];
|
|
63
|
+
private _dedupe;
|
|
64
|
+
private _validateHostRequirements;
|
|
65
|
+
installDeps(executablesToInstallDeps: Executable[], dryRun: boolean): Promise<void>;
|
|
66
|
+
install(executablesToInstall: Executable[], forceReinstall: boolean): Promise<void>;
|
|
67
|
+
uninstall(all: boolean): Promise<{
|
|
68
|
+
numberOfBrowsersLeft: number;
|
|
69
|
+
}>;
|
|
70
|
+
validateHostRequirementsForExecutablesIfNeeded(executables: Executable[], sdkLanguage: string): Promise<void>;
|
|
71
|
+
private _validateHostRequirementsForExecutableIfNeeded;
|
|
72
|
+
private _downloadURLs;
|
|
73
|
+
private _downloadExecutable;
|
|
74
|
+
private _installMSEdgeChannel;
|
|
75
|
+
private _installChromiumChannel;
|
|
76
|
+
listInstalledBrowsers(): Promise<BrowserInfo[]>;
|
|
77
|
+
private _validateInstallationCache;
|
|
78
|
+
private _traverseBrowserInstallations;
|
|
79
|
+
private _deleteStaleBrowsers;
|
|
80
|
+
private _deleteBrokenInstallations;
|
|
81
|
+
}
|
|
82
|
+
export declare function browserDirectoryToMarkerFilePath(browserDirectory: string): string;
|
|
83
|
+
export declare function buildPlaywrightCLICommand(sdkLanguage: string, parameters: string): string;
|
|
84
|
+
export declare function installBrowsersForNpmInstall(browsers: string[]): Promise<boolean>;
|
|
85
|
+
export declare function findChromiumChannelBestEffort(sdkLanguage: string): string | undefined;
|
|
86
|
+
export declare const registry: Registry;
|
|
@@ -49,7 +49,7 @@ const kScreencastOptions = {
|
|
|
49
49
|
class Tracing extends _instrumentation.SdkObject {
|
|
50
50
|
constructor(context, tracesDir) {
|
|
51
51
|
super(context, 'tracing');
|
|
52
|
-
this._fs =
|
|
52
|
+
this._fs = void 0;
|
|
53
53
|
this._snapshotter = void 0;
|
|
54
54
|
this._harTracer = void 0;
|
|
55
55
|
this._screencastListeners = [];
|
|
@@ -63,10 +63,11 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
63
63
|
this._allResources = new Set();
|
|
64
64
|
this._contextCreatedEvent = void 0;
|
|
65
65
|
this._pendingHarEntries = new Set();
|
|
66
|
-
this._secretsFilter = void 0;
|
|
67
66
|
this._context = context;
|
|
68
67
|
this._precreatedTracesDir = tracesDir;
|
|
69
|
-
|
|
68
|
+
// [Checkly] Use SecretSerializedFS when secret scrubbing is enabled
|
|
69
|
+
const needsSecretScrubbing = (0, _secretsFilter.shouldEnableSecretScrubbing)();
|
|
70
|
+
this._fs = needsSecretScrubbing ? new _fileUtils.SecretSerializedFS((0, _secretsFilter.secretsFilter)()) : new _fileUtils.SerializedFS();
|
|
70
71
|
this._harTracer = new _harTracer.HarTracer(context, null, this, {
|
|
71
72
|
content: 'attach',
|
|
72
73
|
includeTraceInfo: true,
|
|
@@ -394,7 +395,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
394
395
|
type: 'resource-snapshot',
|
|
395
396
|
snapshot: entry
|
|
396
397
|
};
|
|
397
|
-
const visited = visitTraceEvent(event, this._state.networkSha1s
|
|
398
|
+
const visited = visitTraceEvent(event, this._state.networkSha1s);
|
|
398
399
|
this._fs.appendFile(this._state.networkFile, JSON.stringify(visited) + '\n', true /* flush */);
|
|
399
400
|
}
|
|
400
401
|
flushHarEntries() {
|
|
@@ -404,7 +405,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
404
405
|
type: 'resource-snapshot',
|
|
405
406
|
snapshot: entry
|
|
406
407
|
};
|
|
407
|
-
const visited = visitTraceEvent(event, this._state.networkSha1s
|
|
408
|
+
const visited = visitTraceEvent(event, this._state.networkSha1s);
|
|
408
409
|
harLines.push(JSON.stringify(visited));
|
|
409
410
|
}
|
|
410
411
|
this._pendingHarEntries.clear();
|
|
@@ -527,7 +528,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
527
528
|
}));
|
|
528
529
|
}
|
|
529
530
|
_appendTraceEvent(event) {
|
|
530
|
-
const visited = visitTraceEvent(event, this._state.traceSha1s
|
|
531
|
+
const visited = visitTraceEvent(event, this._state.traceSha1s);
|
|
531
532
|
// Do not flush (console) events, they are too noisy, unless we are in ui mode (live).
|
|
532
533
|
const flush = this._state.options.live || event.type !== 'event' && event.type !== 'console' && event.type !== 'log';
|
|
533
534
|
this._fs.appendFile(this._state.traceFile, JSON.stringify(visited) + '\n', flush);
|
|
@@ -540,13 +541,8 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
540
541
|
}
|
|
541
542
|
}
|
|
542
543
|
exports.Tracing = Tracing;
|
|
543
|
-
function visitTraceEvent(object, sha1s
|
|
544
|
-
if (Array.isArray(object)) return object.map(o =>
|
|
545
|
-
if (typeof o === 'string' && new Date(o).toString() === 'Invalid Date') {
|
|
546
|
-
return secretsFilter(o);
|
|
547
|
-
}
|
|
548
|
-
return visitTraceEvent(o, sha1s, secretsFilter);
|
|
549
|
-
});
|
|
544
|
+
function visitTraceEvent(object, sha1s) {
|
|
545
|
+
if (Array.isArray(object)) return object.map(o => visitTraceEvent(o, sha1s));
|
|
550
546
|
if (object instanceof _dispatcher.Dispatcher) return `<${object._type}>`;
|
|
551
547
|
if (object instanceof Buffer) return `<Buffer>`;
|
|
552
548
|
if (object instanceof Date) return object;
|
|
@@ -557,13 +553,7 @@ function visitTraceEvent(object, sha1s, secretsFilter) {
|
|
|
557
553
|
if (key === 'sha1' || key === '_sha1' || key.endsWith('Sha1')) {
|
|
558
554
|
if (value) sha1s.add(value);
|
|
559
555
|
}
|
|
560
|
-
|
|
561
|
-
// Some values like numbers or certain strings shouldn't be scrubbed,
|
|
562
|
-
// Otherwise parts of the trace will be unreadable.
|
|
563
|
-
result[key] = key.endsWith('Sha1') || ['pageref', '_sha1', 'downloadsPath', 'tracesDir', 'pageId', 'sha1'].includes(key) ? value : secretsFilter(value);
|
|
564
|
-
} else {
|
|
565
|
-
result[key] = visitTraceEvent(value, sha1s, secretsFilter);
|
|
566
|
-
}
|
|
556
|
+
result[key] = visitTraceEvent(value, sha1s);
|
|
567
557
|
}
|
|
568
558
|
return result;
|
|
569
559
|
}
|