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