rubycrawl 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +11 -0
  4. data/LICENSE +21 -0
  5. data/README.md +585 -0
  6. data/Rakefile +8 -0
  7. data/bin/console +9 -0
  8. data/bin/setup +4 -0
  9. data/lib/rubycrawl/errors.rb +18 -0
  10. data/lib/rubycrawl/helpers.rb +66 -0
  11. data/lib/rubycrawl/markdown_converter.rb +37 -0
  12. data/lib/rubycrawl/railtie.rb +12 -0
  13. data/lib/rubycrawl/result.rb +40 -0
  14. data/lib/rubycrawl/service_client.rb +86 -0
  15. data/lib/rubycrawl/site_crawler.rb +113 -0
  16. data/lib/rubycrawl/tasks/install.rake +85 -0
  17. data/lib/rubycrawl/url_normalizer.rb +68 -0
  18. data/lib/rubycrawl/version.rb +5 -0
  19. data/lib/rubycrawl.rb +141 -0
  20. data/node/.gitignore +2 -0
  21. data/node/.npmrc +1 -0
  22. data/node/README.md +19 -0
  23. data/node/node_modules/.bin/playwright +1 -0
  24. data/node/node_modules/.bin/playwright-core +1 -0
  25. data/node/node_modules/.package-lock.json +65 -0
  26. data/node/node_modules/dotenv/CHANGELOG.md +520 -0
  27. data/node/node_modules/dotenv/LICENSE +23 -0
  28. data/node/node_modules/dotenv/README-es.md +411 -0
  29. data/node/node_modules/dotenv/README.md +645 -0
  30. data/node/node_modules/dotenv/SECURITY.md +1 -0
  31. data/node/node_modules/dotenv/config.d.ts +1 -0
  32. data/node/node_modules/dotenv/config.js +9 -0
  33. data/node/node_modules/dotenv/lib/cli-options.js +17 -0
  34. data/node/node_modules/dotenv/lib/env-options.js +28 -0
  35. data/node/node_modules/dotenv/lib/main.d.ts +162 -0
  36. data/node/node_modules/dotenv/lib/main.js +386 -0
  37. data/node/node_modules/dotenv/package.json +62 -0
  38. data/node/node_modules/playwright/LICENSE +202 -0
  39. data/node/node_modules/playwright/NOTICE +5 -0
  40. data/node/node_modules/playwright/README.md +168 -0
  41. data/node/node_modules/playwright/ThirdPartyNotices.txt +5042 -0
  42. data/node/node_modules/playwright/cli.js +19 -0
  43. data/node/node_modules/playwright/index.d.ts +17 -0
  44. data/node/node_modules/playwright/index.js +17 -0
  45. data/node/node_modules/playwright/index.mjs +18 -0
  46. data/node/node_modules/playwright/jsx-runtime.js +42 -0
  47. data/node/node_modules/playwright/jsx-runtime.mjs +21 -0
  48. data/node/node_modules/playwright/lib/agents/agentParser.js +89 -0
  49. data/node/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  50. data/node/node_modules/playwright/lib/agents/generateAgents.js +348 -0
  51. data/node/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  52. data/node/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  53. data/node/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  54. data/node/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  55. data/node/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
  56. data/node/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  57. data/node/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +73 -0
  58. data/node/node_modules/playwright/lib/common/config.js +282 -0
  59. data/node/node_modules/playwright/lib/common/configLoader.js +344 -0
  60. data/node/node_modules/playwright/lib/common/esmLoaderHost.js +104 -0
  61. data/node/node_modules/playwright/lib/common/expectBundle.js +28 -0
  62. data/node/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
  63. data/node/node_modules/playwright/lib/common/fixtures.js +302 -0
  64. data/node/node_modules/playwright/lib/common/globals.js +58 -0
  65. data/node/node_modules/playwright/lib/common/ipc.js +60 -0
  66. data/node/node_modules/playwright/lib/common/poolBuilder.js +85 -0
  67. data/node/node_modules/playwright/lib/common/process.js +132 -0
  68. data/node/node_modules/playwright/lib/common/suiteUtils.js +140 -0
  69. data/node/node_modules/playwright/lib/common/test.js +321 -0
  70. data/node/node_modules/playwright/lib/common/testLoader.js +101 -0
  71. data/node/node_modules/playwright/lib/common/testType.js +298 -0
  72. data/node/node_modules/playwright/lib/common/validators.js +68 -0
  73. data/node/node_modules/playwright/lib/fsWatcher.js +67 -0
  74. data/node/node_modules/playwright/lib/index.js +726 -0
  75. data/node/node_modules/playwright/lib/internalsForTest.js +42 -0
  76. data/node/node_modules/playwright/lib/isomorphic/events.js +77 -0
  77. data/node/node_modules/playwright/lib/isomorphic/folders.js +30 -0
  78. data/node/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
  79. data/node/node_modules/playwright/lib/isomorphic/teleReceiver.js +521 -0
  80. data/node/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +157 -0
  81. data/node/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
  82. data/node/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
  83. data/node/node_modules/playwright/lib/isomorphic/testTree.js +329 -0
  84. data/node/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
  85. data/node/node_modules/playwright/lib/loader/loaderMain.js +59 -0
  86. data/node/node_modules/playwright/lib/matchers/expect.js +311 -0
  87. data/node/node_modules/playwright/lib/matchers/matcherHint.js +44 -0
  88. data/node/node_modules/playwright/lib/matchers/matchers.js +383 -0
  89. data/node/node_modules/playwright/lib/matchers/toBeTruthy.js +75 -0
  90. data/node/node_modules/playwright/lib/matchers/toEqual.js +100 -0
  91. data/node/node_modules/playwright/lib/matchers/toHaveURL.js +101 -0
  92. data/node/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
  93. data/node/node_modules/playwright/lib/matchers/toMatchSnapshot.js +342 -0
  94. data/node/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
  95. data/node/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +329 -0
  96. data/node/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +84 -0
  97. data/node/node_modules/playwright/lib/mcp/browser/config.js +421 -0
  98. data/node/node_modules/playwright/lib/mcp/browser/context.js +244 -0
  99. data/node/node_modules/playwright/lib/mcp/browser/response.js +278 -0
  100. data/node/node_modules/playwright/lib/mcp/browser/sessionLog.js +75 -0
  101. data/node/node_modules/playwright/lib/mcp/browser/tab.js +343 -0
  102. data/node/node_modules/playwright/lib/mcp/browser/tools/common.js +65 -0
  103. data/node/node_modules/playwright/lib/mcp/browser/tools/console.js +46 -0
  104. data/node/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
  105. data/node/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +61 -0
  106. data/node/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
  107. data/node/node_modules/playwright/lib/mcp/browser/tools/form.js +63 -0
  108. data/node/node_modules/playwright/lib/mcp/browser/tools/install.js +72 -0
  109. data/node/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +107 -0
  110. data/node/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
  111. data/node/node_modules/playwright/lib/mcp/browser/tools/navigate.js +71 -0
  112. data/node/node_modules/playwright/lib/mcp/browser/tools/network.js +63 -0
  113. data/node/node_modules/playwright/lib/mcp/browser/tools/open.js +57 -0
  114. data/node/node_modules/playwright/lib/mcp/browser/tools/pdf.js +49 -0
  115. data/node/node_modules/playwright/lib/mcp/browser/tools/runCode.js +78 -0
  116. data/node/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +93 -0
  117. data/node/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +173 -0
  118. data/node/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
  119. data/node/node_modules/playwright/lib/mcp/browser/tools/tool.js +47 -0
  120. data/node/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
  121. data/node/node_modules/playwright/lib/mcp/browser/tools/utils.js +94 -0
  122. data/node/node_modules/playwright/lib/mcp/browser/tools/verify.js +143 -0
  123. data/node/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
  124. data/node/node_modules/playwright/lib/mcp/browser/tools.js +84 -0
  125. data/node/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
  126. data/node/node_modules/playwright/lib/mcp/config.d.js +16 -0
  127. data/node/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
  128. data/node/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +76 -0
  129. data/node/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
  130. data/node/node_modules/playwright/lib/mcp/index.js +61 -0
  131. data/node/node_modules/playwright/lib/mcp/log.js +35 -0
  132. data/node/node_modules/playwright/lib/mcp/program.js +111 -0
  133. data/node/node_modules/playwright/lib/mcp/sdk/exports.js +28 -0
  134. data/node/node_modules/playwright/lib/mcp/sdk/http.js +152 -0
  135. data/node/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
  136. data/node/node_modules/playwright/lib/mcp/sdk/server.js +223 -0
  137. data/node/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
  138. data/node/node_modules/playwright/lib/mcp/terminal/cli.js +296 -0
  139. data/node/node_modules/playwright/lib/mcp/terminal/command.js +56 -0
  140. data/node/node_modules/playwright/lib/mcp/terminal/commands.js +333 -0
  141. data/node/node_modules/playwright/lib/mcp/terminal/daemon.js +129 -0
  142. data/node/node_modules/playwright/lib/mcp/terminal/help.json +32 -0
  143. data/node/node_modules/playwright/lib/mcp/terminal/helpGenerator.js +88 -0
  144. data/node/node_modules/playwright/lib/mcp/terminal/socketConnection.js +80 -0
  145. data/node/node_modules/playwright/lib/mcp/test/browserBackend.js +98 -0
  146. data/node/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  147. data/node/node_modules/playwright/lib/mcp/test/plannerTools.js +145 -0
  148. data/node/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  149. data/node/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  150. data/node/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  151. data/node/node_modules/playwright/lib/mcp/test/testContext.js +285 -0
  152. data/node/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  153. data/node/node_modules/playwright/lib/mcp/test/testTools.js +108 -0
  154. data/node/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
  155. data/node/node_modules/playwright/lib/plugins/index.js +28 -0
  156. data/node/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
  157. data/node/node_modules/playwright/lib/program.js +417 -0
  158. data/node/node_modules/playwright/lib/reporters/base.js +634 -0
  159. data/node/node_modules/playwright/lib/reporters/blob.js +138 -0
  160. data/node/node_modules/playwright/lib/reporters/dot.js +99 -0
  161. data/node/node_modules/playwright/lib/reporters/empty.js +32 -0
  162. data/node/node_modules/playwright/lib/reporters/github.js +128 -0
  163. data/node/node_modules/playwright/lib/reporters/html.js +633 -0
  164. data/node/node_modules/playwright/lib/reporters/internalReporter.js +138 -0
  165. data/node/node_modules/playwright/lib/reporters/json.js +254 -0
  166. data/node/node_modules/playwright/lib/reporters/junit.js +232 -0
  167. data/node/node_modules/playwright/lib/reporters/line.js +131 -0
  168. data/node/node_modules/playwright/lib/reporters/list.js +253 -0
  169. data/node/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
  170. data/node/node_modules/playwright/lib/reporters/markdown.js +144 -0
  171. data/node/node_modules/playwright/lib/reporters/merge.js +558 -0
  172. data/node/node_modules/playwright/lib/reporters/multiplexer.js +112 -0
  173. data/node/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
  174. data/node/node_modules/playwright/lib/reporters/teleEmitter.js +317 -0
  175. data/node/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
  176. data/node/node_modules/playwright/lib/runner/dispatcher.js +530 -0
  177. data/node/node_modules/playwright/lib/runner/failureTracker.js +72 -0
  178. data/node/node_modules/playwright/lib/runner/lastRun.js +77 -0
  179. data/node/node_modules/playwright/lib/runner/loadUtils.js +334 -0
  180. data/node/node_modules/playwright/lib/runner/loaderHost.js +89 -0
  181. data/node/node_modules/playwright/lib/runner/processHost.js +180 -0
  182. data/node/node_modules/playwright/lib/runner/projectUtils.js +241 -0
  183. data/node/node_modules/playwright/lib/runner/rebase.js +189 -0
  184. data/node/node_modules/playwright/lib/runner/reporters.js +138 -0
  185. data/node/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
  186. data/node/node_modules/playwright/lib/runner/storage.js +91 -0
  187. data/node/node_modules/playwright/lib/runner/taskRunner.js +127 -0
  188. data/node/node_modules/playwright/lib/runner/tasks.js +410 -0
  189. data/node/node_modules/playwright/lib/runner/testGroups.js +125 -0
  190. data/node/node_modules/playwright/lib/runner/testRunner.js +398 -0
  191. data/node/node_modules/playwright/lib/runner/testServer.js +269 -0
  192. data/node/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
  193. data/node/node_modules/playwright/lib/runner/vcs.js +72 -0
  194. data/node/node_modules/playwright/lib/runner/watchMode.js +396 -0
  195. data/node/node_modules/playwright/lib/runner/workerHost.js +104 -0
  196. data/node/node_modules/playwright/lib/third_party/pirates.js +62 -0
  197. data/node/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
  198. data/node/node_modules/playwright/lib/transform/babelBundle.js +46 -0
  199. data/node/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
  200. data/node/node_modules/playwright/lib/transform/compilationCache.js +274 -0
  201. data/node/node_modules/playwright/lib/transform/esmLoader.js +103 -0
  202. data/node/node_modules/playwright/lib/transform/md.js +221 -0
  203. data/node/node_modules/playwright/lib/transform/portTransport.js +67 -0
  204. data/node/node_modules/playwright/lib/transform/transform.js +303 -0
  205. data/node/node_modules/playwright/lib/util.js +400 -0
  206. data/node/node_modules/playwright/lib/utilsBundle.js +50 -0
  207. data/node/node_modules/playwright/lib/utilsBundleImpl.js +103 -0
  208. data/node/node_modules/playwright/lib/worker/fixtureRunner.js +262 -0
  209. data/node/node_modules/playwright/lib/worker/testInfo.js +536 -0
  210. data/node/node_modules/playwright/lib/worker/testTracing.js +345 -0
  211. data/node/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
  212. data/node/node_modules/playwright/lib/worker/util.js +31 -0
  213. data/node/node_modules/playwright/lib/worker/workerMain.js +530 -0
  214. data/node/node_modules/playwright/package.json +72 -0
  215. data/node/node_modules/playwright/test.d.ts +18 -0
  216. data/node/node_modules/playwright/test.js +24 -0
  217. data/node/node_modules/playwright/test.mjs +34 -0
  218. data/node/node_modules/playwright/types/test.d.ts +10251 -0
  219. data/node/node_modules/playwright/types/testReporter.d.ts +822 -0
  220. data/node/node_modules/playwright-core/LICENSE +202 -0
  221. data/node/node_modules/playwright-core/NOTICE +5 -0
  222. data/node/node_modules/playwright-core/README.md +3 -0
  223. data/node/node_modules/playwright-core/ThirdPartyNotices.txt +4076 -0
  224. data/node/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  225. data/node/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  226. data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  227. data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  228. data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  229. data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  230. data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  231. data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  232. data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  233. data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  234. data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  235. data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  236. data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  237. data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  238. data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  239. data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  240. data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  241. data/node/node_modules/playwright-core/browsers.json +79 -0
  242. data/node/node_modules/playwright-core/cli.js +18 -0
  243. data/node/node_modules/playwright-core/index.d.ts +17 -0
  244. data/node/node_modules/playwright-core/index.js +32 -0
  245. data/node/node_modules/playwright-core/index.mjs +28 -0
  246. data/node/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
  247. data/node/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
  248. data/node/node_modules/playwright-core/lib/cli/driver.js +97 -0
  249. data/node/node_modules/playwright-core/lib/cli/program.js +589 -0
  250. data/node/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
  251. data/node/node_modules/playwright-core/lib/client/android.js +361 -0
  252. data/node/node_modules/playwright-core/lib/client/api.js +137 -0
  253. data/node/node_modules/playwright-core/lib/client/artifact.js +79 -0
  254. data/node/node_modules/playwright-core/lib/client/browser.js +161 -0
  255. data/node/node_modules/playwright-core/lib/client/browserContext.js +582 -0
  256. data/node/node_modules/playwright-core/lib/client/browserType.js +185 -0
  257. data/node/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
  258. data/node/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
  259. data/node/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
  260. data/node/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
  261. data/node/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
  262. data/node/node_modules/playwright-core/lib/client/clock.js +68 -0
  263. data/node/node_modules/playwright-core/lib/client/connection.js +318 -0
  264. data/node/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
  265. data/node/node_modules/playwright-core/lib/client/coverage.js +44 -0
  266. data/node/node_modules/playwright-core/lib/client/dialog.js +56 -0
  267. data/node/node_modules/playwright-core/lib/client/download.js +62 -0
  268. data/node/node_modules/playwright-core/lib/client/electron.js +138 -0
  269. data/node/node_modules/playwright-core/lib/client/elementHandle.js +284 -0
  270. data/node/node_modules/playwright-core/lib/client/errors.js +77 -0
  271. data/node/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
  272. data/node/node_modules/playwright-core/lib/client/events.js +103 -0
  273. data/node/node_modules/playwright-core/lib/client/fetch.js +368 -0
  274. data/node/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
  275. data/node/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
  276. data/node/node_modules/playwright-core/lib/client/frame.js +409 -0
  277. data/node/node_modules/playwright-core/lib/client/harRouter.js +87 -0
  278. data/node/node_modules/playwright-core/lib/client/input.js +84 -0
  279. data/node/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
  280. data/node/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
  281. data/node/node_modules/playwright-core/lib/client/localUtils.js +60 -0
  282. data/node/node_modules/playwright-core/lib/client/locator.js +369 -0
  283. data/node/node_modules/playwright-core/lib/client/network.js +747 -0
  284. data/node/node_modules/playwright-core/lib/client/page.js +745 -0
  285. data/node/node_modules/playwright-core/lib/client/pageAgent.js +64 -0
  286. data/node/node_modules/playwright-core/lib/client/platform.js +77 -0
  287. data/node/node_modules/playwright-core/lib/client/playwright.js +71 -0
  288. data/node/node_modules/playwright-core/lib/client/selectors.js +55 -0
  289. data/node/node_modules/playwright-core/lib/client/stream.js +39 -0
  290. data/node/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
  291. data/node/node_modules/playwright-core/lib/client/tracing.js +119 -0
  292. data/node/node_modules/playwright-core/lib/client/types.js +28 -0
  293. data/node/node_modules/playwright-core/lib/client/video.js +59 -0
  294. data/node/node_modules/playwright-core/lib/client/waiter.js +142 -0
  295. data/node/node_modules/playwright-core/lib/client/webError.js +39 -0
  296. data/node/node_modules/playwright-core/lib/client/webSocket.js +93 -0
  297. data/node/node_modules/playwright-core/lib/client/worker.js +85 -0
  298. data/node/node_modules/playwright-core/lib/client/writableStream.js +39 -0
  299. data/node/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
  300. data/node/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
  301. data/node/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
  302. data/node/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
  303. data/node/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
  304. data/node/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
  305. data/node/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
  306. data/node/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
  307. data/node/node_modules/playwright-core/lib/inprocess.js +3 -0
  308. data/node/node_modules/playwright-core/lib/mcpBundle.js +84 -0
  309. data/node/node_modules/playwright-core/lib/mcpBundleImpl/index.js +147 -0
  310. data/node/node_modules/playwright-core/lib/outofprocess.js +76 -0
  311. data/node/node_modules/playwright-core/lib/protocol/serializers.js +197 -0
  312. data/node/node_modules/playwright-core/lib/protocol/validator.js +2969 -0
  313. data/node/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
  314. data/node/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
  315. data/node/node_modules/playwright-core/lib/remote/playwrightServer.js +334 -0
  316. data/node/node_modules/playwright-core/lib/server/agent/actionRunner.js +335 -0
  317. data/node/node_modules/playwright-core/lib/server/agent/actions.js +128 -0
  318. data/node/node_modules/playwright-core/lib/server/agent/codegen.js +111 -0
  319. data/node/node_modules/playwright-core/lib/server/agent/context.js +150 -0
  320. data/node/node_modules/playwright-core/lib/server/agent/expectTools.js +156 -0
  321. data/node/node_modules/playwright-core/lib/server/agent/pageAgent.js +204 -0
  322. data/node/node_modules/playwright-core/lib/server/agent/performTools.js +262 -0
  323. data/node/node_modules/playwright-core/lib/server/agent/tool.js +109 -0
  324. data/node/node_modules/playwright-core/lib/server/android/android.js +465 -0
  325. data/node/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
  326. data/node/node_modules/playwright-core/lib/server/artifact.js +127 -0
  327. data/node/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +549 -0
  328. data/node/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +148 -0
  329. data/node/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +213 -0
  330. data/node/node_modules/playwright-core/lib/server/bidi/bidiDeserializer.js +116 -0
  331. data/node/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +267 -0
  332. data/node/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +128 -0
  333. data/node/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
  334. data/node/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
  335. data/node/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
  336. data/node/node_modules/playwright-core/lib/server/bidi/bidiPage.js +583 -0
  337. data/node/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
  338. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
  339. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
  340. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
  341. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
  342. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
  343. data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
  344. data/node/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
  345. data/node/node_modules/playwright-core/lib/server/browser.js +149 -0
  346. data/node/node_modules/playwright-core/lib/server/browserContext.js +702 -0
  347. data/node/node_modules/playwright-core/lib/server/browserType.js +336 -0
  348. data/node/node_modules/playwright-core/lib/server/callLog.js +82 -0
  349. data/node/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  350. data/node/node_modules/playwright-core/lib/server/chromium/chromium.js +395 -0
  351. data/node/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
  352. data/node/node_modules/playwright-core/lib/server/chromium/crBrowser.js +511 -0
  353. data/node/node_modules/playwright-core/lib/server/chromium/crConnection.js +197 -0
  354. data/node/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
  355. data/node/node_modules/playwright-core/lib/server/chromium/crDevTools.js +111 -0
  356. data/node/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
  357. data/node/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
  358. data/node/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
  359. data/node/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +707 -0
  360. data/node/node_modules/playwright-core/lib/server/chromium/crPage.js +1001 -0
  361. data/node/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
  362. data/node/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
  363. data/node/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
  364. data/node/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
  365. data/node/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
  366. data/node/node_modules/playwright-core/lib/server/clock.js +149 -0
  367. data/node/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
  368. data/node/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
  369. data/node/node_modules/playwright-core/lib/server/codegen/javascript.js +247 -0
  370. data/node/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
  371. data/node/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
  372. data/node/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
  373. data/node/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
  374. data/node/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
  375. data/node/node_modules/playwright-core/lib/server/console.js +57 -0
  376. data/node/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
  377. data/node/node_modules/playwright-core/lib/server/debugController.js +191 -0
  378. data/node/node_modules/playwright-core/lib/server/debugger.js +119 -0
  379. data/node/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
  380. data/node/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
  381. data/node/node_modules/playwright-core/lib/server/dialog.js +116 -0
  382. data/node/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
  383. data/node/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
  384. data/node/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +384 -0
  385. data/node/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
  386. data/node/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
  387. data/node/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
  388. data/node/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
  389. data/node/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
  390. data/node/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +364 -0
  391. data/node/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
  392. data/node/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
  393. data/node/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
  394. data/node/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
  395. data/node/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
  396. data/node/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
  397. data/node/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
  398. data/node/node_modules/playwright-core/lib/server/dispatchers/pageAgentDispatcher.js +96 -0
  399. data/node/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +393 -0
  400. data/node/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
  401. data/node/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
  402. data/node/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
  403. data/node/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
  404. data/node/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
  405. data/node/node_modules/playwright-core/lib/server/dom.js +815 -0
  406. data/node/node_modules/playwright-core/lib/server/download.js +70 -0
  407. data/node/node_modules/playwright-core/lib/server/electron/electron.js +273 -0
  408. data/node/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
  409. data/node/node_modules/playwright-core/lib/server/errors.js +69 -0
  410. data/node/node_modules/playwright-core/lib/server/fetch.js +621 -0
  411. data/node/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
  412. data/node/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
  413. data/node/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +418 -0
  414. data/node/node_modules/playwright-core/lib/server/firefox/ffConnection.js +142 -0
  415. data/node/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
  416. data/node/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
  417. data/node/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
  418. data/node/node_modules/playwright-core/lib/server/firefox/ffPage.js +497 -0
  419. data/node/node_modules/playwright-core/lib/server/firefox/firefox.js +114 -0
  420. data/node/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
  421. data/node/node_modules/playwright-core/lib/server/formData.js +147 -0
  422. data/node/node_modules/playwright-core/lib/server/frameSelectors.js +160 -0
  423. data/node/node_modules/playwright-core/lib/server/frames.js +1471 -0
  424. data/node/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
  425. data/node/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
  426. data/node/node_modules/playwright-core/lib/server/harBackend.js +157 -0
  427. data/node/node_modules/playwright-core/lib/server/helper.js +96 -0
  428. data/node/node_modules/playwright-core/lib/server/index.js +58 -0
  429. data/node/node_modules/playwright-core/lib/server/input.js +277 -0
  430. data/node/node_modules/playwright-core/lib/server/instrumentation.js +72 -0
  431. data/node/node_modules/playwright-core/lib/server/javascript.js +291 -0
  432. data/node/node_modules/playwright-core/lib/server/launchApp.js +128 -0
  433. data/node/node_modules/playwright-core/lib/server/localUtils.js +214 -0
  434. data/node/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
  435. data/node/node_modules/playwright-core/lib/server/network.js +667 -0
  436. data/node/node_modules/playwright-core/lib/server/page.js +830 -0
  437. data/node/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
  438. data/node/node_modules/playwright-core/lib/server/playwright.js +69 -0
  439. data/node/node_modules/playwright-core/lib/server/progress.js +132 -0
  440. data/node/node_modules/playwright-core/lib/server/protocolError.js +52 -0
  441. data/node/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
  442. data/node/node_modules/playwright-core/lib/server/recorder/recorderApp.js +366 -0
  443. data/node/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
  444. data/node/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
  445. data/node/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
  446. data/node/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
  447. data/node/node_modules/playwright-core/lib/server/recorder.js +499 -0
  448. data/node/node_modules/playwright-core/lib/server/registry/browserFetcher.js +177 -0
  449. data/node/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
  450. data/node/node_modules/playwright-core/lib/server/registry/index.js +1422 -0
  451. data/node/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
  452. data/node/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +127 -0
  453. data/node/node_modules/playwright-core/lib/server/screencast.js +190 -0
  454. data/node/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
  455. data/node/node_modules/playwright-core/lib/server/selectors.js +112 -0
  456. data/node/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
  457. data/node/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
  458. data/node/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
  459. data/node/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +561 -0
  460. data/node/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
  461. data/node/node_modules/playwright-core/lib/server/trace/viewer/traceParser.js +72 -0
  462. data/node/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +245 -0
  463. data/node/node_modules/playwright-core/lib/server/transport.js +181 -0
  464. data/node/node_modules/playwright-core/lib/server/types.js +28 -0
  465. data/node/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
  466. data/node/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
  467. data/node/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
  468. data/node/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
  469. data/node/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
  470. data/node/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
  471. data/node/node_modules/playwright-core/lib/server/utils/env.js +73 -0
  472. data/node/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
  473. data/node/node_modules/playwright-core/lib/server/utils/expectUtils.js +123 -0
  474. data/node/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
  475. data/node/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
  476. data/node/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
  477. data/node/node_modules/playwright-core/lib/server/utils/httpServer.js +203 -0
  478. data/node/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
  479. data/node/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
  480. data/node/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
  481. data/node/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
  482. data/node/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
  483. data/node/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
  484. data/node/node_modules/playwright-core/lib/server/utils/network.js +242 -0
  485. data/node/node_modules/playwright-core/lib/server/utils/nodePlatform.js +154 -0
  486. data/node/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
  487. data/node/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
  488. data/node/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
  489. data/node/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
  490. data/node/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
  491. data/node/node_modules/playwright-core/lib/server/utils/task.js +51 -0
  492. data/node/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
  493. data/node/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
  494. data/node/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
  495. data/node/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
  496. data/node/node_modules/playwright-core/lib/server/videoRecorder.js +124 -0
  497. data/node/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
  498. data/node/node_modules/playwright-core/lib/server/webkit/webkit.js +108 -0
  499. data/node/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +335 -0
  500. data/node/node_modules/playwright-core/lib/server/webkit/wkConnection.js +144 -0
  501. data/node/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
  502. data/node/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
  503. data/node/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +197 -0
  504. data/node/node_modules/playwright-core/lib/server/webkit/wkPage.js +1158 -0
  505. data/node/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
  506. data/node/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
  507. data/node/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
  508. data/node/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +455 -0
  509. data/node/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
  510. data/node/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
  511. data/node/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
  512. data/node/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
  513. data/node/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
  514. data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
  515. data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
  516. data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
  517. data/node/node_modules/playwright-core/lib/utils/isomorphic/lruCache.js +51 -0
  518. data/node/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
  519. data/node/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
  520. data/node/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
  521. data/node/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
  522. data/node/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +330 -0
  523. data/node/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
  524. data/node/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
  525. data/node/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
  526. data/node/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
  527. data/node/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +204 -0
  528. data/node/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
  529. data/node/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
  530. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/entries.js +16 -0
  531. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotRenderer.js +499 -0
  532. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
  533. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
  534. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceLoader.js +131 -0
  535. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModel.js +365 -0
  536. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModernizer.js +400 -0
  537. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
  538. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
  539. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
  540. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
  541. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
  542. data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
  543. data/node/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
  544. data/node/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
  545. data/node/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
  546. data/node/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
  547. data/node/node_modules/playwright-core/lib/utils/isomorphic/yaml.js +84 -0
  548. data/node/node_modules/playwright-core/lib/utils.js +111 -0
  549. data/node/node_modules/playwright-core/lib/utilsBundle.js +109 -0
  550. data/node/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
  551. data/node/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
  552. data/node/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
  553. data/node/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
  554. data/node/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DadYNm1I.js +32 -0
  555. data/node/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  556. data/node/node_modules/playwright-core/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -0
  557. data/node/node_modules/playwright-core/lib/vite/recorder/assets/index-BhTWtUlo.js +193 -0
  558. data/node/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  559. data/node/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  560. data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-a5XoALAZ.js +32 -0
  561. data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +266 -0
  562. data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
  563. data/node/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
  564. data/node/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  565. data/node/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +1 -0
  566. data/node/node_modules/playwright-core/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
  567. data/node/node_modules/playwright-core/lib/vite/traceViewer/index.Bk2uYQRV.js +2 -0
  568. data/node/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
  569. data/node/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  570. data/node/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  571. data/node/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
  572. data/node/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +5 -0
  573. data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
  574. data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +5 -0
  575. data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
  576. data/node/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
  577. data/node/node_modules/playwright-core/lib/zipBundle.js +34 -0
  578. data/node/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
  579. data/node/node_modules/playwright-core/package.json +43 -0
  580. data/node/node_modules/playwright-core/types/protocol.d.ts +23824 -0
  581. data/node/node_modules/playwright-core/types/structs.d.ts +45 -0
  582. data/node/node_modules/playwright-core/types/types.d.ts +22843 -0
  583. data/node/package-lock.json +72 -0
  584. data/node/package.json +14 -0
  585. data/node/src/index.js +215 -0
  586. data/rubycrawl.gemspec +29 -0
  587. data/spec/rubycrawl_spec.rb +51 -0
  588. data/spec/spec_helper.rb +11 -0
  589. metadata +645 -0
@@ -0,0 +1,1422 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var registry_exports = {};
30
+ __export(registry_exports, {
31
+ Registry: () => Registry,
32
+ browserDirectoryToMarkerFilePath: () => browserDirectoryToMarkerFilePath,
33
+ buildPlaywrightCLICommand: () => buildPlaywrightCLICommand,
34
+ findChromiumChannelBestEffort: () => findChromiumChannelBestEffort,
35
+ installBrowsersForNpmInstall: () => installBrowsersForNpmInstall,
36
+ registry: () => registry,
37
+ registryDirectory: () => registryDirectory,
38
+ writeDockerVersion: () => import_dependencies3.writeDockerVersion
39
+ });
40
+ module.exports = __toCommonJS(registry_exports);
41
+ var import_fs = __toESM(require("fs"));
42
+ var import_os = __toESM(require("os"));
43
+ var import_path = __toESM(require("path"));
44
+ var util = __toESM(require("util"));
45
+ var import_browserFetcher = require("./browserFetcher");
46
+ var import_dependencies = require("./dependencies");
47
+ var import_dependencies2 = require("./dependencies");
48
+ var import_utils = require("../../utils");
49
+ var import_ascii = require("../utils/ascii");
50
+ var import_debugLogger = require("../utils/debugLogger");
51
+ var import_hostPlatform = require("../utils/hostPlatform");
52
+ var import_network = require("../utils/network");
53
+ var import_spawnAsync = require("../utils/spawnAsync");
54
+ var import_userAgent = require("../utils/userAgent");
55
+ var import_utilsBundle = require("../../utilsBundle");
56
+ var import_fileUtils = require("../utils/fileUtils");
57
+ var import_dependencies3 = require("./dependencies");
58
+ const PACKAGE_PATH = import_path.default.join(__dirname, "..", "..", "..");
59
+ const BIN_PATH = import_path.default.join(__dirname, "..", "..", "..", "bin");
60
+ const PLAYWRIGHT_CDN_MIRRORS = [
61
+ "https://cdn.playwright.dev/dbazure/download/playwright",
62
+ // ESRP CDN
63
+ "https://playwright.download.prss.microsoft.com/dbazure/download/playwright",
64
+ // Directly hit ESRP CDN
65
+ "https://cdn.playwright.dev"
66
+ // Hit the Storage Bucket directly
67
+ ];
68
+ if (process.env.PW_TEST_CDN_THAT_SHOULD_WORK) {
69
+ for (let i = 0; i < PLAYWRIGHT_CDN_MIRRORS.length; i++) {
70
+ const cdn = PLAYWRIGHT_CDN_MIRRORS[i];
71
+ if (cdn !== process.env.PW_TEST_CDN_THAT_SHOULD_WORK) {
72
+ const parsedCDN = new URL(cdn);
73
+ parsedCDN.hostname = parsedCDN.hostname + ".does-not-resolve.playwright.dev";
74
+ PLAYWRIGHT_CDN_MIRRORS[i] = parsedCDN.toString();
75
+ }
76
+ }
77
+ }
78
+ const EXECUTABLE_PATHS = {
79
+ "chromium": {
80
+ "<unknown>": void 0,
81
+ "linux-x64": ["chrome-linux64", "chrome"],
82
+ "linux-arm64": ["chrome-linux", "chrome"],
83
+ // non-cft build
84
+ "mac-x64": ["chrome-mac-x64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
85
+ "mac-arm64": ["chrome-mac-arm64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
86
+ "win-x64": ["chrome-win64", "chrome.exe"]
87
+ },
88
+ "chromium-headless-shell": {
89
+ "<unknown>": void 0,
90
+ "linux-x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
91
+ "linux-arm64": ["chrome-linux", "headless_shell"],
92
+ // non-cft build
93
+ "mac-x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
94
+ "mac-arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
95
+ "win-x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
96
+ },
97
+ "chromium-tip-of-tree": {
98
+ "<unknown>": void 0,
99
+ "linux-x64": ["chrome-linux64", "chrome"],
100
+ "linux-arm64": ["chrome-linux", "chrome"],
101
+ // non-cft build
102
+ "mac-x64": ["chrome-mac-x64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
103
+ "mac-arm64": ["chrome-mac-arm64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
104
+ "win-x64": ["chrome-win64", "chrome.exe"]
105
+ },
106
+ "chromium-tip-of-tree-headless-shell": {
107
+ "<unknown>": void 0,
108
+ "linux-x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
109
+ "linux-arm64": ["chrome-linux", "headless_shell"],
110
+ // non-cft build
111
+ "mac-x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
112
+ "mac-arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
113
+ "win-x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
114
+ },
115
+ "firefox": {
116
+ "<unknown>": void 0,
117
+ "linux-x64": ["firefox", "firefox"],
118
+ "linux-arm64": ["firefox", "firefox"],
119
+ "mac-x64": ["firefox", "Nightly.app", "Contents", "MacOS", "firefox"],
120
+ "mac-arm64": ["firefox", "Nightly.app", "Contents", "MacOS", "firefox"],
121
+ "win-x64": ["firefox", "firefox.exe"]
122
+ },
123
+ "webkit": {
124
+ "<unknown>": void 0,
125
+ "linux-x64": ["pw_run.sh"],
126
+ "linux-arm64": ["pw_run.sh"],
127
+ "mac-x64": ["pw_run.sh"],
128
+ "mac-arm64": ["pw_run.sh"],
129
+ "win-x64": ["Playwright.exe"]
130
+ },
131
+ "ffmpeg": {
132
+ "<unknown>": void 0,
133
+ "linux-x64": ["ffmpeg-linux"],
134
+ "linux-arm64": ["ffmpeg-linux"],
135
+ "mac-x64": ["ffmpeg-mac"],
136
+ "mac-arm64": ["ffmpeg-mac"],
137
+ "win-x64": ["ffmpeg-win64.exe"]
138
+ },
139
+ "winldd": {
140
+ "<unknown>": void 0,
141
+ "linux-x64": void 0,
142
+ "linux-arm64": void 0,
143
+ "mac-x64": void 0,
144
+ "mac-arm64": void 0,
145
+ "win-x64": ["PrintDeps.exe"]
146
+ }
147
+ };
148
+ function cftUrl(suffix) {
149
+ return ({ browserVersion }) => {
150
+ return {
151
+ path: `${browserVersion}/${suffix}`,
152
+ mirrors: [
153
+ "https://cdn.playwright.dev/chrome-for-testing-public"
154
+ ]
155
+ };
156
+ };
157
+ }
158
+ const DOWNLOAD_PATHS = {
159
+ "chromium": {
160
+ "<unknown>": void 0,
161
+ "ubuntu18.04-x64": void 0,
162
+ "ubuntu20.04-x64": cftUrl("linux64/chrome-linux64.zip"),
163
+ "ubuntu22.04-x64": cftUrl("linux64/chrome-linux64.zip"),
164
+ "ubuntu24.04-x64": cftUrl("linux64/chrome-linux64.zip"),
165
+ "ubuntu18.04-arm64": void 0,
166
+ "ubuntu20.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
167
+ "ubuntu22.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
168
+ "ubuntu24.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
169
+ "debian11-x64": cftUrl("linux64/chrome-linux64.zip"),
170
+ "debian11-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
171
+ "debian12-x64": cftUrl("linux64/chrome-linux64.zip"),
172
+ "debian12-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
173
+ "debian13-x64": cftUrl("linux64/chrome-linux64.zip"),
174
+ "debian13-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
175
+ "mac10.13": cftUrl("mac-x64/chrome-mac-x64.zip"),
176
+ "mac10.14": cftUrl("mac-x64/chrome-mac-x64.zip"),
177
+ "mac10.15": cftUrl("mac-x64/chrome-mac-x64.zip"),
178
+ "mac11": cftUrl("mac-x64/chrome-mac-x64.zip"),
179
+ "mac11-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
180
+ "mac12": cftUrl("mac-x64/chrome-mac-x64.zip"),
181
+ "mac12-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
182
+ "mac13": cftUrl("mac-x64/chrome-mac-x64.zip"),
183
+ "mac13-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
184
+ "mac14": cftUrl("mac-x64/chrome-mac-x64.zip"),
185
+ "mac14-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
186
+ "mac15": cftUrl("mac-x64/chrome-mac-x64.zip"),
187
+ "mac15-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
188
+ "win64": cftUrl("win64/chrome-win64.zip")
189
+ },
190
+ "chromium-headless-shell": {
191
+ "<unknown>": void 0,
192
+ "ubuntu18.04-x64": void 0,
193
+ "ubuntu20.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
194
+ "ubuntu22.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
195
+ "ubuntu24.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
196
+ "ubuntu18.04-arm64": void 0,
197
+ "ubuntu20.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
198
+ "ubuntu22.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
199
+ "ubuntu24.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
200
+ "debian11-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
201
+ "debian11-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
202
+ "debian12-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
203
+ "debian12-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
204
+ "debian13-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
205
+ "debian13-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
206
+ "mac10.13": void 0,
207
+ "mac10.14": void 0,
208
+ "mac10.15": void 0,
209
+ "mac11": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
210
+ "mac11-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
211
+ "mac12": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
212
+ "mac12-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
213
+ "mac13": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
214
+ "mac13-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
215
+ "mac14": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
216
+ "mac14-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
217
+ "mac15": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
218
+ "mac15-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
219
+ "win64": cftUrl("win64/chrome-headless-shell-win64.zip")
220
+ },
221
+ "chromium-tip-of-tree": {
222
+ "<unknown>": void 0,
223
+ "ubuntu18.04-x64": void 0,
224
+ "ubuntu20.04-x64": cftUrl("linux64/chrome-linux64.zip"),
225
+ "ubuntu22.04-x64": cftUrl("linux64/chrome-linux64.zip"),
226
+ "ubuntu24.04-x64": cftUrl("linux64/chrome-linux64.zip"),
227
+ "ubuntu18.04-arm64": void 0,
228
+ "ubuntu20.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
229
+ "ubuntu22.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
230
+ "ubuntu24.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
231
+ "debian11-x64": cftUrl("linux64/chrome-linux64.zip"),
232
+ "debian11-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
233
+ "debian12-x64": cftUrl("linux64/chrome-linux64.zip"),
234
+ "debian12-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
235
+ "debian13-x64": cftUrl("linux64/chrome-linux64.zip"),
236
+ "debian13-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
237
+ "mac10.13": cftUrl("mac-x64/chrome-mac-x64.zip"),
238
+ "mac10.14": cftUrl("mac-x64/chrome-mac-x64.zip"),
239
+ "mac10.15": cftUrl("mac-x64/chrome-mac-x64.zip"),
240
+ "mac11": cftUrl("mac-x64/chrome-mac-x64.zip"),
241
+ "mac11-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
242
+ "mac12": cftUrl("mac-x64/chrome-mac-x64.zip"),
243
+ "mac12-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
244
+ "mac13": cftUrl("mac-x64/chrome-mac-x64.zip"),
245
+ "mac13-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
246
+ "mac14": cftUrl("mac-x64/chrome-mac-x64.zip"),
247
+ "mac14-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
248
+ "mac15": cftUrl("mac-x64/chrome-mac-x64.zip"),
249
+ "mac15-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
250
+ "win64": cftUrl("win64/chrome-win64.zip")
251
+ },
252
+ "chromium-tip-of-tree-headless-shell": {
253
+ "<unknown>": void 0,
254
+ "ubuntu18.04-x64": void 0,
255
+ "ubuntu20.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
256
+ "ubuntu22.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
257
+ "ubuntu24.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
258
+ "ubuntu18.04-arm64": void 0,
259
+ "ubuntu20.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
260
+ "ubuntu22.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
261
+ "ubuntu24.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
262
+ "debian11-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
263
+ "debian11-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
264
+ "debian12-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
265
+ "debian12-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
266
+ "debian13-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
267
+ "debian13-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
268
+ "mac10.13": void 0,
269
+ "mac10.14": void 0,
270
+ "mac10.15": void 0,
271
+ "mac11": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
272
+ "mac11-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
273
+ "mac12": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
274
+ "mac12-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
275
+ "mac13": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
276
+ "mac13-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
277
+ "mac14": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
278
+ "mac14-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
279
+ "mac15": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
280
+ "mac15-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
281
+ "win64": cftUrl("win64/chrome-headless-shell-win64.zip")
282
+ },
283
+ "firefox": {
284
+ "<unknown>": void 0,
285
+ "ubuntu18.04-x64": void 0,
286
+ "ubuntu20.04-x64": "builds/firefox/%s/firefox-ubuntu-20.04.zip",
287
+ "ubuntu22.04-x64": "builds/firefox/%s/firefox-ubuntu-22.04.zip",
288
+ "ubuntu24.04-x64": "builds/firefox/%s/firefox-ubuntu-24.04.zip",
289
+ "ubuntu18.04-arm64": void 0,
290
+ "ubuntu20.04-arm64": "builds/firefox/%s/firefox-ubuntu-20.04-arm64.zip",
291
+ "ubuntu22.04-arm64": "builds/firefox/%s/firefox-ubuntu-22.04-arm64.zip",
292
+ "ubuntu24.04-arm64": "builds/firefox/%s/firefox-ubuntu-24.04-arm64.zip",
293
+ "debian11-x64": "builds/firefox/%s/firefox-debian-11.zip",
294
+ "debian11-arm64": "builds/firefox/%s/firefox-debian-11-arm64.zip",
295
+ "debian12-x64": "builds/firefox/%s/firefox-debian-12.zip",
296
+ "debian12-arm64": "builds/firefox/%s/firefox-debian-12-arm64.zip",
297
+ "debian13-x64": "builds/firefox/%s/firefox-debian-13.zip",
298
+ "debian13-arm64": "builds/firefox/%s/firefox-debian-13-arm64.zip",
299
+ "mac10.13": "builds/firefox/%s/firefox-mac.zip",
300
+ "mac10.14": "builds/firefox/%s/firefox-mac.zip",
301
+ "mac10.15": "builds/firefox/%s/firefox-mac.zip",
302
+ "mac11": "builds/firefox/%s/firefox-mac.zip",
303
+ "mac11-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
304
+ "mac12": "builds/firefox/%s/firefox-mac.zip",
305
+ "mac12-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
306
+ "mac13": "builds/firefox/%s/firefox-mac.zip",
307
+ "mac13-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
308
+ "mac14": "builds/firefox/%s/firefox-mac.zip",
309
+ "mac14-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
310
+ "mac15": "builds/firefox/%s/firefox-mac.zip",
311
+ "mac15-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
312
+ "win64": "builds/firefox/%s/firefox-win64.zip"
313
+ },
314
+ "firefox-beta": {
315
+ "<unknown>": void 0,
316
+ "ubuntu18.04-x64": void 0,
317
+ "ubuntu20.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip",
318
+ "ubuntu22.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip",
319
+ "ubuntu24.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04.zip",
320
+ "ubuntu18.04-arm64": void 0,
321
+ "ubuntu20.04-arm64": void 0,
322
+ "ubuntu22.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04-arm64.zip",
323
+ "ubuntu24.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04-arm64.zip",
324
+ "debian11-x64": "builds/firefox-beta/%s/firefox-beta-debian-11.zip",
325
+ "debian11-arm64": "builds/firefox-beta/%s/firefox-beta-debian-11-arm64.zip",
326
+ "debian12-x64": "builds/firefox-beta/%s/firefox-beta-debian-12.zip",
327
+ "debian12-arm64": "builds/firefox-beta/%s/firefox-beta-debian-12-arm64.zip",
328
+ "debian13-x64": "builds/firefox-beta/%s/firefox-beta-debian-12.zip",
329
+ "debian13-arm64": "builds/firefox-beta/%s/firefox-beta-debian-12-arm64.zip",
330
+ "mac10.13": "builds/firefox-beta/%s/firefox-beta-mac.zip",
331
+ "mac10.14": "builds/firefox-beta/%s/firefox-beta-mac.zip",
332
+ "mac10.15": "builds/firefox-beta/%s/firefox-beta-mac.zip",
333
+ "mac11": "builds/firefox-beta/%s/firefox-beta-mac.zip",
334
+ "mac11-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
335
+ "mac12": "builds/firefox-beta/%s/firefox-beta-mac.zip",
336
+ "mac12-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
337
+ "mac13": "builds/firefox-beta/%s/firefox-beta-mac.zip",
338
+ "mac13-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
339
+ "mac14": "builds/firefox-beta/%s/firefox-beta-mac.zip",
340
+ "mac14-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
341
+ "mac15": "builds/firefox-beta/%s/firefox-beta-mac.zip",
342
+ "mac15-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
343
+ "win64": "builds/firefox-beta/%s/firefox-beta-win64.zip"
344
+ },
345
+ "webkit": {
346
+ "<unknown>": void 0,
347
+ "ubuntu18.04-x64": void 0,
348
+ "ubuntu20.04-x64": "builds/webkit/%s/webkit-ubuntu-20.04.zip",
349
+ "ubuntu22.04-x64": "builds/webkit/%s/webkit-ubuntu-22.04.zip",
350
+ "ubuntu24.04-x64": "builds/webkit/%s/webkit-ubuntu-24.04.zip",
351
+ "ubuntu18.04-arm64": void 0,
352
+ "ubuntu20.04-arm64": "builds/webkit/%s/webkit-ubuntu-20.04-arm64.zip",
353
+ "ubuntu22.04-arm64": "builds/webkit/%s/webkit-ubuntu-22.04-arm64.zip",
354
+ "ubuntu24.04-arm64": "builds/webkit/%s/webkit-ubuntu-24.04-arm64.zip",
355
+ "debian11-x64": "builds/webkit/%s/webkit-debian-11.zip",
356
+ "debian11-arm64": "builds/webkit/%s/webkit-debian-11-arm64.zip",
357
+ "debian12-x64": "builds/webkit/%s/webkit-debian-12.zip",
358
+ "debian12-arm64": "builds/webkit/%s/webkit-debian-12-arm64.zip",
359
+ "debian13-x64": "builds/webkit/%s/webkit-debian-13.zip",
360
+ "debian13-arm64": "builds/webkit/%s/webkit-debian-13-arm64.zip",
361
+ "mac10.13": void 0,
362
+ "mac10.14": void 0,
363
+ "mac10.15": void 0,
364
+ "mac11": void 0,
365
+ "mac11-arm64": void 0,
366
+ "mac12": void 0,
367
+ "mac12-arm64": void 0,
368
+ "mac13": void 0,
369
+ "mac13-arm64": void 0,
370
+ "mac14": "builds/webkit/%s/webkit-mac-14.zip",
371
+ "mac14-arm64": "builds/webkit/%s/webkit-mac-14-arm64.zip",
372
+ "mac15": "builds/webkit/%s/webkit-mac-15.zip",
373
+ "mac15-arm64": "builds/webkit/%s/webkit-mac-15-arm64.zip",
374
+ "win64": "builds/webkit/%s/webkit-win64.zip"
375
+ },
376
+ "ffmpeg": {
377
+ "<unknown>": void 0,
378
+ "ubuntu18.04-x64": void 0,
379
+ "ubuntu20.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
380
+ "ubuntu22.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
381
+ "ubuntu24.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
382
+ "ubuntu18.04-arm64": void 0,
383
+ "ubuntu20.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
384
+ "ubuntu22.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
385
+ "ubuntu24.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
386
+ "debian11-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
387
+ "debian11-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
388
+ "debian12-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
389
+ "debian12-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
390
+ "debian13-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
391
+ "debian13-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
392
+ "mac10.13": "builds/ffmpeg/%s/ffmpeg-mac.zip",
393
+ "mac10.14": "builds/ffmpeg/%s/ffmpeg-mac.zip",
394
+ "mac10.15": "builds/ffmpeg/%s/ffmpeg-mac.zip",
395
+ "mac11": "builds/ffmpeg/%s/ffmpeg-mac.zip",
396
+ "mac11-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
397
+ "mac12": "builds/ffmpeg/%s/ffmpeg-mac.zip",
398
+ "mac12-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
399
+ "mac13": "builds/ffmpeg/%s/ffmpeg-mac.zip",
400
+ "mac13-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
401
+ "mac14": "builds/ffmpeg/%s/ffmpeg-mac.zip",
402
+ "mac14-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
403
+ "mac15": "builds/ffmpeg/%s/ffmpeg-mac.zip",
404
+ "mac15-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
405
+ "win64": "builds/ffmpeg/%s/ffmpeg-win64.zip"
406
+ },
407
+ "winldd": {
408
+ "<unknown>": void 0,
409
+ "ubuntu18.04-x64": void 0,
410
+ "ubuntu20.04-x64": void 0,
411
+ "ubuntu22.04-x64": void 0,
412
+ "ubuntu24.04-x64": void 0,
413
+ "ubuntu18.04-arm64": void 0,
414
+ "ubuntu20.04-arm64": void 0,
415
+ "ubuntu22.04-arm64": void 0,
416
+ "ubuntu24.04-arm64": void 0,
417
+ "debian11-x64": void 0,
418
+ "debian11-arm64": void 0,
419
+ "debian12-x64": void 0,
420
+ "debian12-arm64": void 0,
421
+ "debian13-x64": void 0,
422
+ "debian13-arm64": void 0,
423
+ "mac10.13": void 0,
424
+ "mac10.14": void 0,
425
+ "mac10.15": void 0,
426
+ "mac11": void 0,
427
+ "mac11-arm64": void 0,
428
+ "mac12": void 0,
429
+ "mac12-arm64": void 0,
430
+ "mac13": void 0,
431
+ "mac13-arm64": void 0,
432
+ "mac14": void 0,
433
+ "mac14-arm64": void 0,
434
+ "mac15": void 0,
435
+ "mac15-arm64": void 0,
436
+ "win64": "builds/winldd/%s/winldd-win64.zip"
437
+ },
438
+ "android": {
439
+ "<unknown>": "builds/android/%s/android.zip",
440
+ "ubuntu18.04-x64": void 0,
441
+ "ubuntu20.04-x64": "builds/android/%s/android.zip",
442
+ "ubuntu22.04-x64": "builds/android/%s/android.zip",
443
+ "ubuntu24.04-x64": "builds/android/%s/android.zip",
444
+ "ubuntu18.04-arm64": void 0,
445
+ "ubuntu20.04-arm64": "builds/android/%s/android.zip",
446
+ "ubuntu22.04-arm64": "builds/android/%s/android.zip",
447
+ "ubuntu24.04-arm64": "builds/android/%s/android.zip",
448
+ "debian11-x64": "builds/android/%s/android.zip",
449
+ "debian11-arm64": "builds/android/%s/android.zip",
450
+ "debian12-x64": "builds/android/%s/android.zip",
451
+ "debian12-arm64": "builds/android/%s/android.zip",
452
+ "debian13-x64": "builds/android/%s/android.zip",
453
+ "debian13-arm64": "builds/android/%s/android.zip",
454
+ "mac10.13": "builds/android/%s/android.zip",
455
+ "mac10.14": "builds/android/%s/android.zip",
456
+ "mac10.15": "builds/android/%s/android.zip",
457
+ "mac11": "builds/android/%s/android.zip",
458
+ "mac11-arm64": "builds/android/%s/android.zip",
459
+ "mac12": "builds/android/%s/android.zip",
460
+ "mac12-arm64": "builds/android/%s/android.zip",
461
+ "mac13": "builds/android/%s/android.zip",
462
+ "mac13-arm64": "builds/android/%s/android.zip",
463
+ "mac14": "builds/android/%s/android.zip",
464
+ "mac14-arm64": "builds/android/%s/android.zip",
465
+ "mac15": "builds/android/%s/android.zip",
466
+ "mac15-arm64": "builds/android/%s/android.zip",
467
+ "win64": "builds/android/%s/android.zip"
468
+ }
469
+ };
470
+ const registryDirectory = (() => {
471
+ let result;
472
+ const envDefined = (0, import_utils.getFromENV)("PLAYWRIGHT_BROWSERS_PATH");
473
+ if (envDefined === "0") {
474
+ result = import_path.default.join(__dirname, "..", "..", "..", ".local-browsers");
475
+ } else if (envDefined) {
476
+ result = envDefined;
477
+ } else {
478
+ let cacheDirectory;
479
+ if (process.platform === "linux")
480
+ cacheDirectory = process.env.XDG_CACHE_HOME || import_path.default.join(import_os.default.homedir(), ".cache");
481
+ else if (process.platform === "darwin")
482
+ cacheDirectory = import_path.default.join(import_os.default.homedir(), "Library", "Caches");
483
+ else if (process.platform === "win32")
484
+ cacheDirectory = process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local");
485
+ else
486
+ throw new Error("Unsupported platform: " + process.platform);
487
+ result = import_path.default.join(cacheDirectory, "ms-playwright");
488
+ }
489
+ if (!import_path.default.isAbsolute(result)) {
490
+ result = import_path.default.resolve((0, import_utils.getFromENV)("INIT_CWD") || process.cwd(), result);
491
+ }
492
+ return result;
493
+ })();
494
+ function isBrowserDirectory(browserDirectory) {
495
+ const baseName = import_path.default.basename(browserDirectory);
496
+ for (const browserName of allDownloadableDirectoriesThatEverExisted) {
497
+ if (baseName.startsWith(browserName.replace(/-/g, "_") + "-"))
498
+ return true;
499
+ }
500
+ return false;
501
+ }
502
+ function readDescriptors(browsersJSON) {
503
+ return browsersJSON["browsers"].map((obj) => {
504
+ const name = obj.name;
505
+ const revisionOverride = (obj.revisionOverrides || {})[import_hostPlatform.hostPlatform];
506
+ const revision = revisionOverride || obj.revision;
507
+ const browserDirectoryPrefix = revisionOverride ? `${name}_${import_hostPlatform.hostPlatform}_special` : `${name}`;
508
+ const descriptor = {
509
+ name,
510
+ revision,
511
+ hasRevisionOverride: !!revisionOverride,
512
+ // We only put browser version for the supported operating systems.
513
+ browserVersion: revisionOverride ? void 0 : obj.browserVersion,
514
+ title: obj["title"],
515
+ installByDefault: !!obj.installByDefault,
516
+ // Method `isBrowserDirectory` determines directory to be browser iff
517
+ // it starts with some browser name followed by '-'. Some browser names
518
+ // are prefixes of others, e.g. 'webkit' is a prefix of `webkit-technology-preview`.
519
+ // To avoid older registries erroneously removing 'webkit-technology-preview', we have to
520
+ // ensure that browser folders to never include dashes inside.
521
+ dir: import_path.default.join(registryDirectory, browserDirectoryPrefix.replace(/-/g, "_") + "-" + revision)
522
+ };
523
+ return descriptor;
524
+ });
525
+ }
526
+ const allDownloadableDirectoriesThatEverExisted = ["android", "chromium", "firefox", "webkit", "ffmpeg", "firefox-beta", "chromium-tip-of-tree", "chromium-headless-shell", "chromium-tip-of-tree-headless-shell", "winldd"];
527
+ const chromiumAliases = ["bidi-chromium", "chrome-for-testing"];
528
+ class Registry {
529
+ constructor(browsersJSON) {
530
+ const descriptors = readDescriptors(browsersJSON);
531
+ const findExecutablePath = (dir, name) => {
532
+ const tokens = EXECUTABLE_PATHS[name][import_hostPlatform.shortPlatform];
533
+ return tokens ? import_path.default.join(dir, ...tokens) : void 0;
534
+ };
535
+ const executablePathOrDie = (name, e, installByDefault, sdkLanguage) => {
536
+ if (!e)
537
+ throw new Error(`${name} is not supported on ${import_hostPlatform.hostPlatform}`);
538
+ const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install${installByDefault ? "" : " " + name}`);
539
+ if (!(0, import_fileUtils.canAccessFile)(e)) {
540
+ const currentDockerVersion = (0, import_dependencies.readDockerVersionSync)();
541
+ const preferredDockerVersion = currentDockerVersion ? (0, import_dependencies.dockerVersion)(currentDockerVersion.dockerImageNameTemplate) : null;
542
+ const isOutdatedDockerImage = currentDockerVersion && preferredDockerVersion && currentDockerVersion.dockerImageName !== preferredDockerVersion.dockerImageName;
543
+ const prettyMessage = isOutdatedDockerImage ? [
544
+ `Looks like ${sdkLanguage === "javascript" ? "Playwright Test or " : ""}Playwright was just updated to ${preferredDockerVersion.driverVersion}.`,
545
+ `Please update docker image as well.`,
546
+ `- current: ${currentDockerVersion.dockerImageName}`,
547
+ `- required: ${preferredDockerVersion.dockerImageName}`,
548
+ ``,
549
+ `<3 Playwright Team`
550
+ ].join("\n") : [
551
+ `Looks like ${sdkLanguage === "javascript" ? "Playwright Test or " : ""}Playwright was just installed or updated.`,
552
+ `Please run the following command to download new browser${installByDefault ? "s" : ""}:`,
553
+ ``,
554
+ ` ${installCommand}`,
555
+ ``,
556
+ `<3 Playwright Team`
557
+ ].join("\n");
558
+ throw new Error(`Executable doesn't exist at ${e}
559
+ ${(0, import_ascii.wrapInASCIIBox)(prettyMessage, 1)}`);
560
+ }
561
+ return e;
562
+ };
563
+ this._executables = [];
564
+ const chromium = descriptors.find((d) => d.name === "chromium");
565
+ const chromiumExecutable = findExecutablePath(chromium.dir, "chromium");
566
+ this._executables.push({
567
+ name: "chromium",
568
+ browserName: "chromium",
569
+ directory: chromium.dir,
570
+ executablePath: () => chromiumExecutable,
571
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumExecutable, chromium.installByDefault, sdkLanguage),
572
+ installType: chromium.installByDefault ? "download-by-default" : "download-on-demand",
573
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromium.dir, ["chrome-linux"], [], ["chrome-win"]),
574
+ downloadURLs: this._downloadURLs(chromium),
575
+ title: chromium.title,
576
+ revision: chromium.revision,
577
+ browserVersion: chromium.browserVersion,
578
+ _install: (force) => this._downloadExecutable(chromium, force, chromiumExecutable),
579
+ _dependencyGroup: "chromium",
580
+ _isHermeticInstallation: true
581
+ });
582
+ const chromiumHeadlessShell = descriptors.find((d) => d.name === "chromium-headless-shell");
583
+ const chromiumHeadlessShellExecutable = findExecutablePath(chromiumHeadlessShell.dir, "chromium-headless-shell");
584
+ this._executables.push({
585
+ name: "chromium-headless-shell",
586
+ browserName: "chromium",
587
+ directory: chromiumHeadlessShell.dir,
588
+ executablePath: () => chromiumHeadlessShellExecutable,
589
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumHeadlessShellExecutable, chromiumHeadlessShell.installByDefault, sdkLanguage),
590
+ installType: chromiumHeadlessShell.installByDefault ? "download-by-default" : "download-on-demand",
591
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumHeadlessShell.dir, ["chrome-linux"], [], ["chrome-win"]),
592
+ downloadURLs: this._downloadURLs(chromiumHeadlessShell),
593
+ title: chromiumHeadlessShell.title,
594
+ revision: chromiumHeadlessShell.revision,
595
+ browserVersion: chromiumHeadlessShell.browserVersion,
596
+ _install: (force) => this._downloadExecutable(chromiumHeadlessShell, force, chromiumHeadlessShellExecutable),
597
+ _dependencyGroup: "chromium",
598
+ _isHermeticInstallation: true
599
+ });
600
+ const chromiumTipOfTreeHeadlessShell = descriptors.find((d) => d.name === "chromium-tip-of-tree-headless-shell");
601
+ const chromiumTipOfTreeHeadlessShellExecutable = findExecutablePath(chromiumTipOfTreeHeadlessShell.dir, "chromium-tip-of-tree-headless-shell");
602
+ this._executables.push({
603
+ name: "chromium-tip-of-tree-headless-shell",
604
+ browserName: "chromium",
605
+ directory: chromiumTipOfTreeHeadlessShell.dir,
606
+ executablePath: () => chromiumTipOfTreeHeadlessShellExecutable,
607
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumTipOfTreeHeadlessShellExecutable, chromiumTipOfTreeHeadlessShell.installByDefault, sdkLanguage),
608
+ installType: chromiumTipOfTreeHeadlessShell.installByDefault ? "download-by-default" : "download-on-demand",
609
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumTipOfTreeHeadlessShell.dir, ["chrome-linux"], [], ["chrome-win"]),
610
+ downloadURLs: this._downloadURLs(chromiumTipOfTreeHeadlessShell),
611
+ title: chromiumTipOfTreeHeadlessShell.title,
612
+ revision: chromiumTipOfTreeHeadlessShell.revision,
613
+ browserVersion: chromiumTipOfTreeHeadlessShell.browserVersion,
614
+ _install: (force) => this._downloadExecutable(chromiumTipOfTreeHeadlessShell, force, chromiumTipOfTreeHeadlessShellExecutable),
615
+ _dependencyGroup: "chromium",
616
+ _isHermeticInstallation: true
617
+ });
618
+ const chromiumTipOfTree = descriptors.find((d) => d.name === "chromium-tip-of-tree");
619
+ const chromiumTipOfTreeExecutable = findExecutablePath(chromiumTipOfTree.dir, "chromium-tip-of-tree");
620
+ this._executables.push({
621
+ name: "chromium-tip-of-tree",
622
+ browserName: "chromium",
623
+ directory: chromiumTipOfTree.dir,
624
+ executablePath: () => chromiumTipOfTreeExecutable,
625
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium-tip-of-tree", chromiumTipOfTreeExecutable, chromiumTipOfTree.installByDefault, sdkLanguage),
626
+ installType: chromiumTipOfTree.installByDefault ? "download-by-default" : "download-on-demand",
627
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumTipOfTree.dir, ["chrome-linux"], [], ["chrome-win"]),
628
+ downloadURLs: this._downloadURLs(chromiumTipOfTree),
629
+ title: chromiumTipOfTree.title,
630
+ revision: chromiumTipOfTree.revision,
631
+ browserVersion: chromiumTipOfTree.browserVersion,
632
+ _install: (force) => this._downloadExecutable(chromiumTipOfTree, force, chromiumTipOfTreeExecutable),
633
+ _dependencyGroup: "chromium",
634
+ _isHermeticInstallation: true
635
+ });
636
+ this._executables.push(this._createChromiumChannel("chrome", {
637
+ "linux": "/opt/google/chrome/chrome",
638
+ "darwin": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
639
+ "win32": `\\Google\\Chrome\\Application\\chrome.exe`
640
+ }, () => this._installChromiumChannel("chrome", {
641
+ "linux": "reinstall_chrome_stable_linux.sh",
642
+ "darwin": "reinstall_chrome_stable_mac.sh",
643
+ "win32": "reinstall_chrome_stable_win.ps1"
644
+ })));
645
+ this._executables.push(this._createChromiumChannel("chrome-beta", {
646
+ "linux": "/opt/google/chrome-beta/chrome",
647
+ "darwin": "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",
648
+ "win32": `\\Google\\Chrome Beta\\Application\\chrome.exe`
649
+ }, () => this._installChromiumChannel("chrome-beta", {
650
+ "linux": "reinstall_chrome_beta_linux.sh",
651
+ "darwin": "reinstall_chrome_beta_mac.sh",
652
+ "win32": "reinstall_chrome_beta_win.ps1"
653
+ })));
654
+ this._executables.push(this._createChromiumChannel("chrome-dev", {
655
+ "linux": "/opt/google/chrome-unstable/chrome",
656
+ "darwin": "/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",
657
+ "win32": `\\Google\\Chrome Dev\\Application\\chrome.exe`
658
+ }));
659
+ this._executables.push(this._createChromiumChannel("chrome-canary", {
660
+ "linux": "/opt/google/chrome-canary/chrome",
661
+ "darwin": "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
662
+ "win32": `\\Google\\Chrome SxS\\Application\\chrome.exe`
663
+ }));
664
+ this._executables.push(this._createChromiumChannel("msedge", {
665
+ "linux": "/opt/microsoft/msedge/msedge",
666
+ "darwin": "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
667
+ "win32": `\\Microsoft\\Edge\\Application\\msedge.exe`
668
+ }, () => this._installMSEdgeChannel("msedge", {
669
+ "linux": "reinstall_msedge_stable_linux.sh",
670
+ "darwin": "reinstall_msedge_stable_mac.sh",
671
+ "win32": "reinstall_msedge_stable_win.ps1"
672
+ })));
673
+ this._executables.push(this._createChromiumChannel("msedge-beta", {
674
+ "linux": "/opt/microsoft/msedge-beta/msedge",
675
+ "darwin": "/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",
676
+ "win32": `\\Microsoft\\Edge Beta\\Application\\msedge.exe`
677
+ }, () => this._installMSEdgeChannel("msedge-beta", {
678
+ "darwin": "reinstall_msedge_beta_mac.sh",
679
+ "linux": "reinstall_msedge_beta_linux.sh",
680
+ "win32": "reinstall_msedge_beta_win.ps1"
681
+ })));
682
+ this._executables.push(this._createChromiumChannel("msedge-dev", {
683
+ "linux": "/opt/microsoft/msedge-dev/msedge",
684
+ "darwin": "/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",
685
+ "win32": `\\Microsoft\\Edge Dev\\Application\\msedge.exe`
686
+ }, () => this._installMSEdgeChannel("msedge-dev", {
687
+ "darwin": "reinstall_msedge_dev_mac.sh",
688
+ "linux": "reinstall_msedge_dev_linux.sh",
689
+ "win32": "reinstall_msedge_dev_win.ps1"
690
+ })));
691
+ this._executables.push(this._createChromiumChannel("msedge-canary", {
692
+ "linux": "",
693
+ "darwin": "/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",
694
+ "win32": `\\Microsoft\\Edge SxS\\Application\\msedge.exe`
695
+ }));
696
+ this._executables.push(this._createBidiFirefoxChannel("moz-firefox", {
697
+ "linux": "/snap/bin/firefox",
698
+ "darwin": "/Applications/Firefox.app/Contents/MacOS/firefox",
699
+ "win32": "\\Mozilla Firefox\\firefox.exe"
700
+ }));
701
+ this._executables.push(this._createBidiFirefoxChannel("moz-firefox-beta", {
702
+ "linux": "/opt/firefox-beta/firefox",
703
+ "darwin": "/Applications/Firefox.app/Contents/MacOS/firefox",
704
+ "win32": "\\Mozilla Firefox\\firefox.exe"
705
+ }));
706
+ this._executables.push(this._createBidiFirefoxChannel("moz-firefox-nightly", {
707
+ "linux": "/opt/firefox-nightly/firefox",
708
+ "darwin": "/Applications/Firefox Nightly.app/Contents/MacOS/firefox",
709
+ "win32": "\\Mozilla Firefox\\firefox.exe"
710
+ }));
711
+ this._executables.push(this._createBidiChromiumChannel("bidi-chrome-stable", {
712
+ "linux": "/opt/google/chrome/chrome",
713
+ "darwin": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
714
+ "win32": `\\Google\\Chrome\\Application\\chrome.exe`
715
+ }));
716
+ this._executables.push(this._createBidiChromiumChannel("bidi-chrome-canary", {
717
+ "linux": "/opt/google/chrome-canary/chrome",
718
+ "darwin": "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
719
+ "win32": `\\Google\\Chrome SxS\\Application\\chrome.exe`
720
+ }));
721
+ const firefox = descriptors.find((d) => d.name === "firefox");
722
+ const firefoxExecutable = findExecutablePath(firefox.dir, "firefox");
723
+ this._executables.push({
724
+ name: "firefox",
725
+ browserName: "firefox",
726
+ directory: firefox.dir,
727
+ executablePath: () => firefoxExecutable,
728
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("firefox", firefoxExecutable, firefox.installByDefault, sdkLanguage),
729
+ installType: firefox.installByDefault ? "download-by-default" : "download-on-demand",
730
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, firefox.dir, ["firefox"], [], ["firefox"]),
731
+ downloadURLs: this._downloadURLs(firefox),
732
+ title: firefox.title,
733
+ revision: firefox.revision,
734
+ browserVersion: firefox.browserVersion,
735
+ _install: (force) => this._downloadExecutable(firefox, force, firefoxExecutable),
736
+ _dependencyGroup: "firefox",
737
+ _isHermeticInstallation: true
738
+ });
739
+ const firefoxBeta = descriptors.find((d) => d.name === "firefox-beta");
740
+ const firefoxBetaExecutable = findExecutablePath(firefoxBeta.dir, "firefox");
741
+ this._executables.push({
742
+ name: "firefox-beta",
743
+ browserName: "firefox",
744
+ directory: firefoxBeta.dir,
745
+ executablePath: () => firefoxBetaExecutable,
746
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("firefox-beta", firefoxBetaExecutable, firefoxBeta.installByDefault, sdkLanguage),
747
+ installType: firefoxBeta.installByDefault ? "download-by-default" : "download-on-demand",
748
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, firefoxBeta.dir, ["firefox"], [], ["firefox"]),
749
+ downloadURLs: this._downloadURLs(firefoxBeta),
750
+ title: firefoxBeta.title,
751
+ revision: firefoxBeta.revision,
752
+ browserVersion: firefoxBeta.browserVersion,
753
+ _install: (force) => this._downloadExecutable(firefoxBeta, force, firefoxBetaExecutable),
754
+ _dependencyGroup: "firefox",
755
+ _isHermeticInstallation: true
756
+ });
757
+ const webkit = descriptors.find((d) => d.name === "webkit");
758
+ const webkitExecutable = findExecutablePath(webkit.dir, "webkit");
759
+ const webkitLinuxLddDirectories = [
760
+ import_path.default.join("minibrowser-gtk"),
761
+ import_path.default.join("minibrowser-gtk", "bin"),
762
+ import_path.default.join("minibrowser-gtk", "lib"),
763
+ import_path.default.join("minibrowser-gtk", "sys", "lib"),
764
+ import_path.default.join("minibrowser-wpe"),
765
+ import_path.default.join("minibrowser-wpe", "bin"),
766
+ import_path.default.join("minibrowser-wpe", "lib"),
767
+ import_path.default.join("minibrowser-wpe", "sys", "lib")
768
+ ];
769
+ this._executables.push({
770
+ name: "webkit",
771
+ browserName: "webkit",
772
+ directory: webkit.dir,
773
+ executablePath: () => webkitExecutable,
774
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("webkit", webkitExecutable, webkit.installByDefault, sdkLanguage),
775
+ installType: webkit.installByDefault ? "download-by-default" : "download-on-demand",
776
+ _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, webkit.dir, webkitLinuxLddDirectories, ["libGLESv2.so.2", "libx264.so"], [""]),
777
+ downloadURLs: this._downloadURLs(webkit),
778
+ title: webkit.title,
779
+ revision: webkit.revision,
780
+ browserVersion: webkit.browserVersion,
781
+ _install: (force) => this._downloadExecutable(webkit, force, webkitExecutable),
782
+ _dependencyGroup: "webkit",
783
+ _isHermeticInstallation: true
784
+ });
785
+ this._executables.push({
786
+ name: "webkit-wsl",
787
+ browserName: "webkit",
788
+ directory: webkit.dir,
789
+ executablePath: () => webkitExecutable,
790
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("webkit", webkitExecutable, webkit.installByDefault, sdkLanguage),
791
+ installType: "download-on-demand",
792
+ title: "Webkit in WSL",
793
+ _validateHostRequirements: (sdkLanguage) => Promise.resolve(),
794
+ _isHermeticInstallation: true,
795
+ _install: async () => {
796
+ if (process.platform !== "win32")
797
+ throw new Error(`WebKit via WSL is only supported on Windows`);
798
+ const script = import_path.default.join(BIN_PATH, "install_webkit_wsl.ps1");
799
+ const { code } = await (0, import_spawnAsync.spawnAsync)("powershell.exe", [
800
+ "-ExecutionPolicy",
801
+ "Bypass",
802
+ "-File",
803
+ script
804
+ ], {
805
+ stdio: "inherit"
806
+ });
807
+ if (code !== 0)
808
+ throw new Error(`Failed to install WebKit via WSL`);
809
+ }
810
+ });
811
+ const ffmpeg = descriptors.find((d) => d.name === "ffmpeg");
812
+ const ffmpegExecutable = findExecutablePath(ffmpeg.dir, "ffmpeg");
813
+ this._executables.push({
814
+ name: "ffmpeg",
815
+ browserName: void 0,
816
+ directory: ffmpeg.dir,
817
+ executablePath: () => ffmpegExecutable,
818
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("ffmpeg", ffmpegExecutable, ffmpeg.installByDefault, sdkLanguage),
819
+ installType: ffmpeg.installByDefault ? "download-by-default" : "download-on-demand",
820
+ _validateHostRequirements: () => Promise.resolve(),
821
+ downloadURLs: this._downloadURLs(ffmpeg),
822
+ title: ffmpeg.title,
823
+ revision: ffmpeg.revision,
824
+ _install: (force) => this._downloadExecutable(ffmpeg, force, ffmpegExecutable),
825
+ _dependencyGroup: "tools",
826
+ _isHermeticInstallation: true
827
+ });
828
+ const winldd = descriptors.find((d) => d.name === "winldd");
829
+ const winlddExecutable = findExecutablePath(winldd.dir, "winldd");
830
+ this._executables.push({
831
+ name: "winldd",
832
+ browserName: void 0,
833
+ directory: winldd.dir,
834
+ executablePath: () => winlddExecutable,
835
+ executablePathOrDie: (sdkLanguage) => executablePathOrDie("winldd", winlddExecutable, winldd.installByDefault, sdkLanguage),
836
+ installType: process.platform === "win32" ? "download-by-default" : "none",
837
+ _validateHostRequirements: () => Promise.resolve(),
838
+ downloadURLs: this._downloadURLs(winldd),
839
+ title: winldd.title,
840
+ revision: winldd.revision,
841
+ _install: (force) => this._downloadExecutable(winldd, force, winlddExecutable),
842
+ _dependencyGroup: "tools",
843
+ _isHermeticInstallation: true
844
+ });
845
+ const android = descriptors.find((d) => d.name === "android");
846
+ this._executables.push({
847
+ name: "android",
848
+ browserName: void 0,
849
+ directory: android.dir,
850
+ executablePath: () => void 0,
851
+ executablePathOrDie: () => "",
852
+ installType: "download-on-demand",
853
+ _validateHostRequirements: () => Promise.resolve(),
854
+ downloadURLs: this._downloadURLs(android),
855
+ title: android.title,
856
+ revision: android.revision,
857
+ _install: (force) => this._downloadExecutable(android, force),
858
+ _dependencyGroup: "tools",
859
+ _isHermeticInstallation: true
860
+ });
861
+ }
862
+ _createChromiumChannel(name, lookAt, install) {
863
+ const executablePath = (sdkLanguage, shouldThrow) => {
864
+ const suffix = lookAt[process.platform];
865
+ if (!suffix) {
866
+ if (shouldThrow)
867
+ throw new Error(`Chromium distribution '${name}' is not supported on ${process.platform}`);
868
+ return void 0;
869
+ }
870
+ const prefixes = process.platform === "win32" ? [
871
+ process.env.LOCALAPPDATA,
872
+ process.env.PROGRAMFILES,
873
+ process.env["PROGRAMFILES(X86)"],
874
+ // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.
875
+ process.env.HOMEDRIVE + "\\Program Files",
876
+ process.env.HOMEDRIVE + "\\Program Files (x86)"
877
+ ].filter(Boolean) : [""];
878
+ for (const prefix of prefixes) {
879
+ const executablePath2 = import_path.default.join(prefix, suffix);
880
+ if ((0, import_fileUtils.canAccessFile)(executablePath2))
881
+ return executablePath2;
882
+ }
883
+ if (!shouldThrow)
884
+ return void 0;
885
+ const location = prefixes.length ? ` at ${import_path.default.join(prefixes[0], suffix)}` : ``;
886
+ const installation = install ? `
887
+ Run "${buildPlaywrightCLICommand(sdkLanguage, "install " + name)}"` : "";
888
+ throw new Error(`Chromium distribution '${name}' is not found${location}${installation}`);
889
+ };
890
+ return {
891
+ name,
892
+ browserName: "chromium",
893
+ directory: void 0,
894
+ executablePath: (sdkLanguage) => executablePath(sdkLanguage, false),
895
+ executablePathOrDie: (sdkLanguage) => executablePath(sdkLanguage, true),
896
+ installType: install ? "install-script" : "none",
897
+ _validateHostRequirements: () => Promise.resolve(),
898
+ _isHermeticInstallation: false,
899
+ _install: install
900
+ };
901
+ }
902
+ _createBidiFirefoxChannel(name, lookAt, install) {
903
+ const executablePath = (sdkLanguage, shouldThrow) => {
904
+ const suffix = lookAt[process.platform];
905
+ if (!suffix) {
906
+ if (shouldThrow)
907
+ throw new Error(`Firefox distribution '${name}' is not supported on ${process.platform}`);
908
+ return void 0;
909
+ }
910
+ const prefixes = process.platform === "win32" ? [
911
+ process.env.LOCALAPPDATA,
912
+ process.env.PROGRAMFILES,
913
+ process.env["PROGRAMFILES(X86)"],
914
+ // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.
915
+ process.env.HOMEDRIVE + "\\Program Files",
916
+ process.env.HOMEDRIVE + "\\Program Files (x86)"
917
+ ].filter(Boolean) : [""];
918
+ for (const prefix of prefixes) {
919
+ const executablePath2 = import_path.default.join(prefix, suffix);
920
+ if ((0, import_fileUtils.canAccessFile)(executablePath2))
921
+ return executablePath2;
922
+ }
923
+ if (shouldThrow)
924
+ throw new Error(`Cannot find Firefox installation for channel '${name}' at the standard system paths. ${`Tried paths:
925
+ ${prefixes.map((p) => import_path.default.join(p, suffix)).join("\n ")}`}`);
926
+ return void 0;
927
+ };
928
+ return {
929
+ name,
930
+ browserName: "firefox",
931
+ directory: void 0,
932
+ executablePath: (sdkLanguage) => executablePath(sdkLanguage, false),
933
+ executablePathOrDie: (sdkLanguage) => executablePath(sdkLanguage, true),
934
+ installType: "none",
935
+ _validateHostRequirements: () => Promise.resolve(),
936
+ _isHermeticInstallation: true,
937
+ _install: install
938
+ };
939
+ }
940
+ _createBidiChromiumChannel(name, lookAt) {
941
+ const executablePath = (sdkLanguage, shouldThrow) => {
942
+ const suffix = lookAt[process.platform];
943
+ if (!suffix) {
944
+ if (shouldThrow)
945
+ throw new Error(`Chromium distribution '${name}' is not supported on ${process.platform}`);
946
+ return void 0;
947
+ }
948
+ const prefixes = process.platform === "win32" ? [
949
+ process.env.LOCALAPPDATA,
950
+ process.env.PROGRAMFILES,
951
+ process.env["PROGRAMFILES(X86)"],
952
+ // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.
953
+ process.env.HOMEDRIVE + "\\Program Files",
954
+ process.env.HOMEDRIVE + "\\Program Files (x86)"
955
+ ].filter(Boolean) : [""];
956
+ for (const prefix of prefixes) {
957
+ const executablePath2 = import_path.default.join(prefix, suffix);
958
+ if ((0, import_fileUtils.canAccessFile)(executablePath2))
959
+ return executablePath2;
960
+ }
961
+ if (!shouldThrow)
962
+ return void 0;
963
+ const location = prefixes.length ? ` at ${import_path.default.join(prefixes[0], suffix)}` : ``;
964
+ throw new Error(`Chromium distribution '${name}' is not found${location}`);
965
+ };
966
+ return {
967
+ name,
968
+ browserName: "chromium",
969
+ directory: void 0,
970
+ executablePath: (sdkLanguage) => executablePath(sdkLanguage, false),
971
+ executablePathOrDie: (sdkLanguage) => executablePath(sdkLanguage, true),
972
+ installType: "none",
973
+ _validateHostRequirements: () => Promise.resolve(),
974
+ _isHermeticInstallation: false
975
+ };
976
+ }
977
+ executables() {
978
+ return this._executables;
979
+ }
980
+ findExecutable(name) {
981
+ return this._executables.find((b) => b.name === name);
982
+ }
983
+ defaultExecutables() {
984
+ return this._executables.filter((e) => e.installType === "download-by-default");
985
+ }
986
+ _dedupe(executables) {
987
+ return Array.from(new Set(executables));
988
+ }
989
+ async _validateHostRequirements(sdkLanguage, browserDirectory, linuxLddDirectories, dlOpenLibraries, windowsExeAndDllDirectories) {
990
+ if (import_os.default.platform() === "linux")
991
+ return await (0, import_dependencies2.validateDependenciesLinux)(sdkLanguage, linuxLddDirectories.map((d) => import_path.default.join(browserDirectory, d)), dlOpenLibraries);
992
+ if (import_os.default.platform() === "win32" && import_os.default.arch() === "x64")
993
+ return await (0, import_dependencies2.validateDependenciesWindows)(sdkLanguage, windowsExeAndDllDirectories.map((d) => import_path.default.join(browserDirectory, d)));
994
+ }
995
+ async installDeps(executablesToInstallDeps, dryRun) {
996
+ const executables = this._dedupe(executablesToInstallDeps);
997
+ const targets = /* @__PURE__ */ new Set();
998
+ for (const executable of executables) {
999
+ if (executable._dependencyGroup)
1000
+ targets.add(executable._dependencyGroup);
1001
+ }
1002
+ targets.add("tools");
1003
+ if (import_os.default.platform() === "win32")
1004
+ return await (0, import_dependencies2.installDependenciesWindows)(targets, dryRun);
1005
+ if (import_os.default.platform() === "linux")
1006
+ return await (0, import_dependencies2.installDependenciesLinux)(targets, dryRun);
1007
+ }
1008
+ async install(executablesToInstall, options) {
1009
+ const executables = this._dedupe(executablesToInstall);
1010
+ await import_fs.default.promises.mkdir(registryDirectory, { recursive: true });
1011
+ const lockfilePath = import_path.default.join(registryDirectory, "__dirlock");
1012
+ const linksDir = import_path.default.join(registryDirectory, ".links");
1013
+ let releaseLock;
1014
+ try {
1015
+ releaseLock = await import_utilsBundle.lockfile.lock(registryDirectory, {
1016
+ retries: {
1017
+ // Retry 20 times during 10 minutes with
1018
+ // exponential back-off.
1019
+ // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions
1020
+ retries: 20,
1021
+ factor: 1.27579
1022
+ },
1023
+ onCompromised: (err) => {
1024
+ throw new Error(`${err.message} Path: ${lockfilePath}`);
1025
+ },
1026
+ lockfilePath
1027
+ });
1028
+ await import_fs.default.promises.mkdir(linksDir, { recursive: true });
1029
+ await import_fs.default.promises.writeFile(import_path.default.join(linksDir, (0, import_utils.calculateSha1)(PACKAGE_PATH)), PACKAGE_PATH);
1030
+ if (!(0, import_utils.getAsBooleanFromENV)("PLAYWRIGHT_SKIP_BROWSER_GC"))
1031
+ await this._validateInstallationCache(linksDir);
1032
+ for (const executable of executables) {
1033
+ if (!executable._install)
1034
+ throw new Error(`ERROR: Playwright does not support installing ${executable.name}`);
1035
+ const { embedderName } = (0, import_userAgent.getEmbedderName)();
1036
+ if (!(0, import_utils.getAsBooleanFromENV)("CI") && !executable._isHermeticInstallation && !options?.force && executable.executablePath(embedderName)) {
1037
+ const command = buildPlaywrightCLICommand(embedderName, "install --force " + executable.name);
1038
+ process.stderr.write("\n" + (0, import_ascii.wrapInASCIIBox)([
1039
+ `ATTENTION: "${executable.name}" is already installed on the system!`,
1040
+ ``,
1041
+ `"${executable.name}" installation is not hermetic; installing newer version`,
1042
+ `requires *removal* of a current installation first.`,
1043
+ ``,
1044
+ `To *uninstall* current version and re-install latest "${executable.name}":`,
1045
+ ``,
1046
+ `- Close all running instances of "${executable.name}", if any`,
1047
+ `- Use "--force" to install browser:`,
1048
+ ``,
1049
+ ` ${command}`,
1050
+ ``,
1051
+ `<3 Playwright Team`
1052
+ ].join("\n"), 1) + "\n\n");
1053
+ return;
1054
+ }
1055
+ await executable._install(!!options?.force);
1056
+ }
1057
+ } catch (e) {
1058
+ if (e.code === "ELOCKED") {
1059
+ const rmCommand = process.platform === "win32" ? "rm -R" : "rm -rf";
1060
+ throw new Error("\n" + (0, import_ascii.wrapInASCIIBox)([
1061
+ `An active lockfile is found at:`,
1062
+ ``,
1063
+ ` ${lockfilePath}`,
1064
+ ``,
1065
+ `Either:`,
1066
+ `- wait a few minutes if other Playwright is installing browsers in parallel`,
1067
+ `- remove lock manually with:`,
1068
+ ``,
1069
+ ` ${rmCommand} ${lockfilePath}`,
1070
+ ``,
1071
+ `<3 Playwright Team`
1072
+ ].join("\n"), 1));
1073
+ } else {
1074
+ throw e;
1075
+ }
1076
+ } finally {
1077
+ if (releaseLock)
1078
+ await releaseLock();
1079
+ }
1080
+ }
1081
+ async uninstall(all) {
1082
+ const linksDir = import_path.default.join(registryDirectory, ".links");
1083
+ if (all) {
1084
+ const links = await import_fs.default.promises.readdir(linksDir).catch(() => []);
1085
+ for (const link of links)
1086
+ await import_fs.default.promises.unlink(import_path.default.join(linksDir, link));
1087
+ } else {
1088
+ await import_fs.default.promises.unlink(import_path.default.join(linksDir, (0, import_utils.calculateSha1)(PACKAGE_PATH))).catch(() => {
1089
+ });
1090
+ }
1091
+ await this._validateInstallationCache(linksDir);
1092
+ return {
1093
+ numberOfBrowsersLeft: (await import_fs.default.promises.readdir(registryDirectory).catch(() => [])).filter((browserDirectory) => isBrowserDirectory(browserDirectory)).length
1094
+ };
1095
+ }
1096
+ async validateHostRequirementsForExecutablesIfNeeded(executables, sdkLanguage) {
1097
+ if ((0, import_utils.getAsBooleanFromENV)("PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS")) {
1098
+ process.stderr.write("Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n");
1099
+ return;
1100
+ }
1101
+ for (const executable of executables)
1102
+ await this._validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage);
1103
+ }
1104
+ async _validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage) {
1105
+ const kMaximumReValidationPeriod = 30 * 24 * 60 * 60 * 1e3;
1106
+ if (!executable.directory)
1107
+ return;
1108
+ const markerFile = import_path.default.join(executable.directory, "DEPENDENCIES_VALIDATED");
1109
+ if (await import_fs.default.promises.stat(markerFile).then((stat) => Date.now() - stat.mtime.getTime() < kMaximumReValidationPeriod).catch(() => false))
1110
+ return;
1111
+ import_debugLogger.debugLogger.log("install", `validating host requirements for "${executable.name}"`);
1112
+ try {
1113
+ await executable._validateHostRequirements(sdkLanguage);
1114
+ import_debugLogger.debugLogger.log("install", `validation passed for ${executable.name}`);
1115
+ } catch (error) {
1116
+ import_debugLogger.debugLogger.log("install", `validation failed for ${executable.name}`);
1117
+ throw error;
1118
+ }
1119
+ await import_fs.default.promises.writeFile(markerFile, "").catch(() => {
1120
+ });
1121
+ }
1122
+ _downloadURLs(descriptor) {
1123
+ const paths = DOWNLOAD_PATHS[descriptor.name];
1124
+ const downloadPathTemplate = paths[import_hostPlatform.hostPlatform] || paths["<unknown>"];
1125
+ if (!downloadPathTemplate)
1126
+ return [];
1127
+ let downloadPath;
1128
+ let mirrors;
1129
+ if (typeof downloadPathTemplate === "function") {
1130
+ const result = downloadPathTemplate(descriptor);
1131
+ downloadPath = result.path;
1132
+ mirrors = result.mirrors;
1133
+ } else {
1134
+ downloadPath = util.format(downloadPathTemplate, descriptor.revision);
1135
+ mirrors = PLAYWRIGHT_CDN_MIRRORS;
1136
+ }
1137
+ let downloadHostEnv;
1138
+ if (descriptor.name.startsWith("chromium"))
1139
+ downloadHostEnv = "PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST";
1140
+ else if (descriptor.name.startsWith("firefox"))
1141
+ downloadHostEnv = "PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST";
1142
+ else if (descriptor.name.startsWith("webkit"))
1143
+ downloadHostEnv = "PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST";
1144
+ const customHostOverride = downloadHostEnv && (0, import_utils.getFromENV)(downloadHostEnv) || (0, import_utils.getFromENV)("PLAYWRIGHT_DOWNLOAD_HOST");
1145
+ if (customHostOverride)
1146
+ mirrors = [customHostOverride];
1147
+ return mirrors.map((mirror) => `${mirror}/${downloadPath}`);
1148
+ }
1149
+ async _downloadExecutable(descriptor, force, executablePath) {
1150
+ const downloadURLs = this._downloadURLs(descriptor);
1151
+ if (!downloadURLs.length)
1152
+ throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${import_hostPlatform.hostPlatform}`);
1153
+ if (!import_hostPlatform.isOfficiallySupportedPlatform)
1154
+ (0, import_browserFetcher.logPolitely)(`BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ${import_hostPlatform.hostPlatform}.`);
1155
+ if (descriptor.hasRevisionOverride) {
1156
+ const message = `You are using a frozen ${descriptor.name} browser which does not receive updates anymore on ${import_hostPlatform.hostPlatform}. Please update to the latest version of your operating system to test up-to-date browsers.`;
1157
+ if (process.env.GITHUB_ACTIONS)
1158
+ console.log(`::warning title=Playwright::${message}`);
1159
+ else
1160
+ (0, import_browserFetcher.logPolitely)(message);
1161
+ }
1162
+ const title = this.calculateDownloadTitle(descriptor);
1163
+ const downloadFileName = `playwright-download-${descriptor.name}-${import_hostPlatform.hostPlatform}-${descriptor.revision}.zip`;
1164
+ const downloadSocketTimeoutEnv = (0, import_utils.getFromENV)("PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT");
1165
+ const downloadSocketTimeout = +(downloadSocketTimeoutEnv || "0") || import_network.NET_DEFAULT_TIMEOUT;
1166
+ await (0, import_browserFetcher.downloadBrowserWithProgressBar)(title, descriptor.dir, executablePath, downloadURLs, downloadFileName, downloadSocketTimeout, force).catch((e) => {
1167
+ throw new Error(`Failed to download ${title}, caused by
1168
+ ${e.stack}`);
1169
+ });
1170
+ }
1171
+ calculateDownloadTitle(descriptor) {
1172
+ const title = descriptor.title ?? descriptor.name.split("-").map((word) => {
1173
+ return word === "ffmpeg" ? "FFmpeg" : word.charAt(0).toUpperCase() + word.slice(1);
1174
+ }).join(" ");
1175
+ const version = descriptor.browserVersion ? " " + descriptor.browserVersion : "";
1176
+ return `${title}${version} (playwright ${descriptor.name} v${descriptor.revision})`;
1177
+ }
1178
+ async _installMSEdgeChannel(channel, scripts) {
1179
+ const scriptArgs = [];
1180
+ if (process.platform !== "linux") {
1181
+ const products = lowercaseAllKeys(JSON.parse(await (0, import_network.fetchData)(void 0, { url: "https://edgeupdates.microsoft.com/api/products" })));
1182
+ const productName = {
1183
+ "msedge": "Stable",
1184
+ "msedge-beta": "Beta",
1185
+ "msedge-dev": "Dev"
1186
+ }[channel];
1187
+ const product = products.find((product2) => product2.product === productName);
1188
+ const searchConfig = {
1189
+ darwin: { platform: "MacOS", arch: "universal", artifact: "pkg" },
1190
+ win32: { platform: "Windows", arch: "x64", artifact: "msi" }
1191
+ }[process.platform];
1192
+ const release = searchConfig ? product.releases.find((release2) => release2.platform === searchConfig.platform && release2.architecture === searchConfig.arch && release2.artifacts.length > 0) : null;
1193
+ const artifact = release ? release.artifacts.find((artifact2) => artifact2.artifactname === searchConfig.artifact) : null;
1194
+ if (artifact)
1195
+ scriptArgs.push(
1196
+ artifact.location
1197
+ /* url */
1198
+ );
1199
+ else
1200
+ throw new Error(`Cannot install ${channel} on ${process.platform}`);
1201
+ }
1202
+ await this._installChromiumChannel(channel, scripts, scriptArgs);
1203
+ }
1204
+ async _installChromiumChannel(channel, scripts, scriptArgs = []) {
1205
+ const scriptName = scripts[process.platform];
1206
+ if (!scriptName)
1207
+ throw new Error(`Cannot install ${channel} on ${process.platform}`);
1208
+ const cwd = BIN_PATH;
1209
+ const isPowerShell = scriptName.endsWith(".ps1");
1210
+ if (isPowerShell) {
1211
+ const args = [
1212
+ "-ExecutionPolicy",
1213
+ "Bypass",
1214
+ "-File",
1215
+ import_path.default.join(BIN_PATH, scriptName),
1216
+ ...scriptArgs
1217
+ ];
1218
+ const { code } = await (0, import_spawnAsync.spawnAsync)("powershell.exe", args, { cwd, stdio: "inherit" });
1219
+ if (code !== 0)
1220
+ throw new Error(`Failed to install ${channel}`);
1221
+ } else {
1222
+ const { command, args, elevatedPermissions } = await (0, import_dependencies.transformCommandsForRoot)([`bash "${import_path.default.join(BIN_PATH, scriptName)}" ${scriptArgs.join("")}`]);
1223
+ if (elevatedPermissions)
1224
+ console.log("Switching to root user to install dependencies...");
1225
+ const { code } = await (0, import_spawnAsync.spawnAsync)(command, args, { cwd, stdio: "inherit" });
1226
+ if (code !== 0)
1227
+ throw new Error(`Failed to install ${channel}`);
1228
+ }
1229
+ }
1230
+ async listInstalledBrowsers() {
1231
+ const linksDir = import_path.default.join(registryDirectory, ".links");
1232
+ const { browsers } = await this._traverseBrowserInstallations(linksDir);
1233
+ return browsers.filter((browser) => import_fs.default.existsSync(browser.browserPath));
1234
+ }
1235
+ async _validateInstallationCache(linksDir) {
1236
+ const { browsers, brokenLinks } = await this._traverseBrowserInstallations(linksDir);
1237
+ await this._deleteStaleBrowsers(browsers);
1238
+ await this._deleteBrokenInstallations(brokenLinks);
1239
+ }
1240
+ async _traverseBrowserInstallations(linksDir) {
1241
+ const browserList = [];
1242
+ const brokenLinks = [];
1243
+ for (const fileName of await import_fs.default.promises.readdir(linksDir)) {
1244
+ const linkPath = import_path.default.join(linksDir, fileName);
1245
+ let linkTarget = "";
1246
+ try {
1247
+ linkTarget = (await import_fs.default.promises.readFile(linkPath)).toString();
1248
+ const browsersJSON = require(import_path.default.join(linkTarget, "browsers.json"));
1249
+ const descriptors = readDescriptors(browsersJSON);
1250
+ for (const browserName of allDownloadableDirectoriesThatEverExisted) {
1251
+ const descriptor = descriptors.find((d) => d.name === browserName);
1252
+ if (!descriptor)
1253
+ continue;
1254
+ const browserPath = descriptor.dir;
1255
+ const browserVersion = parseInt(descriptor.revision, 10);
1256
+ browserList.push({
1257
+ browserName,
1258
+ browserVersion,
1259
+ browserPath,
1260
+ referenceDir: linkTarget
1261
+ });
1262
+ }
1263
+ } catch (e) {
1264
+ brokenLinks.push(linkPath);
1265
+ }
1266
+ }
1267
+ return { browsers: browserList, brokenLinks };
1268
+ }
1269
+ async _deleteStaleBrowsers(browserList) {
1270
+ const usedBrowserPaths = /* @__PURE__ */ new Set();
1271
+ for (const browser of browserList) {
1272
+ const { browserName, browserVersion, browserPath } = browser;
1273
+ const shouldHaveMarkerFile = browserName === "chromium" && (browserVersion >= 786218 || browserVersion < 3e5) || browserName === "firefox" && browserVersion >= 1128 || browserName === "webkit" && browserVersion >= 1307 || // All new applications have a marker file right away.
1274
+ browserName !== "firefox" && browserName !== "chromium" && browserName !== "webkit";
1275
+ if (!shouldHaveMarkerFile || await (0, import_fileUtils.existsAsync)(browserDirectoryToMarkerFilePath(browserPath)))
1276
+ usedBrowserPaths.add(browserPath);
1277
+ }
1278
+ let downloadedBrowsers = (await import_fs.default.promises.readdir(registryDirectory)).map((file) => import_path.default.join(registryDirectory, file));
1279
+ downloadedBrowsers = downloadedBrowsers.filter((file) => isBrowserDirectory(file));
1280
+ const directories = new Set(downloadedBrowsers);
1281
+ for (const browserDirectory of usedBrowserPaths)
1282
+ directories.delete(browserDirectory);
1283
+ for (const directory of directories)
1284
+ (0, import_browserFetcher.logPolitely)("Removing unused browser at " + directory);
1285
+ await (0, import_fileUtils.removeFolders)([...directories]);
1286
+ }
1287
+ async _deleteBrokenInstallations(brokenLinks) {
1288
+ for (const linkPath of brokenLinks)
1289
+ await import_fs.default.promises.unlink(linkPath).catch((e) => {
1290
+ });
1291
+ }
1292
+ _defaultBrowsersToInstall(options) {
1293
+ let executables = this.defaultExecutables();
1294
+ if (options.shell === "no")
1295
+ executables = executables.filter((e) => e.name !== "chromium-headless-shell" && e.name !== "chromium-tip-of-tree-headless-shell");
1296
+ if (options.shell === "only")
1297
+ executables = executables.filter((e) => e.name !== "chromium" && e.name !== "chromium-tip-of-tree");
1298
+ return executables;
1299
+ }
1300
+ suggestedBrowsersToInstall() {
1301
+ const names = this.executables().filter((e) => e.installType !== "none").map((e) => e.name);
1302
+ names.push(...chromiumAliases);
1303
+ return names.sort().join(", ");
1304
+ }
1305
+ isChromiumAlias(name) {
1306
+ return chromiumAliases.includes(name);
1307
+ }
1308
+ resolveBrowsers(aliases, options) {
1309
+ if (aliases.length === 0)
1310
+ return this._defaultBrowsersToInstall(options);
1311
+ const faultyArguments = [];
1312
+ const executables = [];
1313
+ const handleArgument = (arg) => {
1314
+ const executable = this.findExecutable(arg);
1315
+ if (!executable || executable.installType === "none")
1316
+ faultyArguments.push(arg);
1317
+ else
1318
+ executables.push(executable);
1319
+ if (executable?.browserName)
1320
+ executables.push(this.findExecutable("ffmpeg"));
1321
+ };
1322
+ for (const alias of aliases) {
1323
+ if (alias === "chromium" || chromiumAliases.includes(alias)) {
1324
+ if (options.shell !== "only")
1325
+ handleArgument("chromium");
1326
+ if (options.shell !== "no")
1327
+ handleArgument("chromium-headless-shell");
1328
+ } else if (alias === "chromium-tip-of-tree") {
1329
+ if (options.shell !== "only")
1330
+ handleArgument("chromium-tip-of-tree");
1331
+ if (options.shell !== "no")
1332
+ handleArgument("chromium-tip-of-tree-headless-shell");
1333
+ } else {
1334
+ handleArgument(alias);
1335
+ }
1336
+ }
1337
+ if (process.platform === "win32")
1338
+ executables.push(this.findExecutable("winldd"));
1339
+ if (faultyArguments.length)
1340
+ throw new Error(`Invalid installation targets: ${faultyArguments.map((name) => `'${name}'`).join(", ")}. Expecting one of: ${this.suggestedBrowsersToInstall()}`);
1341
+ return executables;
1342
+ }
1343
+ }
1344
+ function browserDirectoryToMarkerFilePath(browserDirectory) {
1345
+ return import_path.default.join(browserDirectory, "INSTALLATION_COMPLETE");
1346
+ }
1347
+ function buildPlaywrightCLICommand(sdkLanguage, parameters) {
1348
+ switch (sdkLanguage) {
1349
+ case "python":
1350
+ return `playwright ${parameters}`;
1351
+ case "java":
1352
+ return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="${parameters}"`;
1353
+ case "csharp":
1354
+ return `pwsh bin/Debug/netX/playwright.ps1 ${parameters}`;
1355
+ default: {
1356
+ const packageManagerCommand = (0, import_utils.getPackageManagerExecCommand)();
1357
+ return `${packageManagerCommand} playwright ${parameters}`;
1358
+ }
1359
+ }
1360
+ }
1361
+ async function installBrowsersForNpmInstall(browsers) {
1362
+ if ((0, import_utils.getAsBooleanFromENV)("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD")) {
1363
+ (0, import_browserFetcher.logPolitely)("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set");
1364
+ return false;
1365
+ }
1366
+ const executables = [];
1367
+ if (process.platform === "win32")
1368
+ executables.push(registry.findExecutable("winldd"));
1369
+ for (const browserName of browsers) {
1370
+ const executable = registry.findExecutable(browserName);
1371
+ if (!executable || executable.installType === "none")
1372
+ throw new Error(`Cannot install ${browserName}`);
1373
+ executables.push(executable);
1374
+ }
1375
+ await registry.install(executables);
1376
+ }
1377
+ function findChromiumChannelBestEffort(sdkLanguage) {
1378
+ let channel = null;
1379
+ for (const name of ["chromium", "chrome", "msedge"]) {
1380
+ try {
1381
+ registry.findExecutable(name).executablePathOrDie(sdkLanguage);
1382
+ channel = name === "chromium" ? void 0 : name;
1383
+ break;
1384
+ } catch (e) {
1385
+ }
1386
+ }
1387
+ if (channel === null) {
1388
+ const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install chromium`);
1389
+ const prettyMessage = [
1390
+ `No chromium-based browser found on the system.`,
1391
+ `Please run the following command to download one:`,
1392
+ ``,
1393
+ ` ${installCommand}`,
1394
+ ``,
1395
+ `<3 Playwright Team`
1396
+ ].join("\n");
1397
+ throw new Error("\n" + (0, import_ascii.wrapInASCIIBox)(prettyMessage, 1));
1398
+ }
1399
+ return channel;
1400
+ }
1401
+ function lowercaseAllKeys(json) {
1402
+ if (typeof json !== "object" || !json)
1403
+ return json;
1404
+ if (Array.isArray(json))
1405
+ return json.map(lowercaseAllKeys);
1406
+ const result = {};
1407
+ for (const [key, value] of Object.entries(json))
1408
+ result[key.toLowerCase()] = lowercaseAllKeys(value);
1409
+ return result;
1410
+ }
1411
+ const registry = new Registry(require("../../../browsers.json"));
1412
+ // Annotate the CommonJS export names for ESM import in node:
1413
+ 0 && (module.exports = {
1414
+ Registry,
1415
+ browserDirectoryToMarkerFilePath,
1416
+ buildPlaywrightCLICommand,
1417
+ findChromiumChannelBestEffort,
1418
+ installBrowsersForNpmInstall,
1419
+ registry,
1420
+ registryDirectory,
1421
+ writeDockerVersion
1422
+ });