rebrowser-playwright-core 1.49.1 → 1.64.1

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 (393) hide show
  1. package/ThirdPartyNotices.txt +7 -1228
  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 +7 -1
  8. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  9. package/bin/reinstall_msedge_dev_linux.sh +7 -1
  10. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  11. package/bin/reinstall_msedge_stable_linux.sh +7 -1
  12. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  13. package/browsers.json +21 -34
  14. package/cli.js +5 -1
  15. package/index.js +2 -18
  16. package/lib/bootstrap.js +149 -0
  17. package/lib/coreBundle.js +78218 -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/package.js +50 -0
  23. package/lib/server/electron/loader.js +109 -43
  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 +86076 -79
  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 +3 -56
  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 -11
  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 -8
  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 +9357 -6200
  98. package/types/structs.d.ts +8 -1
  99. package/types/types.d.ts +9490 -4947
  100. package/bin/PrintDeps.exe +0 -0
  101. package/bin/README.md +0 -2
  102. package/lib/androidServerImpl.js +0 -69
  103. package/lib/browserServerImpl.js +0 -92
  104. package/lib/cli/driver.js +0 -95
  105. package/lib/cli/program.js +0 -607
  106. package/lib/cli/programWithTestStub.js +0 -67
  107. package/lib/client/accessibility.js +0 -50
  108. package/lib/client/android.js +0 -473
  109. package/lib/client/api.js +0 -285
  110. package/lib/client/artifact.js +0 -79
  111. package/lib/client/browser.js +0 -145
  112. package/lib/client/browserContext.js +0 -559
  113. package/lib/client/browserType.js +0 -241
  114. package/lib/client/cdpSession.js +0 -53
  115. package/lib/client/channelOwner.js +0 -235
  116. package/lib/client/clientHelper.js +0 -57
  117. package/lib/client/clientInstrumentation.js +0 -50
  118. package/lib/client/clock.js +0 -68
  119. package/lib/client/connection.js +0 -333
  120. package/lib/client/consoleMessage.js +0 -55
  121. package/lib/client/coverage.js +0 -41
  122. package/lib/client/dialog.js +0 -57
  123. package/lib/client/download.js +0 -62
  124. package/lib/client/electron.js +0 -135
  125. package/lib/client/elementHandle.js +0 -321
  126. package/lib/client/errors.js +0 -77
  127. package/lib/client/eventEmitter.js +0 -314
  128. package/lib/client/events.js +0 -94
  129. package/lib/client/fetch.js +0 -391
  130. package/lib/client/fileChooser.js +0 -45
  131. package/lib/client/frame.js +0 -504
  132. package/lib/client/harRouter.js +0 -99
  133. package/lib/client/input.js +0 -111
  134. package/lib/client/jsHandle.js +0 -121
  135. package/lib/client/jsonPipe.js +0 -35
  136. package/lib/client/localUtils.js +0 -36
  137. package/lib/client/locator.js +0 -448
  138. package/lib/client/network.js +0 -767
  139. package/lib/client/page.js +0 -748
  140. package/lib/client/playwright.js +0 -80
  141. package/lib/client/selectors.js +0 -67
  142. package/lib/client/stream.js +0 -54
  143. package/lib/client/tracing.js +0 -147
  144. package/lib/client/types.js +0 -24
  145. package/lib/client/video.js +0 -51
  146. package/lib/client/waiter.js +0 -162
  147. package/lib/client/webError.js +0 -37
  148. package/lib/client/worker.js +0 -71
  149. package/lib/client/writableStream.js +0 -54
  150. package/lib/common/socksProxy.js +0 -569
  151. package/lib/common/timeoutSettings.js +0 -73
  152. package/lib/common/types.js +0 -5
  153. package/lib/generated/clockSource.js +0 -7
  154. package/lib/generated/consoleApiSource.js +0 -7
  155. package/lib/generated/injectedScriptSource.js +0 -7
  156. package/lib/generated/pollingRecorderSource.js +0 -7
  157. package/lib/generated/utilityScriptSource.js +0 -7
  158. package/lib/generated/webSocketMockSource.js +0 -7
  159. package/lib/image_tools/colorUtils.js +0 -98
  160. package/lib/image_tools/compare.js +0 -108
  161. package/lib/image_tools/imageChannel.js +0 -70
  162. package/lib/image_tools/stats.js +0 -102
  163. package/lib/inProcessFactory.js +0 -54
  164. package/lib/inprocess.js +0 -20
  165. package/lib/outofprocess.js +0 -67
  166. package/lib/protocol/debug.js +0 -27
  167. package/lib/protocol/serializers.js +0 -173
  168. package/lib/protocol/transport.js +0 -82
  169. package/lib/protocol/validator.js +0 -2780
  170. package/lib/protocol/validatorPrimitives.js +0 -139
  171. package/lib/remote/playwrightConnection.js +0 -274
  172. package/lib/remote/playwrightServer.js +0 -110
  173. package/lib/server/accessibility.js +0 -62
  174. package/lib/server/android/android.js +0 -441
  175. package/lib/server/android/backendAdb.js +0 -172
  176. package/lib/server/ariaSnapshot.js +0 -33
  177. package/lib/server/artifact.js +0 -104
  178. package/lib/server/bidi/bidiBrowser.js +0 -311
  179. package/lib/server/bidi/bidiChromium.js +0 -124
  180. package/lib/server/bidi/bidiConnection.js +0 -204
  181. package/lib/server/bidi/bidiExecutionContext.js +0 -156
  182. package/lib/server/bidi/bidiFirefox.js +0 -104
  183. package/lib/server/bidi/bidiInput.js +0 -158
  184. package/lib/server/bidi/bidiNetworkManager.js +0 -338
  185. package/lib/server/bidi/bidiOverCdp.js +0 -103
  186. package/lib/server/bidi/bidiPage.js +0 -529
  187. package/lib/server/bidi/bidiPdf.js +0 -140
  188. package/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
  189. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -238
  190. package/lib/server/bidi/third_party/bidiProtocol.js +0 -139
  191. package/lib/server/bidi/third_party/bidiSerializer.js +0 -144
  192. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -221
  193. package/lib/server/browser.js +0 -148
  194. package/lib/server/browserContext.js +0 -667
  195. package/lib/server/browserType.js +0 -338
  196. package/lib/server/chromium/chromium.js +0 -354
  197. package/lib/server/chromium/chromiumSwitches.js +0 -46
  198. package/lib/server/chromium/crAccessibility.js +0 -237
  199. package/lib/server/chromium/crBrowser.js +0 -516
  200. package/lib/server/chromium/crConnection.js +0 -381
  201. package/lib/server/chromium/crCoverage.js +0 -246
  202. package/lib/server/chromium/crDevTools.js +0 -108
  203. package/lib/server/chromium/crDragDrop.js +0 -143
  204. package/lib/server/chromium/crExecutionContext.js +0 -136
  205. package/lib/server/chromium/crInput.js +0 -171
  206. package/lib/server/chromium/crNetworkManager.js +0 -767
  207. package/lib/server/chromium/crPage.js +0 -1143
  208. package/lib/server/chromium/crPdf.js +0 -153
  209. package/lib/server/chromium/crProtocolHelper.js +0 -133
  210. package/lib/server/chromium/crServiceWorker.js +0 -114
  211. package/lib/server/chromium/defaultFontFamilies.js +0 -145
  212. package/lib/server/chromium/videoRecorder.js +0 -155
  213. package/lib/server/clock.js +0 -125
  214. package/lib/server/codegen/csharp.js +0 -294
  215. package/lib/server/codegen/java.js +0 -232
  216. package/lib/server/codegen/javascript.js +0 -245
  217. package/lib/server/codegen/jsonl.js +0 -47
  218. package/lib/server/codegen/language.js +0 -88
  219. package/lib/server/codegen/languages.js +0 -30
  220. package/lib/server/codegen/python.js +0 -261
  221. package/lib/server/codegen/types.js +0 -5
  222. package/lib/server/console.js +0 -57
  223. package/lib/server/cookieStore.js +0 -185
  224. package/lib/server/debugController.js +0 -237
  225. package/lib/server/debugger.js +0 -132
  226. package/lib/server/deviceDescriptors.js +0 -26
  227. package/lib/server/deviceDescriptorsSource.json +0 -1669
  228. package/lib/server/dialog.js +0 -71
  229. package/lib/server/dispatchers/androidDispatcher.js +0 -204
  230. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  231. package/lib/server/dispatchers/browserContextDispatcher.js +0 -368
  232. package/lib/server/dispatchers/browserDispatcher.js +0 -170
  233. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
  234. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
  235. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -103
  236. package/lib/server/dispatchers/dialogDispatcher.js +0 -44
  237. package/lib/server/dispatchers/dispatcher.js +0 -395
  238. package/lib/server/dispatchers/electronDispatcher.js +0 -93
  239. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
  240. package/lib/server/dispatchers/frameDispatcher.js +0 -293
  241. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -97
  242. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
  243. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
  244. package/lib/server/dispatchers/networkDispatchers.js +0 -221
  245. package/lib/server/dispatchers/pageDispatcher.js +0 -367
  246. package/lib/server/dispatchers/playwrightDispatcher.js +0 -107
  247. package/lib/server/dispatchers/selectorsDispatcher.js +0 -36
  248. package/lib/server/dispatchers/streamDispatcher.js +0 -62
  249. package/lib/server/dispatchers/tracingDispatcher.js +0 -64
  250. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -189
  251. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
  252. package/lib/server/dom.js +0 -888
  253. package/lib/server/download.js +0 -60
  254. package/lib/server/electron/electron.js +0 -296
  255. package/lib/server/errors.js +0 -68
  256. package/lib/server/fetch.js +0 -669
  257. package/lib/server/fileChooser.js +0 -42
  258. package/lib/server/fileUploadUtils.js +0 -75
  259. package/lib/server/firefox/ffAccessibility.js +0 -216
  260. package/lib/server/firefox/ffBrowser.js +0 -460
  261. package/lib/server/firefox/ffConnection.js +0 -168
  262. package/lib/server/firefox/ffExecutionContext.js +0 -123
  263. package/lib/server/firefox/ffInput.js +0 -150
  264. package/lib/server/firefox/ffNetworkManager.js +0 -233
  265. package/lib/server/firefox/ffPage.js +0 -559
  266. package/lib/server/firefox/firefox.js +0 -99
  267. package/lib/server/formData.js +0 -75
  268. package/lib/server/frameSelectors.js +0 -171
  269. package/lib/server/frames.js +0 -1691
  270. package/lib/server/har/harRecorder.js +0 -139
  271. package/lib/server/har/harTracer.js +0 -542
  272. package/lib/server/helper.js +0 -103
  273. package/lib/server/index.js +0 -108
  274. package/lib/server/input.js +0 -310
  275. package/lib/server/instrumentation.js +0 -70
  276. package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
  277. package/lib/server/javascript.js +0 -293
  278. package/lib/server/launchApp.js +0 -91
  279. package/lib/server/macEditingCommands.js +0 -139
  280. package/lib/server/network.js +0 -617
  281. package/lib/server/page.js +0 -873
  282. package/lib/server/pipeTransport.js +0 -85
  283. package/lib/server/playwright.js +0 -88
  284. package/lib/server/progress.js +0 -99
  285. package/lib/server/protocolError.js +0 -49
  286. package/lib/server/recorder/contextRecorder.js +0 -299
  287. package/lib/server/recorder/recorderApp.js +0 -187
  288. package/lib/server/recorder/recorderCollection.js +0 -116
  289. package/lib/server/recorder/recorderFrontend.js +0 -5
  290. package/lib/server/recorder/recorderInTraceViewer.js +0 -144
  291. package/lib/server/recorder/recorderRunner.js +0 -155
  292. package/lib/server/recorder/recorderUtils.js +0 -113
  293. package/lib/server/recorder/throttledFile.js +0 -46
  294. package/lib/server/recorder.js +0 -364
  295. package/lib/server/registry/browserFetcher.js +0 -168
  296. package/lib/server/registry/dependencies.js +0 -322
  297. package/lib/server/registry/index.js +0 -1052
  298. package/lib/server/registry/nativeDeps.js +0 -493
  299. package/lib/server/registry/oopDownloadBrowserMain.js +0 -138
  300. package/lib/server/screenshotter.js +0 -348
  301. package/lib/server/selectors.js +0 -73
  302. package/lib/server/socksClientCertificatesInterceptor.js +0 -340
  303. package/lib/server/socksInterceptor.js +0 -100
  304. package/lib/server/trace/recorder/snapshotter.js +0 -161
  305. package/lib/server/trace/recorder/snapshotterInjected.js +0 -511
  306. package/lib/server/trace/recorder/tracing.js +0 -596
  307. package/lib/server/trace/test/inMemorySnapshotter.js +0 -93
  308. package/lib/server/trace/viewer/traceViewer.js +0 -214
  309. package/lib/server/transport.js +0 -191
  310. package/lib/server/types.js +0 -24
  311. package/lib/server/usKeyboardLayout.js +0 -555
  312. package/lib/server/webkit/webkit.js +0 -87
  313. package/lib/server/webkit/wkAccessibility.js +0 -194
  314. package/lib/server/webkit/wkBrowser.js +0 -329
  315. package/lib/server/webkit/wkConnection.js +0 -173
  316. package/lib/server/webkit/wkExecutionContext.js +0 -130
  317. package/lib/server/webkit/wkInput.js +0 -169
  318. package/lib/server/webkit/wkInterceptableRequest.js +0 -162
  319. package/lib/server/webkit/wkPage.js +0 -1225
  320. package/lib/server/webkit/wkProvisionalPage.js +0 -94
  321. package/lib/server/webkit/wkWorkers.js +0 -104
  322. package/lib/third_party/pixelmatch.js +0 -255
  323. package/lib/utils/ascii.js +0 -31
  324. package/lib/utils/comparators.js +0 -153
  325. package/lib/utils/crypto.js +0 -171
  326. package/lib/utils/debug.js +0 -46
  327. package/lib/utils/debugLogger.js +0 -91
  328. package/lib/utils/env.js +0 -49
  329. package/lib/utils/eventsHelper.js +0 -38
  330. package/lib/utils/expectUtils.js +0 -33
  331. package/lib/utils/fileUtils.js +0 -205
  332. package/lib/utils/happy-eyeballs.js +0 -194
  333. package/lib/utils/headers.js +0 -52
  334. package/lib/utils/hostPlatform.js +0 -139
  335. package/lib/utils/httpServer.js +0 -237
  336. package/lib/utils/index.js +0 -368
  337. package/lib/utils/isomorphic/ariaSnapshot.js +0 -267
  338. package/lib/utils/isomorphic/cssParser.js +0 -250
  339. package/lib/utils/isomorphic/cssTokenizer.js +0 -979
  340. package/lib/utils/isomorphic/locatorGenerators.js +0 -660
  341. package/lib/utils/isomorphic/locatorParser.js +0 -179
  342. package/lib/utils/isomorphic/locatorUtils.js +0 -62
  343. package/lib/utils/isomorphic/mimeType.js +0 -29
  344. package/lib/utils/isomorphic/recorderUtils.js +0 -227
  345. package/lib/utils/isomorphic/selectorParser.js +0 -397
  346. package/lib/utils/isomorphic/stringUtils.js +0 -169
  347. package/lib/utils/isomorphic/traceUtils.js +0 -39
  348. package/lib/utils/isomorphic/urlMatch.js +0 -124
  349. package/lib/utils/linuxUtils.js +0 -78
  350. package/lib/utils/manualPromise.js +0 -109
  351. package/lib/utils/multimap.js +0 -75
  352. package/lib/utils/network.js +0 -160
  353. package/lib/utils/processLauncher.js +0 -248
  354. package/lib/utils/profiler.js +0 -53
  355. package/lib/utils/rtti.js +0 -44
  356. package/lib/utils/semaphore.js +0 -51
  357. package/lib/utils/sequence.js +0 -64
  358. package/lib/utils/spawnAsync.js +0 -45
  359. package/lib/utils/stackTrace.js +0 -134
  360. package/lib/utils/task.js +0 -58
  361. package/lib/utils/time.js +0 -37
  362. package/lib/utils/timeoutRunner.js +0 -66
  363. package/lib/utils/traceUtils.js +0 -44
  364. package/lib/utils/userAgent.js +0 -105
  365. package/lib/utils/wsServer.js +0 -127
  366. package/lib/utils/zipFile.js +0 -75
  367. package/lib/utils/zones.js +0 -71
  368. package/lib/utilsBundleImpl/index.js +0 -210
  369. package/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js +0 -24
  370. package/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
  371. package/lib/vite/recorder/assets/index-iA1aAGZg.css +0 -1
  372. package/lib/vite/recorder/assets/index-m0XdVJHe.js +0 -184
  373. package/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js +0 -24
  374. package/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js +0 -68
  375. package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
  376. package/lib/vite/traceViewer/assets/workbench-DFlGYqou.js +0 -9
  377. package/lib/vite/traceViewer/assets/xtermModule-BeNbaIVa.js +0 -9
  378. package/lib/vite/traceViewer/codeMirrorModule.ez37Vkbh.css +0 -1
  379. package/lib/vite/traceViewer/embedded.CmarehFk.js +0 -2
  380. package/lib/vite/traceViewer/embedded.html +0 -18
  381. package/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
  382. package/lib/vite/traceViewer/index.CrbWWHbf.css +0 -1
  383. package/lib/vite/traceViewer/index.FBucu_gE.js +0 -2
  384. package/lib/vite/traceViewer/inspectorTab.DEOUW62d.css +0 -1
  385. package/lib/vite/traceViewer/recorder.B_SY1GJM.css +0 -0
  386. package/lib/vite/traceViewer/recorder.CW_rzcEp.js +0 -2
  387. package/lib/vite/traceViewer/recorder.html +0 -17
  388. package/lib/vite/traceViewer/uiMode.CDUVjusr.js +0 -5
  389. package/lib/vite/traceViewer/uiMode.voC1ZiOQ.css +0 -1
  390. package/lib/vite/traceViewer/workbench.C-zR9ysA.css +0 -1
  391. package/lib/vite/traceViewer/xtermModule.DSXBckUd.css +0 -32
  392. package/lib/zipBundle.js +0 -25
  393. package/lib/zipBundleImpl.js +0 -5
@@ -1,1052 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Registry = void 0;
7
- exports.browserDirectoryToMarkerFilePath = browserDirectoryToMarkerFilePath;
8
- exports.buildPlaywrightCLICommand = buildPlaywrightCLICommand;
9
- exports.findChromiumChannel = findChromiumChannel;
10
- exports.installBrowsersForNpmInstall = installBrowsersForNpmInstall;
11
- exports.registryDirectory = exports.registry = void 0;
12
- Object.defineProperty(exports, "writeDockerVersion", {
13
- enumerable: true,
14
- get: function () {
15
- return _dependencies.writeDockerVersion;
16
- }
17
- });
18
- var os = _interopRequireWildcard(require("os"));
19
- var _path = _interopRequireDefault(require("path"));
20
- var util = _interopRequireWildcard(require("util"));
21
- var fs = _interopRequireWildcard(require("fs"));
22
- var _utilsBundle = require("../../utilsBundle");
23
- var _network = require("../../utils/network");
24
- var _userAgent = require("../../utils/userAgent");
25
- var _utils = require("../../utils");
26
- var _fileUtils = require("../../utils/fileUtils");
27
- var _hostPlatform = require("../../utils/hostPlatform");
28
- var _spawnAsync = require("../../utils/spawnAsync");
29
- var _dependencies = require("./dependencies");
30
- var _browserFetcher = require("./browserFetcher");
31
- var _debugLogger = require("../../utils/debugLogger");
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
34
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
35
- /**
36
- * Copyright 2017 Google Inc. All rights reserved.
37
- * Modifications copyright (c) Microsoft Corporation.
38
- *
39
- * Licensed under the Apache License, Version 2.0 (the "License");
40
- * you may not use this file except in compliance with the License.
41
- * You may obtain a copy of the License at
42
- *
43
- * http://www.apache.org/licenses/LICENSE-2.0
44
- *
45
- * Unless required by applicable law or agreed to in writing, software
46
- * distributed under the License is distributed on an "AS IS" BASIS,
47
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48
- * See the License for the specific language governing permissions and
49
- * limitations under the License.
50
- */
51
-
52
- const PACKAGE_PATH = _path.default.join(__dirname, '..', '..', '..');
53
- const BIN_PATH = _path.default.join(__dirname, '..', '..', '..', 'bin');
54
- const PLAYWRIGHT_CDN_MIRRORS = ['https://playwright.azureedge.net', 'https://playwright-akamai.azureedge.net', 'https://playwright-verizon.azureedge.net'];
55
- if (process.env.PW_TEST_CDN_THAT_SHOULD_WORK) {
56
- for (let i = 0; i < PLAYWRIGHT_CDN_MIRRORS.length; i++) {
57
- const cdn = PLAYWRIGHT_CDN_MIRRORS[i];
58
- if (cdn !== process.env.PW_TEST_CDN_THAT_SHOULD_WORK) PLAYWRIGHT_CDN_MIRRORS[i] = cdn + '.does-not-resolve.playwright.dev';
59
- }
60
- }
61
- const EXECUTABLE_PATHS = {
62
- 'chromium': {
63
- 'linux': ['chrome-linux', 'chrome'],
64
- 'mac': ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium'],
65
- 'win': ['chrome-win', 'chrome.exe']
66
- },
67
- 'chromium-headless-shell': {
68
- 'linux': ['chrome-linux', 'headless_shell'],
69
- 'mac': ['chrome-mac', 'headless_shell'],
70
- 'win': ['chrome-win', 'headless_shell.exe']
71
- },
72
- 'firefox': {
73
- 'linux': ['firefox', 'firefox'],
74
- 'mac': ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox'],
75
- 'win': ['firefox', 'firefox.exe']
76
- },
77
- 'webkit': {
78
- 'linux': ['pw_run.sh'],
79
- 'mac': ['pw_run.sh'],
80
- 'win': ['Playwright.exe']
81
- },
82
- 'ffmpeg': {
83
- 'linux': ['ffmpeg-linux'],
84
- 'mac': ['ffmpeg-mac'],
85
- 'win': ['ffmpeg-win64.exe']
86
- }
87
- };
88
- const DOWNLOAD_PATHS = {
89
- 'chromium': {
90
- '<unknown>': undefined,
91
- 'ubuntu18.04-x64': undefined,
92
- 'ubuntu20.04-x64': 'builds/chromium/%s/chromium-linux.zip',
93
- 'ubuntu22.04-x64': 'builds/chromium/%s/chromium-linux.zip',
94
- 'ubuntu24.04-x64': 'builds/chromium/%s/chromium-linux.zip',
95
- 'ubuntu18.04-arm64': undefined,
96
- 'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
97
- 'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
98
- 'ubuntu24.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
99
- 'debian11-x64': 'builds/chromium/%s/chromium-linux.zip',
100
- 'debian11-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
101
- 'debian12-x64': 'builds/chromium/%s/chromium-linux.zip',
102
- 'debian12-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
103
- 'mac10.13': 'builds/chromium/%s/chromium-mac.zip',
104
- 'mac10.14': 'builds/chromium/%s/chromium-mac.zip',
105
- 'mac10.15': 'builds/chromium/%s/chromium-mac.zip',
106
- 'mac11': 'builds/chromium/%s/chromium-mac.zip',
107
- 'mac11-arm64': 'builds/chromium/%s/chromium-mac-arm64.zip',
108
- 'mac12': 'builds/chromium/%s/chromium-mac.zip',
109
- 'mac12-arm64': 'builds/chromium/%s/chromium-mac-arm64.zip',
110
- 'mac13': 'builds/chromium/%s/chromium-mac.zip',
111
- 'mac13-arm64': 'builds/chromium/%s/chromium-mac-arm64.zip',
112
- 'mac14': 'builds/chromium/%s/chromium-mac.zip',
113
- 'mac14-arm64': 'builds/chromium/%s/chromium-mac-arm64.zip',
114
- 'mac15': 'builds/chromium/%s/chromium-mac.zip',
115
- 'mac15-arm64': 'builds/chromium/%s/chromium-mac-arm64.zip',
116
- 'win64': 'builds/chromium/%s/chromium-win64.zip'
117
- },
118
- 'chromium-headless-shell': {
119
- '<unknown>': undefined,
120
- 'ubuntu18.04-x64': undefined,
121
- 'ubuntu20.04-x64': 'builds/chromium/%s/chromium-headless-shell-linux.zip',
122
- 'ubuntu22.04-x64': 'builds/chromium/%s/chromium-headless-shell-linux.zip',
123
- 'ubuntu24.04-x64': 'builds/chromium/%s/chromium-headless-shell-linux.zip',
124
- 'ubuntu18.04-arm64': undefined,
125
- 'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-headless-shell-linux-arm64.zip',
126
- 'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-headless-shell-linux-arm64.zip',
127
- 'ubuntu24.04-arm64': 'builds/chromium/%s/chromium-headless-shell-linux-arm64.zip',
128
- 'debian11-x64': 'builds/chromium/%s/chromium-headless-shell-linux.zip',
129
- 'debian11-arm64': 'builds/chromium/%s/chromium-headless-shell-linux-arm64.zip',
130
- 'debian12-x64': 'builds/chromium/%s/chromium-headless-shell-linux.zip',
131
- 'debian12-arm64': 'builds/chromium/%s/chromium-headless-shell-linux-arm64.zip',
132
- 'mac10.13': undefined,
133
- 'mac10.14': undefined,
134
- 'mac10.15': undefined,
135
- 'mac11': 'builds/chromium/%s/chromium-headless-shell-mac.zip',
136
- 'mac11-arm64': 'builds/chromium/%s/chromium-headless-shell-mac-arm64.zip',
137
- 'mac12': 'builds/chromium/%s/chromium-headless-shell-mac.zip',
138
- 'mac12-arm64': 'builds/chromium/%s/chromium-headless-shell-mac-arm64.zip',
139
- 'mac13': 'builds/chromium/%s/chromium-headless-shell-mac.zip',
140
- 'mac13-arm64': 'builds/chromium/%s/chromium-headless-shell-mac-arm64.zip',
141
- 'mac14': 'builds/chromium/%s/chromium-headless-shell-mac.zip',
142
- 'mac14-arm64': 'builds/chromium/%s/chromium-headless-shell-mac-arm64.zip',
143
- 'mac15': 'builds/chromium/%s/chromium-headless-shell-mac.zip',
144
- 'mac15-arm64': 'builds/chromium/%s/chromium-headless-shell-mac-arm64.zip',
145
- 'win64': 'builds/chromium/%s/chromium-headless-shell-win64.zip'
146
- },
147
- 'chromium-tip-of-tree': {
148
- '<unknown>': undefined,
149
- 'ubuntu18.04-x64': undefined,
150
- 'ubuntu20.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
151
- 'ubuntu22.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
152
- 'ubuntu24.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
153
- 'ubuntu18.04-arm64': undefined,
154
- 'ubuntu20.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
155
- 'ubuntu22.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
156
- 'ubuntu24.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
157
- 'debian11-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
158
- 'debian11-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
159
- 'debian12-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
160
- 'debian12-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
161
- 'mac10.13': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
162
- 'mac10.14': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
163
- 'mac10.15': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
164
- 'mac11': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
165
- 'mac11-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac-arm64.zip',
166
- 'mac12': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
167
- 'mac12-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac-arm64.zip',
168
- 'mac13': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
169
- 'mac13-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac-arm64.zip',
170
- 'mac14': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
171
- 'mac14-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac-arm64.zip',
172
- 'mac15': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip',
173
- 'mac15-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac-arm64.zip',
174
- 'win64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-win64.zip'
175
- },
176
- 'firefox': {
177
- '<unknown>': undefined,
178
- 'ubuntu18.04-x64': undefined,
179
- 'ubuntu20.04-x64': 'builds/firefox/%s/firefox-ubuntu-20.04.zip',
180
- 'ubuntu22.04-x64': 'builds/firefox/%s/firefox-ubuntu-22.04.zip',
181
- 'ubuntu24.04-x64': 'builds/firefox/%s/firefox-ubuntu-24.04.zip',
182
- 'ubuntu18.04-arm64': undefined,
183
- 'ubuntu20.04-arm64': 'builds/firefox/%s/firefox-ubuntu-20.04-arm64.zip',
184
- 'ubuntu22.04-arm64': 'builds/firefox/%s/firefox-ubuntu-22.04-arm64.zip',
185
- 'ubuntu24.04-arm64': 'builds/firefox/%s/firefox-ubuntu-24.04-arm64.zip',
186
- 'debian11-x64': 'builds/firefox/%s/firefox-debian-11.zip',
187
- 'debian11-arm64': 'builds/firefox/%s/firefox-debian-11-arm64.zip',
188
- 'debian12-x64': 'builds/firefox/%s/firefox-debian-12.zip',
189
- 'debian12-arm64': 'builds/firefox/%s/firefox-debian-12-arm64.zip',
190
- 'mac10.13': 'builds/firefox/%s/firefox-mac.zip',
191
- 'mac10.14': 'builds/firefox/%s/firefox-mac.zip',
192
- 'mac10.15': 'builds/firefox/%s/firefox-mac.zip',
193
- 'mac11': 'builds/firefox/%s/firefox-mac.zip',
194
- 'mac11-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
195
- 'mac12': 'builds/firefox/%s/firefox-mac.zip',
196
- 'mac12-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
197
- 'mac13': 'builds/firefox/%s/firefox-mac.zip',
198
- 'mac13-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
199
- 'mac14': 'builds/firefox/%s/firefox-mac.zip',
200
- 'mac14-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
201
- 'mac15': 'builds/firefox/%s/firefox-mac.zip',
202
- 'mac15-arm64': 'builds/firefox/%s/firefox-mac-arm64.zip',
203
- 'win64': 'builds/firefox/%s/firefox-win64.zip'
204
- },
205
- 'firefox-beta': {
206
- '<unknown>': undefined,
207
- 'ubuntu18.04-x64': undefined,
208
- 'ubuntu20.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip',
209
- 'ubuntu22.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip',
210
- 'ubuntu24.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-24.04.zip',
211
- 'ubuntu18.04-arm64': undefined,
212
- 'ubuntu20.04-arm64': undefined,
213
- 'ubuntu22.04-arm64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-22.04-arm64.zip',
214
- 'ubuntu24.04-arm64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-24.04-arm64.zip',
215
- 'debian11-x64': 'builds/firefox-beta/%s/firefox-beta-debian-11.zip',
216
- 'debian11-arm64': 'builds/firefox-beta/%s/firefox-beta-debian-11-arm64.zip',
217
- 'debian12-x64': 'builds/firefox-beta/%s/firefox-beta-debian-12.zip',
218
- 'debian12-arm64': 'builds/firefox-beta/%s/firefox-beta-debian-12-arm64.zip',
219
- 'mac10.13': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
220
- 'mac10.14': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
221
- 'mac10.15': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
222
- 'mac11': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
223
- 'mac11-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
224
- 'mac12': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
225
- 'mac12-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
226
- 'mac13': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
227
- 'mac13-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
228
- 'mac14': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
229
- 'mac14-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
230
- 'mac15': 'builds/firefox-beta/%s/firefox-beta-mac.zip',
231
- 'mac15-arm64': 'builds/firefox-beta/%s/firefox-beta-mac-arm64.zip',
232
- 'win64': 'builds/firefox-beta/%s/firefox-beta-win64.zip'
233
- },
234
- 'webkit': {
235
- '<unknown>': undefined,
236
- 'ubuntu18.04-x64': undefined,
237
- 'ubuntu20.04-x64': 'builds/webkit/%s/webkit-ubuntu-20.04.zip',
238
- 'ubuntu22.04-x64': 'builds/webkit/%s/webkit-ubuntu-22.04.zip',
239
- 'ubuntu24.04-x64': 'builds/webkit/%s/webkit-ubuntu-24.04.zip',
240
- 'ubuntu18.04-arm64': undefined,
241
- 'ubuntu20.04-arm64': 'builds/webkit/%s/webkit-ubuntu-20.04-arm64.zip',
242
- 'ubuntu22.04-arm64': 'builds/webkit/%s/webkit-ubuntu-22.04-arm64.zip',
243
- 'ubuntu24.04-arm64': 'builds/webkit/%s/webkit-ubuntu-24.04-arm64.zip',
244
- 'debian11-x64': 'builds/webkit/%s/webkit-debian-11.zip',
245
- 'debian11-arm64': 'builds/webkit/%s/webkit-debian-11-arm64.zip',
246
- 'debian12-x64': 'builds/webkit/%s/webkit-debian-12.zip',
247
- 'debian12-arm64': 'builds/webkit/%s/webkit-debian-12-arm64.zip',
248
- 'mac10.13': undefined,
249
- 'mac10.14': 'builds/deprecated-webkit-mac-10.14/%s/deprecated-webkit-mac-10.14.zip',
250
- 'mac10.15': 'builds/deprecated-webkit-mac-10.15/%s/deprecated-webkit-mac-10.15.zip',
251
- 'mac11': 'builds/webkit/%s/webkit-mac-11.zip',
252
- 'mac11-arm64': 'builds/webkit/%s/webkit-mac-11-arm64.zip',
253
- 'mac12': 'builds/webkit/%s/webkit-mac-12.zip',
254
- 'mac12-arm64': 'builds/webkit/%s/webkit-mac-12-arm64.zip',
255
- 'mac13': 'builds/webkit/%s/webkit-mac-13.zip',
256
- 'mac13-arm64': 'builds/webkit/%s/webkit-mac-13-arm64.zip',
257
- 'mac14': 'builds/webkit/%s/webkit-mac-14.zip',
258
- 'mac14-arm64': 'builds/webkit/%s/webkit-mac-14-arm64.zip',
259
- 'mac15': 'builds/webkit/%s/webkit-mac-15.zip',
260
- 'mac15-arm64': 'builds/webkit/%s/webkit-mac-15-arm64.zip',
261
- 'win64': 'builds/webkit/%s/webkit-win64.zip'
262
- },
263
- 'ffmpeg': {
264
- '<unknown>': undefined,
265
- 'ubuntu18.04-x64': undefined,
266
- 'ubuntu20.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
267
- 'ubuntu22.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
268
- 'ubuntu24.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
269
- 'ubuntu18.04-arm64': undefined,
270
- 'ubuntu20.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
271
- 'ubuntu22.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
272
- 'ubuntu24.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
273
- 'debian11-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
274
- 'debian11-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
275
- 'debian12-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
276
- 'debian12-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
277
- 'mac10.13': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
278
- 'mac10.14': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
279
- 'mac10.15': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
280
- 'mac11': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
281
- 'mac11-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
282
- 'mac12': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
283
- 'mac12-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
284
- 'mac13': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
285
- 'mac13-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
286
- 'mac14': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
287
- 'mac14-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
288
- 'mac15': 'builds/ffmpeg/%s/ffmpeg-mac.zip',
289
- 'mac15-arm64': 'builds/ffmpeg/%s/ffmpeg-mac-arm64.zip',
290
- 'win64': 'builds/ffmpeg/%s/ffmpeg-win64.zip'
291
- },
292
- 'android': {
293
- '<unknown>': 'builds/android/%s/android.zip',
294
- 'ubuntu18.04-x64': undefined,
295
- 'ubuntu20.04-x64': 'builds/android/%s/android.zip',
296
- 'ubuntu22.04-x64': 'builds/android/%s/android.zip',
297
- 'ubuntu24.04-x64': 'builds/android/%s/android.zip',
298
- 'ubuntu18.04-arm64': undefined,
299
- 'ubuntu20.04-arm64': 'builds/android/%s/android.zip',
300
- 'ubuntu22.04-arm64': 'builds/android/%s/android.zip',
301
- 'ubuntu24.04-arm64': 'builds/android/%s/android.zip',
302
- 'debian11-x64': 'builds/android/%s/android.zip',
303
- 'debian11-arm64': 'builds/android/%s/android.zip',
304
- 'debian12-x64': 'builds/android/%s/android.zip',
305
- 'debian12-arm64': 'builds/android/%s/android.zip',
306
- 'mac10.13': 'builds/android/%s/android.zip',
307
- 'mac10.14': 'builds/android/%s/android.zip',
308
- 'mac10.15': 'builds/android/%s/android.zip',
309
- 'mac11': 'builds/android/%s/android.zip',
310
- 'mac11-arm64': 'builds/android/%s/android.zip',
311
- 'mac12': 'builds/android/%s/android.zip',
312
- 'mac12-arm64': 'builds/android/%s/android.zip',
313
- 'mac13': 'builds/android/%s/android.zip',
314
- 'mac13-arm64': 'builds/android/%s/android.zip',
315
- 'mac14': 'builds/android/%s/android.zip',
316
- 'mac14-arm64': 'builds/android/%s/android.zip',
317
- 'mac15': 'builds/android/%s/android.zip',
318
- 'mac15-arm64': 'builds/android/%s/android.zip',
319
- 'win64': 'builds/android/%s/android.zip'
320
- },
321
- // TODO(bidi): implement downloads.
322
- 'bidi': {}
323
- };
324
- const registryDirectory = exports.registryDirectory = (() => {
325
- let result;
326
- const envDefined = (0, _utils.getFromENV)('PLAYWRIGHT_BROWSERS_PATH');
327
- if (envDefined === '0') {
328
- result = _path.default.join(__dirname, '..', '..', '..', '.local-browsers');
329
- } else if (envDefined) {
330
- result = envDefined;
331
- } else {
332
- let cacheDirectory;
333
- if (process.platform === 'linux') cacheDirectory = process.env.XDG_CACHE_HOME || _path.default.join(os.homedir(), '.cache');else if (process.platform === 'darwin') cacheDirectory = _path.default.join(os.homedir(), 'Library', 'Caches');else if (process.platform === 'win32') cacheDirectory = process.env.LOCALAPPDATA || _path.default.join(os.homedir(), 'AppData', 'Local');else throw new Error('Unsupported platform: ' + process.platform);
334
- result = _path.default.join(cacheDirectory, 'ms-playwright');
335
- }
336
- if (!_path.default.isAbsolute(result)) {
337
- // It is important to resolve to the absolute path:
338
- // - for unzipping to work correctly;
339
- // - so that registry directory matches between installation and execution.
340
- // INIT_CWD points to the root of `npm/yarn install` and is probably what
341
- // the user meant when typing the relative path.
342
- result = _path.default.resolve((0, _utils.getFromENV)('INIT_CWD') || process.cwd(), result);
343
- }
344
- return result;
345
- })();
346
- function isBrowserDirectory(browserDirectory) {
347
- const baseName = _path.default.basename(browserDirectory);
348
- for (const browserName of allDownloadable) {
349
- if (baseName.startsWith(browserName.replace(/-/g, '_') + '-')) return true;
350
- }
351
- return false;
352
- }
353
- function readDescriptors(browsersJSON) {
354
- return browsersJSON['browsers'].map(obj => {
355
- const name = obj.name;
356
- const revisionOverride = (obj.revisionOverrides || {})[_hostPlatform.hostPlatform];
357
- const revision = revisionOverride || obj.revision;
358
- const browserDirectoryPrefix = revisionOverride ? `${name}_${_hostPlatform.hostPlatform}_special` : `${name}`;
359
- const descriptor = {
360
- name,
361
- revision,
362
- hasRevisionOverride: !!revisionOverride,
363
- // We only put browser version for the supported operating systems.
364
- browserVersion: revisionOverride ? undefined : obj.browserVersion,
365
- installByDefault: !!obj.installByDefault,
366
- // Method `isBrowserDirectory` determines directory to be browser iff
367
- // it starts with some browser name followed by '-'. Some browser names
368
- // are prefixes of others, e.g. 'webkit' is a prefix of `webkit-technology-preview`.
369
- // To avoid older registries erroneously removing 'webkit-technology-preview', we have to
370
- // ensure that browser folders to never include dashes inside.
371
- dir: _path.default.join(registryDirectory, browserDirectoryPrefix.replace(/-/g, '_') + '-' + revision)
372
- };
373
- return descriptor;
374
- });
375
- }
376
- const allDownloadable = ['android', 'chromium', 'firefox', 'webkit', 'ffmpeg', 'firefox-beta', 'chromium-tip-of-tree', 'chromium-headless-shell'];
377
- class Registry {
378
- constructor(browsersJSON) {
379
- this._executables = void 0;
380
- const descriptors = readDescriptors(browsersJSON);
381
- const findExecutablePath = (dir, name) => {
382
- let tokens = undefined;
383
- if (process.platform === 'linux') tokens = EXECUTABLE_PATHS[name]['linux'];else if (process.platform === 'darwin') tokens = EXECUTABLE_PATHS[name]['mac'];else if (process.platform === 'win32') tokens = EXECUTABLE_PATHS[name]['win'];
384
- return tokens ? _path.default.join(dir, ...tokens) : undefined;
385
- };
386
- const executablePathOrDie = (name, e, installByDefault, sdkLanguage) => {
387
- if (!e) throw new Error(`${name} is not supported on ${_hostPlatform.hostPlatform}`);
388
- const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install${installByDefault ? '' : ' ' + name}`);
389
- if (!(0, _fileUtils.canAccessFile)(e)) {
390
- const currentDockerVersion = (0, _dependencies.readDockerVersionSync)();
391
- const preferredDockerVersion = currentDockerVersion ? (0, _dependencies.dockerVersion)(currentDockerVersion.dockerImageNameTemplate) : null;
392
- const isOutdatedDockerImage = currentDockerVersion && preferredDockerVersion && currentDockerVersion.dockerImageName !== preferredDockerVersion.dockerImageName;
393
- const prettyMessage = isOutdatedDockerImage ? [`Looks like ${sdkLanguage === 'javascript' ? 'Playwright Test or ' : ''}Playwright was just updated to ${preferredDockerVersion.driverVersion}.`, `Please update docker image as well.`, `- current: ${currentDockerVersion.dockerImageName}`, `- required: ${preferredDockerVersion.dockerImageName}`, ``, `<3 Playwright Team`].join('\n') : [`Looks like ${sdkLanguage === 'javascript' ? 'Playwright Test or ' : ''}Playwright was just installed or updated.`, `Please run the following command to download new browser${installByDefault ? 's' : ''}:`, ``, ` ${installCommand}`, ``, `<3 Playwright Team`].join('\n');
394
- throw new Error(`Executable doesn't exist at ${e}\n${(0, _utils.wrapInASCIIBox)(prettyMessage, 1)}`);
395
- }
396
- return e;
397
- };
398
- this._executables = [];
399
- const chromium = descriptors.find(d => d.name === 'chromium');
400
- const chromiumExecutable = findExecutablePath(chromium.dir, 'chromium');
401
- this._executables.push({
402
- type: 'browser',
403
- name: 'chromium',
404
- browserName: 'chromium',
405
- directory: chromium.dir,
406
- executablePath: () => chromiumExecutable,
407
- executablePathOrDie: sdkLanguage => executablePathOrDie('chromium', chromiumExecutable, chromium.installByDefault, sdkLanguage),
408
- installType: chromium.installByDefault ? 'download-by-default' : 'download-on-demand',
409
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, chromium.dir, ['chrome-linux'], [], ['chrome-win']),
410
- downloadURLs: this._downloadURLs(chromium),
411
- browserVersion: chromium.browserVersion,
412
- _install: () => this._downloadExecutable(chromium, chromiumExecutable),
413
- _dependencyGroup: 'chromium',
414
- _isHermeticInstallation: true
415
- });
416
- const chromiumHeadlessShell = descriptors.find(d => d.name === 'chromium-headless-shell');
417
- const chromiumHeadlessShellExecutable = findExecutablePath(chromiumHeadlessShell.dir, 'chromium-headless-shell');
418
- this._executables.push({
419
- type: 'channel',
420
- name: 'chromium-headless-shell',
421
- browserName: 'chromium',
422
- directory: chromiumHeadlessShell.dir,
423
- executablePath: () => chromiumHeadlessShellExecutable,
424
- executablePathOrDie: sdkLanguage => executablePathOrDie('chromium', chromiumHeadlessShellExecutable, chromiumHeadlessShell.installByDefault, sdkLanguage),
425
- installType: chromiumHeadlessShell.installByDefault ? 'download-by-default' : 'download-on-demand',
426
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, chromiumHeadlessShell.dir, ['chrome-linux'], [], ['chrome-win']),
427
- downloadURLs: this._downloadURLs(chromiumHeadlessShell),
428
- browserVersion: chromium.browserVersion,
429
- _install: () => this._downloadExecutable(chromiumHeadlessShell, chromiumHeadlessShellExecutable),
430
- _dependencyGroup: 'chromium',
431
- _isHermeticInstallation: true
432
- });
433
- const chromiumTipOfTree = descriptors.find(d => d.name === 'chromium-tip-of-tree');
434
- const chromiumTipOfTreeExecutable = findExecutablePath(chromiumTipOfTree.dir, 'chromium');
435
- this._executables.push({
436
- type: 'tool',
437
- name: 'chromium-tip-of-tree',
438
- browserName: 'chromium',
439
- directory: chromiumTipOfTree.dir,
440
- executablePath: () => chromiumTipOfTreeExecutable,
441
- executablePathOrDie: sdkLanguage => executablePathOrDie('chromium-tip-of-tree', chromiumTipOfTreeExecutable, chromiumTipOfTree.installByDefault, sdkLanguage),
442
- installType: chromiumTipOfTree.installByDefault ? 'download-by-default' : 'download-on-demand',
443
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, chromiumTipOfTree.dir, ['chrome-linux'], [], ['chrome-win']),
444
- downloadURLs: this._downloadURLs(chromiumTipOfTree),
445
- browserVersion: chromiumTipOfTree.browserVersion,
446
- _install: () => this._downloadExecutable(chromiumTipOfTree, chromiumTipOfTreeExecutable),
447
- _dependencyGroup: 'chromium',
448
- _isHermeticInstallation: true
449
- });
450
- this._executables.push(this._createChromiumChannel('chrome', {
451
- 'linux': '/opt/google/chrome/chrome',
452
- 'darwin': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
453
- 'win32': `\\Google\\Chrome\\Application\\chrome.exe`
454
- }, () => this._installChromiumChannel('chrome', {
455
- 'linux': 'reinstall_chrome_stable_linux.sh',
456
- 'darwin': 'reinstall_chrome_stable_mac.sh',
457
- 'win32': 'reinstall_chrome_stable_win.ps1'
458
- })));
459
- this._executables.push(this._createChromiumChannel('chrome-beta', {
460
- 'linux': '/opt/google/chrome-beta/chrome',
461
- 'darwin': '/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta',
462
- 'win32': `\\Google\\Chrome Beta\\Application\\chrome.exe`
463
- }, () => this._installChromiumChannel('chrome-beta', {
464
- 'linux': 'reinstall_chrome_beta_linux.sh',
465
- 'darwin': 'reinstall_chrome_beta_mac.sh',
466
- 'win32': 'reinstall_chrome_beta_win.ps1'
467
- })));
468
- this._executables.push(this._createChromiumChannel('chrome-dev', {
469
- 'linux': '/opt/google/chrome-unstable/chrome',
470
- 'darwin': '/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev',
471
- 'win32': `\\Google\\Chrome Dev\\Application\\chrome.exe`
472
- }));
473
- this._executables.push(this._createChromiumChannel('chrome-canary', {
474
- 'linux': '',
475
- 'darwin': '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary',
476
- 'win32': `\\Google\\Chrome SxS\\Application\\chrome.exe`
477
- }));
478
- this._executables.push(this._createChromiumChannel('msedge', {
479
- 'linux': '/opt/microsoft/msedge/msedge',
480
- 'darwin': '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
481
- 'win32': `\\Microsoft\\Edge\\Application\\msedge.exe`
482
- }, () => this._installMSEdgeChannel('msedge', {
483
- 'linux': 'reinstall_msedge_stable_linux.sh',
484
- 'darwin': 'reinstall_msedge_stable_mac.sh',
485
- 'win32': 'reinstall_msedge_stable_win.ps1'
486
- })));
487
- this._executables.push(this._createChromiumChannel('msedge-beta', {
488
- 'linux': '/opt/microsoft/msedge-beta/msedge',
489
- 'darwin': '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta',
490
- 'win32': `\\Microsoft\\Edge Beta\\Application\\msedge.exe`
491
- }, () => this._installMSEdgeChannel('msedge-beta', {
492
- 'darwin': 'reinstall_msedge_beta_mac.sh',
493
- 'linux': 'reinstall_msedge_beta_linux.sh',
494
- 'win32': 'reinstall_msedge_beta_win.ps1'
495
- })));
496
- this._executables.push(this._createChromiumChannel('msedge-dev', {
497
- 'linux': '/opt/microsoft/msedge-dev/msedge',
498
- 'darwin': '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev',
499
- 'win32': `\\Microsoft\\Edge Dev\\Application\\msedge.exe`
500
- }, () => this._installMSEdgeChannel('msedge-dev', {
501
- 'darwin': 'reinstall_msedge_dev_mac.sh',
502
- 'linux': 'reinstall_msedge_dev_linux.sh',
503
- 'win32': 'reinstall_msedge_dev_win.ps1'
504
- })));
505
- this._executables.push(this._createChromiumChannel('msedge-canary', {
506
- 'linux': '',
507
- 'darwin': '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary',
508
- 'win32': `\\Microsoft\\Edge SxS\\Application\\msedge.exe`
509
- }));
510
- this._executables.push(this._createBidiFirefoxChannel('bidi-firefox-stable', {
511
- 'linux': '/firefox/firefox',
512
- 'darwin': '/Firefox.app/Contents/MacOS/firefox',
513
- 'win32': '\\core\\firefox.exe'
514
- }));
515
- this._executables.push(this._createBidiFirefoxChannel('bidi-firefox-beta', {
516
- 'linux': '/firefox/firefox',
517
- 'darwin': '/Firefox.app/Contents/MacOS/firefox',
518
- 'win32': '\\core\\firefox.exe'
519
- }));
520
- this._executables.push(this._createBidiFirefoxChannel('bidi-firefox-nightly', {
521
- 'linux': '/firefox/firefox',
522
- 'darwin': '/Firefox Nightly.app/Contents/MacOS/firefox',
523
- 'win32': '\\firefox\\firefox.exe'
524
- }));
525
- this._executables.push(this._createBidiChannel('bidi-chrome-stable', {
526
- 'linux': '/opt/google/chrome/chrome',
527
- 'darwin': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
528
- 'win32': `\\Google\\Chrome\\Application\\chrome.exe`
529
- }));
530
- this._executables.push(this._createBidiChannel('bidi-chrome-canary', {
531
- 'linux': '',
532
- 'darwin': '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary',
533
- 'win32': `\\Google\\Chrome SxS\\Application\\chrome.exe`
534
- }));
535
- this._executables.push({
536
- type: 'browser',
537
- name: 'bidi-chromium',
538
- browserName: 'bidi',
539
- directory: chromium.dir,
540
- executablePath: () => chromiumExecutable,
541
- executablePathOrDie: sdkLanguage => executablePathOrDie('chromium', chromiumExecutable, chromium.installByDefault, sdkLanguage),
542
- installType: 'download-on-demand',
543
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, chromium.dir, ['chrome-linux'], [], ['chrome-win']),
544
- downloadURLs: this._downloadURLs(chromium),
545
- browserVersion: chromium.browserVersion,
546
- _install: () => this._downloadExecutable(chromium, chromiumExecutable),
547
- _dependencyGroup: 'chromium',
548
- _isHermeticInstallation: true
549
- });
550
- const firefox = descriptors.find(d => d.name === 'firefox');
551
- const firefoxExecutable = findExecutablePath(firefox.dir, 'firefox');
552
- this._executables.push({
553
- type: 'browser',
554
- name: 'firefox',
555
- browserName: 'firefox',
556
- directory: firefox.dir,
557
- executablePath: () => firefoxExecutable,
558
- executablePathOrDie: sdkLanguage => executablePathOrDie('firefox', firefoxExecutable, firefox.installByDefault, sdkLanguage),
559
- installType: firefox.installByDefault ? 'download-by-default' : 'download-on-demand',
560
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, firefox.dir, ['firefox'], [], ['firefox']),
561
- downloadURLs: this._downloadURLs(firefox),
562
- browserVersion: firefox.browserVersion,
563
- _install: () => this._downloadExecutable(firefox, firefoxExecutable),
564
- _dependencyGroup: 'firefox',
565
- _isHermeticInstallation: true
566
- });
567
- const firefoxBeta = descriptors.find(d => d.name === 'firefox-beta');
568
- const firefoxBetaExecutable = findExecutablePath(firefoxBeta.dir, 'firefox');
569
- this._executables.push({
570
- type: 'tool',
571
- name: 'firefox-beta',
572
- browserName: 'firefox',
573
- directory: firefoxBeta.dir,
574
- executablePath: () => firefoxBetaExecutable,
575
- executablePathOrDie: sdkLanguage => executablePathOrDie('firefox-beta', firefoxBetaExecutable, firefoxBeta.installByDefault, sdkLanguage),
576
- installType: firefoxBeta.installByDefault ? 'download-by-default' : 'download-on-demand',
577
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, firefoxBeta.dir, ['firefox'], [], ['firefox']),
578
- downloadURLs: this._downloadURLs(firefoxBeta),
579
- browserVersion: firefoxBeta.browserVersion,
580
- _install: () => this._downloadExecutable(firefoxBeta, firefoxBetaExecutable),
581
- _dependencyGroup: 'firefox',
582
- _isHermeticInstallation: true
583
- });
584
- const webkit = descriptors.find(d => d.name === 'webkit');
585
- const webkitExecutable = findExecutablePath(webkit.dir, 'webkit');
586
- const webkitLinuxLddDirectories = [_path.default.join('minibrowser-gtk'), _path.default.join('minibrowser-gtk', 'bin'), _path.default.join('minibrowser-gtk', 'lib'), _path.default.join('minibrowser-gtk', 'sys', 'lib'), _path.default.join('minibrowser-wpe'), _path.default.join('minibrowser-wpe', 'bin'), _path.default.join('minibrowser-wpe', 'lib'), _path.default.join('minibrowser-wpe', 'sys', 'lib')];
587
- this._executables.push({
588
- type: 'browser',
589
- name: 'webkit',
590
- browserName: 'webkit',
591
- directory: webkit.dir,
592
- executablePath: () => webkitExecutable,
593
- executablePathOrDie: sdkLanguage => executablePathOrDie('webkit', webkitExecutable, webkit.installByDefault, sdkLanguage),
594
- installType: webkit.installByDefault ? 'download-by-default' : 'download-on-demand',
595
- _validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, webkit.dir, webkitLinuxLddDirectories, ['libGLESv2.so.2', 'libx264.so'], ['']),
596
- downloadURLs: this._downloadURLs(webkit),
597
- browserVersion: webkit.browserVersion,
598
- _install: () => this._downloadExecutable(webkit, webkitExecutable),
599
- _dependencyGroup: 'webkit',
600
- _isHermeticInstallation: true
601
- });
602
- const ffmpeg = descriptors.find(d => d.name === 'ffmpeg');
603
- const ffmpegExecutable = findExecutablePath(ffmpeg.dir, 'ffmpeg');
604
- this._executables.push({
605
- type: 'tool',
606
- name: 'ffmpeg',
607
- browserName: undefined,
608
- directory: ffmpeg.dir,
609
- executablePath: () => ffmpegExecutable,
610
- executablePathOrDie: sdkLanguage => executablePathOrDie('ffmpeg', ffmpegExecutable, ffmpeg.installByDefault, sdkLanguage),
611
- installType: ffmpeg.installByDefault ? 'download-by-default' : 'download-on-demand',
612
- _validateHostRequirements: () => Promise.resolve(),
613
- downloadURLs: this._downloadURLs(ffmpeg),
614
- _install: () => this._downloadExecutable(ffmpeg, ffmpegExecutable),
615
- _dependencyGroup: 'tools',
616
- _isHermeticInstallation: true
617
- });
618
- const android = descriptors.find(d => d.name === 'android');
619
- this._executables.push({
620
- type: 'tool',
621
- name: 'android',
622
- browserName: undefined,
623
- directory: android.dir,
624
- executablePath: () => undefined,
625
- executablePathOrDie: () => '',
626
- installType: 'download-on-demand',
627
- _validateHostRequirements: () => Promise.resolve(),
628
- downloadURLs: this._downloadURLs(android),
629
- _install: () => this._downloadExecutable(android),
630
- _dependencyGroup: 'tools',
631
- _isHermeticInstallation: true
632
- });
633
- this._executables.push({
634
- type: 'browser',
635
- name: 'bidi',
636
- browserName: 'bidi',
637
- directory: undefined,
638
- executablePath: () => undefined,
639
- executablePathOrDie: () => '',
640
- installType: 'none',
641
- _validateHostRequirements: () => Promise.resolve(),
642
- downloadURLs: [],
643
- _install: () => Promise.resolve(),
644
- _dependencyGroup: 'tools',
645
- _isHermeticInstallation: true
646
- });
647
- }
648
- _createChromiumChannel(name, lookAt, install) {
649
- const executablePath = (sdkLanguage, shouldThrow) => {
650
- const suffix = lookAt[process.platform];
651
- if (!suffix) {
652
- if (shouldThrow) throw new Error(`Chromium distribution '${name}' is not supported on ${process.platform}`);
653
- return undefined;
654
- }
655
- const prefixes = process.platform === 'win32' ? [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']].filter(Boolean) : [''];
656
- for (const prefix of prefixes) {
657
- const executablePath = _path.default.join(prefix, suffix);
658
- if ((0, _fileUtils.canAccessFile)(executablePath)) return executablePath;
659
- }
660
- if (!shouldThrow) return undefined;
661
- const location = prefixes.length ? ` at ${_path.default.join(prefixes[0], suffix)}` : ``;
662
- const installation = install ? `\nRun "${buildPlaywrightCLICommand(sdkLanguage, 'install ' + name)}"` : '';
663
- throw new Error(`Chromium distribution '${name}' is not found${location}${installation}`);
664
- };
665
- return {
666
- type: 'channel',
667
- name,
668
- browserName: 'chromium',
669
- directory: undefined,
670
- executablePath: sdkLanguage => executablePath(sdkLanguage, false),
671
- executablePathOrDie: sdkLanguage => executablePath(sdkLanguage, true),
672
- installType: install ? 'install-script' : 'none',
673
- _validateHostRequirements: () => Promise.resolve(),
674
- _isHermeticInstallation: false,
675
- _install: install
676
- };
677
- }
678
- _createBidiFirefoxChannel(name, lookAt, install) {
679
- const executablePath = (sdkLanguage, shouldThrow) => {
680
- const suffix = lookAt[process.platform];
681
- if (!suffix) {
682
- if (shouldThrow) throw new Error(`Firefox distribution '${name}' is not supported on ${process.platform}`);
683
- return undefined;
684
- }
685
- const folder = _path.default.resolve('firefox');
686
- let channelName = 'stable';
687
- if (name.includes('beta')) channelName = 'beta';else if (name.includes('nightly')) channelName = 'nightly';
688
- const installedVersions = fs.readdirSync(folder);
689
- const found = installedVersions.filter(e => e.includes(channelName));
690
- if (found.length === 1) return _path.default.join(folder, found[0], suffix);
691
- if (found.length > 1) {
692
- if (shouldThrow) throw new Error(`Multiple Firefox installations found for channel '${name}': ${found.join(', ')}`);else return undefined;
693
- }
694
- if (shouldThrow) throw new Error(`Cannot find Firefox installation for channel '${name}' under ${folder}`);
695
- return undefined;
696
- };
697
- return {
698
- type: 'channel',
699
- name,
700
- browserName: 'bidi',
701
- directory: undefined,
702
- executablePath: sdkLanguage => executablePath(sdkLanguage, false),
703
- executablePathOrDie: sdkLanguage => executablePath(sdkLanguage, true),
704
- installType: 'none',
705
- _validateHostRequirements: () => Promise.resolve(),
706
- _isHermeticInstallation: true,
707
- _install: install
708
- };
709
- }
710
- _createBidiChannel(name, lookAt, install) {
711
- const executablePath = (sdkLanguage, shouldThrow) => {
712
- const suffix = lookAt[process.platform];
713
- if (!suffix) {
714
- if (shouldThrow) throw new Error(`Firefox distribution '${name}' is not supported on ${process.platform}`);
715
- return undefined;
716
- }
717
- const prefixes = process.platform === 'win32' ? [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']].filter(Boolean) : [''];
718
- for (const prefix of prefixes) {
719
- const executablePath = _path.default.join(prefix, suffix);
720
- if ((0, _fileUtils.canAccessFile)(executablePath)) return executablePath;
721
- }
722
- if (!shouldThrow) return undefined;
723
- const location = prefixes.length ? ` at ${_path.default.join(prefixes[0], suffix)}` : ``;
724
- const installation = install ? `\nRun "${buildPlaywrightCLICommand(sdkLanguage, 'install ' + name)}"` : '';
725
- throw new Error(`Firefox distribution '${name}' is not found${location}${installation}`);
726
- };
727
- return {
728
- type: 'channel',
729
- name,
730
- browserName: 'bidi',
731
- directory: undefined,
732
- executablePath: sdkLanguage => executablePath(sdkLanguage, false),
733
- executablePathOrDie: sdkLanguage => executablePath(sdkLanguage, true),
734
- installType: install ? 'install-script' : 'none',
735
- _validateHostRequirements: () => Promise.resolve(),
736
- _isHermeticInstallation: false,
737
- _install: install
738
- };
739
- }
740
- executables() {
741
- return this._executables;
742
- }
743
- findExecutable(name) {
744
- return this._executables.find(b => b.name === name);
745
- }
746
- defaultExecutables() {
747
- return this._executables.filter(e => e.installType === 'download-by-default');
748
- }
749
- _dedupe(executables) {
750
- return Array.from(new Set(executables));
751
- }
752
- async _validateHostRequirements(sdkLanguage, browserDirectory, linuxLddDirectories, dlOpenLibraries, windowsExeAndDllDirectories) {
753
- if (os.platform() === 'linux') return await (0, _dependencies.validateDependenciesLinux)(sdkLanguage, linuxLddDirectories.map(d => _path.default.join(browserDirectory, d)), dlOpenLibraries);
754
- if (os.platform() === 'win32' && os.arch() === 'x64') return await (0, _dependencies.validateDependenciesWindows)(windowsExeAndDllDirectories.map(d => _path.default.join(browserDirectory, d)));
755
- }
756
- async installDeps(executablesToInstallDeps, dryRun) {
757
- const executables = this._dedupe(executablesToInstallDeps);
758
- const targets = new Set();
759
- for (const executable of executables) {
760
- if (executable._dependencyGroup) targets.add(executable._dependencyGroup);
761
- }
762
- targets.add('tools');
763
- if (os.platform() === 'win32') return await (0, _dependencies.installDependenciesWindows)(targets, dryRun);
764
- if (os.platform() === 'linux') return await (0, _dependencies.installDependenciesLinux)(targets, dryRun);
765
- }
766
- async install(executablesToInstall, forceReinstall) {
767
- const executables = this._dedupe(executablesToInstall);
768
- await fs.promises.mkdir(registryDirectory, {
769
- recursive: true
770
- });
771
- const lockfilePath = _path.default.join(registryDirectory, '__dirlock');
772
- const linksDir = _path.default.join(registryDirectory, '.links');
773
- let releaseLock;
774
- try {
775
- releaseLock = await _utilsBundle.lockfile.lock(registryDirectory, {
776
- retries: {
777
- // Retry 20 times during 10 minutes with
778
- // exponential back-off.
779
- // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions
780
- retries: 20,
781
- factor: 1.27579
782
- },
783
- onCompromised: err => {
784
- throw new Error(`${err.message} Path: ${lockfilePath}`);
785
- },
786
- lockfilePath
787
- });
788
- // Create a link first, so that cache validation does not remove our own browsers.
789
- await fs.promises.mkdir(linksDir, {
790
- recursive: true
791
- });
792
- await fs.promises.writeFile(_path.default.join(linksDir, (0, _utils.calculateSha1)(PACKAGE_PATH)), PACKAGE_PATH);
793
-
794
- // Remove stale browsers.
795
- await this._validateInstallationCache(linksDir);
796
-
797
- // Install browsers for this package.
798
- for (const executable of executables) {
799
- if (!executable._install) throw new Error(`ERROR: Playwright does not support installing ${executable.name}`);
800
- const {
801
- embedderName
802
- } = (0, _userAgent.getEmbedderName)();
803
- if (!(0, _utils.getAsBooleanFromENV)('CI') && !executable._isHermeticInstallation && !forceReinstall && executable.executablePath(embedderName)) {
804
- const command = buildPlaywrightCLICommand(embedderName, 'install --force ' + executable.name);
805
- throw new Error('\n' + (0, _utils.wrapInASCIIBox)([`ATTENTION: "${executable.name}" is already installed on the system!`, ``, `"${executable.name}" installation is not hermetic; installing newer version`, `requires *removal* of a current installation first.`, ``, `To *uninstall* current version and re-install latest "${executable.name}":`, ``, `- Close all running instances of "${executable.name}", if any`, `- Use "--force" to install browser:`, ``, ` ${command}`, ``, `<3 Playwright Team`].join('\n'), 1));
806
- }
807
- await executable._install();
808
- }
809
- } catch (e) {
810
- if (e.code === 'ELOCKED') {
811
- const rmCommand = process.platform === 'win32' ? 'rm -R' : 'rm -rf';
812
- throw new Error('\n' + (0, _utils.wrapInASCIIBox)([`An active lockfile is found at:`, ``, ` ${lockfilePath}`, ``, `Either:`, `- wait a few minutes if other Playwright is installing browsers in parallel`, `- remove lock manually with:`, ``, ` ${rmCommand} ${lockfilePath}`, ``, `<3 Playwright Team`].join('\n'), 1));
813
- } else {
814
- throw e;
815
- }
816
- } finally {
817
- if (releaseLock) await releaseLock();
818
- }
819
- }
820
- async uninstall(all) {
821
- const linksDir = _path.default.join(registryDirectory, '.links');
822
- if (all) {
823
- const links = await fs.promises.readdir(linksDir).catch(() => []);
824
- for (const link of links) await fs.promises.unlink(_path.default.join(linksDir, link));
825
- } else {
826
- await fs.promises.unlink(_path.default.join(linksDir, (0, _utils.calculateSha1)(PACKAGE_PATH))).catch(() => {});
827
- }
828
-
829
- // Remove stale browsers.
830
- await this._validateInstallationCache(linksDir);
831
- return {
832
- numberOfBrowsersLeft: (await fs.promises.readdir(registryDirectory).catch(() => [])).filter(browserDirectory => isBrowserDirectory(browserDirectory)).length
833
- };
834
- }
835
- async validateHostRequirementsForExecutablesIfNeeded(executables, sdkLanguage) {
836
- if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS')) {
837
- process.stderr.write('Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n');
838
- return;
839
- }
840
- for (const executable of executables) await this._validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage);
841
- }
842
- async _validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage) {
843
- const kMaximumReValidationPeriod = 30 * 24 * 60 * 60 * 1000; // 30 days
844
- // Executable does not require validation.
845
- if (!executable.directory) return;
846
- const markerFile = _path.default.join(executable.directory, 'DEPENDENCIES_VALIDATED');
847
- // Executable is already validated.
848
- if (await fs.promises.stat(markerFile).then(stat => Date.now() - stat.mtime.getTime() < kMaximumReValidationPeriod).catch(() => false)) return;
849
- _debugLogger.debugLogger.log('install', `validating host requirements for "${executable.name}"`);
850
- try {
851
- await executable._validateHostRequirements(sdkLanguage);
852
- _debugLogger.debugLogger.log('install', `validation passed for ${executable.name}`);
853
- } catch (error) {
854
- _debugLogger.debugLogger.log('install', `validation failed for ${executable.name}`);
855
- throw error;
856
- }
857
- await fs.promises.writeFile(markerFile, '').catch(() => {});
858
- }
859
- _downloadURLs(descriptor) {
860
- const paths = DOWNLOAD_PATHS[descriptor.name];
861
- const downloadPathTemplate = paths[_hostPlatform.hostPlatform] || paths['<unknown>'];
862
- if (!downloadPathTemplate) return [];
863
- const downloadPath = util.format(downloadPathTemplate, descriptor.revision);
864
- let downloadURLs = PLAYWRIGHT_CDN_MIRRORS.map(mirror => `${mirror}/${downloadPath}`);
865
- let downloadHostEnv;
866
- if (descriptor.name.startsWith('chromium')) downloadHostEnv = 'PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST';else if (descriptor.name.startsWith('firefox')) downloadHostEnv = 'PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST';else if (descriptor.name.startsWith('webkit')) downloadHostEnv = 'PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST';
867
- const customHostOverride = downloadHostEnv && (0, _utils.getFromENV)(downloadHostEnv) || (0, _utils.getFromENV)('PLAYWRIGHT_DOWNLOAD_HOST');
868
- if (customHostOverride) downloadURLs = [`${customHostOverride}/${downloadPath}`];
869
- return downloadURLs;
870
- }
871
- async _downloadExecutable(descriptor, executablePath) {
872
- const downloadURLs = this._downloadURLs(descriptor);
873
- if (!downloadURLs.length) throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${_hostPlatform.hostPlatform}`);
874
- if (!_hostPlatform.isOfficiallySupportedPlatform) (0, _browserFetcher.logPolitely)(`BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ${_hostPlatform.hostPlatform}.`);
875
- if (descriptor.hasRevisionOverride) {
876
- const message = `You are using a frozen ${descriptor.name} browser which does not receive updates anymore on ${_hostPlatform.hostPlatform}. Please update to the latest version of your operating system to test up-to-date browsers.`;
877
- if (process.env.GITHUB_ACTIONS) console.log(`::warning title=Playwright::${message}`); // eslint-disable-line no-console
878
- else (0, _browserFetcher.logPolitely)(message);
879
- }
880
- const displayName = descriptor.name.split('-').map(word => {
881
- return word === 'ffmpeg' ? 'FFMPEG' : word.charAt(0).toUpperCase() + word.slice(1);
882
- }).join(' ');
883
- const title = descriptor.browserVersion ? `${displayName} ${descriptor.browserVersion} (playwright build v${descriptor.revision})` : `${displayName} playwright build v${descriptor.revision}`;
884
- const downloadFileName = `playwright-download-${descriptor.name}-${_hostPlatform.hostPlatform}-${descriptor.revision}.zip`;
885
- const downloadConnectionTimeoutEnv = (0, _utils.getFromENV)('PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT');
886
- const downloadConnectionTimeout = +(downloadConnectionTimeoutEnv || '0') || 30_000;
887
- await (0, _browserFetcher.downloadBrowserWithProgressBar)(title, descriptor.dir, executablePath, downloadURLs, downloadFileName, downloadConnectionTimeout).catch(e => {
888
- throw new Error(`Failed to download ${title}, caused by\n${e.stack}`);
889
- });
890
- }
891
- async _installMSEdgeChannel(channel, scripts) {
892
- const scriptArgs = [];
893
- if (process.platform !== 'linux') {
894
- const products = lowercaseAllKeys(JSON.parse(await (0, _network.fetchData)({
895
- url: 'https://edgeupdates.microsoft.com/api/products'
896
- })));
897
- const productName = {
898
- 'msedge': 'Stable',
899
- 'msedge-beta': 'Beta',
900
- 'msedge-dev': 'Dev'
901
- }[channel];
902
- const product = products.find(product => product.product === productName);
903
- const searchConfig = {
904
- darwin: {
905
- platform: 'MacOS',
906
- arch: 'universal',
907
- artifact: 'pkg'
908
- },
909
- win32: {
910
- platform: 'Windows',
911
- arch: 'x64',
912
- artifact: 'msi'
913
- }
914
- }[process.platform];
915
- const release = searchConfig ? product.releases.find(release => release.platform === searchConfig.platform && release.architecture === searchConfig.arch && release.artifacts.length > 0) : null;
916
- const artifact = release ? release.artifacts.find(artifact => artifact.artifactname === searchConfig.artifact) : null;
917
- if (artifact) scriptArgs.push(artifact.location /* url */);else throw new Error(`Cannot install ${channel} on ${process.platform}`);
918
- }
919
- await this._installChromiumChannel(channel, scripts, scriptArgs);
920
- }
921
- async _installChromiumChannel(channel, scripts, scriptArgs = []) {
922
- const scriptName = scripts[process.platform];
923
- if (!scriptName) throw new Error(`Cannot install ${channel} on ${process.platform}`);
924
- const cwd = BIN_PATH;
925
- const isPowerShell = scriptName.endsWith('.ps1');
926
- if (isPowerShell) {
927
- const args = ['-ExecutionPolicy', 'Bypass', '-File', _path.default.join(BIN_PATH, scriptName), ...scriptArgs];
928
- const {
929
- code
930
- } = await (0, _spawnAsync.spawnAsync)('powershell.exe', args, {
931
- cwd,
932
- stdio: 'inherit'
933
- });
934
- if (code !== 0) throw new Error(`Failed to install ${channel}`);
935
- } else {
936
- const {
937
- command,
938
- args,
939
- elevatedPermissions
940
- } = await (0, _dependencies.transformCommandsForRoot)([`bash "${_path.default.join(BIN_PATH, scriptName)}" ${scriptArgs.join('')}`]);
941
- if (elevatedPermissions) console.log('Switching to root user to install dependencies...'); // eslint-disable-line no-console
942
- const {
943
- code
944
- } = await (0, _spawnAsync.spawnAsync)(command, args, {
945
- cwd,
946
- stdio: 'inherit'
947
- });
948
- if (code !== 0) throw new Error(`Failed to install ${channel}`);
949
- }
950
- }
951
- async _validateInstallationCache(linksDir) {
952
- // 1. Collect used downloads and package descriptors.
953
- const usedBrowserPaths = new Set();
954
- for (const fileName of await fs.promises.readdir(linksDir)) {
955
- const linkPath = _path.default.join(linksDir, fileName);
956
- let linkTarget = '';
957
- try {
958
- linkTarget = (await fs.promises.readFile(linkPath)).toString();
959
- const browsersJSON = require(_path.default.join(linkTarget, 'browsers.json'));
960
- const descriptors = readDescriptors(browsersJSON);
961
- for (const browserName of allDownloadable) {
962
- // We retain browsers if they are found in the descriptor.
963
- // Note, however, that there are older versions out in the wild that rely on
964
- // the "download" field in the browser descriptor and use its value
965
- // to retain and download browsers.
966
- // As of v1.10, we decided to abandon "download" field.
967
- const descriptor = descriptors.find(d => d.name === browserName);
968
- if (!descriptor) continue;
969
- const usedBrowserPath = descriptor.dir;
970
- const browserRevision = parseInt(descriptor.revision, 10);
971
- // Old browser installations don't have marker file.
972
- // We switched chromium from 999999 to 1000, 300000 is the new Y2K.
973
- const shouldHaveMarkerFile = browserName === 'chromium' && (browserRevision >= 786218 || browserRevision < 300000) || browserName === 'firefox' && browserRevision >= 1128 || browserName === 'webkit' && browserRevision >= 1307 ||
974
- // All new applications have a marker file right away.
975
- browserName !== 'firefox' && browserName !== 'chromium' && browserName !== 'webkit';
976
- if (!shouldHaveMarkerFile || (await (0, _fileUtils.existsAsync)(browserDirectoryToMarkerFilePath(usedBrowserPath)))) usedBrowserPaths.add(usedBrowserPath);
977
- }
978
- } catch (e) {
979
- await fs.promises.unlink(linkPath).catch(e => {});
980
- }
981
- }
982
-
983
- // 2. Delete all unused browsers.
984
- if (!(0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_BROWSER_GC')) {
985
- let downloadedBrowsers = (await fs.promises.readdir(registryDirectory)).map(file => _path.default.join(registryDirectory, file));
986
- downloadedBrowsers = downloadedBrowsers.filter(file => isBrowserDirectory(file));
987
- const directories = new Set(downloadedBrowsers);
988
- for (const browserDirectory of usedBrowserPaths) directories.delete(browserDirectory);
989
- for (const directory of directories) (0, _browserFetcher.logPolitely)('Removing unused browser at ' + directory);
990
- await (0, _fileUtils.removeFolders)([...directories]);
991
- }
992
- }
993
- }
994
- exports.Registry = Registry;
995
- function browserDirectoryToMarkerFilePath(browserDirectory) {
996
- return _path.default.join(browserDirectory, 'INSTALLATION_COMPLETE');
997
- }
998
- function buildPlaywrightCLICommand(sdkLanguage, parameters) {
999
- switch (sdkLanguage) {
1000
- case 'python':
1001
- return `playwright ${parameters}`;
1002
- case 'java':
1003
- return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="${parameters}"`;
1004
- case 'csharp':
1005
- return `pwsh bin/Debug/netX/playwright.ps1 ${parameters}`;
1006
- default:
1007
- {
1008
- const packageManagerCommand = (0, _utils.getPackageManagerExecCommand)();
1009
- return `${packageManagerCommand} playwright ${parameters}`;
1010
- }
1011
- }
1012
- }
1013
- async function installBrowsersForNpmInstall(browsers) {
1014
- // PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD should have a value of 0 or 1
1015
- if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD')) {
1016
- (0, _browserFetcher.logPolitely)('Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set');
1017
- return false;
1018
- }
1019
- const executables = [];
1020
- for (const browserName of browsers) {
1021
- const executable = registry.findExecutable(browserName);
1022
- if (!executable || executable.installType === 'none') throw new Error(`Cannot install ${browserName}`);
1023
- executables.push(executable);
1024
- }
1025
- await registry.install(executables, false /* forceReinstall */);
1026
- }
1027
- function findChromiumChannel(sdkLanguage) {
1028
- // Fall back to the stable channels of popular vendors to work out of the box.
1029
- // Null means no installation and no channels found.
1030
- let channel = null;
1031
- for (const name of ['chromium', 'chrome', 'msedge']) {
1032
- try {
1033
- registry.findExecutable(name).executablePathOrDie(sdkLanguage);
1034
- channel = name === 'chromium' ? undefined : name;
1035
- break;
1036
- } catch (e) {}
1037
- }
1038
- if (channel === null) {
1039
- const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install chromium`);
1040
- const prettyMessage = [`No chromium-based browser found on the system.`, `Please run the following command to download one:`, ``, ` ${installCommand}`, ``, `<3 Playwright Team`].join('\n');
1041
- throw new Error('\n' + (0, _utils.wrapInASCIIBox)(prettyMessage, 1));
1042
- }
1043
- return channel;
1044
- }
1045
- function lowercaseAllKeys(json) {
1046
- if (typeof json !== 'object' || !json) return json;
1047
- if (Array.isArray(json)) return json.map(lowercaseAllKeys);
1048
- const result = {};
1049
- for (const [key, value] of Object.entries(json)) result[key.toLowerCase()] = lowercaseAllKeys(value);
1050
- return result;
1051
- }
1052
- const registry = exports.registry = new Registry(require('../../../browsers.json'));