easytouch-linux 1.0.7 → 1.0.18

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