patchright-bun-core 1.58.0 → 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.
Files changed (475) hide show
  1. package/README.md +2 -2
  2. package/ThirdPartyNotices.txt +3551 -4075
  3. package/bin/install_media_pack.ps1 +5 -5
  4. package/bin/install_webkit_wsl.ps1 +32 -32
  5. package/bin/reinstall_chrome_beta_linux.sh +42 -42
  6. package/bin/reinstall_chrome_beta_mac.sh +13 -13
  7. package/bin/reinstall_chrome_beta_win.ps1 +24 -24
  8. package/bin/reinstall_chrome_stable_linux.sh +42 -42
  9. package/bin/reinstall_chrome_stable_mac.sh +12 -12
  10. package/bin/reinstall_chrome_stable_win.ps1 +24 -24
  11. package/bin/reinstall_msedge_beta_linux.sh +48 -48
  12. package/bin/reinstall_msedge_beta_mac.sh +11 -11
  13. package/bin/reinstall_msedge_beta_win.ps1 +23 -23
  14. package/bin/reinstall_msedge_dev_linux.sh +48 -48
  15. package/bin/reinstall_msedge_dev_mac.sh +11 -11
  16. package/bin/reinstall_msedge_dev_win.ps1 +23 -23
  17. package/bin/reinstall_msedge_stable_linux.sh +48 -48
  18. package/bin/reinstall_msedge_stable_mac.sh +11 -11
  19. package/bin/reinstall_msedge_stable_win.ps1 +23 -23
  20. package/browsers.json +81 -79
  21. package/cli.js +18 -18
  22. package/index.d.ts +17 -17
  23. package/index.js +32 -32
  24. package/index.mjs +28 -28
  25. package/lib/androidServerImpl.js +65 -65
  26. package/lib/bootstrap.js +77 -0
  27. package/lib/browserServerImpl.js +120 -120
  28. package/lib/cli/browserActions.js +308 -0
  29. package/lib/cli/driver.js +98 -97
  30. package/lib/cli/installActions.js +171 -0
  31. package/lib/cli/program.js +225 -589
  32. package/lib/cli/programWithTestStub.js +74 -74
  33. package/lib/client/android.js +361 -361
  34. package/lib/client/api.js +137 -137
  35. package/lib/client/artifact.js +79 -79
  36. package/lib/client/browser.js +169 -161
  37. package/lib/client/browserContext.js +563 -582
  38. package/lib/client/browserType.js +153 -185
  39. package/lib/client/cdpSession.js +55 -51
  40. package/lib/client/channelOwner.js +194 -194
  41. package/lib/client/clientHelper.js +64 -64
  42. package/lib/client/clientInstrumentation.js +55 -55
  43. package/lib/client/clientStackTrace.js +69 -69
  44. package/lib/client/clock.js +68 -68
  45. package/lib/client/{webSocket.js → connect.js} +143 -93
  46. package/lib/client/connection.js +322 -318
  47. package/lib/client/consoleMessage.js +61 -58
  48. package/lib/client/coverage.js +44 -44
  49. package/lib/client/debugger.js +57 -0
  50. package/lib/client/dialog.js +63 -56
  51. package/lib/client/disposable.js +76 -0
  52. package/lib/client/download.js +62 -62
  53. package/lib/client/electron.js +139 -138
  54. package/lib/client/elementHandle.js +281 -284
  55. package/lib/client/errors.js +77 -77
  56. package/lib/client/eventEmitter.js +314 -314
  57. package/lib/client/events.js +103 -103
  58. package/lib/client/fetch.js +367 -368
  59. package/lib/client/fileChooser.js +46 -46
  60. package/lib/client/fileUtils.js +34 -34
  61. package/lib/client/frame.js +404 -409
  62. package/lib/client/harRouter.js +99 -87
  63. package/lib/client/input.js +84 -84
  64. package/lib/client/jsHandle.js +105 -109
  65. package/lib/client/jsonPipe.js +39 -39
  66. package/lib/client/localUtils.js +60 -60
  67. package/lib/client/locator.js +367 -369
  68. package/lib/client/network.js +750 -747
  69. package/lib/client/page.js +731 -745
  70. package/lib/client/platform.js +74 -77
  71. package/lib/client/playwright.js +71 -71
  72. package/lib/client/screencast.js +88 -0
  73. package/lib/client/selectors.js +57 -55
  74. package/lib/client/stream.js +39 -39
  75. package/lib/client/timeoutSettings.js +79 -79
  76. package/lib/client/tracing.js +126 -119
  77. package/lib/client/types.js +28 -28
  78. package/lib/client/video.js +52 -59
  79. package/lib/client/waiter.js +142 -142
  80. package/lib/client/webError.js +39 -39
  81. package/lib/client/worker.js +85 -85
  82. package/lib/client/writableStream.js +39 -39
  83. package/lib/generated/bindingsControllerSource.js +28 -28
  84. package/lib/generated/clockSource.js +28 -28
  85. package/lib/generated/injectedScriptSource.js +28 -28
  86. package/lib/generated/pollingRecorderSource.js +28 -28
  87. package/lib/generated/storageScriptSource.js +28 -28
  88. package/lib/generated/utilityScriptSource.js +28 -28
  89. package/lib/generated/webSocketMockSource.js +336 -336
  90. package/lib/inProcessFactory.js +60 -60
  91. package/lib/inprocess.js +3 -3
  92. package/lib/mcpBundle.js +78 -84
  93. package/lib/mcpBundleImpl.js +91 -0
  94. package/lib/outofprocess.js +76 -76
  95. package/lib/protocol/serializers.js +197 -197
  96. package/lib/protocol/validator.js +3067 -2969
  97. package/lib/protocol/validatorPrimitives.js +193 -193
  98. package/lib/remote/playwrightConnection.js +131 -129
  99. package/lib/remote/playwrightPipeServer.js +100 -0
  100. package/lib/remote/playwrightServer.js +339 -334
  101. package/lib/remote/playwrightWebSocketServer.js +73 -0
  102. package/lib/remote/serverTransport.js +96 -0
  103. package/lib/server/android/android.js +465 -465
  104. package/lib/server/android/backendAdb.js +177 -177
  105. package/lib/server/artifact.js +127 -127
  106. package/lib/server/bidi/bidiBrowser.js +571 -549
  107. package/lib/server/bidi/bidiChromium.js +162 -148
  108. package/lib/server/bidi/bidiConnection.js +213 -213
  109. package/lib/server/bidi/bidiDeserializer.js +116 -116
  110. package/lib/server/bidi/bidiExecutionContext.js +267 -267
  111. package/lib/server/bidi/bidiFirefox.js +128 -128
  112. package/lib/server/bidi/bidiInput.js +146 -146
  113. package/lib/server/bidi/bidiNetworkManager.js +411 -383
  114. package/lib/server/bidi/bidiOverCdp.js +102 -102
  115. package/lib/server/bidi/bidiPage.js +599 -583
  116. package/lib/server/bidi/bidiPdf.js +106 -106
  117. package/lib/server/bidi/third_party/bidiCommands.d.js +22 -22
  118. package/lib/server/bidi/third_party/bidiKeyboard.js +256 -256
  119. package/lib/server/bidi/third_party/bidiProtocol.js +24 -24
  120. package/lib/server/bidi/third_party/bidiProtocolCore.js +180 -180
  121. package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -42
  122. package/lib/server/bidi/third_party/bidiSerializer.js +148 -148
  123. package/lib/server/bidi/third_party/firefoxPrefs.js +261 -259
  124. package/lib/server/browser.js +212 -149
  125. package/lib/server/browserContext.js +741 -702
  126. package/lib/server/browserType.js +338 -336
  127. package/lib/server/callLog.js +82 -82
  128. package/lib/server/chromium/chromium.js +399 -395
  129. package/lib/server/chromium/chromiumSwitches.js +104 -104
  130. package/lib/server/chromium/crBrowser.js +528 -511
  131. package/lib/server/chromium/crConnection.js +197 -197
  132. package/lib/server/chromium/crCoverage.js +235 -235
  133. package/lib/server/chromium/crDevTools.js +111 -111
  134. package/lib/server/chromium/crDragDrop.js +131 -131
  135. package/lib/server/chromium/crExecutionContext.js +146 -146
  136. package/lib/server/chromium/crInput.js +187 -187
  137. package/lib/server/chromium/crNetworkManager.js +707 -707
  138. package/lib/server/chromium/crPage.js +963 -1001
  139. package/lib/server/chromium/crPdf.js +121 -121
  140. package/lib/server/chromium/crProtocolHelper.js +145 -145
  141. package/lib/server/chromium/crServiceWorker.js +137 -136
  142. package/lib/server/chromium/defaultFontFamilies.js +162 -162
  143. package/lib/server/chromium/protocol.d.js +16 -16
  144. package/lib/server/clock.js +149 -149
  145. package/lib/server/codegen/csharp.js +327 -327
  146. package/lib/server/codegen/java.js +274 -274
  147. package/lib/server/codegen/javascript.js +247 -247
  148. package/lib/server/codegen/jsonl.js +52 -52
  149. package/lib/server/codegen/language.js +132 -132
  150. package/lib/server/codegen/languages.js +68 -68
  151. package/lib/server/codegen/python.js +279 -279
  152. package/lib/server/codegen/types.js +16 -16
  153. package/lib/server/console.js +61 -57
  154. package/lib/server/cookieStore.js +206 -206
  155. package/lib/server/debugController.js +197 -191
  156. package/lib/server/debugger.js +112 -119
  157. package/lib/server/deviceDescriptors.js +39 -39
  158. package/lib/server/deviceDescriptorsSource.json +1778 -1778
  159. package/lib/server/dialog.js +116 -116
  160. package/lib/server/dispatchers/androidDispatcher.js +325 -325
  161. package/lib/server/dispatchers/artifactDispatcher.js +118 -118
  162. package/lib/server/dispatchers/browserContextDispatcher.js +381 -384
  163. package/lib/server/dispatchers/browserDispatcher.js +124 -118
  164. package/lib/server/dispatchers/browserTypeDispatcher.js +71 -64
  165. package/lib/server/dispatchers/cdpSessionDispatcher.js +47 -44
  166. package/lib/server/dispatchers/debugControllerDispatcher.js +78 -78
  167. package/lib/server/dispatchers/debuggerDispatcher.js +84 -0
  168. package/lib/server/dispatchers/dialogDispatcher.js +47 -47
  169. package/lib/server/dispatchers/dispatcher.js +364 -364
  170. package/lib/server/dispatchers/disposableDispatcher.js +39 -0
  171. package/lib/server/dispatchers/electronDispatcher.js +90 -89
  172. package/lib/server/dispatchers/elementHandlerDispatcher.js +181 -181
  173. package/lib/server/dispatchers/frameDispatcher.js +227 -227
  174. package/lib/server/dispatchers/jsHandleDispatcher.js +85 -85
  175. package/lib/server/dispatchers/jsonPipeDispatcher.js +58 -58
  176. package/lib/server/dispatchers/localUtilsDispatcher.js +185 -149
  177. package/lib/server/dispatchers/networkDispatchers.js +214 -213
  178. package/lib/server/dispatchers/pageDispatcher.js +456 -393
  179. package/lib/server/dispatchers/playwrightDispatcher.js +108 -108
  180. package/lib/server/dispatchers/streamDispatcher.js +67 -67
  181. package/lib/server/dispatchers/tracingDispatcher.js +68 -68
  182. package/lib/server/dispatchers/webSocketRouteDispatcher.js +164 -165
  183. package/lib/server/dispatchers/writableStreamDispatcher.js +79 -79
  184. package/lib/server/disposable.js +41 -0
  185. package/lib/server/dom.js +833 -815
  186. package/lib/server/download.js +71 -70
  187. package/lib/server/electron/electron.js +278 -273
  188. package/lib/server/electron/loader.js +29 -29
  189. package/lib/server/errors.js +69 -69
  190. package/lib/server/fetch.js +621 -621
  191. package/lib/server/fileChooser.js +43 -43
  192. package/lib/server/fileUploadUtils.js +84 -84
  193. package/lib/server/firefox/ffBrowser.js +408 -418
  194. package/lib/server/firefox/ffConnection.js +142 -142
  195. package/lib/server/firefox/ffExecutionContext.js +150 -150
  196. package/lib/server/firefox/ffInput.js +175 -159
  197. package/lib/server/firefox/ffNetworkManager.js +256 -256
  198. package/lib/server/firefox/ffPage.js +494 -497
  199. package/lib/server/firefox/firefox.js +114 -114
  200. package/lib/server/firefox/protocol.d.js +16 -16
  201. package/lib/server/formData.js +147 -147
  202. package/lib/server/frameSelectors.js +160 -160
  203. package/lib/server/frames.js +1500 -1471
  204. package/lib/server/har/harRecorder.js +147 -147
  205. package/lib/server/har/harTracer.js +608 -607
  206. package/lib/server/harBackend.js +157 -157
  207. package/lib/server/helper.js +96 -96
  208. package/lib/server/index.js +58 -58
  209. package/lib/server/input.js +322 -277
  210. package/lib/server/instrumentation.js +77 -72
  211. package/lib/server/javascript.js +291 -291
  212. package/lib/server/launchApp.js +127 -128
  213. package/lib/server/localUtils.js +214 -214
  214. package/lib/server/macEditingCommands.js +143 -143
  215. package/lib/server/network.js +668 -667
  216. package/lib/server/overlay.js +138 -0
  217. package/lib/server/page.js +890 -830
  218. package/lib/server/pipeTransport.js +89 -89
  219. package/lib/server/playwright.js +69 -69
  220. package/lib/server/progress.js +138 -132
  221. package/lib/server/protocolError.js +52 -52
  222. package/lib/server/recorder/chat.js +161 -161
  223. package/lib/server/recorder/recorderApp.js +367 -366
  224. package/lib/server/recorder/recorderRunner.js +138 -138
  225. package/lib/server/recorder/recorderSignalProcessor.js +83 -83
  226. package/lib/server/recorder/recorderUtils.js +157 -157
  227. package/lib/server/recorder/throttledFile.js +57 -57
  228. package/lib/server/recorder.js +535 -499
  229. package/lib/server/registry/browserFetcher.js +177 -177
  230. package/lib/server/registry/dependencies.js +371 -371
  231. package/lib/server/registry/index.js +1395 -1422
  232. package/lib/server/registry/nativeDeps.js +1281 -1280
  233. package/lib/server/registry/oopDownloadBrowserMain.js +127 -127
  234. package/lib/server/screencast.js +137 -190
  235. package/lib/server/screenshotter.js +333 -333
  236. package/lib/server/selectors.js +112 -112
  237. package/lib/server/socksClientCertificatesInterceptor.js +383 -383
  238. package/lib/server/socksInterceptor.js +95 -95
  239. package/lib/server/trace/recorder/snapshotter.js +147 -147
  240. package/lib/server/trace/recorder/snapshotterInjected.js +561 -561
  241. package/lib/server/trace/recorder/tracing.js +655 -604
  242. package/lib/server/trace/viewer/traceViewer.js +244 -245
  243. package/lib/server/transport.js +254 -254
  244. package/lib/server/types.js +28 -28
  245. package/lib/server/usKeyboardLayout.js +152 -145
  246. package/lib/server/utils/ascii.js +44 -44
  247. package/lib/server/utils/comparators.js +139 -139
  248. package/lib/server/utils/crypto.js +216 -216
  249. package/lib/server/utils/debug.js +42 -42
  250. package/lib/server/utils/debugLogger.js +122 -122
  251. package/lib/server/utils/disposable.js +32 -0
  252. package/lib/server/utils/env.js +73 -73
  253. package/lib/server/utils/eventsHelper.js +41 -39
  254. package/lib/server/utils/expectUtils.js +123 -123
  255. package/lib/server/utils/fileUtils.js +205 -191
  256. package/lib/server/utils/happyEyeballs.js +210 -207
  257. package/lib/server/utils/hostPlatform.js +123 -123
  258. package/lib/server/utils/httpServer.js +205 -203
  259. package/lib/server/utils/image_tools/colorUtils.js +89 -89
  260. package/lib/server/utils/image_tools/compare.js +109 -109
  261. package/lib/server/utils/image_tools/imageChannel.js +78 -78
  262. package/lib/server/utils/image_tools/stats.js +102 -102
  263. package/lib/server/utils/linuxUtils.js +71 -71
  264. package/lib/server/utils/network.js +243 -242
  265. package/lib/server/utils/nodePlatform.js +148 -154
  266. package/lib/server/utils/pipeTransport.js +84 -84
  267. package/lib/server/utils/processLauncher.js +243 -241
  268. package/lib/server/utils/profiler.js +65 -65
  269. package/lib/server/utils/socksProxy.js +511 -511
  270. package/lib/server/utils/spawnAsync.js +41 -41
  271. package/lib/server/utils/task.js +51 -51
  272. package/lib/server/utils/userAgent.js +98 -98
  273. package/lib/server/utils/wsServer.js +121 -121
  274. package/lib/server/utils/zipFile.js +74 -74
  275. package/lib/server/utils/zones.js +57 -57
  276. package/lib/server/videoRecorder.js +194 -124
  277. package/lib/server/webkit/protocol.d.js +16 -16
  278. package/lib/server/webkit/webkit.js +108 -108
  279. package/lib/server/webkit/wkBrowser.js +330 -335
  280. package/lib/server/webkit/wkConnection.js +144 -144
  281. package/lib/server/webkit/wkExecutionContext.js +154 -154
  282. package/lib/server/webkit/wkInput.js +181 -181
  283. package/lib/server/webkit/wkInterceptableRequest.js +197 -197
  284. package/lib/server/webkit/wkPage.js +1161 -1158
  285. package/lib/server/webkit/wkProvisionalPage.js +83 -83
  286. package/lib/server/webkit/wkWorkers.js +106 -105
  287. package/lib/serverRegistry.js +156 -0
  288. package/lib/third_party/pixelmatch.js +255 -255
  289. package/lib/tools/backend/browserBackend.js +79 -0
  290. package/lib/tools/backend/common.js +63 -0
  291. package/lib/tools/backend/config.js +41 -0
  292. package/lib/tools/backend/console.js +66 -0
  293. package/lib/tools/backend/context.js +296 -0
  294. package/lib/tools/backend/cookies.js +152 -0
  295. package/lib/tools/backend/devtools.js +69 -0
  296. package/lib/tools/backend/dialogs.js +59 -0
  297. package/lib/tools/backend/evaluate.js +64 -0
  298. package/lib/tools/backend/files.js +60 -0
  299. package/lib/tools/backend/form.js +64 -0
  300. package/lib/tools/backend/keyboard.js +155 -0
  301. package/lib/tools/backend/logFile.js +95 -0
  302. package/lib/tools/backend/mouse.js +168 -0
  303. package/lib/tools/backend/navigate.js +106 -0
  304. package/lib/tools/backend/network.js +135 -0
  305. package/lib/tools/backend/pdf.js +48 -0
  306. package/lib/tools/backend/response.js +305 -0
  307. package/lib/tools/backend/route.js +140 -0
  308. package/lib/tools/backend/runCode.js +77 -0
  309. package/lib/tools/backend/screenshot.js +88 -0
  310. package/lib/tools/backend/sessionLog.js +74 -0
  311. package/lib/tools/backend/snapshot.js +208 -0
  312. package/lib/tools/backend/storage.js +68 -0
  313. package/lib/tools/backend/tab.js +445 -0
  314. package/lib/tools/backend/tabs.js +67 -0
  315. package/lib/tools/backend/tool.js +47 -0
  316. package/lib/tools/backend/tools.js +102 -0
  317. package/lib/tools/backend/tracing.js +78 -0
  318. package/lib/tools/backend/utils.js +83 -0
  319. package/lib/tools/backend/verify.js +151 -0
  320. package/lib/tools/backend/video.js +98 -0
  321. package/lib/tools/backend/wait.js +63 -0
  322. package/lib/tools/backend/webstorage.js +223 -0
  323. package/lib/tools/cli-client/cli.js +6 -0
  324. package/lib/tools/cli-client/help.json +399 -0
  325. package/lib/tools/cli-client/minimist.js +128 -0
  326. package/lib/tools/cli-client/program.js +350 -0
  327. package/lib/tools/cli-client/registry.js +176 -0
  328. package/lib/tools/cli-client/session.js +289 -0
  329. package/lib/tools/cli-client/skill/SKILL.md +328 -0
  330. package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  331. package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  332. package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  333. package/lib/tools/cli-client/skill/references/running-code.md +231 -0
  334. package/lib/tools/cli-client/skill/references/session-management.md +169 -0
  335. package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  336. package/lib/tools/cli-client/skill/references/test-generation.md +88 -0
  337. package/lib/tools/cli-client/skill/references/tracing.md +139 -0
  338. package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  339. package/lib/tools/cli-daemon/command.js +73 -0
  340. package/lib/tools/cli-daemon/commands.js +956 -0
  341. package/lib/tools/cli-daemon/daemon.js +157 -0
  342. package/lib/tools/cli-daemon/helpGenerator.js +177 -0
  343. package/lib/tools/cli-daemon/program.js +129 -0
  344. package/lib/tools/dashboard/appIcon.png +0 -0
  345. package/lib/tools/dashboard/dashboardApp.js +284 -0
  346. package/lib/tools/dashboard/dashboardController.js +296 -0
  347. package/lib/tools/exports.js +60 -0
  348. package/lib/tools/mcp/browserFactory.js +233 -0
  349. package/lib/tools/mcp/cdpRelay.js +352 -0
  350. package/lib/tools/mcp/cli-stub.js +7 -0
  351. package/lib/tools/mcp/config.d.js +16 -0
  352. package/lib/tools/mcp/config.js +446 -0
  353. package/lib/tools/mcp/configIni.js +189 -0
  354. package/lib/{server/trace/viewer/traceParser.js → tools/mcp/extensionContextFactory.js} +55 -72
  355. package/lib/tools/mcp/index.js +62 -0
  356. package/lib/tools/mcp/log.js +35 -0
  357. package/lib/tools/mcp/program.js +107 -0
  358. package/lib/tools/mcp/protocol.js +28 -0
  359. package/lib/tools/mcp/watchdog.js +44 -0
  360. package/lib/tools/trace/SKILL.md +171 -0
  361. package/lib/tools/trace/installSkill.js +48 -0
  362. package/lib/tools/trace/traceActions.js +142 -0
  363. package/lib/tools/trace/traceAttachments.js +69 -0
  364. package/lib/tools/trace/traceCli.js +87 -0
  365. package/lib/tools/trace/traceConsole.js +97 -0
  366. package/lib/tools/trace/traceErrors.js +55 -0
  367. package/lib/tools/trace/traceOpen.js +69 -0
  368. package/lib/tools/trace/traceParser.js +96 -0
  369. package/lib/tools/trace/traceRequests.js +182 -0
  370. package/lib/tools/trace/traceScreenshot.js +68 -0
  371. package/lib/tools/trace/traceSnapshot.js +149 -0
  372. package/lib/tools/trace/traceUtils.js +153 -0
  373. package/lib/tools/utils/connect.js +32 -0
  374. package/lib/tools/utils/mcp/http.js +152 -0
  375. package/lib/tools/utils/mcp/server.js +230 -0
  376. package/lib/tools/utils/mcp/tool.js +47 -0
  377. package/lib/tools/utils/socketConnection.js +108 -0
  378. package/lib/utils/isomorphic/ariaSnapshot.js +455 -455
  379. package/lib/utils/isomorphic/assert.js +31 -31
  380. package/lib/utils/isomorphic/colors.js +72 -72
  381. package/lib/utils/isomorphic/cssParser.js +245 -245
  382. package/lib/utils/isomorphic/cssTokenizer.js +1051 -1051
  383. package/lib/utils/isomorphic/formatUtils.js +64 -0
  384. package/lib/utils/isomorphic/headers.js +53 -53
  385. package/lib/{server/utils → utils/isomorphic}/imageUtils.js +141 -141
  386. package/lib/utils/isomorphic/jsonSchema.js +89 -0
  387. package/lib/utils/isomorphic/locatorGenerators.js +689 -689
  388. package/lib/utils/isomorphic/locatorParser.js +176 -176
  389. package/lib/utils/isomorphic/locatorUtils.js +81 -81
  390. package/lib/utils/isomorphic/lruCache.js +51 -51
  391. package/lib/utils/isomorphic/manualPromise.js +114 -114
  392. package/lib/utils/isomorphic/mimeType.js +464 -459
  393. package/lib/utils/isomorphic/multimap.js +80 -80
  394. package/lib/utils/isomorphic/protocolFormatter.js +81 -81
  395. package/lib/utils/isomorphic/protocolMetainfo.js +351 -330
  396. package/lib/utils/isomorphic/rtti.js +43 -43
  397. package/lib/utils/isomorphic/selectorParser.js +386 -386
  398. package/lib/utils/isomorphic/semaphore.js +54 -54
  399. package/lib/utils/isomorphic/stackTrace.js +158 -158
  400. package/lib/utils/isomorphic/stringUtils.js +204 -204
  401. package/lib/utils/isomorphic/time.js +49 -49
  402. package/lib/utils/isomorphic/timeoutRunner.js +66 -66
  403. package/lib/utils/isomorphic/trace/entries.js +16 -16
  404. package/lib/utils/isomorphic/trace/snapshotRenderer.js +492 -499
  405. package/lib/utils/isomorphic/trace/snapshotServer.js +120 -120
  406. package/lib/utils/isomorphic/trace/snapshotStorage.js +89 -89
  407. package/lib/utils/isomorphic/trace/traceLoader.js +132 -131
  408. package/lib/utils/isomorphic/trace/traceModel.js +366 -365
  409. package/lib/utils/isomorphic/trace/traceModernizer.js +401 -400
  410. package/lib/utils/isomorphic/{traceUtils.js → trace/traceUtils.js} +58 -58
  411. package/lib/utils/isomorphic/trace/versions/traceV3.js +16 -16
  412. package/lib/utils/isomorphic/trace/versions/traceV4.js +16 -16
  413. package/lib/utils/isomorphic/trace/versions/traceV5.js +16 -16
  414. package/lib/utils/isomorphic/trace/versions/traceV6.js +16 -16
  415. package/lib/utils/isomorphic/trace/versions/traceV7.js +16 -16
  416. package/lib/utils/isomorphic/trace/versions/traceV8.js +16 -16
  417. package/lib/utils/isomorphic/types.js +16 -16
  418. package/lib/utils/isomorphic/urlMatch.js +243 -190
  419. package/lib/utils/isomorphic/utilityScriptSerializers.js +262 -251
  420. package/lib/utils/isomorphic/yaml.js +84 -84
  421. package/lib/utils.js +115 -111
  422. package/lib/utilsBundle.js +91 -109
  423. package/lib/utilsBundleImpl/index.js +217 -218
  424. package/lib/utilsBundleImpl/xdg-open +1066 -1066
  425. package/lib/vite/dashboard/assets/index-BAOybkp8.js +50 -0
  426. package/lib/vite/dashboard/assets/index-CZAYOG76.css +1 -0
  427. package/lib/vite/dashboard/index.html +28 -0
  428. package/lib/vite/htmlReport/index.html +16 -84
  429. package/lib/vite/htmlReport/report.css +1 -0
  430. package/lib/vite/htmlReport/report.js +72 -0
  431. package/lib/vite/recorder/assets/{codeMirrorModule-DadYNm1I.js → codeMirrorModule-C8KMvO9L.js} +32 -32
  432. package/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -1
  433. package/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -1
  434. package/lib/vite/recorder/assets/index-CqAYX1I3.js +193 -0
  435. package/lib/vite/recorder/index.html +29 -29
  436. package/lib/vite/recorder/playwright-logo.svg +9 -9
  437. package/lib/vite/traceViewer/assets/{codeMirrorModule-a5XoALAZ.js → codeMirrorModule-DS0FLvoc.js} +32 -32
  438. package/lib/vite/traceViewer/assets/defaultSettingsView-GTWI-W_B.js +262 -0
  439. package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -9
  440. package/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -1
  441. package/lib/vite/traceViewer/defaultSettingsView.B4dS75f0.css +1 -0
  442. package/lib/vite/traceViewer/{index.BVu7tZDe.css → index.CzXZzn5A.css} +1 -1
  443. package/lib/vite/traceViewer/{index.Bk2uYQRV.js → index.Dtstcb7U.js} +2 -2
  444. package/lib/vite/traceViewer/index.html +43 -43
  445. package/lib/vite/traceViewer/manifest.webmanifest +16 -16
  446. package/lib/vite/traceViewer/playwright-logo.svg +9 -9
  447. package/lib/vite/traceViewer/snapshot.html +21 -21
  448. package/lib/vite/traceViewer/sw.bundle.js +5 -5
  449. package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -1
  450. package/lib/vite/traceViewer/uiMode.Vipi55dB.js +6 -0
  451. package/lib/vite/traceViewer/uiMode.html +17 -17
  452. package/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -32
  453. package/lib/zipBundle.js +34 -34
  454. package/lib/zipBundleImpl.js +5 -5
  455. package/lib/zodBundle.js +39 -0
  456. package/lib/zodBundleImpl.js +40 -0
  457. package/package.json +6 -1
  458. package/types/protocol.d.ts +24720 -23824
  459. package/types/structs.d.ts +45 -45
  460. package/types/types.d.ts +23623 -22843
  461. package/lib/client/pageAgent.js +0 -64
  462. package/lib/mcpBundleImpl/index.js +0 -147
  463. package/lib/server/agent/actionRunner.js +0 -335
  464. package/lib/server/agent/actions.js +0 -128
  465. package/lib/server/agent/codegen.js +0 -111
  466. package/lib/server/agent/context.js +0 -150
  467. package/lib/server/agent/expectTools.js +0 -156
  468. package/lib/server/agent/pageAgent.js +0 -204
  469. package/lib/server/agent/performTools.js +0 -262
  470. package/lib/server/agent/tool.js +0 -109
  471. package/lib/server/dispatchers/pageAgentDispatcher.js +0 -96
  472. package/lib/vite/recorder/assets/index-BhTWtUlo.js +0 -193
  473. package/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +0 -266
  474. package/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +0 -1
  475. package/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +0 -5
@@ -1,79 +1,79 @@
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
- TimeoutSettings: () => TimeoutSettings
22
- });
23
- module.exports = __toCommonJS(timeoutSettings_exports);
24
- var import_time = require("../utils/isomorphic/time");
25
- class TimeoutSettings {
26
- constructor(platform, parent) {
27
- this._parent = parent;
28
- this._platform = platform;
29
- }
30
- setDefaultTimeout(timeout) {
31
- this._defaultTimeout = timeout;
32
- }
33
- setDefaultNavigationTimeout(timeout) {
34
- this._defaultNavigationTimeout = timeout;
35
- }
36
- defaultNavigationTimeout() {
37
- return this._defaultNavigationTimeout;
38
- }
39
- defaultTimeout() {
40
- return this._defaultTimeout;
41
- }
42
- navigationTimeout(options) {
43
- if (typeof options.timeout === "number")
44
- return options.timeout;
45
- if (this._defaultNavigationTimeout !== void 0)
46
- return this._defaultNavigationTimeout;
47
- if (this._platform.isDebugMode())
48
- return 0;
49
- if (this._defaultTimeout !== void 0)
50
- return this._defaultTimeout;
51
- if (this._parent)
52
- return this._parent.navigationTimeout(options);
53
- return import_time.DEFAULT_PLAYWRIGHT_TIMEOUT;
54
- }
55
- timeout(options) {
56
- if (typeof options.timeout === "number")
57
- return options.timeout;
58
- if (this._platform.isDebugMode())
59
- return 0;
60
- if (this._defaultTimeout !== void 0)
61
- return this._defaultTimeout;
62
- if (this._parent)
63
- return this._parent.timeout(options);
64
- return import_time.DEFAULT_PLAYWRIGHT_TIMEOUT;
65
- }
66
- launchTimeout(options) {
67
- if (typeof options.timeout === "number")
68
- return options.timeout;
69
- if (this._platform.isDebugMode())
70
- return 0;
71
- if (this._parent)
72
- return this._parent.launchTimeout(options);
73
- return import_time.DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
74
- }
75
- }
76
- // Annotate the CommonJS export names for ESM import in node:
77
- 0 && (module.exports = {
78
- TimeoutSettings
79
- });
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
+ TimeoutSettings: () => TimeoutSettings
22
+ });
23
+ module.exports = __toCommonJS(timeoutSettings_exports);
24
+ var import_time = require("../utils/isomorphic/time");
25
+ class TimeoutSettings {
26
+ constructor(platform, parent) {
27
+ this._parent = parent;
28
+ this._platform = platform;
29
+ }
30
+ setDefaultTimeout(timeout) {
31
+ this._defaultTimeout = timeout;
32
+ }
33
+ setDefaultNavigationTimeout(timeout) {
34
+ this._defaultNavigationTimeout = timeout;
35
+ }
36
+ defaultNavigationTimeout() {
37
+ return this._defaultNavigationTimeout;
38
+ }
39
+ defaultTimeout() {
40
+ return this._defaultTimeout;
41
+ }
42
+ navigationTimeout(options) {
43
+ if (typeof options.timeout === "number")
44
+ return options.timeout;
45
+ if (this._defaultNavigationTimeout !== void 0)
46
+ return this._defaultNavigationTimeout;
47
+ if (this._platform.isDebugMode())
48
+ return 0;
49
+ if (this._defaultTimeout !== void 0)
50
+ return this._defaultTimeout;
51
+ if (this._parent)
52
+ return this._parent.navigationTimeout(options);
53
+ return import_time.DEFAULT_PLAYWRIGHT_TIMEOUT;
54
+ }
55
+ timeout(options) {
56
+ if (typeof options.timeout === "number")
57
+ return options.timeout;
58
+ if (this._platform.isDebugMode())
59
+ return 0;
60
+ if (this._defaultTimeout !== void 0)
61
+ return this._defaultTimeout;
62
+ if (this._parent)
63
+ return this._parent.timeout(options);
64
+ return import_time.DEFAULT_PLAYWRIGHT_TIMEOUT;
65
+ }
66
+ launchTimeout(options) {
67
+ if (typeof options.timeout === "number")
68
+ return options.timeout;
69
+ if (this._platform.isDebugMode())
70
+ return 0;
71
+ if (this._parent)
72
+ return this._parent.launchTimeout(options);
73
+ return import_time.DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
74
+ }
75
+ }
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ TimeoutSettings
79
+ });
@@ -1,119 +1,126 @@
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 tracing_exports = {};
20
- __export(tracing_exports, {
21
- Tracing: () => Tracing
22
- });
23
- module.exports = __toCommonJS(tracing_exports);
24
- var import_artifact = require("./artifact");
25
- var import_channelOwner = require("./channelOwner");
26
- class Tracing extends import_channelOwner.ChannelOwner {
27
- constructor(parent, type, guid, initializer) {
28
- super(parent, type, guid, initializer);
29
- this._includeSources = false;
30
- this._isLive = false;
31
- this._isTracing = false;
32
- }
33
- static from(channel) {
34
- return channel._object;
35
- }
36
- async start(options = {}) {
37
- await this._wrapApiCall(async () => {
38
- this._includeSources = !!options.sources;
39
- this._isLive = !!options._live;
40
- await this._channel.tracingStart({
41
- name: options.name,
42
- snapshots: options.snapshots,
43
- screenshots: options.screenshots,
44
- live: options._live
45
- });
46
- const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title });
47
- await this._startCollectingStacks(traceName, this._isLive);
48
- });
49
- }
50
- async startChunk(options = {}) {
51
- await this._wrapApiCall(async () => {
52
- const { traceName } = await this._channel.tracingStartChunk(options);
53
- await this._startCollectingStacks(traceName, this._isLive);
54
- });
55
- }
56
- async group(name, options = {}) {
57
- await this._channel.tracingGroup({ name, location: options.location });
58
- }
59
- async groupEnd() {
60
- await this._channel.tracingGroupEnd();
61
- }
62
- async _startCollectingStacks(traceName, live) {
63
- if (!this._isTracing) {
64
- this._isTracing = true;
65
- this._connection.setIsTracing(true);
66
- }
67
- const result = await this._connection.localUtils()?.tracingStarted({ tracesDir: this._tracesDir, traceName, live });
68
- this._stacksId = result?.stacksId;
69
- }
70
- async stopChunk(options = {}) {
71
- await this._wrapApiCall(async () => {
72
- await this._doStopChunk(options.path);
73
- });
74
- }
75
- async stop(options = {}) {
76
- await this._wrapApiCall(async () => {
77
- await this._doStopChunk(options.path);
78
- await this._channel.tracingStop();
79
- });
80
- }
81
- async _doStopChunk(filePath) {
82
- this._resetStackCounter();
83
- if (!filePath) {
84
- await this._channel.tracingStopChunk({ mode: "discard" });
85
- if (this._stacksId)
86
- await this._connection.localUtils().traceDiscarded({ stacksId: this._stacksId });
87
- return;
88
- }
89
- const localUtils = this._connection.localUtils();
90
- if (!localUtils)
91
- throw new Error("Cannot save trace in thin clients");
92
- const isLocal = !this._connection.isRemote();
93
- if (isLocal) {
94
- const result2 = await this._channel.tracingStopChunk({ mode: "entries" });
95
- await localUtils.zip({ zipFile: filePath, entries: result2.entries, mode: "write", stacksId: this._stacksId, includeSources: this._includeSources });
96
- return;
97
- }
98
- const result = await this._channel.tracingStopChunk({ mode: "archive" });
99
- if (!result.artifact) {
100
- if (this._stacksId)
101
- await localUtils.traceDiscarded({ stacksId: this._stacksId });
102
- return;
103
- }
104
- const artifact = import_artifact.Artifact.from(result.artifact);
105
- await artifact.saveAs(filePath);
106
- await artifact.delete();
107
- await localUtils.zip({ zipFile: filePath, entries: [], mode: "append", stacksId: this._stacksId, includeSources: this._includeSources });
108
- }
109
- _resetStackCounter() {
110
- if (this._isTracing) {
111
- this._isTracing = false;
112
- this._connection.setIsTracing(false);
113
- }
114
- }
115
- }
116
- // Annotate the CommonJS export names for ESM import in node:
117
- 0 && (module.exports = {
118
- Tracing
119
- });
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 tracing_exports = {};
20
+ __export(tracing_exports, {
21
+ Tracing: () => Tracing
22
+ });
23
+ module.exports = __toCommonJS(tracing_exports);
24
+ var import_artifact = require("./artifact");
25
+ var import_channelOwner = require("./channelOwner");
26
+ var import_disposable = require("./disposable");
27
+ class Tracing extends import_channelOwner.ChannelOwner {
28
+ constructor(parent, type, guid, initializer) {
29
+ super(parent, type, guid, initializer);
30
+ this._includeSources = false;
31
+ this._additionalSources = /* @__PURE__ */ new Set();
32
+ this._isLive = false;
33
+ this._isTracing = false;
34
+ }
35
+ static from(channel) {
36
+ return channel._object;
37
+ }
38
+ async start(options = {}) {
39
+ await this._wrapApiCall(async () => {
40
+ this._includeSources = !!options.sources;
41
+ this._isLive = !!options.live;
42
+ await this._channel.tracingStart({
43
+ name: options.name,
44
+ snapshots: options.snapshots,
45
+ screenshots: options.screenshots,
46
+ live: options.live
47
+ });
48
+ const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title });
49
+ await this._startCollectingStacks(traceName, this._isLive);
50
+ });
51
+ }
52
+ async startChunk(options = {}) {
53
+ await this._wrapApiCall(async () => {
54
+ const { traceName } = await this._channel.tracingStartChunk(options);
55
+ await this._startCollectingStacks(traceName, this._isLive);
56
+ });
57
+ }
58
+ async group(name, options = {}) {
59
+ if (options.location)
60
+ this._additionalSources.add(options.location.file);
61
+ await this._channel.tracingGroup({ name, location: options.location });
62
+ return new import_disposable.DisposableStub(() => this.groupEnd());
63
+ }
64
+ async groupEnd() {
65
+ await this._channel.tracingGroupEnd();
66
+ }
67
+ async _startCollectingStacks(traceName, live) {
68
+ if (!this._isTracing) {
69
+ this._isTracing = true;
70
+ this._connection.setIsTracing(true);
71
+ }
72
+ const result = await this._connection.localUtils()?.tracingStarted({ tracesDir: this._tracesDir, traceName, live });
73
+ this._stacksId = result?.stacksId;
74
+ }
75
+ async stopChunk(options = {}) {
76
+ await this._wrapApiCall(async () => {
77
+ await this._doStopChunk(options.path);
78
+ });
79
+ }
80
+ async stop(options = {}) {
81
+ await this._wrapApiCall(async () => {
82
+ await this._doStopChunk(options.path);
83
+ await this._channel.tracingStop();
84
+ });
85
+ }
86
+ async _doStopChunk(filePath) {
87
+ this._resetStackCounter();
88
+ const additionalSources = [...this._additionalSources];
89
+ this._additionalSources.clear();
90
+ if (!filePath) {
91
+ await this._channel.tracingStopChunk({ mode: "discard" });
92
+ if (this._stacksId)
93
+ await this._connection.localUtils().traceDiscarded({ stacksId: this._stacksId });
94
+ return;
95
+ }
96
+ const localUtils = this._connection.localUtils();
97
+ if (!localUtils)
98
+ throw new Error("Cannot save trace in thin clients");
99
+ const isLocal = !this._connection.isRemote();
100
+ if (isLocal) {
101
+ const result2 = await this._channel.tracingStopChunk({ mode: "entries" });
102
+ await localUtils.zip({ zipFile: filePath, entries: result2.entries, mode: "write", stacksId: this._stacksId, includeSources: this._includeSources, additionalSources });
103
+ return;
104
+ }
105
+ const result = await this._channel.tracingStopChunk({ mode: "archive" });
106
+ if (!result.artifact) {
107
+ if (this._stacksId)
108
+ await localUtils.traceDiscarded({ stacksId: this._stacksId });
109
+ return;
110
+ }
111
+ const artifact = import_artifact.Artifact.from(result.artifact);
112
+ await artifact.saveAs(filePath);
113
+ await artifact.delete();
114
+ await localUtils.zip({ zipFile: filePath, entries: [], mode: "append", stacksId: this._stacksId, includeSources: this._includeSources, additionalSources });
115
+ }
116
+ _resetStackCounter() {
117
+ if (this._isTracing) {
118
+ this._isTracing = false;
119
+ this._connection.setIsTracing(false);
120
+ }
121
+ }
122
+ }
123
+ // Annotate the CommonJS export names for ESM import in node:
124
+ 0 && (module.exports = {
125
+ Tracing
126
+ });
@@ -1,28 +1,28 @@
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 types_exports = {};
20
- __export(types_exports, {
21
- kLifecycleEvents: () => kLifecycleEvents
22
- });
23
- module.exports = __toCommonJS(types_exports);
24
- const kLifecycleEvents = /* @__PURE__ */ new Set(["load", "domcontentloaded", "networkidle", "commit"]);
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- kLifecycleEvents
28
- });
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 types_exports = {};
20
+ __export(types_exports, {
21
+ kLifecycleEvents: () => kLifecycleEvents
22
+ });
23
+ module.exports = __toCommonJS(types_exports);
24
+ const kLifecycleEvents = /* @__PURE__ */ new Set(["load", "domcontentloaded", "networkidle", "commit"]);
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ kLifecycleEvents
28
+ });
@@ -1,59 +1,52 @@
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 video_exports = {};
20
- __export(video_exports, {
21
- Video: () => Video
22
- });
23
- module.exports = __toCommonJS(video_exports);
24
- var import_manualPromise = require("../utils/isomorphic/manualPromise");
25
- class Video {
26
- constructor(page, connection) {
27
- this._artifact = null;
28
- this._artifactReadyPromise = new import_manualPromise.ManualPromise();
29
- this._isRemote = false;
30
- this._isRemote = connection.isRemote();
31
- this._artifact = page._closedOrCrashedScope.safeRace(this._artifactReadyPromise);
32
- }
33
- _artifactReady(artifact) {
34
- this._artifactReadyPromise.resolve(artifact);
35
- }
36
- async path() {
37
- if (this._isRemote)
38
- throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
39
- const artifact = await this._artifact;
40
- if (!artifact)
41
- throw new Error("Page did not produce any video frames");
42
- return artifact._initializer.absolutePath;
43
- }
44
- async saveAs(path) {
45
- const artifact = await this._artifact;
46
- if (!artifact)
47
- throw new Error("Page did not produce any video frames");
48
- return await artifact.saveAs(path);
49
- }
50
- async delete() {
51
- const artifact = await this._artifact;
52
- if (artifact)
53
- await artifact.delete();
54
- }
55
- }
56
- // Annotate the CommonJS export names for ESM import in node:
57
- 0 && (module.exports = {
58
- Video
59
- });
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 video_exports = {};
20
+ __export(video_exports, {
21
+ Video: () => Video
22
+ });
23
+ module.exports = __toCommonJS(video_exports);
24
+ var import_eventEmitter = require("./eventEmitter");
25
+ class Video extends import_eventEmitter.EventEmitter {
26
+ constructor(page, connection, artifact) {
27
+ super(page._platform);
28
+ this._isRemote = false;
29
+ this._isRemote = connection.isRemote();
30
+ this._artifact = artifact;
31
+ }
32
+ async path() {
33
+ if (this._isRemote)
34
+ throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
35
+ if (!this._artifact)
36
+ throw new Error("Video recording has not been started.");
37
+ return this._artifact._initializer.absolutePath;
38
+ }
39
+ async saveAs(path) {
40
+ if (!this._artifact)
41
+ throw new Error("Video recording has not been started.");
42
+ return await this._artifact.saveAs(path);
43
+ }
44
+ async delete() {
45
+ if (this._artifact)
46
+ await this._artifact.delete();
47
+ }
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ Video
52
+ });