rebrowser-playwright-core 1.52.0 → 1.64.100

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 (395) hide show
  1. package/ThirdPartyNotices.txt +7 -1554
  2. package/bin/install_webkit_wsl.ps1 +33 -0
  3. package/bin/reinstall_chrome_beta_linux.sh +1 -1
  4. package/bin/reinstall_chrome_beta_mac.sh +1 -1
  5. package/bin/reinstall_chrome_stable_linux.sh +1 -1
  6. package/bin/reinstall_chrome_stable_mac.sh +1 -1
  7. package/bin/reinstall_msedge_beta_linux.sh +1 -1
  8. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  9. package/bin/reinstall_msedge_dev_linux.sh +1 -1
  10. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  11. package/bin/reinstall_msedge_stable_linux.sh +1 -1
  12. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  13. package/browsers.json +16 -44
  14. package/cli.js +5 -1
  15. package/index.js +2 -17
  16. package/lib/bootstrap.js +149 -0
  17. package/lib/coreBundle.js +78322 -0
  18. package/lib/entry/cliDaemon.js +5 -0
  19. package/lib/entry/dashboardApp.js +3 -0
  20. package/lib/entry/mcp.js +10 -0
  21. package/lib/entry/oopBrowserDownload.js +3 -0
  22. package/lib/{server/deviceDescriptors.js → package.js} +18 -7
  23. package/lib/server/electron/loader.js +108 -14
  24. package/lib/serverRegistry.js +1939 -0
  25. package/lib/serverRegistry.js.LICENSE +65 -0
  26. package/lib/tools/cli-client/channelSessions.js +141 -0
  27. package/lib/tools/cli-client/cli.js +7 -0
  28. package/lib/tools/cli-client/help.json +808 -0
  29. package/lib/tools/cli-client/minimist.js +128 -0
  30. package/lib/tools/cli-client/output.js +352 -0
  31. package/lib/tools/cli-client/program.js +422 -0
  32. package/lib/tools/cli-client/registry.js +180 -0
  33. package/lib/tools/cli-client/session.js +261 -0
  34. package/lib/tools/dashboard/appIcon.png +0 -0
  35. package/lib/tools/skills/playwright-cli/SKILL.md +493 -0
  36. package/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  37. package/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  38. package/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
  39. package/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  40. package/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
  41. package/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
  42. package/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  43. package/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  44. package/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  45. package/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
  46. package/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  47. package/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  48. package/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  49. package/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  50. package/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  51. package/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  52. package/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  53. package/lib/tools/utils/extension.js +112 -0
  54. package/lib/tools/utils/socketConnection.js +108 -0
  55. package/lib/utilsBundle.js +86038 -66
  56. package/lib/utilsBundle.js.LICENSE +1890 -0
  57. package/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  58. package/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  59. package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  60. package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  61. package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  62. package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  63. package/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  64. package/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  65. package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  66. package/lib/vite/dashboard/index.html +29 -0
  67. package/lib/vite/dashboard/playwright-logo.svg +24 -0
  68. package/lib/vite/htmlReport/index.html +2 -61
  69. package/lib/vite/htmlReport/report.css +2 -0
  70. package/lib/vite/htmlReport/report.js +32 -0
  71. package/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  72. package/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +32 -0
  73. package/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  74. package/lib/vite/recorder/assets/index-Cn0mmDuv.js +129 -0
  75. package/lib/vite/recorder/index.html +3 -3
  76. package/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +32 -0
  77. package/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +184 -0
  78. package/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  79. package/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +7 -0
  80. package/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  81. package/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
  82. package/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  83. package/lib/vite/traceViewer/index.html +9 -8
  84. package/lib/vite/traceViewer/index.oNry3Hjv.js +1 -0
  85. package/lib/vite/traceViewer/manifest.webmanifest +16 -0
  86. package/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  87. package/lib/vite/traceViewer/snapshot.html +4 -15
  88. package/lib/vite/traceViewer/sw.bundle.js +4 -3
  89. package/lib/vite/traceViewer/uiMode.CYwC_gH1.js +5 -0
  90. package/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  91. package/lib/vite/traceViewer/uiMode.html +6 -5
  92. package/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  93. package/lib/webp_codec.LICENSE +173 -0
  94. package/lib/webp_codec.wasm +0 -0
  95. package/lib/{utilsBundleImpl/xdg-open → xdg-open} +338 -137
  96. package/package.json +6 -16
  97. package/types/protocol.d.ts +10495 -8030
  98. package/types/structs.d.ts +8 -1
  99. package/types/types.d.ts +9256 -4825
  100. package/lib/androidServerImpl.js +0 -63
  101. package/lib/browserServerImpl.js +0 -88
  102. package/lib/cli/driver.js +0 -97
  103. package/lib/cli/program.js +0 -567
  104. package/lib/cli/programWithTestStub.js +0 -74
  105. package/lib/client/accessibility.js +0 -49
  106. package/lib/client/android.js +0 -365
  107. package/lib/client/api.js +0 -137
  108. package/lib/client/artifact.js +0 -79
  109. package/lib/client/browser.js +0 -136
  110. package/lib/client/browserContext.js +0 -539
  111. package/lib/client/browserType.js +0 -193
  112. package/lib/client/cdpSession.js +0 -51
  113. package/lib/client/channelOwner.js +0 -205
  114. package/lib/client/clientHelper.js +0 -64
  115. package/lib/client/clientInstrumentation.js +0 -55
  116. package/lib/client/clientStackTrace.js +0 -69
  117. package/lib/client/clock.js +0 -68
  118. package/lib/client/connection.js +0 -318
  119. package/lib/client/consoleMessage.js +0 -55
  120. package/lib/client/coverage.js +0 -44
  121. package/lib/client/dialog.js +0 -56
  122. package/lib/client/download.js +0 -62
  123. package/lib/client/electron.js +0 -133
  124. package/lib/client/elementHandle.js +0 -284
  125. package/lib/client/errors.js +0 -77
  126. package/lib/client/eventEmitter.js +0 -314
  127. package/lib/client/events.js +0 -98
  128. package/lib/client/fetch.js +0 -367
  129. package/lib/client/fileChooser.js +0 -46
  130. package/lib/client/fileUtils.js +0 -34
  131. package/lib/client/frame.js +0 -386
  132. package/lib/client/harRouter.js +0 -87
  133. package/lib/client/input.js +0 -82
  134. package/lib/client/jsHandle.js +0 -105
  135. package/lib/client/jsonPipe.js +0 -39
  136. package/lib/client/localUtils.js +0 -61
  137. package/lib/client/locator.js +0 -362
  138. package/lib/client/network.js +0 -751
  139. package/lib/client/page.js +0 -709
  140. package/lib/client/platform.js +0 -74
  141. package/lib/client/playwright.js +0 -85
  142. package/lib/client/selectors.js +0 -75
  143. package/lib/client/stream.js +0 -39
  144. package/lib/client/timeoutSettings.js +0 -75
  145. package/lib/client/tracing.js +0 -114
  146. package/lib/client/types.js +0 -28
  147. package/lib/client/video.js +0 -59
  148. package/lib/client/waiter.js +0 -142
  149. package/lib/client/webError.js +0 -39
  150. package/lib/client/webSocket.js +0 -111
  151. package/lib/client/worker.js +0 -63
  152. package/lib/client/writableStream.js +0 -39
  153. package/lib/generated/clockSource.js +0 -28
  154. package/lib/generated/consoleApiSource.js +0 -28
  155. package/lib/generated/injectedScriptSource.js +0 -28
  156. package/lib/generated/pollingRecorderSource.js +0 -28
  157. package/lib/generated/utilityScriptSource.js +0 -28
  158. package/lib/generated/webSocketMockSource.js +0 -378
  159. package/lib/inProcessFactory.js +0 -59
  160. package/lib/inprocess.js +0 -3
  161. package/lib/outofprocess.js +0 -78
  162. package/lib/protocol/debug.js +0 -211
  163. package/lib/protocol/serializers.js +0 -192
  164. package/lib/protocol/validator.js +0 -2825
  165. package/lib/protocol/validatorPrimitives.js +0 -179
  166. package/lib/remote/playwrightConnection.js +0 -266
  167. package/lib/remote/playwrightServer.js +0 -139
  168. package/lib/server/accessibility.js +0 -69
  169. package/lib/server/android/android.js +0 -451
  170. package/lib/server/android/backendAdb.js +0 -179
  171. package/lib/server/artifact.js +0 -127
  172. package/lib/server/bidi/bidiBrowser.js +0 -380
  173. package/lib/server/bidi/bidiChromium.js +0 -152
  174. package/lib/server/bidi/bidiConnection.js +0 -187
  175. package/lib/server/bidi/bidiExecutionContext.js +0 -220
  176. package/lib/server/bidi/bidiFirefox.js +0 -112
  177. package/lib/server/bidi/bidiInput.js +0 -146
  178. package/lib/server/bidi/bidiNetworkManager.js +0 -320
  179. package/lib/server/bidi/bidiOverCdp.js +0 -102
  180. package/lib/server/bidi/bidiPage.js +0 -530
  181. package/lib/server/bidi/bidiPdf.js +0 -106
  182. package/lib/server/bidi/third_party/bidiCommands.d.js +0 -22
  183. package/lib/server/bidi/third_party/bidiDeserializer.js +0 -98
  184. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -256
  185. package/lib/server/bidi/third_party/bidiProtocol.js +0 -152
  186. package/lib/server/bidi/third_party/bidiSerializer.js +0 -148
  187. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -259
  188. package/lib/server/browser.js +0 -140
  189. package/lib/server/browserContext.js +0 -650
  190. package/lib/server/browserType.js +0 -326
  191. package/lib/server/callLog.js +0 -82
  192. package/lib/server/chromium/chromium.js +0 -376
  193. package/lib/server/chromium/chromiumSwitches.js +0 -101
  194. package/lib/server/chromium/crAccessibility.js +0 -263
  195. package/lib/server/chromium/crBrowser.js +0 -498
  196. package/lib/server/chromium/crConnection.js +0 -324
  197. package/lib/server/chromium/crCoverage.js +0 -232
  198. package/lib/server/chromium/crDevTools.js +0 -117
  199. package/lib/server/chromium/crDragDrop.js +0 -126
  200. package/lib/server/chromium/crExecutionContext.js +0 -145
  201. package/lib/server/chromium/crInput.js +0 -184
  202. package/lib/server/chromium/crNetworkManager.js +0 -666
  203. package/lib/server/chromium/crPage.js +0 -1055
  204. package/lib/server/chromium/crPdf.js +0 -121
  205. package/lib/server/chromium/crProtocolHelper.js +0 -145
  206. package/lib/server/chromium/crServiceWorker.js +0 -130
  207. package/lib/server/chromium/defaultFontFamilies.js +0 -162
  208. package/lib/server/chromium/protocol.d.js +0 -16
  209. package/lib/server/chromium/videoRecorder.js +0 -121
  210. package/lib/server/clock.js +0 -137
  211. package/lib/server/codegen/csharp.js +0 -329
  212. package/lib/server/codegen/java.js +0 -270
  213. package/lib/server/codegen/javascript.js +0 -268
  214. package/lib/server/codegen/jsonl.js +0 -51
  215. package/lib/server/codegen/language.js +0 -111
  216. package/lib/server/codegen/languages.js +0 -68
  217. package/lib/server/codegen/python.js +0 -277
  218. package/lib/server/codegen/types.js +0 -16
  219. package/lib/server/console.js +0 -53
  220. package/lib/server/cookieStore.js +0 -204
  221. package/lib/server/debugController.js +0 -185
  222. package/lib/server/debugger.js +0 -136
  223. package/lib/server/deviceDescriptorsSource.json +0 -1669
  224. package/lib/server/dialog.js +0 -72
  225. package/lib/server/dispatchers/androidDispatcher.js +0 -293
  226. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  227. package/lib/server/dispatchers/browserContextDispatcher.js +0 -328
  228. package/lib/server/dispatchers/browserDispatcher.js +0 -151
  229. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
  230. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -44
  231. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -87
  232. package/lib/server/dispatchers/dialogDispatcher.js +0 -47
  233. package/lib/server/dispatchers/dispatcher.js +0 -346
  234. package/lib/server/dispatchers/electronDispatcher.js +0 -90
  235. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -191
  236. package/lib/server/dispatchers/frameDispatcher.js +0 -224
  237. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -80
  238. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -58
  239. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -155
  240. package/lib/server/dispatchers/networkDispatchers.js +0 -204
  241. package/lib/server/dispatchers/pageDispatcher.js +0 -328
  242. package/lib/server/dispatchers/playwrightDispatcher.js +0 -100
  243. package/lib/server/dispatchers/selectorsDispatcher.js +0 -40
  244. package/lib/server/dispatchers/streamDispatcher.js +0 -60
  245. package/lib/server/dispatchers/tracingDispatcher.js +0 -59
  246. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -154
  247. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -73
  248. package/lib/server/dom.js +0 -869
  249. package/lib/server/download.js +0 -70
  250. package/lib/server/electron/electron.js +0 -277
  251. package/lib/server/errors.js +0 -69
  252. package/lib/server/fetch.js +0 -640
  253. package/lib/server/fileChooser.js +0 -43
  254. package/lib/server/fileUploadUtils.js +0 -84
  255. package/lib/server/firefox/ffAccessibility.js +0 -238
  256. package/lib/server/firefox/ffBrowser.js +0 -404
  257. package/lib/server/firefox/ffConnection.js +0 -147
  258. package/lib/server/firefox/ffExecutionContext.js +0 -149
  259. package/lib/server/firefox/ffInput.js +0 -159
  260. package/lib/server/firefox/ffNetworkManager.js +0 -254
  261. package/lib/server/firefox/ffPage.js +0 -501
  262. package/lib/server/firefox/firefox.js +0 -106
  263. package/lib/server/firefox/protocol.d.js +0 -16
  264. package/lib/server/formData.js +0 -147
  265. package/lib/server/frameSelectors.js +0 -137
  266. package/lib/server/frames.js +0 -1555
  267. package/lib/server/har/harRecorder.js +0 -147
  268. package/lib/server/har/harTracer.js +0 -606
  269. package/lib/server/harBackend.js +0 -157
  270. package/lib/server/helper.js +0 -100
  271. package/lib/server/index.js +0 -61
  272. package/lib/server/input.js +0 -280
  273. package/lib/server/instrumentation.js +0 -75
  274. package/lib/server/javascript.js +0 -299
  275. package/lib/server/launchApp.js +0 -110
  276. package/lib/server/localUtils.js +0 -211
  277. package/lib/server/macEditingCommands.js +0 -143
  278. package/lib/server/network.js +0 -583
  279. package/lib/server/page.js +0 -790
  280. package/lib/server/pageBinding.js +0 -88
  281. package/lib/server/pipeTransport.js +0 -89
  282. package/lib/server/playwright.js +0 -81
  283. package/lib/server/progress.js +0 -104
  284. package/lib/server/protocolError.js +0 -52
  285. package/lib/server/recorder/chat.js +0 -161
  286. package/lib/server/recorder/contextRecorder.js +0 -286
  287. package/lib/server/recorder/recorderApp.js +0 -184
  288. package/lib/server/recorder/recorderCollection.js +0 -116
  289. package/lib/server/recorder/recorderFrontend.js +0 -16
  290. package/lib/server/recorder/recorderRunner.js +0 -135
  291. package/lib/server/recorder/recorderUtils.js +0 -100
  292. package/lib/server/recorder/throttledFile.js +0 -57
  293. package/lib/server/recorder.js +0 -360
  294. package/lib/server/registry/browserFetcher.js +0 -175
  295. package/lib/server/registry/dependencies.js +0 -371
  296. package/lib/server/registry/index.js +0 -1271
  297. package/lib/server/registry/nativeDeps.js +0 -1105
  298. package/lib/server/registry/oopDownloadBrowserMain.js +0 -120
  299. package/lib/server/screenshotter.js +0 -332
  300. package/lib/server/selectors.js +0 -112
  301. package/lib/server/socksClientCertificatesInterceptor.js +0 -321
  302. package/lib/server/socksInterceptor.js +0 -95
  303. package/lib/server/storageScript.js +0 -154
  304. package/lib/server/timeoutSettings.js +0 -89
  305. package/lib/server/trace/recorder/snapshotter.js +0 -143
  306. package/lib/server/trace/recorder/snapshotterInjected.js +0 -539
  307. package/lib/server/trace/recorder/tracing.js +0 -593
  308. package/lib/server/trace/test/inMemorySnapshotter.js +0 -87
  309. package/lib/server/trace/viewer/traceViewer.js +0 -249
  310. package/lib/server/transport.js +0 -183
  311. package/lib/server/types.js +0 -28
  312. package/lib/server/usKeyboardLayout.js +0 -145
  313. package/lib/server/utils/ascii.js +0 -44
  314. package/lib/server/utils/comparators.js +0 -161
  315. package/lib/server/utils/crypto.js +0 -216
  316. package/lib/server/utils/debug.js +0 -47
  317. package/lib/server/utils/debugLogger.js +0 -114
  318. package/lib/server/utils/env.js +0 -68
  319. package/lib/server/utils/eventsHelper.js +0 -39
  320. package/lib/server/utils/expectUtils.js +0 -38
  321. package/lib/server/utils/fileUtils.js +0 -191
  322. package/lib/server/utils/happyEyeballs.js +0 -207
  323. package/lib/server/utils/hostPlatform.js +0 -109
  324. package/lib/server/utils/httpServer.js +0 -218
  325. package/lib/server/utils/image_tools/colorUtils.js +0 -89
  326. package/lib/server/utils/image_tools/compare.js +0 -109
  327. package/lib/server/utils/image_tools/imageChannel.js +0 -78
  328. package/lib/server/utils/image_tools/stats.js +0 -102
  329. package/lib/server/utils/linuxUtils.js +0 -71
  330. package/lib/server/utils/network.js +0 -217
  331. package/lib/server/utils/nodePlatform.js +0 -148
  332. package/lib/server/utils/pipeTransport.js +0 -84
  333. package/lib/server/utils/processLauncher.js +0 -238
  334. package/lib/server/utils/profiler.js +0 -65
  335. package/lib/server/utils/socksProxy.js +0 -511
  336. package/lib/server/utils/spawnAsync.js +0 -41
  337. package/lib/server/utils/task.js +0 -51
  338. package/lib/server/utils/userAgent.js +0 -98
  339. package/lib/server/utils/wsServer.js +0 -132
  340. package/lib/server/utils/zipFile.js +0 -74
  341. package/lib/server/utils/zones.js +0 -57
  342. package/lib/server/webkit/protocol.d.js +0 -16
  343. package/lib/server/webkit/webkit.js +0 -100
  344. package/lib/server/webkit/wkAccessibility.js +0 -237
  345. package/lib/server/webkit/wkBrowser.js +0 -312
  346. package/lib/server/webkit/wkConnection.js +0 -149
  347. package/lib/server/webkit/wkExecutionContext.js +0 -153
  348. package/lib/server/webkit/wkInput.js +0 -181
  349. package/lib/server/webkit/wkInterceptableRequest.js +0 -169
  350. package/lib/server/webkit/wkPage.js +0 -1114
  351. package/lib/server/webkit/wkProvisionalPage.js +0 -83
  352. package/lib/server/webkit/wkWorkers.js +0 -104
  353. package/lib/third_party/pixelmatch.js +0 -255
  354. package/lib/utils/isomorphic/ariaSnapshot.js +0 -384
  355. package/lib/utils/isomorphic/assert.js +0 -31
  356. package/lib/utils/isomorphic/builtins.js +0 -90
  357. package/lib/utils/isomorphic/colors.js +0 -72
  358. package/lib/utils/isomorphic/cssParser.js +0 -246
  359. package/lib/utils/isomorphic/cssTokenizer.js +0 -1051
  360. package/lib/utils/isomorphic/headers.js +0 -53
  361. package/lib/utils/isomorphic/locatorGenerators.js +0 -655
  362. package/lib/utils/isomorphic/locatorParser.js +0 -176
  363. package/lib/utils/isomorphic/locatorUtils.js +0 -81
  364. package/lib/utils/isomorphic/manualPromise.js +0 -115
  365. package/lib/utils/isomorphic/mimeType.js +0 -460
  366. package/lib/utils/isomorphic/multimap.js +0 -81
  367. package/lib/utils/isomorphic/rtti.js +0 -43
  368. package/lib/utils/isomorphic/selectorParser.js +0 -387
  369. package/lib/utils/isomorphic/semaphore.js +0 -54
  370. package/lib/utils/isomorphic/stackTrace.js +0 -158
  371. package/lib/utils/isomorphic/stringUtils.js +0 -176
  372. package/lib/utils/isomorphic/time.js +0 -44
  373. package/lib/utils/isomorphic/timeoutRunner.js +0 -67
  374. package/lib/utils/isomorphic/traceUtils.js +0 -59
  375. package/lib/utils/isomorphic/types.js +0 -16
  376. package/lib/utils/isomorphic/urlMatch.js +0 -167
  377. package/lib/utils/isomorphic/utilityScriptSerializers.js +0 -248
  378. package/lib/utils.js +0 -101
  379. package/lib/utilsBundleImpl/index.js +0 -208
  380. package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +0 -1
  381. package/lib/vite/recorder/assets/codeMirrorModule-DVQi6prl.js +0 -24
  382. package/lib/vite/recorder/assets/index-97EUAAbk.js +0 -184
  383. package/lib/vite/recorder/assets/index-eHBmevrY.css +0 -1
  384. package/lib/vite/traceViewer/assets/codeMirrorModule-DwAiTpyC.js +0 -24
  385. package/lib/vite/traceViewer/assets/defaultSettingsView-DkkRvn5X.js +0 -265
  386. package/lib/vite/traceViewer/assets/xtermModule-BoAIEibi.js +0 -9
  387. package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +0 -1
  388. package/lib/vite/traceViewer/defaultSettingsView.QdHITyLI.css +0 -1
  389. package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
  390. package/lib/vite/traceViewer/index.DvtSwn6E.js +0 -2
  391. package/lib/vite/traceViewer/uiMode.BatfzHMG.css +0 -1
  392. package/lib/vite/traceViewer/uiMode.Sdytl9wc.js +0 -5
  393. package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +0 -32
  394. package/lib/zipBundle.js +0 -34
  395. package/lib/zipBundleImpl.js +0 -5
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var dialogDispatcher_exports = {};
20
- __export(dialogDispatcher_exports, {
21
- DialogDispatcher: () => DialogDispatcher
22
- });
23
- module.exports = __toCommonJS(dialogDispatcher_exports);
24
- var import_dispatcher = require("./dispatcher");
25
- var import_pageDispatcher = require("./pageDispatcher");
26
- class DialogDispatcher extends import_dispatcher.Dispatcher {
27
- constructor(scope, dialog) {
28
- const page = import_pageDispatcher.PageDispatcher.fromNullable(scope, dialog.page().initializedOrUndefined());
29
- super(page || scope, dialog, "Dialog", {
30
- page,
31
- type: dialog.type(),
32
- message: dialog.message(),
33
- defaultValue: dialog.defaultValue()
34
- });
35
- this._type_Dialog = true;
36
- }
37
- async accept(params) {
38
- await this._object.accept(params.promptText);
39
- }
40
- async dismiss() {
41
- await this._object.dismiss();
42
- }
43
- }
44
- // Annotate the CommonJS export names for ESM import in node:
45
- 0 && (module.exports = {
46
- DialogDispatcher
47
- });
@@ -1,346 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var dispatcher_exports = {};
20
- __export(dispatcher_exports, {
21
- Dispatcher: () => Dispatcher,
22
- DispatcherConnection: () => DispatcherConnection,
23
- RootDispatcher: () => RootDispatcher,
24
- dispatcherSymbol: () => dispatcherSymbol,
25
- existingDispatcher: () => existingDispatcher,
26
- setMaxDispatchersForTest: () => setMaxDispatchersForTest
27
- });
28
- module.exports = __toCommonJS(dispatcher_exports);
29
- var import_events = require("events");
30
- var import_eventsHelper = require("../utils/eventsHelper");
31
- var import_validator = require("../../protocol/validator");
32
- var import_utils = require("../../utils");
33
- var import_debug = require("../utils/debug");
34
- var import_errors = require("../errors");
35
- var import_instrumentation = require("../instrumentation");
36
- var import_protocolError = require("../protocolError");
37
- var import_callLog = require("../callLog");
38
- const dispatcherSymbol = Symbol("dispatcher");
39
- const metadataValidator = (0, import_validator.createMetadataValidator)();
40
- function existingDispatcher(object) {
41
- return object[dispatcherSymbol];
42
- }
43
- let maxDispatchersOverride;
44
- function setMaxDispatchersForTest(value) {
45
- maxDispatchersOverride = value;
46
- }
47
- function maxDispatchersForBucket(gcBucket) {
48
- return maxDispatchersOverride ?? {
49
- "JSHandle": 1e5,
50
- "ElementHandle": 1e5
51
- }[gcBucket] ?? 1e4;
52
- }
53
- class Dispatcher extends import_events.EventEmitter {
54
- constructor(parent, object, type, initializer, gcBucket) {
55
- super();
56
- // Only "isScope" channel owners have registered dispatchers inside.
57
- this._dispatchers = /* @__PURE__ */ new Map();
58
- this._disposed = false;
59
- this._eventListeners = [];
60
- this._openScope = new import_utils.LongStandingScope();
61
- this._connection = parent instanceof DispatcherConnection ? parent : parent._connection;
62
- this._parent = parent instanceof DispatcherConnection ? void 0 : parent;
63
- const guid = object.guid;
64
- this._guid = guid;
65
- this._type = type;
66
- this._object = object;
67
- this._gcBucket = gcBucket ?? type;
68
- object[dispatcherSymbol] = this;
69
- this._connection.registerDispatcher(this);
70
- if (this._parent) {
71
- (0, import_utils.assert)(!this._parent._dispatchers.has(guid));
72
- this._parent._dispatchers.set(guid, this);
73
- }
74
- if (this._parent)
75
- this._connection.sendCreate(this._parent, type, guid, initializer);
76
- this._connection.maybeDisposeStaleDispatchers(this._gcBucket);
77
- }
78
- parentScope() {
79
- return this._parent;
80
- }
81
- addObjectListener(eventName, handler) {
82
- this._eventListeners.push(import_eventsHelper.eventsHelper.addEventListener(this._object, eventName, handler));
83
- }
84
- adopt(child) {
85
- if (child._parent === this)
86
- return;
87
- const oldParent = child._parent;
88
- oldParent._dispatchers.delete(child._guid);
89
- this._dispatchers.set(child._guid, child);
90
- child._parent = this;
91
- this._connection.sendAdopt(this, child);
92
- }
93
- async _handleCommand(callMetadata, method, validParams) {
94
- const commandPromise = this[method](validParams, callMetadata);
95
- try {
96
- return await this._openScope.race(commandPromise);
97
- } catch (e) {
98
- if (callMetadata.potentiallyClosesScope && (0, import_errors.isTargetClosedError)(e))
99
- return await commandPromise;
100
- throw e;
101
- }
102
- }
103
- _dispatchEvent(method, params) {
104
- if (this._disposed) {
105
- if ((0, import_debug.isUnderTest)())
106
- throw new Error(`${this._guid} is sending "${String(method)}" event after being disposed`);
107
- return;
108
- }
109
- this._connection.sendEvent(this, method, params);
110
- }
111
- _dispose(reason) {
112
- this._disposeRecursively(new import_errors.TargetClosedError());
113
- this._connection.sendDispose(this, reason);
114
- }
115
- _onDispose() {
116
- }
117
- _disposeRecursively(error) {
118
- (0, import_utils.assert)(!this._disposed, `${this._guid} is disposed more than once`);
119
- this._onDispose();
120
- this._disposed = true;
121
- import_eventsHelper.eventsHelper.removeEventListeners(this._eventListeners);
122
- this._parent?._dispatchers.delete(this._guid);
123
- const list = this._connection._dispatchersByBucket.get(this._gcBucket);
124
- list?.delete(this._guid);
125
- this._connection._dispatchers.delete(this._guid);
126
- for (const dispatcher of [...this._dispatchers.values()])
127
- dispatcher._disposeRecursively(error);
128
- this._dispatchers.clear();
129
- delete this._object[dispatcherSymbol];
130
- this._openScope.close(error);
131
- }
132
- _debugScopeState() {
133
- return {
134
- _guid: this._guid,
135
- objects: Array.from(this._dispatchers.values()).map((o) => o._debugScopeState())
136
- };
137
- }
138
- async waitForEventInfo() {
139
- }
140
- }
141
- class RootDispatcher extends Dispatcher {
142
- constructor(connection, createPlaywright) {
143
- super(connection, { guid: "" }, "Root", {});
144
- this.createPlaywright = createPlaywright;
145
- this._initialized = false;
146
- }
147
- async initialize(params) {
148
- (0, import_utils.assert)(this.createPlaywright);
149
- (0, import_utils.assert)(!this._initialized);
150
- this._initialized = true;
151
- return {
152
- playwright: await this.createPlaywright(this, params)
153
- };
154
- }
155
- }
156
- class DispatcherConnection {
157
- constructor(isLocal) {
158
- this._dispatchers = /* @__PURE__ */ new Map();
159
- this._dispatchersByBucket = /* @__PURE__ */ new Map();
160
- this.onmessage = (message) => {
161
- };
162
- this._waitOperations = /* @__PURE__ */ new Map();
163
- this._isLocal = !!isLocal;
164
- }
165
- sendEvent(dispatcher, event, params) {
166
- const validator = (0, import_validator.findValidator)(dispatcher._type, event, "Event");
167
- params = validator(params, "", this._validatorToWireContext());
168
- this.onmessage({ guid: dispatcher._guid, method: event, params });
169
- }
170
- sendCreate(parent, type, guid, initializer) {
171
- const validator = (0, import_validator.findValidator)(type, "", "Initializer");
172
- initializer = validator(initializer, "", this._validatorToWireContext());
173
- this.onmessage({ guid: parent._guid, method: "__create__", params: { type, initializer, guid } });
174
- }
175
- sendAdopt(parent, dispatcher) {
176
- this.onmessage({ guid: parent._guid, method: "__adopt__", params: { guid: dispatcher._guid } });
177
- }
178
- sendDispose(dispatcher, reason) {
179
- this.onmessage({ guid: dispatcher._guid, method: "__dispose__", params: { reason } });
180
- }
181
- _validatorToWireContext() {
182
- return {
183
- tChannelImpl: this._tChannelImplToWire.bind(this),
184
- binary: this._isLocal ? "buffer" : "toBase64",
185
- isUnderTest: import_debug.isUnderTest
186
- };
187
- }
188
- _validatorFromWireContext() {
189
- return {
190
- tChannelImpl: this._tChannelImplFromWire.bind(this),
191
- binary: this._isLocal ? "buffer" : "fromBase64",
192
- isUnderTest: import_debug.isUnderTest
193
- };
194
- }
195
- _tChannelImplFromWire(names, arg, path, context) {
196
- if (arg && typeof arg === "object" && typeof arg.guid === "string") {
197
- const guid = arg.guid;
198
- const dispatcher = this._dispatchers.get(guid);
199
- if (!dispatcher)
200
- throw new import_validator.ValidationError(`${path}: no object with guid ${guid}`);
201
- if (names !== "*" && !names.includes(dispatcher._type))
202
- throw new import_validator.ValidationError(`${path}: object with guid ${guid} has type ${dispatcher._type}, expected ${names.toString()}`);
203
- return dispatcher;
204
- }
205
- throw new import_validator.ValidationError(`${path}: expected guid for ${names.toString()}`);
206
- }
207
- _tChannelImplToWire(names, arg, path, context) {
208
- if (arg instanceof Dispatcher) {
209
- if (names !== "*" && !names.includes(arg._type))
210
- throw new import_validator.ValidationError(`${path}: dispatcher with guid ${arg._guid} has type ${arg._type}, expected ${names.toString()}`);
211
- return { guid: arg._guid };
212
- }
213
- throw new import_validator.ValidationError(`${path}: expected dispatcher ${names.toString()}`);
214
- }
215
- registerDispatcher(dispatcher) {
216
- (0, import_utils.assert)(!this._dispatchers.has(dispatcher._guid));
217
- this._dispatchers.set(dispatcher._guid, dispatcher);
218
- let list = this._dispatchersByBucket.get(dispatcher._gcBucket);
219
- if (!list) {
220
- list = /* @__PURE__ */ new Set();
221
- this._dispatchersByBucket.set(dispatcher._gcBucket, list);
222
- }
223
- list.add(dispatcher._guid);
224
- }
225
- maybeDisposeStaleDispatchers(gcBucket) {
226
- const maxDispatchers = maxDispatchersForBucket(gcBucket);
227
- const list = this._dispatchersByBucket.get(gcBucket);
228
- if (!list || list.size <= maxDispatchers)
229
- return;
230
- const dispatchersArray = [...list];
231
- const disposeCount = maxDispatchers / 10 | 0;
232
- this._dispatchersByBucket.set(gcBucket, new Set(dispatchersArray.slice(disposeCount)));
233
- for (let i = 0; i < disposeCount; ++i) {
234
- const d = this._dispatchers.get(dispatchersArray[i]);
235
- if (!d)
236
- continue;
237
- d._dispose("gc");
238
- }
239
- }
240
- async dispatch(message) {
241
- const { id, guid, method, params, metadata } = message;
242
- const dispatcher = this._dispatchers.get(guid);
243
- if (!dispatcher) {
244
- this.onmessage({ id, error: (0, import_errors.serializeError)(new import_errors.TargetClosedError()) });
245
- return;
246
- }
247
- let validParams;
248
- let validMetadata;
249
- try {
250
- const validator = (0, import_validator.findValidator)(dispatcher._type, method, "Params");
251
- const validatorContext = this._validatorFromWireContext();
252
- validParams = validator(params, "", validatorContext);
253
- validMetadata = metadataValidator(metadata, "", validatorContext);
254
- if (typeof dispatcher[method] !== "function")
255
- throw new Error(`Mismatching dispatcher: "${dispatcher._type}" does not implement "${method}"`);
256
- } catch (e) {
257
- this.onmessage({ id, error: (0, import_errors.serializeError)(e) });
258
- return;
259
- }
260
- const sdkObject = dispatcher._object instanceof import_instrumentation.SdkObject ? dispatcher._object : void 0;
261
- const callMetadata = {
262
- id: `call@${id}`,
263
- location: validMetadata.location,
264
- apiName: validMetadata.apiName,
265
- internal: validMetadata.internal,
266
- stepId: validMetadata.stepId,
267
- objectId: sdkObject?.guid,
268
- pageId: sdkObject?.attribution?.page?.guid,
269
- frameId: sdkObject?.attribution?.frame?.guid,
270
- startTime: (0, import_utils.monotonicTime)(),
271
- endTime: 0,
272
- type: dispatcher._type,
273
- method,
274
- params: params || {},
275
- log: []
276
- };
277
- if (sdkObject && params?.info?.waitId) {
278
- const info = params.info;
279
- switch (info.phase) {
280
- case "before": {
281
- this._waitOperations.set(info.waitId, callMetadata);
282
- await sdkObject.instrumentation.onBeforeCall(sdkObject, callMetadata);
283
- this.onmessage({ id });
284
- return;
285
- }
286
- case "log": {
287
- const originalMetadata = this._waitOperations.get(info.waitId);
288
- originalMetadata.log.push(info.message);
289
- sdkObject.instrumentation.onCallLog(sdkObject, originalMetadata, "api", info.message);
290
- this.onmessage({ id });
291
- return;
292
- }
293
- case "after": {
294
- const originalMetadata = this._waitOperations.get(info.waitId);
295
- originalMetadata.endTime = (0, import_utils.monotonicTime)();
296
- originalMetadata.error = info.error ? { error: { name: "Error", message: info.error } } : void 0;
297
- this._waitOperations.delete(info.waitId);
298
- await sdkObject.instrumentation.onAfterCall(sdkObject, originalMetadata);
299
- this.onmessage({ id });
300
- return;
301
- }
302
- }
303
- }
304
- await sdkObject?.instrumentation.onBeforeCall(sdkObject, callMetadata);
305
- const response = { id };
306
- try {
307
- const result = await dispatcher._handleCommand(callMetadata, method, validParams);
308
- const validator = (0, import_validator.findValidator)(dispatcher._type, method, "Result");
309
- response.result = validator(result, "", this._validatorToWireContext());
310
- callMetadata.result = result;
311
- } catch (e) {
312
- if ((0, import_errors.isTargetClosedError)(e) && sdkObject) {
313
- const reason = closeReason(sdkObject);
314
- if (reason)
315
- (0, import_utils.rewriteErrorMessage)(e, reason);
316
- } else if ((0, import_protocolError.isProtocolError)(e)) {
317
- if (e.type === "closed") {
318
- const reason = sdkObject ? closeReason(sdkObject) : void 0;
319
- e = new import_errors.TargetClosedError(reason, e.browserLogMessage());
320
- } else if (e.type === "crashed") {
321
- (0, import_utils.rewriteErrorMessage)(e, "Target crashed " + e.browserLogMessage());
322
- }
323
- }
324
- response.error = (0, import_errors.serializeError)(e);
325
- callMetadata.error = response.error;
326
- } finally {
327
- callMetadata.endTime = (0, import_utils.monotonicTime)();
328
- await sdkObject?.instrumentation.onAfterCall(sdkObject, callMetadata);
329
- }
330
- if (response.error)
331
- response.log = (0, import_callLog.compressCallLog)(callMetadata.log);
332
- this.onmessage(response);
333
- }
334
- }
335
- function closeReason(sdkObject) {
336
- return sdkObject.attribution.page?._closeReason || sdkObject.attribution.context?._closeReason || sdkObject.attribution.browser?._closeReason;
337
- }
338
- // Annotate the CommonJS export names for ESM import in node:
339
- 0 && (module.exports = {
340
- Dispatcher,
341
- DispatcherConnection,
342
- RootDispatcher,
343
- dispatcherSymbol,
344
- existingDispatcher,
345
- setMaxDispatchersForTest
346
- });
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var electronDispatcher_exports = {};
20
- __export(electronDispatcher_exports, {
21
- ElectronApplicationDispatcher: () => ElectronApplicationDispatcher,
22
- ElectronDispatcher: () => ElectronDispatcher
23
- });
24
- module.exports = __toCommonJS(electronDispatcher_exports);
25
- var import_browserContextDispatcher = require("./browserContextDispatcher");
26
- var import_dispatcher = require("./dispatcher");
27
- var import_elementHandlerDispatcher = require("./elementHandlerDispatcher");
28
- var import_jsHandleDispatcher = require("./jsHandleDispatcher");
29
- var import_electron = require("../electron/electron");
30
- class ElectronDispatcher extends import_dispatcher.Dispatcher {
31
- constructor(scope, electron) {
32
- super(scope, electron, "Electron", {});
33
- this._type_Electron = true;
34
- }
35
- async launch(params) {
36
- const electronApplication = await this._object.launch(params);
37
- return { electronApplication: new ElectronApplicationDispatcher(this, electronApplication) };
38
- }
39
- }
40
- class ElectronApplicationDispatcher extends import_dispatcher.Dispatcher {
41
- constructor(scope, electronApplication) {
42
- super(scope, electronApplication, "ElectronApplication", {
43
- context: new import_browserContextDispatcher.BrowserContextDispatcher(scope, electronApplication.context())
44
- });
45
- this._type_EventTarget = true;
46
- this._type_ElectronApplication = true;
47
- this._subscriptions = /* @__PURE__ */ new Set();
48
- this.addObjectListener(import_electron.ElectronApplication.Events.Close, () => {
49
- this._dispatchEvent("close");
50
- this._dispose();
51
- });
52
- this.addObjectListener(import_electron.ElectronApplication.Events.Console, (message) => {
53
- if (!this._subscriptions.has("console"))
54
- return;
55
- this._dispatchEvent("console", {
56
- type: message.type(),
57
- text: message.text(),
58
- args: message.args().map((a) => import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSHandle(this, a)),
59
- location: message.location()
60
- });
61
- });
62
- }
63
- async browserWindow(params) {
64
- const handle = await this._object.browserWindow(params.page.page());
65
- return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSHandle(this, handle) };
66
- }
67
- async evaluateExpression(params) {
68
- const handle = await this._object._nodeElectronHandlePromise;
69
- return { value: (0, import_jsHandleDispatcher.serializeResult)(await handle.evaluateExpression(params.expression, { isFunction: params.isFunction }, (0, import_jsHandleDispatcher.parseArgument)(params.arg))) };
70
- }
71
- async evaluateExpressionHandle(params) {
72
- const handle = await this._object._nodeElectronHandlePromise;
73
- const result = await handle.evaluateExpressionHandle(params.expression, { isFunction: params.isFunction }, (0, import_jsHandleDispatcher.parseArgument)(params.arg));
74
- return { handle: import_elementHandlerDispatcher.ElementHandleDispatcher.fromJSHandle(this, result) };
75
- }
76
- async updateSubscription(params) {
77
- if (params.enabled)
78
- this._subscriptions.add(params.event);
79
- else
80
- this._subscriptions.delete(params.event);
81
- }
82
- async close() {
83
- await this._object.close();
84
- }
85
- }
86
- // Annotate the CommonJS export names for ESM import in node:
87
- 0 && (module.exports = {
88
- ElectronApplicationDispatcher,
89
- ElectronDispatcher
90
- });
@@ -1,191 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var elementHandlerDispatcher_exports = {};
20
- __export(elementHandlerDispatcher_exports, {
21
- ElementHandleDispatcher: () => ElementHandleDispatcher
22
- });
23
- module.exports = __toCommonJS(elementHandlerDispatcher_exports);
24
- var import_browserContextDispatcher = require("./browserContextDispatcher");
25
- var import_dispatcher = require("./dispatcher");
26
- var import_frameDispatcher = require("./frameDispatcher");
27
- var import_jsHandleDispatcher = require("./jsHandleDispatcher");
28
- var import_pageDispatcher = require("./pageDispatcher");
29
- class ElementHandleDispatcher extends import_jsHandleDispatcher.JSHandleDispatcher {
30
- constructor(scope, elementHandle) {
31
- super(scope, elementHandle);
32
- this._type_ElementHandle = true;
33
- this._elementHandle = elementHandle;
34
- }
35
- static from(scope, handle) {
36
- return (0, import_dispatcher.existingDispatcher)(handle) || new ElementHandleDispatcher(scope, handle);
37
- }
38
- static fromNullable(scope, handle) {
39
- if (!handle)
40
- return void 0;
41
- return (0, import_dispatcher.existingDispatcher)(handle) || new ElementHandleDispatcher(scope, handle);
42
- }
43
- static fromJSHandle(scope, handle) {
44
- const result = (0, import_dispatcher.existingDispatcher)(handle);
45
- if (result)
46
- return result;
47
- return handle.asElement() ? new ElementHandleDispatcher(scope, handle.asElement()) : new import_jsHandleDispatcher.JSHandleDispatcher(scope, handle);
48
- }
49
- async ownerFrame(params, metadata) {
50
- const frame = await this._elementHandle.ownerFrame();
51
- return { frame: frame ? import_frameDispatcher.FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
52
- }
53
- async contentFrame(params, metadata) {
54
- const frame = await this._elementHandle.contentFrame();
55
- return { frame: frame ? import_frameDispatcher.FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
56
- }
57
- async generateLocatorString(params, metadata) {
58
- return { value: await this._elementHandle.generateLocatorString() };
59
- }
60
- async getAttribute(params, metadata) {
61
- const value = await this._elementHandle.getAttribute(metadata, params.name);
62
- return { value: value === null ? void 0 : value };
63
- }
64
- async inputValue(params, metadata) {
65
- const value = await this._elementHandle.inputValue(metadata);
66
- return { value };
67
- }
68
- async textContent(params, metadata) {
69
- const value = await this._elementHandle.textContent(metadata);
70
- return { value: value === null ? void 0 : value };
71
- }
72
- async innerText(params, metadata) {
73
- return { value: await this._elementHandle.innerText(metadata) };
74
- }
75
- async innerHTML(params, metadata) {
76
- return { value: await this._elementHandle.innerHTML(metadata) };
77
- }
78
- async isChecked(params, metadata) {
79
- return { value: await this._elementHandle.isChecked(metadata) };
80
- }
81
- async isDisabled(params, metadata) {
82
- return { value: await this._elementHandle.isDisabled(metadata) };
83
- }
84
- async isEditable(params, metadata) {
85
- return { value: await this._elementHandle.isEditable(metadata) };
86
- }
87
- async isEnabled(params, metadata) {
88
- return { value: await this._elementHandle.isEnabled(metadata) };
89
- }
90
- async isHidden(params, metadata) {
91
- return { value: await this._elementHandle.isHidden(metadata) };
92
- }
93
- async isVisible(params, metadata) {
94
- return { value: await this._elementHandle.isVisible(metadata) };
95
- }
96
- async dispatchEvent(params, metadata) {
97
- await this._elementHandle.dispatchEvent(metadata, params.type, (0, import_jsHandleDispatcher.parseArgument)(params.eventInit));
98
- }
99
- async scrollIntoViewIfNeeded(params, metadata) {
100
- await this._elementHandle.scrollIntoViewIfNeeded(metadata, params);
101
- }
102
- async hover(params, metadata) {
103
- return await this._elementHandle.hover(metadata, params);
104
- }
105
- async click(params, metadata) {
106
- return await this._elementHandle.click(metadata, params);
107
- }
108
- async dblclick(params, metadata) {
109
- return await this._elementHandle.dblclick(metadata, params);
110
- }
111
- async tap(params, metadata) {
112
- return await this._elementHandle.tap(metadata, params);
113
- }
114
- async selectOption(params, metadata) {
115
- const elements = (params.elements || []).map((e) => e._elementHandle);
116
- return { values: await this._elementHandle.selectOption(metadata, elements, params.options || [], params) };
117
- }
118
- async fill(params, metadata) {
119
- return await this._elementHandle.fill(metadata, params.value, params);
120
- }
121
- async selectText(params, metadata) {
122
- await this._elementHandle.selectText(metadata, params);
123
- }
124
- async setInputFiles(params, metadata) {
125
- return await this._elementHandle.setInputFiles(metadata, params);
126
- }
127
- async focus(params, metadata) {
128
- await this._elementHandle.focus(metadata);
129
- }
130
- async type(params, metadata) {
131
- return await this._elementHandle.type(metadata, params.text, params);
132
- }
133
- async press(params, metadata) {
134
- return await this._elementHandle.press(metadata, params.key, params);
135
- }
136
- async check(params, metadata) {
137
- return await this._elementHandle.check(metadata, params);
138
- }
139
- async uncheck(params, metadata) {
140
- return await this._elementHandle.uncheck(metadata, params);
141
- }
142
- async boundingBox(params, metadata) {
143
- const value = await this._elementHandle.boundingBox();
144
- return { value: value || void 0 };
145
- }
146
- async screenshot(params, metadata) {
147
- const mask = (params.mask || []).map(({ frame, selector }) => ({
148
- frame: frame._object,
149
- selector
150
- }));
151
- return { binary: await this._elementHandle.screenshot(metadata, { ...params, mask }) };
152
- }
153
- async querySelector(params, metadata) {
154
- const handle = await this._elementHandle.querySelector(params.selector, params);
155
- return { element: ElementHandleDispatcher.fromNullable(this.parentScope(), handle) };
156
- }
157
- async querySelectorAll(params, metadata) {
158
- const elements = await this._elementHandle.querySelectorAll(params.selector);
159
- return { elements: elements.map((e) => ElementHandleDispatcher.from(this.parentScope(), e)) };
160
- }
161
- async evalOnSelector(params, metadata) {
162
- return { value: (0, import_jsHandleDispatcher.serializeResult)(await this._elementHandle.evalOnSelector(params.selector, !!params.strict, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg))) };
163
- }
164
- async evalOnSelectorAll(params, metadata) {
165
- return { value: (0, import_jsHandleDispatcher.serializeResult)(await this._elementHandle.evalOnSelectorAll(params.selector, params.expression, params.isFunction, (0, import_jsHandleDispatcher.parseArgument)(params.arg))) };
166
- }
167
- async waitForElementState(params, metadata) {
168
- await this._elementHandle.waitForElementState(metadata, params.state, params);
169
- }
170
- async waitForSelector(params, metadata) {
171
- return { element: ElementHandleDispatcher.fromNullable(this.parentScope(), await this._elementHandle.waitForSelector(metadata, params.selector, params)) };
172
- }
173
- _browserContextDispatcher() {
174
- const scope = this.parentScope();
175
- if (scope instanceof import_browserContextDispatcher.BrowserContextDispatcher)
176
- return scope;
177
- if (scope instanceof import_pageDispatcher.PageDispatcher)
178
- return scope.parentScope();
179
- if (scope instanceof import_pageDispatcher.WorkerDispatcher || scope instanceof import_frameDispatcher.FrameDispatcher) {
180
- const parentScope = scope.parentScope();
181
- if (parentScope instanceof import_browserContextDispatcher.BrowserContextDispatcher)
182
- return parentScope;
183
- return parentScope.parentScope();
184
- }
185
- throw new Error("ElementHandle belongs to unexpected scope");
186
- }
187
- }
188
- // Annotate the CommonJS export names for ESM import in node:
189
- 0 && (module.exports = {
190
- ElementHandleDispatcher
191
- });