patchright-bun-core 1.58.2 → 1.59.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 +126 -650
- package/browsers.json +16 -14
- package/lib/bootstrap.js +77 -0
- package/lib/cli/browserActions.js +308 -0
- package/lib/cli/driver.js +3 -2
- package/lib/cli/installActions.js +171 -0
- package/lib/cli/program.js +47 -411
- package/lib/client/android.js +4 -4
- package/lib/client/api.js +3 -3
- package/lib/client/browser.js +8 -0
- package/lib/client/browserContext.js +18 -37
- package/lib/client/browserType.js +19 -51
- package/lib/client/cdpSession.js +6 -2
- package/lib/client/channelOwner.js +1 -1
- package/lib/client/{webSocket.js → connect.js} +57 -7
- package/lib/client/connection.js +8 -4
- package/lib/client/consoleMessage.js +3 -0
- package/lib/client/debugger.js +57 -0
- package/lib/client/dialog.js +8 -1
- package/lib/client/disposable.js +76 -0
- package/lib/client/electron.js +1 -0
- package/lib/client/elementHandle.js +1 -4
- package/lib/client/events.js +3 -3
- package/lib/client/fetch.js +0 -1
- package/lib/client/frame.js +0 -5
- package/lib/client/harRouter.js +13 -1
- package/lib/client/jsHandle.js +0 -4
- package/lib/client/locator.js +5 -7
- package/lib/client/network.js +14 -11
- package/lib/client/page.js +34 -48
- package/lib/client/platform.js +0 -3
- package/lib/client/screencast.js +88 -0
- package/lib/client/selectors.js +3 -1
- package/lib/client/tracing.js +11 -4
- package/lib/client/video.js +13 -20
- package/lib/generated/bindingsControllerSource.js +1 -1
- 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 +1 -1
- package/lib/generated/utilityScriptSource.js +1 -1
- package/lib/mcpBundle.js +0 -6
- package/lib/mcpBundleImpl.js +91 -0
- package/lib/protocol/validator.js +216 -118
- package/lib/protocol/validatorPrimitives.js +1 -1
- package/lib/remote/playwrightConnection.js +10 -8
- package/lib/remote/playwrightPipeServer.js +100 -0
- package/lib/remote/playwrightServer.js +13 -8
- package/lib/remote/playwrightWebSocketServer.js +73 -0
- package/lib/remote/serverTransport.js +96 -0
- package/lib/server/android/android.js +2 -2
- package/lib/server/bidi/bidiBrowser.js +30 -8
- package/lib/server/bidi/bidiChromium.js +18 -5
- package/lib/server/bidi/bidiNetworkManager.js +39 -11
- package/lib/server/bidi/bidiPage.js +31 -15
- package/lib/server/bidi/third_party/firefoxPrefs.js +3 -1
- package/lib/server/browser.js +84 -21
- package/lib/server/browserContext.js +97 -58
- package/lib/server/browserType.js +14 -12
- package/lib/server/chromium/chromium.js +15 -13
- package/lib/server/chromium/crBrowser.js +18 -10
- package/lib/server/chromium/crNetworkManager.js +4 -4
- package/lib/server/chromium/crPage.js +26 -64
- package/lib/server/chromium/crServiceWorker.js +5 -4
- package/lib/server/clock.js +33 -33
- package/lib/server/console.js +5 -1
- package/lib/server/debugController.js +12 -6
- package/lib/server/debugger.js +40 -47
- package/lib/server/deviceDescriptorsSource.json +137 -137
- package/lib/server/dispatchers/browserContextDispatcher.js +27 -30
- package/lib/server/dispatchers/browserDispatcher.js +11 -5
- package/lib/server/dispatchers/browserTypeDispatcher.js +7 -0
- package/lib/server/dispatchers/cdpSessionDispatcher.js +4 -1
- package/lib/server/dispatchers/debuggerDispatcher.js +84 -0
- package/lib/server/dispatchers/dispatcher.js +1 -1
- package/lib/server/dispatchers/disposableDispatcher.js +39 -0
- package/lib/server/dispatchers/electronDispatcher.js +2 -1
- package/lib/server/dispatchers/frameDispatcher.js +3 -3
- package/lib/server/dispatchers/localUtilsDispatcher.js +37 -1
- package/lib/server/dispatchers/networkDispatchers.js +6 -5
- package/lib/server/dispatchers/pageDispatcher.js +101 -38
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +4 -5
- package/lib/server/disposable.js +41 -0
- package/lib/server/dom.js +44 -26
- package/lib/server/download.js +3 -2
- package/lib/server/electron/electron.js +12 -7
- package/lib/server/firefox/ffBrowser.js +9 -19
- package/lib/server/firefox/ffInput.js +21 -5
- package/lib/server/firefox/ffNetworkManager.js +2 -2
- package/lib/server/firefox/ffPage.js +24 -27
- package/lib/server/frames.js +40 -11
- package/lib/server/har/harRecorder.js +2 -2
- package/lib/server/har/harTracer.js +5 -4
- package/lib/server/input.js +49 -4
- package/lib/server/instrumentation.js +5 -0
- package/lib/server/launchApp.js +0 -1
- package/lib/server/localUtils.js +6 -6
- package/lib/server/network.js +9 -8
- package/lib/server/overlay.js +138 -0
- package/lib/server/page.js +111 -51
- package/lib/server/progress.js +6 -0
- package/lib/server/recorder/recorderApp.js +9 -8
- package/lib/server/recorder.js +76 -40
- package/lib/server/registry/index.js +54 -81
- package/lib/server/registry/nativeDeps.js +1 -0
- package/lib/server/screencast.js +90 -143
- package/lib/server/trace/recorder/snapshotter.js +2 -2
- package/lib/server/trace/recorder/tracing.js +87 -36
- package/lib/server/trace/viewer/traceViewer.js +3 -4
- package/lib/server/usKeyboardLayout.js +7 -0
- package/lib/server/utils/comparators.js +1 -1
- package/lib/server/utils/disposable.js +32 -0
- package/lib/server/utils/eventsHelper.js +3 -1
- package/lib/server/utils/fileUtils.js +16 -2
- package/lib/server/utils/happyEyeballs.js +15 -12
- package/lib/server/utils/hostPlatform.js +0 -15
- package/lib/server/utils/httpServer.js +5 -3
- package/lib/server/utils/network.js +2 -1
- package/lib/server/utils/nodePlatform.js +0 -6
- package/lib/server/utils/processLauncher.js +8 -6
- package/lib/server/utils/zipFile.js +2 -2
- package/lib/server/videoRecorder.js +82 -12
- package/lib/server/webkit/wkBrowser.js +1 -6
- package/lib/server/webkit/wkPage.js +27 -25
- package/lib/server/webkit/wkWorkers.js +2 -1
- package/lib/serverRegistry.js +156 -0
- package/lib/tools/backend/browserBackend.js +79 -0
- package/lib/tools/backend/common.js +63 -0
- package/lib/tools/backend/config.js +41 -0
- package/lib/tools/backend/console.js +66 -0
- package/lib/tools/backend/context.js +296 -0
- package/lib/tools/backend/cookies.js +152 -0
- package/lib/tools/backend/devtools.js +69 -0
- package/lib/tools/backend/dialogs.js +59 -0
- package/lib/tools/backend/evaluate.js +64 -0
- package/lib/tools/backend/files.js +60 -0
- package/lib/tools/backend/form.js +64 -0
- package/lib/tools/backend/keyboard.js +155 -0
- package/lib/tools/backend/logFile.js +95 -0
- package/lib/tools/backend/mouse.js +168 -0
- package/lib/tools/backend/navigate.js +106 -0
- package/lib/tools/backend/network.js +135 -0
- package/lib/tools/backend/pdf.js +48 -0
- package/lib/tools/backend/response.js +305 -0
- package/lib/tools/backend/route.js +140 -0
- package/lib/tools/backend/runCode.js +77 -0
- package/lib/tools/backend/screenshot.js +88 -0
- package/lib/tools/backend/sessionLog.js +74 -0
- package/lib/tools/backend/snapshot.js +208 -0
- package/lib/tools/backend/storage.js +68 -0
- package/lib/tools/backend/tab.js +445 -0
- package/lib/tools/backend/tabs.js +67 -0
- package/lib/tools/backend/tool.js +47 -0
- package/lib/tools/backend/tools.js +102 -0
- package/lib/tools/backend/tracing.js +78 -0
- package/lib/tools/backend/utils.js +83 -0
- package/lib/tools/backend/verify.js +151 -0
- package/lib/tools/backend/video.js +98 -0
- package/lib/tools/backend/wait.js +63 -0
- package/lib/tools/backend/webstorage.js +223 -0
- package/lib/tools/cli-client/cli.js +6 -0
- package/lib/tools/cli-client/help.json +399 -0
- package/lib/tools/cli-client/minimist.js +128 -0
- package/lib/tools/cli-client/program.js +350 -0
- package/lib/tools/cli-client/registry.js +176 -0
- package/lib/tools/cli-client/session.js +289 -0
- package/lib/tools/cli-client/skill/SKILL.md +328 -0
- package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
- package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
- package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
- package/lib/tools/cli-client/skill/references/running-code.md +231 -0
- package/lib/tools/cli-client/skill/references/session-management.md +169 -0
- package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
- package/lib/tools/cli-client/skill/references/test-generation.md +88 -0
- package/lib/tools/cli-client/skill/references/tracing.md +139 -0
- package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
- package/lib/tools/cli-daemon/command.js +73 -0
- package/lib/tools/cli-daemon/commands.js +956 -0
- package/lib/tools/cli-daemon/daemon.js +157 -0
- package/lib/tools/cli-daemon/helpGenerator.js +177 -0
- package/lib/tools/cli-daemon/program.js +129 -0
- package/lib/tools/dashboard/appIcon.png +0 -0
- package/lib/tools/dashboard/dashboardApp.js +284 -0
- package/lib/tools/dashboard/dashboardController.js +296 -0
- package/lib/tools/exports.js +60 -0
- package/lib/tools/mcp/browserFactory.js +233 -0
- package/lib/tools/mcp/cdpRelay.js +352 -0
- package/lib/tools/mcp/cli-stub.js +7 -0
- package/lib/tools/mcp/config.d.js +16 -0
- package/lib/tools/mcp/config.js +446 -0
- package/lib/tools/mcp/configIni.js +189 -0
- package/lib/tools/mcp/extensionContextFactory.js +55 -0
- package/lib/tools/mcp/index.js +62 -0
- package/lib/tools/mcp/log.js +35 -0
- package/lib/tools/mcp/program.js +107 -0
- package/lib/tools/mcp/protocol.js +28 -0
- package/lib/tools/mcp/watchdog.js +44 -0
- package/lib/tools/trace/SKILL.md +171 -0
- package/lib/{server/trace/viewer/traceParser.js → tools/trace/installSkill.js} +15 -39
- package/lib/tools/trace/traceActions.js +142 -0
- package/lib/tools/trace/traceAttachments.js +69 -0
- package/lib/tools/trace/traceCli.js +87 -0
- package/lib/tools/trace/traceConsole.js +97 -0
- package/lib/tools/trace/traceErrors.js +55 -0
- package/lib/tools/trace/traceOpen.js +69 -0
- package/lib/tools/trace/traceParser.js +96 -0
- package/lib/tools/trace/traceRequests.js +182 -0
- package/lib/tools/trace/traceScreenshot.js +68 -0
- package/lib/tools/trace/traceSnapshot.js +149 -0
- package/lib/tools/trace/traceUtils.js +153 -0
- package/lib/tools/utils/connect.js +32 -0
- package/lib/tools/utils/mcp/http.js +152 -0
- package/lib/tools/utils/mcp/server.js +230 -0
- package/lib/tools/utils/mcp/tool.js +47 -0
- package/lib/tools/utils/socketConnection.js +108 -0
- package/lib/utils/isomorphic/formatUtils.js +64 -0
- package/lib/utils/isomorphic/jsonSchema.js +89 -0
- package/lib/utils/isomorphic/mimeType.js +7 -2
- package/lib/utils/isomorphic/protocolFormatter.js +2 -2
- package/lib/utils/isomorphic/protocolMetainfo.js +127 -106
- package/lib/utils/isomorphic/stringUtils.js +3 -3
- package/lib/utils/isomorphic/timeoutRunner.js +3 -3
- package/lib/utils/isomorphic/trace/snapshotRenderer.js +35 -42
- package/lib/utils/isomorphic/trace/traceLoader.js +15 -14
- package/lib/utils/isomorphic/trace/traceModel.js +3 -2
- package/lib/utils/isomorphic/trace/traceModernizer.js +1 -0
- package/lib/utils/isomorphic/urlMatch.js +54 -1
- package/lib/utils/isomorphic/utilityScriptSerializers.js +11 -0
- package/lib/utils.js +6 -2
- package/lib/utilsBundle.js +3 -21
- package/lib/utilsBundleImpl/index.js +132 -133
- package/lib/vite/dashboard/assets/index-BAOybkp8.js +50 -0
- package/lib/vite/dashboard/assets/index-CZAYOG76.css +1 -0
- package/lib/vite/dashboard/index.html +28 -0
- package/lib/vite/htmlReport/index.html +2 -70
- package/lib/vite/htmlReport/report.css +1 -0
- package/lib/vite/htmlReport/report.js +72 -0
- package/lib/vite/recorder/assets/{codeMirrorModule-DadYNm1I.js → codeMirrorModule-C8KMvO9L.js} +20 -20
- package/lib/vite/recorder/assets/index-CqAYX1I3.js +193 -0
- package/lib/vite/recorder/index.html +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-a5XoALAZ.js → codeMirrorModule-DS0FLvoc.js} +20 -20
- package/lib/vite/traceViewer/assets/defaultSettingsView-GTWI-W_B.js +262 -0
- package/lib/vite/traceViewer/defaultSettingsView.B4dS75f0.css +1 -0
- package/lib/vite/traceViewer/{index.BVu7tZDe.css → index.CzXZzn5A.css} +1 -1
- package/lib/vite/traceViewer/{index.BDwrLSGN.js → index.Dtstcb7U.js} +1 -1
- package/lib/vite/traceViewer/index.html +4 -4
- package/lib/vite/traceViewer/sw.bundle.js +4 -4
- package/lib/vite/traceViewer/uiMode.Vipi55dB.js +6 -0
- package/lib/vite/traceViewer/uiMode.html +3 -3
- package/lib/zipBundleImpl.js +2 -2
- package/lib/zodBundle.js +39 -0
- package/lib/zodBundleImpl.js +40 -0
- package/package.json +6 -1
- package/types/protocol.d.ts +947 -51
- package/types/types.d.ts +854 -74
- package/lib/client/pageAgent.js +0 -64
- package/lib/mcpBundleImpl/index.js +0 -147
- package/lib/server/agent/actionRunner.js +0 -335
- package/lib/server/agent/actions.js +0 -128
- package/lib/server/agent/codegen.js +0 -111
- package/lib/server/agent/context.js +0 -150
- package/lib/server/agent/expectTools.js +0 -156
- package/lib/server/agent/pageAgent.js +0 -204
- package/lib/server/agent/performTools.js +0 -262
- package/lib/server/agent/tool.js +0 -109
- package/lib/server/dispatchers/pageAgentDispatcher.js +0 -96
- package/lib/vite/recorder/assets/index-BhTWtUlo.js +0 -193
- package/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +0 -266
- package/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +0 -1
- package/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +0 -5
- /package/lib/{server/utils → utils/isomorphic}/imageUtils.js +0 -0
- /package/lib/utils/isomorphic/{traceUtils.js → trace/traceUtils.js} +0 -0
|
@@ -166,20 +166,23 @@ async function createConnectionAsync(options, oncreate, useTLS) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
async function lookupAddresses(hostname) {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
const [v4Result, v6Result] = await Promise.allSettled([
|
|
170
|
+
import_dns.default.promises.lookup(hostname, { all: true, family: 4 }),
|
|
171
|
+
import_dns.default.promises.lookup(hostname, { all: true, family: 6 })
|
|
172
|
+
]);
|
|
173
|
+
const v4Addresses = v4Result.status === "fulfilled" ? v4Result.value : [];
|
|
174
|
+
const v6Addresses = v6Result.status === "fulfilled" ? v6Result.value : [];
|
|
175
|
+
if (!v4Addresses.length && !v6Addresses.length) {
|
|
176
|
+
if (v4Result.status === "rejected")
|
|
177
|
+
throw v4Result.reason;
|
|
178
|
+
throw v6Result.reason;
|
|
176
179
|
}
|
|
177
180
|
const result = [];
|
|
178
|
-
for (let i = 0; i < Math.max(
|
|
179
|
-
if (
|
|
180
|
-
result.push(
|
|
181
|
-
if (
|
|
182
|
-
result.push(
|
|
181
|
+
for (let i = 0; i < Math.max(v4Addresses.length, v6Addresses.length); i++) {
|
|
182
|
+
if (v6Addresses[i])
|
|
183
|
+
result.push(v6Addresses[i]);
|
|
184
|
+
if (v4Addresses[i])
|
|
185
|
+
result.push(v4Addresses[i]);
|
|
183
186
|
}
|
|
184
187
|
return result;
|
|
185
188
|
}
|
|
@@ -28,13 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var hostPlatform_exports = {};
|
|
30
30
|
__export(hostPlatform_exports, {
|
|
31
|
-
hasGpuMac: () => hasGpuMac,
|
|
32
31
|
hostPlatform: () => hostPlatform,
|
|
33
32
|
isOfficiallySupportedPlatform: () => isOfficiallySupportedPlatform,
|
|
34
33
|
shortPlatform: () => shortPlatform
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(hostPlatform_exports);
|
|
37
|
-
var import_child_process = require("child_process");
|
|
38
36
|
var import_os = __toESM(require("os"));
|
|
39
37
|
var import_linuxUtils = require("./linuxUtils");
|
|
40
38
|
function calculatePlatform() {
|
|
@@ -117,21 +115,8 @@ function toShortPlatform(hostPlatform2) {
|
|
|
117
115
|
return hostPlatform2.endsWith("arm64") ? "linux-arm64" : "linux-x64";
|
|
118
116
|
}
|
|
119
117
|
const shortPlatform = toShortPlatform(hostPlatform);
|
|
120
|
-
let hasGpuMacValue;
|
|
121
|
-
function hasGpuMac() {
|
|
122
|
-
try {
|
|
123
|
-
if (hasGpuMacValue === void 0) {
|
|
124
|
-
const output = (0, import_child_process.execSync)("system_profiler SPDisplaysDataType", { stdio: ["ignore", "pipe", "ignore"] }).toString();
|
|
125
|
-
hasGpuMacValue = output.includes("Metal: Supported") || output.includes("Metal Support: Metal");
|
|
126
|
-
}
|
|
127
|
-
return hasGpuMacValue;
|
|
128
|
-
} catch (e) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
118
|
// Annotate the CommonJS export names for ESM import in node:
|
|
133
119
|
0 && (module.exports = {
|
|
134
|
-
hasGpuMac,
|
|
135
120
|
hostPlatform,
|
|
136
121
|
isOfficiallySupportedPlatform,
|
|
137
122
|
shortPlatform
|
|
@@ -58,14 +58,16 @@ class HttpServer {
|
|
|
58
58
|
port() {
|
|
59
59
|
return this._port;
|
|
60
60
|
}
|
|
61
|
-
createWebSocket(
|
|
61
|
+
createWebSocket(transportFactory, guid) {
|
|
62
62
|
(0, import_assert.assert)(!this._wsGuid, "can only create one main websocket transport per server");
|
|
63
63
|
this._wsGuid = guid || (0, import_crypto.createGuid)();
|
|
64
64
|
const wss = new import_utilsBundle.wsServer({ server: this._server, path: "/" + this._wsGuid });
|
|
65
|
-
wss.on("connection", (ws) => {
|
|
66
|
-
|
|
65
|
+
wss.on("connection", (ws, request) => {
|
|
66
|
+
const url = new URL(request.url ?? "/", "http://localhost");
|
|
67
|
+
const transport = transportFactory(url);
|
|
67
68
|
transport.sendEvent = (method, params) => ws.send(JSON.stringify({ method, params }));
|
|
68
69
|
transport.close = () => ws.close();
|
|
70
|
+
transport.onconnect();
|
|
69
71
|
ws.on("message", async (message) => {
|
|
70
72
|
const { id, method, params } = JSON.parse(String(message));
|
|
71
73
|
try {
|
|
@@ -33,6 +33,7 @@ __export(network_exports, {
|
|
|
33
33
|
createHttpServer: () => createHttpServer,
|
|
34
34
|
createHttpsServer: () => createHttpsServer,
|
|
35
35
|
createProxyAgent: () => createProxyAgent,
|
|
36
|
+
decorateServer: () => decorateServer,
|
|
36
37
|
fetchData: () => fetchData,
|
|
37
38
|
httpRequest: () => httpRequest,
|
|
38
39
|
isURLAvailable: () => isURLAvailable,
|
|
@@ -62,7 +63,6 @@ function httpRequest(params, onResponse, onError) {
|
|
|
62
63
|
url = parsedProxyURL;
|
|
63
64
|
} else {
|
|
64
65
|
options.agent = new import_utilsBundle.HttpsProxyAgent(parsedProxyURL);
|
|
65
|
-
options.rejectUnauthorized = false;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
options.agent ??= url.protocol === "https:" ? import_happyEyeballs.httpsHappyEyeballsAgent : import_happyEyeballs.httpHappyEyeballsAgent;
|
|
@@ -235,6 +235,7 @@ function decorateServer(server) {
|
|
|
235
235
|
createHttpServer,
|
|
236
236
|
createHttpsServer,
|
|
237
237
|
createProxyAgent,
|
|
238
|
+
decorateServer,
|
|
238
239
|
fetchData,
|
|
239
240
|
httpRequest,
|
|
240
241
|
isURLAvailable,
|
|
@@ -42,7 +42,6 @@ var import_utilsBundle = require("../../utilsBundle");
|
|
|
42
42
|
var import_debugLogger = require("./debugLogger");
|
|
43
43
|
var import_zones = require("./zones");
|
|
44
44
|
var import_debug = require("./debug");
|
|
45
|
-
var import_mcpBundle = require("../../mcpBundle");
|
|
46
45
|
const pipelineAsync = util.promisify(import_stream.pipeline);
|
|
47
46
|
class NodeZone {
|
|
48
47
|
constructor(zone) {
|
|
@@ -106,11 +105,6 @@ const nodePlatform = {
|
|
|
106
105
|
streamWritable: (channel) => {
|
|
107
106
|
return new WritableStreamImpl(channel);
|
|
108
107
|
},
|
|
109
|
-
zodToJsonSchema: (schema) => {
|
|
110
|
-
if ("_zod" in schema)
|
|
111
|
-
return import_mcpBundle.z.toJSONSchema(schema);
|
|
112
|
-
return (0, import_mcpBundle.zodToJsonSchema)(schema);
|
|
113
|
-
},
|
|
114
108
|
zones: {
|
|
115
109
|
current: () => new NodeZone((0, import_zones.currentZone)()),
|
|
116
110
|
empty: new NodeZone(import_zones.emptyZone)
|
|
@@ -46,11 +46,12 @@ async function gracefullyCloseAll() {
|
|
|
46
46
|
await Promise.all(Array.from(gracefullyCloseSet).map((gracefullyClose) => gracefullyClose().catch((e) => {
|
|
47
47
|
})));
|
|
48
48
|
}
|
|
49
|
-
function gracefullyProcessExitDoNotHang(code) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
function gracefullyProcessExitDoNotHang(code, onExit) {
|
|
50
|
+
const beforeExit = onExit ? () => onExit().catch(() => {
|
|
51
|
+
}) : () => Promise.resolve();
|
|
52
|
+
const callback = () => beforeExit().then(() => process.exit(code));
|
|
53
|
+
setTimeout(callback, 3e4);
|
|
54
|
+
gracefullyCloseAll().then(callback);
|
|
54
55
|
}
|
|
55
56
|
function exitHandler() {
|
|
56
57
|
for (const kill of killSet)
|
|
@@ -109,6 +110,7 @@ async function launchProcess(options) {
|
|
|
109
110
|
// process group, making it possible to kill child process tree with `.kill(-pid)` command.
|
|
110
111
|
// @see https://nodejs.org/api/child_process.html#child_process_options_detached
|
|
111
112
|
detached: process.platform !== "win32",
|
|
113
|
+
windowsHide: true,
|
|
112
114
|
env: options.env,
|
|
113
115
|
cwd: options.cwd,
|
|
114
116
|
shell: options.shell,
|
|
@@ -191,7 +193,7 @@ async function launchProcess(options) {
|
|
|
191
193
|
options.log(`[pid=${spawnedProcess.pid}] <will force kill>`);
|
|
192
194
|
try {
|
|
193
195
|
if (process.platform === "win32") {
|
|
194
|
-
const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true });
|
|
196
|
+
const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true, windowsHide: true });
|
|
195
197
|
const [stdout2, stderr2] = [taskkillProcess.stdout.toString(), taskkillProcess.stderr.toString()];
|
|
196
198
|
if (stdout2)
|
|
197
199
|
options.log(`[pid=${spawnedProcess.pid}] taskkill stdout: ${stdout2}`);
|
|
@@ -21,7 +21,6 @@ __export(zipFile_exports, {
|
|
|
21
21
|
ZipFile: () => ZipFile
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(zipFile_exports);
|
|
24
|
-
var import_zipBundle = require("../../zipBundle");
|
|
25
24
|
class ZipFile {
|
|
26
25
|
constructor(fileName) {
|
|
27
26
|
this._entries = /* @__PURE__ */ new Map();
|
|
@@ -29,8 +28,9 @@ class ZipFile {
|
|
|
29
28
|
this._openedPromise = this._open();
|
|
30
29
|
}
|
|
31
30
|
async _open() {
|
|
31
|
+
const { yauzl } = require("../../zipBundle");
|
|
32
32
|
await new Promise((fulfill, reject) => {
|
|
33
|
-
|
|
33
|
+
yauzl.open(this._fileName, { autoClose: false }, (e, z) => {
|
|
34
34
|
if (e) {
|
|
35
35
|
reject(e);
|
|
36
36
|
return;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,17 +17,75 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var videoRecorder_exports = {};
|
|
20
30
|
__export(videoRecorder_exports, {
|
|
21
|
-
VideoRecorder: () => VideoRecorder
|
|
31
|
+
VideoRecorder: () => VideoRecorder,
|
|
32
|
+
startAutomaticVideoRecording: () => startAutomaticVideoRecording
|
|
22
33
|
});
|
|
23
34
|
module.exports = __toCommonJS(videoRecorder_exports);
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
24
36
|
var import_utils = require("../utils");
|
|
25
37
|
var import_processLauncher = require("./utils/processLauncher");
|
|
38
|
+
var import_utilsBundle = require("../utilsBundle");
|
|
39
|
+
var import_artifact = require("./artifact");
|
|
40
|
+
var import__ = require(".");
|
|
26
41
|
const fps = 25;
|
|
27
42
|
class VideoRecorder {
|
|
28
|
-
constructor(
|
|
43
|
+
constructor(screencast) {
|
|
44
|
+
this._screencast = screencast;
|
|
45
|
+
}
|
|
46
|
+
start(options) {
|
|
47
|
+
(0, import_utils.assert)(!this._artifact);
|
|
48
|
+
const ffmpegPath = import__.registry.findExecutable("ffmpeg").executablePathOrDie(this._screencast.page.browserContext._browser.sdkLanguage());
|
|
49
|
+
const outputFile = options.fileName ?? import_path.default.join(this._screencast.page.browserContext._browser.options.artifactsDir, (0, import_utils.createGuid)() + ".webm");
|
|
50
|
+
this._client = {
|
|
51
|
+
onFrame: (frame) => this._videoRecorder.writeFrame(frame.buffer, frame.frameSwapWallTime / 1e3),
|
|
52
|
+
gracefulClose: () => this.stop(),
|
|
53
|
+
dispose: () => this.stop().catch((e) => import_utils.debugLogger.log("error", `Failed to stop video recorder: ${String(e)}`)),
|
|
54
|
+
size: options.size
|
|
55
|
+
};
|
|
56
|
+
const { size } = this._screencast.addClient(this._client);
|
|
57
|
+
const videoSize = options.size ?? size;
|
|
58
|
+
this._videoRecorder = new FfmpegVideoRecorder(ffmpegPath, videoSize, outputFile);
|
|
59
|
+
this._artifact = new import_artifact.Artifact(this._screencast.page.browserContext, outputFile);
|
|
60
|
+
return this._artifact;
|
|
61
|
+
}
|
|
62
|
+
async stop() {
|
|
63
|
+
if (!this._artifact)
|
|
64
|
+
return;
|
|
65
|
+
const artifact = this._artifact;
|
|
66
|
+
this._artifact = void 0;
|
|
67
|
+
const client = this._client;
|
|
68
|
+
this._client = void 0;
|
|
69
|
+
const videoRecorder = this._videoRecorder;
|
|
70
|
+
this._videoRecorder = void 0;
|
|
71
|
+
this._screencast.removeClient(client);
|
|
72
|
+
await videoRecorder.stop();
|
|
73
|
+
await artifact.reportFinished();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function startAutomaticVideoRecording(page) {
|
|
77
|
+
const recordVideo = page.browserContext._options.recordVideo;
|
|
78
|
+
if (!recordVideo)
|
|
79
|
+
return;
|
|
80
|
+
const recorder = new VideoRecorder(page.screencast);
|
|
81
|
+
if (page.browserContext._options.recordVideo?.showActions)
|
|
82
|
+
page.screencast.showActions(page.browserContext._options.recordVideo?.showActions);
|
|
83
|
+
const dir = recordVideo.dir ?? page.browserContext._browser.options.artifactsDir;
|
|
84
|
+
const artifact = recorder.start({ size: recordVideo.size, fileName: import_path.default.join(dir, page.guid + ".webm") });
|
|
85
|
+
page.video = artifact;
|
|
86
|
+
}
|
|
87
|
+
class FfmpegVideoRecorder {
|
|
88
|
+
constructor(ffmpegPath, size, outputFile) {
|
|
29
89
|
this._process = null;
|
|
30
90
|
this._gracefullyClose = null;
|
|
31
91
|
this._lastWritePromise = Promise.resolve();
|
|
@@ -34,17 +94,19 @@ class VideoRecorder {
|
|
|
34
94
|
this._lastWriteNodeTime = 0;
|
|
35
95
|
this._frameQueue = [];
|
|
36
96
|
this._isStopped = false;
|
|
37
|
-
|
|
38
|
-
if (!options.outputFile.endsWith(".webm"))
|
|
97
|
+
if (!outputFile.endsWith(".webm"))
|
|
39
98
|
throw new Error("File must have .webm extension");
|
|
40
|
-
this.
|
|
99
|
+
this._outputFile = outputFile;
|
|
100
|
+
this._ffmpegPath = ffmpegPath;
|
|
101
|
+
this._size = size;
|
|
102
|
+
this._launchPromise = this._launch().catch((e) => e);
|
|
41
103
|
}
|
|
42
|
-
async _launch(
|
|
43
|
-
await (0, import_utils.mkdirIfNeeded)(
|
|
44
|
-
const w =
|
|
45
|
-
const h =
|
|
104
|
+
async _launch() {
|
|
105
|
+
await (0, import_utils.mkdirIfNeeded)(this._outputFile);
|
|
106
|
+
const w = this._size.width;
|
|
107
|
+
const h = this._size.height;
|
|
46
108
|
const args = `-loglevel error -f image2pipe -avioflags direct -fpsprobesize 0 -probesize 32 -analyzeduration 0 -c:v mjpeg -i pipe:0 -y -an -r ${fps} -c:v vp8 -qmin 0 -qmax 50 -crf 8 -deadline realtime -speed 8 -b:v 1M -threads 1 -vf pad=${w}:${h}:0:0:gray,crop=${w}:${h}:0:0`.split(" ");
|
|
47
|
-
args.push(
|
|
109
|
+
args.push(this._outputFile);
|
|
48
110
|
const { launchedProcess, gracefullyClose } = await (0, import_processLauncher.launchProcess)({
|
|
49
111
|
command: this._ffmpegPath,
|
|
50
112
|
args,
|
|
@@ -105,8 +167,11 @@ class VideoRecorder {
|
|
|
105
167
|
const error = await this._launchPromise;
|
|
106
168
|
if (error)
|
|
107
169
|
throw error;
|
|
108
|
-
if (this._isStopped
|
|
170
|
+
if (this._isStopped)
|
|
109
171
|
return;
|
|
172
|
+
if (!this._lastFrame) {
|
|
173
|
+
this._writeFrame(createWhiteImage(this._size.width, this._size.height), (0, import_utils.monotonicTime)());
|
|
174
|
+
}
|
|
110
175
|
const addTime = Math.max(((0, import_utils.monotonicTime)() - this._lastWriteNodeTime) / 1e3, 1);
|
|
111
176
|
this._writeFrame(Buffer.from([]), this._lastFrame.timestamp + addTime);
|
|
112
177
|
this._isStopped = true;
|
|
@@ -118,7 +183,12 @@ class VideoRecorder {
|
|
|
118
183
|
}
|
|
119
184
|
}
|
|
120
185
|
}
|
|
186
|
+
function createWhiteImage(width, height) {
|
|
187
|
+
const data = Buffer.alloc(width * height * 4, 255);
|
|
188
|
+
return import_utilsBundle.jpegjs.encode({ data, width, height }, 80).data;
|
|
189
|
+
}
|
|
121
190
|
// Annotate the CommonJS export names for ESM import in node:
|
|
122
191
|
0 && (module.exports = {
|
|
123
|
-
VideoRecorder
|
|
192
|
+
VideoRecorder,
|
|
193
|
+
startAutomaticVideoRecording
|
|
124
194
|
});
|
|
@@ -38,9 +38,8 @@ var import_browserContext = require("../browserContext");
|
|
|
38
38
|
var network = __toESM(require("../network"));
|
|
39
39
|
var import_wkConnection = require("./wkConnection");
|
|
40
40
|
var import_wkPage = require("./wkPage");
|
|
41
|
-
var import_errors = require("../errors");
|
|
42
41
|
var import_webkit = require("./webkit");
|
|
43
|
-
const BROWSER_VERSION = "26.
|
|
42
|
+
const BROWSER_VERSION = "26.4";
|
|
44
43
|
const DEFAULT_USER_AGENT = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/${BROWSER_VERSION} Safari/605.1.15`;
|
|
45
44
|
class WKBrowser extends import_browser.Browser {
|
|
46
45
|
constructor(parent, transport, options) {
|
|
@@ -77,9 +76,6 @@ class WKBrowser extends import_browser.Browser {
|
|
|
77
76
|
for (const wkPage of this._wkPages.values())
|
|
78
77
|
wkPage.didClose();
|
|
79
78
|
this._wkPages.clear();
|
|
80
|
-
for (const video of this._idToVideo.values())
|
|
81
|
-
video.artifact.reportFinished(new import_errors.TargetClosedError(this.closeReason()));
|
|
82
|
-
this._idToVideo.clear();
|
|
83
79
|
this._didClose();
|
|
84
80
|
}
|
|
85
81
|
async doCreateNewContext(options) {
|
|
@@ -311,7 +307,6 @@ class WKBrowserContext extends import_browserContext.BrowserContext {
|
|
|
311
307
|
}
|
|
312
308
|
async doClose(reason) {
|
|
313
309
|
if (!this._browserContextId) {
|
|
314
|
-
await Promise.all(this._wkPages().map((wkPage) => wkPage._page.screencast.stopVideoRecording()));
|
|
315
310
|
await this._browser.close({ reason });
|
|
316
311
|
} else {
|
|
317
312
|
await this._browser._browserSession.send("Playwright.deleteContext", { browserContextId: this._browserContextId });
|
|
@@ -37,6 +37,7 @@ var import_eventsHelper = require("../utils/eventsHelper");
|
|
|
37
37
|
var import_hostPlatform = require("../utils/hostPlatform");
|
|
38
38
|
var import_stackTrace = require("../../utils/isomorphic/stackTrace");
|
|
39
39
|
var import_utilsBundle = require("../../utilsBundle");
|
|
40
|
+
var import_browserContext = require("../browserContext");
|
|
40
41
|
var dialog = __toESM(require("../dialog"));
|
|
41
42
|
var dom = __toESM(require("../dom"));
|
|
42
43
|
var import_errors = require("../errors");
|
|
@@ -51,8 +52,9 @@ var import_wkProvisionalPage = require("./wkProvisionalPage");
|
|
|
51
52
|
var import_wkWorkers = require("./wkWorkers");
|
|
52
53
|
var import_webkit = require("./webkit");
|
|
53
54
|
var import_registry = require("../registry");
|
|
55
|
+
var import_videoRecorder = require("../videoRecorder");
|
|
54
56
|
const UTILITY_WORLD_NAME = "__playwright_utility_world__";
|
|
55
|
-
const enableFrameSessions = !process.env.WK_DISABLE_FRAME_SESSIONS && parseInt(import_registry.registry.findExecutable("webkit").revision, 10) >= 2245;
|
|
57
|
+
const enableFrameSessions = !process.env.WK_DISABLE_FRAME_SESSIONS && parseInt(import_registry.registry.findExecutable("webkit").revision, 10) >= 2245 && parseInt(import_registry.registry.findExecutable("webkit").revision, 10) <= 2255;
|
|
56
58
|
class WKPage {
|
|
57
59
|
constructor(browserContext, pageProxySession, opener) {
|
|
58
60
|
this._provisionalPage = null;
|
|
@@ -115,7 +117,7 @@ class WKPage {
|
|
|
115
117
|
for (const [key, value] of this._browserContext._permissions)
|
|
116
118
|
promises.push(this._grantPermissions(key, value));
|
|
117
119
|
}
|
|
118
|
-
|
|
120
|
+
(0, import_videoRecorder.startAutomaticVideoRecording)(this._page);
|
|
119
121
|
await Promise.all(promises);
|
|
120
122
|
}
|
|
121
123
|
_setSession(session) {
|
|
@@ -518,7 +520,7 @@ class WKPage {
|
|
|
518
520
|
columnNumber: (columnNumber || 1) - 1
|
|
519
521
|
}
|
|
520
522
|
};
|
|
521
|
-
this._onConsoleRepeatCountUpdated({ count: 1 });
|
|
523
|
+
this._onConsoleRepeatCountUpdated({ count: 1, timestamp: event.message.timestamp });
|
|
522
524
|
}
|
|
523
525
|
_onConsoleRepeatCountUpdated(event) {
|
|
524
526
|
if (this._lastConsoleMessage) {
|
|
@@ -529,8 +531,9 @@ class WKPage {
|
|
|
529
531
|
count,
|
|
530
532
|
location
|
|
531
533
|
} = this._lastConsoleMessage;
|
|
534
|
+
const timestamp = event.timestamp ? event.timestamp * 1e3 : Date.now();
|
|
532
535
|
for (let i = count; i < event.count; ++i)
|
|
533
|
-
this._page.addConsoleMessage(null, derivedType, handles, location, handles.length ? void 0 : text);
|
|
536
|
+
this._page.addConsoleMessage(null, derivedType, handles, location, handles.length ? void 0 : text, timestamp);
|
|
534
537
|
this._lastConsoleMessage.count = event.count;
|
|
535
538
|
}
|
|
536
539
|
}
|
|
@@ -645,9 +648,11 @@ class WKPage {
|
|
|
645
648
|
async updateUserAgent() {
|
|
646
649
|
const contextOptions = this._browserContext._options;
|
|
647
650
|
this._updateState("Page.overrideUserAgent", { value: contextOptions.userAgent });
|
|
651
|
+
const { navigatorPlatform } = (0, import_browserContext.calculateUserAgentEmulation)(contextOptions);
|
|
652
|
+
this._updateState("Page.overridePlatform", navigatorPlatform ? { value: navigatorPlatform } : {});
|
|
648
653
|
}
|
|
649
654
|
async bringToFront() {
|
|
650
|
-
this._pageProxySession.send("Target.activate", {
|
|
655
|
+
await this._pageProxySession.send("Target.activate", {
|
|
651
656
|
targetId: this._session.sessionId
|
|
652
657
|
});
|
|
653
658
|
}
|
|
@@ -773,12 +778,6 @@ class WKPage {
|
|
|
773
778
|
return import_hostPlatform.hostPlatform === "mac10.15" ? 55 : 59;
|
|
774
779
|
return 0;
|
|
775
780
|
}
|
|
776
|
-
async _initializeVideoRecording() {
|
|
777
|
-
const screencast = this._page.screencast;
|
|
778
|
-
const videoOptions = screencast.launchVideoRecorder();
|
|
779
|
-
if (videoOptions)
|
|
780
|
-
await screencast.startVideoRecording(videoOptions);
|
|
781
|
-
}
|
|
782
781
|
validateScreenshotDimension(side, omitDeviceScaleFactor) {
|
|
783
782
|
if (process.platform === "darwin")
|
|
784
783
|
return;
|
|
@@ -845,29 +844,28 @@ class WKPage {
|
|
|
845
844
|
throw e;
|
|
846
845
|
});
|
|
847
846
|
}
|
|
848
|
-
|
|
849
|
-
|
|
847
|
+
startScreencast(options) {
|
|
848
|
+
this._pageProxySession.send("Screencast.startScreencast", {
|
|
850
849
|
quality: options.quality,
|
|
851
850
|
width: options.width,
|
|
852
851
|
height: options.height,
|
|
853
852
|
toolbarHeight: this._toolbarHeight()
|
|
853
|
+
}).then(({ generation }) => this._screencastGeneration = generation).catch(() => {
|
|
854
854
|
});
|
|
855
|
-
this._screencastGeneration = generation;
|
|
856
855
|
}
|
|
857
|
-
|
|
858
|
-
|
|
856
|
+
stopScreencast() {
|
|
857
|
+
this._pageProxySession.sendMayFail("Screencast.stopScreencast");
|
|
859
858
|
}
|
|
860
859
|
_onScreencastFrame(event) {
|
|
861
860
|
const generation = this._screencastGeneration;
|
|
862
|
-
this._page.screencast.throttleFrameAck(() => {
|
|
863
|
-
this._pageProxySession.sendMayFail("Screencast.screencastFrameAck", { generation });
|
|
864
|
-
});
|
|
865
861
|
const buffer = Buffer.from(event.data, "base64");
|
|
866
|
-
this._page.
|
|
862
|
+
this._page.screencast.onScreencastFrame({
|
|
867
863
|
buffer,
|
|
868
864
|
frameSwapWallTime: event.timestamp ? event.timestamp * 1e3 : Date.now(),
|
|
869
|
-
|
|
870
|
-
|
|
865
|
+
viewportWidth: event.deviceWidth,
|
|
866
|
+
viewportHeight: event.deviceHeight
|
|
867
|
+
}, () => {
|
|
868
|
+
this._pageProxySession.sendMayFail("Screencast.screencastFrameAck", { generation });
|
|
871
869
|
});
|
|
872
870
|
}
|
|
873
871
|
rafCountForStablePosition() {
|
|
@@ -981,6 +979,7 @@ class WKPage {
|
|
|
981
979
|
}
|
|
982
980
|
_handleRequestRedirect(request, requestId, responsePayload, timestamp) {
|
|
983
981
|
const response = request.createResponse(responsePayload);
|
|
982
|
+
response._setHttpVersion(null);
|
|
984
983
|
response._securityDetailsFinished();
|
|
985
984
|
response._serverAddrFinished();
|
|
986
985
|
response.setResponseHeadersSize(null);
|
|
@@ -1033,8 +1032,7 @@ class WKPage {
|
|
|
1033
1032
|
validFrom: responseReceivedPayload?.response.security?.certificate?.validFrom,
|
|
1034
1033
|
validTo: responseReceivedPayload?.response.security?.certificate?.validUntil
|
|
1035
1034
|
});
|
|
1036
|
-
|
|
1037
|
-
response._setHttpVersion(event.metrics.protocol);
|
|
1035
|
+
response._setHttpVersion(event.metrics?.protocol ?? null);
|
|
1038
1036
|
response.setEncodedBodySize(event.metrics?.responseBodyBytesReceived ?? null);
|
|
1039
1037
|
response.setResponseHeadersSize(event.metrics?.responseHeaderBytesReceived ?? null);
|
|
1040
1038
|
response._requestFinished(import_helper.helper.secondsToRoundishMillis(event.timestamp - request._timestamp));
|
|
@@ -1058,6 +1056,7 @@ class WKPage {
|
|
|
1058
1056
|
if (response) {
|
|
1059
1057
|
response._serverAddrFinished();
|
|
1060
1058
|
response._securityDetailsFinished();
|
|
1059
|
+
response._setHttpVersion(null);
|
|
1061
1060
|
response.setResponseHeadersSize(null);
|
|
1062
1061
|
response.setEncodedBodySize(null);
|
|
1063
1062
|
response._requestFinished(import_helper.helper.secondsToRoundishMillis(event.timestamp - request._timestamp));
|
|
@@ -1072,7 +1071,8 @@ class WKPage {
|
|
|
1072
1071
|
const webPermissionToProtocol = /* @__PURE__ */ new Map([
|
|
1073
1072
|
["geolocation", "geolocation"],
|
|
1074
1073
|
["notifications", "notifications"],
|
|
1075
|
-
["clipboard-read", "clipboard-read"]
|
|
1074
|
+
["clipboard-read", "clipboard-read"],
|
|
1075
|
+
["screen-wake-lock", "screen-wake-lock"]
|
|
1076
1076
|
]);
|
|
1077
1077
|
const filtered = permissions.map((permission) => {
|
|
1078
1078
|
const protocolPermission = webPermissionToProtocol.get(permission);
|
|
@@ -1088,6 +1088,8 @@ class WKPage {
|
|
|
1088
1088
|
shouldToggleStyleSheetToSyncAnimations() {
|
|
1089
1089
|
return true;
|
|
1090
1090
|
}
|
|
1091
|
+
async setDockTile(image) {
|
|
1092
|
+
}
|
|
1091
1093
|
}
|
|
1092
1094
|
class WKFrame {
|
|
1093
1095
|
constructor(page, session) {
|
|
@@ -96,7 +96,8 @@ class WKWorkers {
|
|
|
96
96
|
lineNumber: (lineNumber || 1) - 1,
|
|
97
97
|
columnNumber: (columnNumber || 1) - 1
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
const timestamp = event.message.timestamp ? event.message.timestamp * 1e3 : Date.now();
|
|
100
|
+
this._page.addConsoleMessage(worker, derivedType, handles, location, handles.length ? void 0 : text, timestamp);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
// Annotate the CommonJS export names for ESM import in node:
|