@stablyai/internal-playwright-core 0.1.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 (405) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +3 -0
  4. package/ThirdPartyNotices.txt +1134 -0
  5. package/bin/install_media_pack.ps1 +5 -0
  6. package/bin/install_webkit_wsl.ps1 +35 -0
  7. package/bin/reinstall_chrome_beta_linux.sh +42 -0
  8. package/bin/reinstall_chrome_beta_mac.sh +13 -0
  9. package/bin/reinstall_chrome_beta_win.ps1 +24 -0
  10. package/bin/reinstall_chrome_stable_linux.sh +42 -0
  11. package/bin/reinstall_chrome_stable_mac.sh +12 -0
  12. package/bin/reinstall_chrome_stable_win.ps1 +24 -0
  13. package/bin/reinstall_msedge_beta_linux.sh +48 -0
  14. package/bin/reinstall_msedge_beta_mac.sh +11 -0
  15. package/bin/reinstall_msedge_beta_win.ps1 +23 -0
  16. package/bin/reinstall_msedge_dev_linux.sh +48 -0
  17. package/bin/reinstall_msedge_dev_mac.sh +11 -0
  18. package/bin/reinstall_msedge_dev_win.ps1 +23 -0
  19. package/bin/reinstall_msedge_stable_linux.sh +48 -0
  20. package/bin/reinstall_msedge_stable_mac.sh +11 -0
  21. package/bin/reinstall_msedge_stable_win.ps1 +24 -0
  22. package/browsers.json +80 -0
  23. package/cli.js +18 -0
  24. package/index.d.ts +17 -0
  25. package/index.js +32 -0
  26. package/index.mjs +28 -0
  27. package/lib/androidServerImpl.js +65 -0
  28. package/lib/browserServerImpl.js +120 -0
  29. package/lib/cli/cli.js +58 -0
  30. package/lib/cli/driver.js +97 -0
  31. package/lib/cli/program.js +634 -0
  32. package/lib/cli/programWithTestStub.js +74 -0
  33. package/lib/client/accessibility.js +49 -0
  34. package/lib/client/android.js +361 -0
  35. package/lib/client/api.js +137 -0
  36. package/lib/client/artifact.js +79 -0
  37. package/lib/client/browser.js +163 -0
  38. package/lib/client/browserContext.js +529 -0
  39. package/lib/client/browserType.js +184 -0
  40. package/lib/client/cdpSession.js +51 -0
  41. package/lib/client/channelOwner.js +194 -0
  42. package/lib/client/clientHelper.js +64 -0
  43. package/lib/client/clientInstrumentation.js +55 -0
  44. package/lib/client/clientStackTrace.js +69 -0
  45. package/lib/client/clock.js +68 -0
  46. package/lib/client/connection.js +314 -0
  47. package/lib/client/consoleMessage.js +54 -0
  48. package/lib/client/coverage.js +44 -0
  49. package/lib/client/dialog.js +56 -0
  50. package/lib/client/download.js +62 -0
  51. package/lib/client/electron.js +138 -0
  52. package/lib/client/elementHandle.js +281 -0
  53. package/lib/client/errors.js +77 -0
  54. package/lib/client/eventEmitter.js +314 -0
  55. package/lib/client/events.js +99 -0
  56. package/lib/client/fetch.js +369 -0
  57. package/lib/client/fileChooser.js +46 -0
  58. package/lib/client/fileUtils.js +34 -0
  59. package/lib/client/frame.js +408 -0
  60. package/lib/client/harRouter.js +87 -0
  61. package/lib/client/input.js +84 -0
  62. package/lib/client/jsHandle.js +109 -0
  63. package/lib/client/jsonPipe.js +39 -0
  64. package/lib/client/localUtils.js +60 -0
  65. package/lib/client/locator.js +368 -0
  66. package/lib/client/network.js +747 -0
  67. package/lib/client/page.js +721 -0
  68. package/lib/client/platform.js +74 -0
  69. package/lib/client/playwright.js +71 -0
  70. package/lib/client/selectors.js +55 -0
  71. package/lib/client/stream.js +39 -0
  72. package/lib/client/timeoutSettings.js +79 -0
  73. package/lib/client/tracing.js +117 -0
  74. package/lib/client/types.js +28 -0
  75. package/lib/client/video.js +59 -0
  76. package/lib/client/waiter.js +142 -0
  77. package/lib/client/webError.js +39 -0
  78. package/lib/client/webSocket.js +93 -0
  79. package/lib/client/worker.js +63 -0
  80. package/lib/client/writableStream.js +39 -0
  81. package/lib/common/debugLogger.js +90 -0
  82. package/lib/common/socksProxy.js +569 -0
  83. package/lib/common/timeoutSettings.js +73 -0
  84. package/lib/common/types.js +5 -0
  85. package/lib/generated/bindingsControllerSource.js +28 -0
  86. package/lib/generated/clockSource.js +28 -0
  87. package/lib/generated/consoleApiSource.js +28 -0
  88. package/lib/generated/injectedScriptSource.js +28 -0
  89. package/lib/generated/pollingRecorderSource.js +28 -0
  90. package/lib/generated/recorderSource.js +28 -0
  91. package/lib/generated/storageScriptSource.js +28 -0
  92. package/lib/generated/utilityScriptSource.js +28 -0
  93. package/lib/generated/webSocketMockSource.js +336 -0
  94. package/lib/image_tools/colorUtils.js +98 -0
  95. package/lib/image_tools/compare.js +108 -0
  96. package/lib/image_tools/imageChannel.js +70 -0
  97. package/lib/image_tools/stats.js +102 -0
  98. package/lib/inProcessFactory.js +60 -0
  99. package/lib/index.js +19 -0
  100. package/lib/inprocess.js +3 -0
  101. package/lib/outofprocess.js +76 -0
  102. package/lib/protocol/debug.js +27 -0
  103. package/lib/protocol/serializers.js +192 -0
  104. package/lib/protocol/transport.js +82 -0
  105. package/lib/protocol/validator.js +2919 -0
  106. package/lib/protocol/validatorPrimitives.js +193 -0
  107. package/lib/remote/playwrightConnection.js +129 -0
  108. package/lib/remote/playwrightServer.js +335 -0
  109. package/lib/server/accessibility.js +69 -0
  110. package/lib/server/android/android.js +465 -0
  111. package/lib/server/android/backendAdb.js +177 -0
  112. package/lib/server/artifact.js +127 -0
  113. package/lib/server/bidi/bidiBrowser.js +490 -0
  114. package/lib/server/bidi/bidiChromium.js +153 -0
  115. package/lib/server/bidi/bidiConnection.js +212 -0
  116. package/lib/server/bidi/bidiExecutionContext.js +221 -0
  117. package/lib/server/bidi/bidiFirefox.js +130 -0
  118. package/lib/server/bidi/bidiInput.js +146 -0
  119. package/lib/server/bidi/bidiNetworkManager.js +383 -0
  120. package/lib/server/bidi/bidiOverCdp.js +102 -0
  121. package/lib/server/bidi/bidiPage.js +552 -0
  122. package/lib/server/bidi/bidiPdf.js +106 -0
  123. package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
  124. package/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
  125. package/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
  126. package/lib/server/bidi/third_party/bidiProtocol.js +24 -0
  127. package/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
  128. package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
  129. package/lib/server/bidi/third_party/bidiSerializer.js +148 -0
  130. package/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
  131. package/lib/server/browser.js +149 -0
  132. package/lib/server/browserContext.js +695 -0
  133. package/lib/server/browserType.js +328 -0
  134. package/lib/server/callLog.js +82 -0
  135. package/lib/server/chromium/appIcon.png +0 -0
  136. package/lib/server/chromium/chromium.js +402 -0
  137. package/lib/server/chromium/chromiumSwitches.js +95 -0
  138. package/lib/server/chromium/crAccessibility.js +263 -0
  139. package/lib/server/chromium/crBrowser.js +501 -0
  140. package/lib/server/chromium/crConnection.js +202 -0
  141. package/lib/server/chromium/crCoverage.js +235 -0
  142. package/lib/server/chromium/crDevTools.js +113 -0
  143. package/lib/server/chromium/crDragDrop.js +131 -0
  144. package/lib/server/chromium/crExecutionContext.js +146 -0
  145. package/lib/server/chromium/crInput.js +187 -0
  146. package/lib/server/chromium/crNetworkManager.js +666 -0
  147. package/lib/server/chromium/crPage.js +1069 -0
  148. package/lib/server/chromium/crPdf.js +121 -0
  149. package/lib/server/chromium/crProtocolHelper.js +145 -0
  150. package/lib/server/chromium/crServiceWorker.js +123 -0
  151. package/lib/server/chromium/defaultFontFamilies.js +162 -0
  152. package/lib/server/chromium/protocol.d.js +16 -0
  153. package/lib/server/chromium/videoRecorder.js +113 -0
  154. package/lib/server/clock.js +149 -0
  155. package/lib/server/codegen/csharp.js +327 -0
  156. package/lib/server/codegen/java.js +274 -0
  157. package/lib/server/codegen/javascript.js +270 -0
  158. package/lib/server/codegen/jsonl.js +52 -0
  159. package/lib/server/codegen/language.js +132 -0
  160. package/lib/server/codegen/languages.js +68 -0
  161. package/lib/server/codegen/python.js +279 -0
  162. package/lib/server/codegen/types.js +16 -0
  163. package/lib/server/console.js +53 -0
  164. package/lib/server/cookieStore.js +206 -0
  165. package/lib/server/debugController.js +191 -0
  166. package/lib/server/debugger.js +119 -0
  167. package/lib/server/deviceDescriptors.js +39 -0
  168. package/lib/server/deviceDescriptorsSource.json +1779 -0
  169. package/lib/server/dialog.js +116 -0
  170. package/lib/server/dispatchers/androidDispatcher.js +325 -0
  171. package/lib/server/dispatchers/artifactDispatcher.js +118 -0
  172. package/lib/server/dispatchers/browserContextDispatcher.js +364 -0
  173. package/lib/server/dispatchers/browserDispatcher.js +118 -0
  174. package/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
  175. package/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
  176. package/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
  177. package/lib/server/dispatchers/dialogDispatcher.js +47 -0
  178. package/lib/server/dispatchers/dispatcher.js +371 -0
  179. package/lib/server/dispatchers/electronDispatcher.js +89 -0
  180. package/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
  181. package/lib/server/dispatchers/frameDispatcher.js +227 -0
  182. package/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
  183. package/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
  184. package/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
  185. package/lib/server/dispatchers/networkDispatchers.js +213 -0
  186. package/lib/server/dispatchers/pageDispatcher.js +401 -0
  187. package/lib/server/dispatchers/playwrightDispatcher.js +108 -0
  188. package/lib/server/dispatchers/selectorsDispatcher.js +36 -0
  189. package/lib/server/dispatchers/streamDispatcher.js +67 -0
  190. package/lib/server/dispatchers/tracingDispatcher.js +68 -0
  191. package/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
  192. package/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
  193. package/lib/server/dom.js +806 -0
  194. package/lib/server/download.js +70 -0
  195. package/lib/server/electron/electron.js +270 -0
  196. package/lib/server/electron/loader.js +29 -0
  197. package/lib/server/errors.js +69 -0
  198. package/lib/server/fetch.js +621 -0
  199. package/lib/server/fileChooser.js +43 -0
  200. package/lib/server/fileUploadUtils.js +84 -0
  201. package/lib/server/firefox/ffAccessibility.js +238 -0
  202. package/lib/server/firefox/ffBrowser.js +428 -0
  203. package/lib/server/firefox/ffConnection.js +147 -0
  204. package/lib/server/firefox/ffExecutionContext.js +150 -0
  205. package/lib/server/firefox/ffInput.js +159 -0
  206. package/lib/server/firefox/ffNetworkManager.js +256 -0
  207. package/lib/server/firefox/ffPage.js +503 -0
  208. package/lib/server/firefox/firefox.js +116 -0
  209. package/lib/server/firefox/protocol.d.js +16 -0
  210. package/lib/server/formData.js +147 -0
  211. package/lib/server/frameSelectors.js +156 -0
  212. package/lib/server/frames.js +1502 -0
  213. package/lib/server/har/harRecorder.js +147 -0
  214. package/lib/server/har/harTracer.js +607 -0
  215. package/lib/server/harBackend.js +157 -0
  216. package/lib/server/helper.js +96 -0
  217. package/lib/server/index.js +58 -0
  218. package/lib/server/input.js +273 -0
  219. package/lib/server/instrumentation.js +69 -0
  220. package/lib/server/isomorphic/utilityScriptSerializers.js +212 -0
  221. package/lib/server/javascript.js +291 -0
  222. package/lib/server/launchApp.js +128 -0
  223. package/lib/server/localUtils.js +218 -0
  224. package/lib/server/macEditingCommands.js +143 -0
  225. package/lib/server/network.js +629 -0
  226. package/lib/server/page.js +871 -0
  227. package/lib/server/pipeTransport.js +89 -0
  228. package/lib/server/playwright.js +69 -0
  229. package/lib/server/progress.js +112 -0
  230. package/lib/server/protocolError.js +52 -0
  231. package/lib/server/recorder/chat.js +161 -0
  232. package/lib/server/recorder/codeGenerator.js +153 -0
  233. package/lib/server/recorder/csharp.js +310 -0
  234. package/lib/server/recorder/java.js +248 -0
  235. package/lib/server/recorder/javascript.js +229 -0
  236. package/lib/server/recorder/jsonl.js +47 -0
  237. package/lib/server/recorder/language.js +44 -0
  238. package/lib/server/recorder/python.js +276 -0
  239. package/lib/server/recorder/recorderActions.js +5 -0
  240. package/lib/server/recorder/recorderApp.js +387 -0
  241. package/lib/server/recorder/recorderRunner.js +138 -0
  242. package/lib/server/recorder/recorderSignalProcessor.js +83 -0
  243. package/lib/server/recorder/recorderUtils.js +157 -0
  244. package/lib/server/recorder/throttledFile.js +57 -0
  245. package/lib/server/recorder/utils.js +45 -0
  246. package/lib/server/recorder.js +499 -0
  247. package/lib/server/registry/browserFetcher.js +175 -0
  248. package/lib/server/registry/dependencies.js +371 -0
  249. package/lib/server/registry/index.js +1331 -0
  250. package/lib/server/registry/nativeDeps.js +1280 -0
  251. package/lib/server/registry/oopDownloadBrowserMain.js +120 -0
  252. package/lib/server/screenshotter.js +333 -0
  253. package/lib/server/selectors.js +112 -0
  254. package/lib/server/socksClientCertificatesInterceptor.js +383 -0
  255. package/lib/server/socksInterceptor.js +95 -0
  256. package/lib/server/stably/ai-tools/http-request.js +70 -0
  257. package/lib/server/stably/ai-tools/stablyApiCaller.js +137 -0
  258. package/lib/server/stably/autohealing/elementHandleFromCoordinates.js +64 -0
  259. package/lib/server/stably/autohealing/healingService.js +228 -0
  260. package/lib/server/stably/autohealing/screenshotFrame.js +41 -0
  261. package/lib/server/stably/constants.js +31 -0
  262. package/lib/server/trace/recorder/snapshotter.js +147 -0
  263. package/lib/server/trace/recorder/snapshotterInjected.js +541 -0
  264. package/lib/server/trace/recorder/tracing.js +602 -0
  265. package/lib/server/trace/test/inMemorySnapshotter.js +87 -0
  266. package/lib/server/trace/viewer/traceViewer.js +240 -0
  267. package/lib/server/transport.js +181 -0
  268. package/lib/server/types.js +28 -0
  269. package/lib/server/usKeyboardLayout.js +145 -0
  270. package/lib/server/utils/ascii.js +44 -0
  271. package/lib/server/utils/comparators.js +161 -0
  272. package/lib/server/utils/crypto.js +216 -0
  273. package/lib/server/utils/debug.js +42 -0
  274. package/lib/server/utils/debugLogger.js +122 -0
  275. package/lib/server/utils/env.js +73 -0
  276. package/lib/server/utils/eventsHelper.js +39 -0
  277. package/lib/server/utils/expectUtils.js +38 -0
  278. package/lib/server/utils/fileUtils.js +191 -0
  279. package/lib/server/utils/happyEyeballs.js +207 -0
  280. package/lib/server/utils/hostPlatform.js +111 -0
  281. package/lib/server/utils/httpServer.js +218 -0
  282. package/lib/server/utils/image_tools/colorUtils.js +89 -0
  283. package/lib/server/utils/image_tools/compare.js +109 -0
  284. package/lib/server/utils/image_tools/imageChannel.js +78 -0
  285. package/lib/server/utils/image_tools/stats.js +102 -0
  286. package/lib/server/utils/linuxUtils.js +71 -0
  287. package/lib/server/utils/network.js +233 -0
  288. package/lib/server/utils/nodePlatform.js +148 -0
  289. package/lib/server/utils/pipeTransport.js +84 -0
  290. package/lib/server/utils/processLauncher.js +241 -0
  291. package/lib/server/utils/profiler.js +65 -0
  292. package/lib/server/utils/socksProxy.js +511 -0
  293. package/lib/server/utils/spawnAsync.js +41 -0
  294. package/lib/server/utils/task.js +51 -0
  295. package/lib/server/utils/userAgent.js +98 -0
  296. package/lib/server/utils/wsServer.js +121 -0
  297. package/lib/server/utils/zipFile.js +74 -0
  298. package/lib/server/utils/zones.js +57 -0
  299. package/lib/server/webkit/protocol.d.js +16 -0
  300. package/lib/server/webkit/webkit.js +119 -0
  301. package/lib/server/webkit/wkAccessibility.js +237 -0
  302. package/lib/server/webkit/wkBrowser.js +339 -0
  303. package/lib/server/webkit/wkConnection.js +149 -0
  304. package/lib/server/webkit/wkExecutionContext.js +154 -0
  305. package/lib/server/webkit/wkInput.js +181 -0
  306. package/lib/server/webkit/wkInterceptableRequest.js +169 -0
  307. package/lib/server/webkit/wkPage.js +1134 -0
  308. package/lib/server/webkit/wkProvisionalPage.js +83 -0
  309. package/lib/server/webkit/wkWorkers.js +104 -0
  310. package/lib/server/webkit/wsl/webkit-wsl-transport-client.js +74 -0
  311. package/lib/server/webkit/wsl/webkit-wsl-transport-server.js +113 -0
  312. package/lib/third_party/diff_match_patch.js +2222 -0
  313. package/lib/third_party/pixelmatch.js +255 -0
  314. package/lib/utils/ascii.js +31 -0
  315. package/lib/utils/comparators.js +171 -0
  316. package/lib/utils/crypto.js +33 -0
  317. package/lib/utils/debug.js +46 -0
  318. package/lib/utils/debugLogger.js +89 -0
  319. package/lib/utils/env.js +49 -0
  320. package/lib/utils/eventsHelper.js +38 -0
  321. package/lib/utils/fileUtils.js +205 -0
  322. package/lib/utils/glob.js +83 -0
  323. package/lib/utils/happy-eyeballs.js +160 -0
  324. package/lib/utils/headers.js +52 -0
  325. package/lib/utils/hostPlatform.js +128 -0
  326. package/lib/utils/httpServer.js +236 -0
  327. package/lib/utils/index.js +346 -0
  328. package/lib/utils/isomorphic/ariaSnapshot.js +392 -0
  329. package/lib/utils/isomorphic/assert.js +31 -0
  330. package/lib/utils/isomorphic/colors.js +72 -0
  331. package/lib/utils/isomorphic/cssParser.js +245 -0
  332. package/lib/utils/isomorphic/cssTokenizer.js +1051 -0
  333. package/lib/utils/isomorphic/headers.js +53 -0
  334. package/lib/utils/isomorphic/locatorGenerators.js +673 -0
  335. package/lib/utils/isomorphic/locatorParser.js +176 -0
  336. package/lib/utils/isomorphic/locatorUtils.js +81 -0
  337. package/lib/utils/isomorphic/manualPromise.js +114 -0
  338. package/lib/utils/isomorphic/mimeType.js +459 -0
  339. package/lib/utils/isomorphic/multimap.js +80 -0
  340. package/lib/utils/isomorphic/protocolFormatter.js +78 -0
  341. package/lib/utils/isomorphic/protocolMetainfo.js +321 -0
  342. package/lib/utils/isomorphic/rtti.js +43 -0
  343. package/lib/utils/isomorphic/selectorParser.js +386 -0
  344. package/lib/utils/isomorphic/semaphore.js +54 -0
  345. package/lib/utils/isomorphic/stackTrace.js +158 -0
  346. package/lib/utils/isomorphic/stringUtils.js +155 -0
  347. package/lib/utils/isomorphic/time.js +49 -0
  348. package/lib/utils/isomorphic/timeoutRunner.js +66 -0
  349. package/lib/utils/isomorphic/traceUtils.js +58 -0
  350. package/lib/utils/isomorphic/types.js +16 -0
  351. package/lib/utils/isomorphic/urlMatch.js +176 -0
  352. package/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
  353. package/lib/utils/linuxUtils.js +78 -0
  354. package/lib/utils/manualPromise.js +109 -0
  355. package/lib/utils/mimeType.js +29 -0
  356. package/lib/utils/multimap.js +75 -0
  357. package/lib/utils/network.js +188 -0
  358. package/lib/utils/processLauncher.js +248 -0
  359. package/lib/utils/profiler.js +53 -0
  360. package/lib/utils/rtti.js +44 -0
  361. package/lib/utils/semaphore.js +51 -0
  362. package/lib/utils/spawnAsync.js +45 -0
  363. package/lib/utils/stackTrace.js +121 -0
  364. package/lib/utils/task.js +58 -0
  365. package/lib/utils/time.js +37 -0
  366. package/lib/utils/timeoutRunner.js +66 -0
  367. package/lib/utils/traceUtils.js +44 -0
  368. package/lib/utils/userAgent.js +105 -0
  369. package/lib/utils/wsServer.js +127 -0
  370. package/lib/utils/zipFile.js +75 -0
  371. package/lib/utils/zones.js +62 -0
  372. package/lib/utils.js +107 -0
  373. package/lib/utilsBundle.js +109 -0
  374. package/lib/utilsBundleImpl/index.js +218 -0
  375. package/lib/utilsBundleImpl/xdg-open +1066 -0
  376. package/lib/vite/htmlReport/index.html +84 -0
  377. package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
  378. package/lib/vite/recorder/assets/codeMirrorModule-RJCXzfmE.js +24 -0
  379. package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  380. package/lib/vite/recorder/assets/index-Ri0uHF7I.css +1 -0
  381. package/lib/vite/recorder/assets/index-Y-X2TGJv.js +193 -0
  382. package/lib/vite/recorder/index.html +29 -0
  383. package/lib/vite/recorder/playwright-logo.svg +9 -0
  384. package/lib/vite/traceViewer/assets/codeMirrorModule-Bhnc5o2x.js +24 -0
  385. package/lib/vite/traceViewer/assets/defaultSettingsView-ClwvkA2N.js +265 -0
  386. package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
  387. package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
  388. package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  389. package/lib/vite/traceViewer/defaultSettingsView.TQ8_7ybu.css +1 -0
  390. package/lib/vite/traceViewer/index.DFO9NNF5.js +2 -0
  391. package/lib/vite/traceViewer/index.I8N9v4jT.css +1 -0
  392. package/lib/vite/traceViewer/index.html +43 -0
  393. package/lib/vite/traceViewer/playwright-logo.svg +9 -0
  394. package/lib/vite/traceViewer/snapshot.html +21 -0
  395. package/lib/vite/traceViewer/sw.bundle.js +3 -0
  396. package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
  397. package/lib/vite/traceViewer/uiMode.Shu3QS-1.js +5 -0
  398. package/lib/vite/traceViewer/uiMode.html +17 -0
  399. package/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
  400. package/lib/zipBundle.js +34 -0
  401. package/lib/zipBundleImpl.js +5 -0
  402. package/package.json +43 -0
  403. package/types/protocol.d.ts +23130 -0
  404. package/types/structs.d.ts +45 -0
  405. package/types/types.d.ts +22857 -0
@@ -0,0 +1,408 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var frame_exports = {};
30
+ __export(frame_exports, {
31
+ Frame: () => Frame,
32
+ verifyLoadState: () => verifyLoadState
33
+ });
34
+ module.exports = __toCommonJS(frame_exports);
35
+ var import_eventEmitter = require("./eventEmitter");
36
+ var import_channelOwner = require("./channelOwner");
37
+ var import_clientHelper = require("./clientHelper");
38
+ var import_elementHandle = require("./elementHandle");
39
+ var import_events = require("./events");
40
+ var import_jsHandle = require("./jsHandle");
41
+ var import_locator = require("./locator");
42
+ var network = __toESM(require("./network"));
43
+ var import_types = require("./types");
44
+ var import_waiter = require("./waiter");
45
+ var import_assert = require("../utils/isomorphic/assert");
46
+ var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
47
+ var import_urlMatch = require("../utils/isomorphic/urlMatch");
48
+ var import_timeoutSettings = require("./timeoutSettings");
49
+ class Frame extends import_channelOwner.ChannelOwner {
50
+ constructor(parent, type, guid, initializer) {
51
+ super(parent, type, guid, initializer);
52
+ this._parentFrame = null;
53
+ this._url = "";
54
+ this._name = "";
55
+ this._detached = false;
56
+ this._childFrames = /* @__PURE__ */ new Set();
57
+ this._eventEmitter = new import_eventEmitter.EventEmitter(parent._platform);
58
+ this._eventEmitter.setMaxListeners(0);
59
+ this._parentFrame = Frame.fromNullable(initializer.parentFrame);
60
+ if (this._parentFrame)
61
+ this._parentFrame._childFrames.add(this);
62
+ this._name = initializer.name;
63
+ this._url = initializer.url;
64
+ this._loadStates = new Set(initializer.loadStates);
65
+ this._channel.on("loadstate", (event) => {
66
+ if (event.add) {
67
+ this._loadStates.add(event.add);
68
+ this._eventEmitter.emit("loadstate", event.add);
69
+ }
70
+ if (event.remove)
71
+ this._loadStates.delete(event.remove);
72
+ if (!this._parentFrame && event.add === "load" && this._page)
73
+ this._page.emit(import_events.Events.Page.Load, this._page);
74
+ if (!this._parentFrame && event.add === "domcontentloaded" && this._page)
75
+ this._page.emit(import_events.Events.Page.DOMContentLoaded, this._page);
76
+ });
77
+ this._channel.on("navigated", (event) => {
78
+ this._url = event.url;
79
+ this._name = event.name;
80
+ this._eventEmitter.emit("navigated", event);
81
+ if (!event.error && this._page)
82
+ this._page.emit(import_events.Events.Page.FrameNavigated, this);
83
+ });
84
+ }
85
+ static from(frame) {
86
+ return frame._object;
87
+ }
88
+ static fromNullable(frame) {
89
+ return frame ? Frame.from(frame) : null;
90
+ }
91
+ page() {
92
+ return this._page;
93
+ }
94
+ _timeout(options) {
95
+ const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
96
+ return timeoutSettings.timeout(options || {});
97
+ }
98
+ _navigationTimeout(options) {
99
+ const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
100
+ return timeoutSettings.navigationTimeout(options || {});
101
+ }
102
+ async goto(url, options = {}) {
103
+ const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
104
+ return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
105
+ }
106
+ _setupNavigationWaiter(options) {
107
+ const waiter = new import_waiter.Waiter(this._page, "");
108
+ if (this._page.isClosed())
109
+ waiter.rejectImmediately(this._page._closeErrorWithReason());
110
+ waiter.rejectOnEvent(this._page, import_events.Events.Page.Close, () => this._page._closeErrorWithReason());
111
+ waiter.rejectOnEvent(this._page, import_events.Events.Page.Crash, new Error("Navigation failed because page crashed!"));
112
+ waiter.rejectOnEvent(this._page, import_events.Events.Page.FrameDetached, new Error("Navigating frame was detached!"), (frame) => frame === this);
113
+ const timeout = this._page._timeoutSettings.navigationTimeout(options);
114
+ waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded.`);
115
+ return waiter;
116
+ }
117
+ async waitForNavigation(options = {}) {
118
+ return await this._page._wrapApiCall(async () => {
119
+ const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
120
+ const waiter = this._setupNavigationWaiter(options);
121
+ const toUrl = typeof options.url === "string" ? ` to "${options.url}"` : "";
122
+ waiter.log(`waiting for navigation${toUrl} until "${waitUntil}"`);
123
+ const navigatedEvent = await waiter.waitForEvent(this._eventEmitter, "navigated", (event) => {
124
+ if (event.error)
125
+ return true;
126
+ waiter.log(` navigated to "${event.url}"`);
127
+ return (0, import_urlMatch.urlMatches)(this._page?.context()._options.baseURL, event.url, options.url);
128
+ });
129
+ if (navigatedEvent.error) {
130
+ const e = new Error(navigatedEvent.error);
131
+ e.stack = "";
132
+ await waiter.waitForPromise(Promise.reject(e));
133
+ }
134
+ if (!this._loadStates.has(waitUntil)) {
135
+ await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
136
+ waiter.log(` "${s}" event fired`);
137
+ return s === waitUntil;
138
+ });
139
+ }
140
+ const request = navigatedEvent.newDocument ? network.Request.fromNullable(navigatedEvent.newDocument.request) : null;
141
+ const response = request ? await waiter.waitForPromise(request._finalRequest()._internalResponse()) : null;
142
+ waiter.dispose();
143
+ return response;
144
+ }, { title: "Wait for navigation" });
145
+ }
146
+ async waitForLoadState(state = "load", options = {}) {
147
+ state = verifyLoadState("state", state);
148
+ return await this._page._wrapApiCall(async () => {
149
+ const waiter = this._setupNavigationWaiter(options);
150
+ if (this._loadStates.has(state)) {
151
+ waiter.log(` not waiting, "${state}" event already fired`);
152
+ } else {
153
+ await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
154
+ waiter.log(` "${s}" event fired`);
155
+ return s === state;
156
+ });
157
+ }
158
+ waiter.dispose();
159
+ }, { title: `Wait for load state "${state}"` });
160
+ }
161
+ async waitForURL(url, options = {}) {
162
+ if ((0, import_urlMatch.urlMatches)(this._page?.context()._options.baseURL, this.url(), url))
163
+ return await this.waitForLoadState(options.waitUntil, options);
164
+ await this.waitForNavigation({ url, ...options });
165
+ }
166
+ async frameElement() {
167
+ return import_elementHandle.ElementHandle.from((await this._channel.frameElement()).element);
168
+ }
169
+ async evaluateHandle(pageFunction, arg) {
170
+ (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
171
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
172
+ return import_jsHandle.JSHandle.from(result.handle);
173
+ }
174
+ async evaluate(pageFunction, arg) {
175
+ (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
176
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
177
+ return (0, import_jsHandle.parseResult)(result.value);
178
+ }
179
+ async _evaluateFunction(functionDeclaration) {
180
+ const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: (0, import_jsHandle.serializeArgument)(void 0) });
181
+ return (0, import_jsHandle.parseResult)(result.value);
182
+ }
183
+ async _evaluateExposeUtilityScript(pageFunction, arg) {
184
+ (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
185
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
186
+ return (0, import_jsHandle.parseResult)(result.value);
187
+ }
188
+ async $(selector, options) {
189
+ const result = await this._channel.querySelector({ selector, ...options });
190
+ return import_elementHandle.ElementHandle.fromNullable(result.element);
191
+ }
192
+ async waitForSelector(selector, options = {}) {
193
+ if (options.visibility)
194
+ throw new Error("options.visibility is not supported, did you mean options.state?");
195
+ if (options.waitFor && options.waitFor !== "visible")
196
+ throw new Error("options.waitFor is not supported, did you mean options.state?");
197
+ const result = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) });
198
+ return import_elementHandle.ElementHandle.fromNullable(result.element);
199
+ }
200
+ async dispatchEvent(selector, type, eventInit, options = {}) {
201
+ await this._channel.dispatchEvent({ selector, type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit), ...options, timeout: this._timeout(options) });
202
+ }
203
+ async $eval(selector, pageFunction, arg) {
204
+ (0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
205
+ const result = await this._channel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
206
+ return (0, import_jsHandle.parseResult)(result.value);
207
+ }
208
+ async $$eval(selector, pageFunction, arg) {
209
+ (0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
210
+ const result = await this._channel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
211
+ return (0, import_jsHandle.parseResult)(result.value);
212
+ }
213
+ async $$(selector) {
214
+ const result = await this._channel.querySelectorAll({ selector });
215
+ return result.elements.map((e) => import_elementHandle.ElementHandle.from(e));
216
+ }
217
+ async _queryCount(selector, options) {
218
+ return (await this._channel.queryCount({ selector, ...options })).value;
219
+ }
220
+ async content() {
221
+ return (await this._channel.content()).value;
222
+ }
223
+ async setContent(html, options = {}) {
224
+ const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
225
+ await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) });
226
+ }
227
+ name() {
228
+ return this._name || "";
229
+ }
230
+ url() {
231
+ return this._url;
232
+ }
233
+ parentFrame() {
234
+ return this._parentFrame;
235
+ }
236
+ childFrames() {
237
+ return Array.from(this._childFrames);
238
+ }
239
+ isDetached() {
240
+ return this._detached;
241
+ }
242
+ async addScriptTag(options = {}) {
243
+ const copy = { ...options };
244
+ if (copy.path) {
245
+ copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
246
+ copy.content = (0, import_clientHelper.addSourceUrlToScript)(copy.content, copy.path);
247
+ }
248
+ return import_elementHandle.ElementHandle.from((await this._channel.addScriptTag({ ...copy })).element);
249
+ }
250
+ async addStyleTag(options = {}) {
251
+ const copy = { ...options };
252
+ if (copy.path) {
253
+ copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
254
+ copy.content += "/*# sourceURL=" + copy.path.replace(/\n/g, "") + "*/";
255
+ }
256
+ return import_elementHandle.ElementHandle.from((await this._channel.addStyleTag({ ...copy })).element);
257
+ }
258
+ async click(selector, options = {}) {
259
+ return await this._channel.click({ selector, ...options, timeout: this._timeout(options) });
260
+ }
261
+ async dblclick(selector, options = {}) {
262
+ return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) });
263
+ }
264
+ async dragAndDrop(source, target, options = {}) {
265
+ return await this._channel.dragAndDrop({ source, target, ...options, timeout: this._timeout(options) });
266
+ }
267
+ async tap(selector, options = {}) {
268
+ return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) });
269
+ }
270
+ async fill(selector, value, options = {}) {
271
+ return await this._channel.fill({ selector, value, ...options, timeout: this._timeout(options) });
272
+ }
273
+ async _highlight(selector) {
274
+ return await this._channel.highlight({ selector });
275
+ }
276
+ locator(selector, options) {
277
+ return new import_locator.Locator(this, selector, options);
278
+ }
279
+ getByTestId(testId) {
280
+ return this.locator((0, import_locatorUtils.getByTestIdSelector)((0, import_locator.testIdAttributeName)(), testId));
281
+ }
282
+ getByAltText(text, options) {
283
+ return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
284
+ }
285
+ getByLabel(text, options) {
286
+ return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
287
+ }
288
+ getByPlaceholder(text, options) {
289
+ return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
290
+ }
291
+ getByText(text, options) {
292
+ return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
293
+ }
294
+ getByTitle(text, options) {
295
+ return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
296
+ }
297
+ getByRole(role, options = {}) {
298
+ return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
299
+ }
300
+ frameLocator(selector) {
301
+ return new import_locator.FrameLocator(this, selector);
302
+ }
303
+ async focus(selector, options = {}) {
304
+ await this._channel.focus({ selector, ...options, timeout: this._timeout(options) });
305
+ }
306
+ async textContent(selector, options = {}) {
307
+ const value = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) })).value;
308
+ return value === void 0 ? null : value;
309
+ }
310
+ async innerText(selector, options = {}) {
311
+ return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) })).value;
312
+ }
313
+ async innerHTML(selector, options = {}) {
314
+ return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) })).value;
315
+ }
316
+ async getAttribute(selector, name, options = {}) {
317
+ const value = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) })).value;
318
+ return value === void 0 ? null : value;
319
+ }
320
+ async inputValue(selector, options = {}) {
321
+ return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) })).value;
322
+ }
323
+ async isChecked(selector, options = {}) {
324
+ return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) })).value;
325
+ }
326
+ async isDisabled(selector, options = {}) {
327
+ return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) })).value;
328
+ }
329
+ async isEditable(selector, options = {}) {
330
+ return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) })).value;
331
+ }
332
+ async isEnabled(selector, options = {}) {
333
+ return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) })).value;
334
+ }
335
+ async isHidden(selector, options = {}) {
336
+ return (await this._channel.isHidden({ selector, ...options })).value;
337
+ }
338
+ async isVisible(selector, options = {}) {
339
+ return (await this._channel.isVisible({ selector, ...options })).value;
340
+ }
341
+ async hover(selector, options = {}) {
342
+ await this._channel.hover({ selector, ...options, timeout: this._timeout(options) });
343
+ }
344
+ async selectOption(selector, values, options = {}) {
345
+ return (await this._channel.selectOption({ selector, ...(0, import_elementHandle.convertSelectOptionValues)(values), ...options, timeout: this._timeout(options) })).values;
346
+ }
347
+ async setInputFiles(selector, files, options = {}) {
348
+ const converted = await (0, import_elementHandle.convertInputFiles)(this._platform, files, this.page().context());
349
+ await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) });
350
+ }
351
+ async type(selector, text, options = {}) {
352
+ await this._channel.type({ selector, text, ...options, timeout: this._timeout(options) });
353
+ }
354
+ async press(selector, key, options = {}) {
355
+ await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) });
356
+ }
357
+ async check(selector, options = {}) {
358
+ await this._channel.check({ selector, ...options, timeout: this._timeout(options) });
359
+ }
360
+ async uncheck(selector, options = {}) {
361
+ await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) });
362
+ }
363
+ async setChecked(selector, checked, options) {
364
+ if (checked)
365
+ await this.check(selector, options);
366
+ else
367
+ await this.uncheck(selector, options);
368
+ }
369
+ async waitForTimeout(timeout) {
370
+ await this._channel.waitForTimeout({ waitTimeout: timeout });
371
+ }
372
+ async waitForFunction(pageFunction, arg, options = {}) {
373
+ if (typeof options.polling === "string")
374
+ (0, import_assert.assert)(options.polling === "raf", "Unknown polling option: " + options.polling);
375
+ const result = await this._channel.waitForFunction({
376
+ ...options,
377
+ pollingInterval: options.polling === "raf" ? void 0 : options.polling,
378
+ expression: String(pageFunction),
379
+ isFunction: typeof pageFunction === "function",
380
+ arg: (0, import_jsHandle.serializeArgument)(arg),
381
+ timeout: this._timeout(options)
382
+ });
383
+ return import_jsHandle.JSHandle.from(result.handle);
384
+ }
385
+ async title() {
386
+ return (await this._channel.title()).value;
387
+ }
388
+ async _expect(expression, options) {
389
+ const params = { expression, ...options, isNot: !!options.isNot };
390
+ params.expectedValue = (0, import_jsHandle.serializeArgument)(options.expectedValue);
391
+ const result = await this._channel.expect(params);
392
+ if (result.received !== void 0)
393
+ result.received = (0, import_jsHandle.parseResult)(result.received);
394
+ return result;
395
+ }
396
+ }
397
+ function verifyLoadState(name, waitUntil) {
398
+ if (waitUntil === "networkidle0")
399
+ waitUntil = "networkidle";
400
+ if (!import_types.kLifecycleEvents.has(waitUntil))
401
+ throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`);
402
+ return waitUntil;
403
+ }
404
+ // Annotate the CommonJS export names for ESM import in node:
405
+ 0 && (module.exports = {
406
+ Frame,
407
+ verifyLoadState
408
+ });
@@ -0,0 +1,87 @@
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 harRouter_exports = {};
20
+ __export(harRouter_exports, {
21
+ HarRouter: () => HarRouter
22
+ });
23
+ module.exports = __toCommonJS(harRouter_exports);
24
+ class HarRouter {
25
+ static async create(localUtils, file, notFoundAction, options) {
26
+ const { harId, error } = await localUtils.harOpen({ file });
27
+ if (error)
28
+ throw new Error(error);
29
+ return new HarRouter(localUtils, harId, notFoundAction, options);
30
+ }
31
+ constructor(localUtils, harId, notFoundAction, options) {
32
+ this._localUtils = localUtils;
33
+ this._harId = harId;
34
+ this._options = options;
35
+ this._notFoundAction = notFoundAction;
36
+ }
37
+ async _handle(route) {
38
+ const request = route.request();
39
+ const response = await this._localUtils.harLookup({
40
+ harId: this._harId,
41
+ url: request.url(),
42
+ method: request.method(),
43
+ headers: await request.headersArray(),
44
+ postData: request.postDataBuffer() || void 0,
45
+ isNavigationRequest: request.isNavigationRequest()
46
+ });
47
+ if (response.action === "redirect") {
48
+ route._platform.log("api", `HAR: ${route.request().url()} redirected to ${response.redirectURL}`);
49
+ await route._redirectNavigationRequest(response.redirectURL);
50
+ return;
51
+ }
52
+ if (response.action === "fulfill") {
53
+ if (response.status === -1)
54
+ return;
55
+ await route.fulfill({
56
+ status: response.status,
57
+ headers: Object.fromEntries(response.headers.map((h) => [h.name, h.value])),
58
+ body: response.body
59
+ });
60
+ return;
61
+ }
62
+ if (response.action === "error")
63
+ route._platform.log("api", "HAR: " + response.message);
64
+ if (this._notFoundAction === "abort") {
65
+ await route.abort();
66
+ return;
67
+ }
68
+ await route.fallback();
69
+ }
70
+ async addContextRoute(context) {
71
+ await context.route(this._options.urlMatch || "**/*", (route) => this._handle(route));
72
+ }
73
+ async addPageRoute(page) {
74
+ await page.route(this._options.urlMatch || "**/*", (route) => this._handle(route));
75
+ }
76
+ async [Symbol.asyncDispose]() {
77
+ await this.dispose();
78
+ }
79
+ dispose() {
80
+ this._localUtils.harClose({ harId: this._harId }).catch(() => {
81
+ });
82
+ }
83
+ }
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ HarRouter
87
+ });
@@ -0,0 +1,84 @@
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 input_exports = {};
20
+ __export(input_exports, {
21
+ Keyboard: () => Keyboard,
22
+ Mouse: () => Mouse,
23
+ Touchscreen: () => Touchscreen
24
+ });
25
+ module.exports = __toCommonJS(input_exports);
26
+ class Keyboard {
27
+ constructor(page) {
28
+ this._page = page;
29
+ }
30
+ async down(key) {
31
+ await this._page._channel.keyboardDown({ key });
32
+ }
33
+ async up(key) {
34
+ await this._page._channel.keyboardUp({ key });
35
+ }
36
+ async insertText(text) {
37
+ await this._page._channel.keyboardInsertText({ text });
38
+ }
39
+ async type(text, options = {}) {
40
+ await this._page._channel.keyboardType({ text, ...options });
41
+ }
42
+ async press(key, options = {}) {
43
+ await this._page._channel.keyboardPress({ key, ...options });
44
+ }
45
+ }
46
+ class Mouse {
47
+ constructor(page) {
48
+ this._page = page;
49
+ }
50
+ async move(x, y, options = {}) {
51
+ await this._page._channel.mouseMove({ x, y, ...options });
52
+ }
53
+ async down(options = {}) {
54
+ await this._page._channel.mouseDown({ ...options });
55
+ }
56
+ async up(options = {}) {
57
+ await this._page._channel.mouseUp(options);
58
+ }
59
+ async click(x, y, options = {}) {
60
+ await this._page._channel.mouseClick({ x, y, ...options });
61
+ }
62
+ async dblclick(x, y, options = {}) {
63
+ await this._page._wrapApiCall(async () => {
64
+ await this.click(x, y, { ...options, clickCount: 2 });
65
+ }, { title: "Double click" });
66
+ }
67
+ async wheel(deltaX, deltaY) {
68
+ await this._page._channel.mouseWheel({ deltaX, deltaY });
69
+ }
70
+ }
71
+ class Touchscreen {
72
+ constructor(page) {
73
+ this._page = page;
74
+ }
75
+ async tap(x, y) {
76
+ await this._page._channel.touchscreenTap({ x, y });
77
+ }
78
+ }
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ Keyboard,
82
+ Mouse,
83
+ Touchscreen
84
+ });
@@ -0,0 +1,109 @@
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 jsHandle_exports = {};
20
+ __export(jsHandle_exports, {
21
+ JSHandle: () => JSHandle,
22
+ assertMaxArguments: () => assertMaxArguments,
23
+ parseResult: () => parseResult,
24
+ serializeArgument: () => serializeArgument
25
+ });
26
+ module.exports = __toCommonJS(jsHandle_exports);
27
+ var import_channelOwner = require("./channelOwner");
28
+ var import_errors = require("./errors");
29
+ var import_serializers = require("../protocol/serializers");
30
+ class JSHandle extends import_channelOwner.ChannelOwner {
31
+ static from(handle) {
32
+ return handle._object;
33
+ }
34
+ constructor(parent, type, guid, initializer) {
35
+ super(parent, type, guid, initializer);
36
+ this._preview = this._initializer.preview;
37
+ this._channel.on("previewUpdated", ({ preview }) => this._preview = preview);
38
+ }
39
+ async evaluate(pageFunction, arg) {
40
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
41
+ return parseResult(result.value);
42
+ }
43
+ async _evaluateFunction(functionDeclaration) {
44
+ const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: serializeArgument(void 0) });
45
+ return parseResult(result.value);
46
+ }
47
+ async evaluateHandle(pageFunction, arg) {
48
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
49
+ return JSHandle.from(result.handle);
50
+ }
51
+ async getProperty(propertyName) {
52
+ const result = await this._channel.getProperty({ name: propertyName });
53
+ return JSHandle.from(result.handle);
54
+ }
55
+ async getProperties() {
56
+ const map = /* @__PURE__ */ new Map();
57
+ for (const { name, value } of (await this._channel.getPropertyList()).properties)
58
+ map.set(name, JSHandle.from(value));
59
+ return map;
60
+ }
61
+ async jsonValue() {
62
+ return parseResult((await this._channel.jsonValue()).value);
63
+ }
64
+ asElement() {
65
+ return null;
66
+ }
67
+ async [Symbol.asyncDispose]() {
68
+ await this.dispose();
69
+ }
70
+ async dispose() {
71
+ try {
72
+ await this._channel.dispose();
73
+ } catch (e) {
74
+ if ((0, import_errors.isTargetClosedError)(e))
75
+ return;
76
+ throw e;
77
+ }
78
+ }
79
+ toString() {
80
+ return this._preview;
81
+ }
82
+ }
83
+ function serializeArgument(arg) {
84
+ const handles = [];
85
+ const pushHandle = (channel) => {
86
+ handles.push(channel);
87
+ return handles.length - 1;
88
+ };
89
+ const value = (0, import_serializers.serializeValue)(arg, (value2) => {
90
+ if (value2 instanceof JSHandle)
91
+ return { h: pushHandle(value2._channel) };
92
+ return { fallThrough: value2 };
93
+ });
94
+ return { value, handles };
95
+ }
96
+ function parseResult(value) {
97
+ return (0, import_serializers.parseSerializedValue)(value, void 0);
98
+ }
99
+ function assertMaxArguments(count, max) {
100
+ if (count > max)
101
+ throw new Error("Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.");
102
+ }
103
+ // Annotate the CommonJS export names for ESM import in node:
104
+ 0 && (module.exports = {
105
+ JSHandle,
106
+ assertMaxArguments,
107
+ parseResult,
108
+ serializeArgument
109
+ });