@treegress.com/treegress-browser-core 1.59.0-treegress.3
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/README.md +60 -0
- package/ThirdPartyNotices.txt +3759 -0
- package/bin/install_media_pack.ps1 +5 -0
- package/bin/install_webkit_wsl.ps1 +33 -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 +81 -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/client/cli.js +6 -0
- package/lib/cli/client/program.js +375 -0
- package/lib/cli/client/registry.js +171 -0
- package/lib/cli/client/session.js +282 -0
- package/lib/cli/client/socketConnection.js +108 -0
- package/lib/cli/daemon/command.js +73 -0
- package/lib/cli/daemon/commands.js +879 -0
- package/lib/cli/daemon/daemon.js +179 -0
- package/lib/cli/daemon/helpGenerator.js +173 -0
- package/lib/cli/daemon/program.js +123 -0
- package/lib/cli/driver.js +98 -0
- package/lib/cli/program.js +598 -0
- package/lib/cli/programWithTestStub.js +74 -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 +169 -0
- package/lib/client/browserContext.js +590 -0
- package/lib/client/browserType.js +153 -0
- package/lib/client/cdpSession.js +55 -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/connect.js +152 -0
- package/lib/client/connection.js +322 -0
- package/lib/client/consoleMessage.js +61 -0
- package/lib/client/coverage.js +44 -0
- package/lib/client/dialog.js +56 -0
- package/lib/client/disposable.js +76 -0
- package/lib/client/download.js +62 -0
- package/lib/client/electron.js +138 -0
- package/lib/client/elementHandle.js +284 -0
- package/lib/client/errors.js +77 -0
- package/lib/client/eventEmitter.js +327 -0
- package/lib/client/events.js +103 -0
- package/lib/client/fetch.js +368 -0
- package/lib/client/fileChooser.js +46 -0
- package/lib/client/fileUtils.js +34 -0
- package/lib/client/frame.js +409 -0
- package/lib/client/harRouter.js +99 -0
- package/lib/client/input.js +84 -0
- package/lib/client/inspector.js +48 -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 +373 -0
- package/lib/client/network.js +750 -0
- package/lib/client/page.js +750 -0
- package/lib/client/pageAgent.js +64 -0
- package/lib/client/platform.js +77 -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 +124 -0
- package/lib/client/types.js +28 -0
- package/lib/client/video.js +65 -0
- package/lib/client/waiter.js +142 -0
- package/lib/client/webError.js +39 -0
- package/lib/client/worker.js +85 -0
- package/lib/client/writableStream.js +39 -0
- package/lib/devtools/appIcon.png +0 -0
- package/lib/devtools/devtoolsApp.js +275 -0
- package/lib/devtools/devtoolsController.js +289 -0
- package/lib/generated/bindingsControllerSource.js +28 -0
- package/lib/generated/clockSource.js +28 -0
- package/lib/generated/injectedScriptSource.js +28 -0
- package/lib/generated/pollingRecorderSource.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/inProcessFactory.js +60 -0
- package/lib/inprocess.js +3 -0
- package/lib/mcp/browserFactory.js +196 -0
- package/lib/mcp/cdpRelay.js +353 -0
- package/lib/mcp/config.d.js +16 -0
- package/lib/mcp/config.js +399 -0
- package/lib/mcp/configIni.js +190 -0
- package/lib/mcp/exports.js +42 -0
- package/lib/mcp/extensionContextFactory.js +59 -0
- package/lib/mcp/index.js +62 -0
- package/lib/mcp/log.js +35 -0
- package/lib/mcp/program.js +111 -0
- package/lib/mcp/protocol.js +28 -0
- package/lib/mcp/sdk/http.js +152 -0
- package/lib/mcp/sdk/server.js +230 -0
- package/lib/mcp/sdk/tool.js +47 -0
- package/lib/mcp/watchdog.js +44 -0
- package/lib/mcpBundle.js +84 -0
- package/lib/mcpBundleImpl/index.js +147 -0
- package/lib/outofprocess.js +76 -0
- package/lib/protocol/serializers.js +197 -0
- package/lib/protocol/validator.js +3064 -0
- package/lib/protocol/validatorPrimitives.js +193 -0
- package/lib/remote/playwrightConnection.js +129 -0
- package/lib/remote/playwrightPipeServer.js +100 -0
- package/lib/remote/playwrightServer.js +339 -0
- package/lib/remote/playwrightWebSocketServer.js +73 -0
- package/lib/remote/serverTransport.js +96 -0
- package/lib/server/agent/actionRunner.js +341 -0
- package/lib/server/agent/actions.js +128 -0
- package/lib/server/agent/codegen.js +111 -0
- package/lib/server/agent/context.js +161 -0
- package/lib/server/agent/expectTools.js +156 -0
- package/lib/server/agent/pageAgent.js +204 -0
- package/lib/server/agent/performTools.js +262 -0
- package/lib/server/agent/tool.js +109 -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 +560 -0
- package/lib/server/bidi/bidiChromium.js +162 -0
- package/lib/server/bidi/bidiConnection.js +213 -0
- package/lib/server/bidi/bidiDeserializer.js +116 -0
- package/lib/server/bidi/bidiExecutionContext.js +267 -0
- package/lib/server/bidi/bidiFirefox.js +128 -0
- package/lib/server/bidi/bidiInput.js +146 -0
- package/lib/server/bidi/bidiNetworkManager.js +411 -0
- package/lib/server/bidi/bidiOverCdp.js +102 -0
- package/lib/server/bidi/bidiPage.js +598 -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/bidiKeyboard.js +256 -0
- package/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/lib/server/bidi/third_party/bidiProtocolCore.js +180 -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 +261 -0
- package/lib/server/browser.js +217 -0
- package/lib/server/browserContext.js +699 -0
- package/lib/server/browserType.js +337 -0
- package/lib/server/callLog.js +82 -0
- package/lib/server/chromium/appIcon.png +0 -0
- package/lib/server/chromium/chromium.js +399 -0
- package/lib/server/chromium/chromiumSwitches.js +104 -0
- package/lib/server/chromium/crBrowser.js +532 -0
- package/lib/server/chromium/crConnection.js +197 -0
- package/lib/server/chromium/crCoverage.js +235 -0
- package/lib/server/chromium/crDevTools.js +111 -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 +708 -0
- package/lib/server/chromium/crPage.js +1004 -0
- package/lib/server/chromium/crPdf.js +121 -0
- package/lib/server/chromium/crProtocolHelper.js +145 -0
- package/lib/server/chromium/crServiceWorker.js +136 -0
- package/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/lib/server/chromium/protocol.d.js +16 -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 +247 -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 +61 -0
- package/lib/server/cookieStore.js +206 -0
- package/lib/server/debugController.js +197 -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 +377 -0
- package/lib/server/dispatchers/browserDispatcher.js +124 -0
- package/lib/server/dispatchers/browserTypeDispatcher.js +71 -0
- package/lib/server/dispatchers/cdpSessionDispatcher.js +47 -0
- package/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/lib/server/dispatchers/dispatcher.js +364 -0
- package/lib/server/dispatchers/disposableDispatcher.js +39 -0
- package/lib/server/dispatchers/electronDispatcher.js +90 -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 +185 -0
- package/lib/server/dispatchers/networkDispatchers.js +214 -0
- package/lib/server/dispatchers/pageAgentDispatcher.js +106 -0
- package/lib/server/dispatchers/pageDispatcher.js +441 -0
- package/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +164 -0
- package/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/lib/server/disposable.js +41 -0
- package/lib/server/dom.js +815 -0
- package/lib/server/download.js +71 -0
- package/lib/server/electron/electron.js +272 -0
- package/lib/server/electron/loader.js +30 -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/ffBrowser.js +415 -0
- package/lib/server/firefox/ffConnection.js +142 -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 +495 -0
- package/lib/server/firefox/firefox.js +114 -0
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +147 -0
- package/lib/server/frameSelectors.js +160 -0
- package/lib/server/frames.js +1476 -0
- package/lib/server/har/harRecorder.js +147 -0
- package/lib/server/har/harTracer.js +608 -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 +277 -0
- package/lib/server/instrumentation.js +72 -0
- package/lib/server/javascript.js +291 -0
- package/lib/server/launchApp.js +127 -0
- package/lib/server/localUtils.js +214 -0
- package/lib/server/macEditingCommands.js +143 -0
- package/lib/server/network.js +668 -0
- package/lib/server/page.js +915 -0
- package/lib/server/pipeTransport.js +89 -0
- package/lib/server/playwright.js +69 -0
- package/lib/server/progress.js +136 -0
- package/lib/server/protocolError.js +52 -0
- package/lib/server/recorder/chat.js +161 -0
- package/lib/server/recorder/recorderApp.js +367 -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.js +533 -0
- package/lib/server/registry/browserFetcher.js +177 -0
- package/lib/server/registry/dependencies.js +371 -0
- package/lib/server/registry/index.js +1395 -0
- package/lib/server/registry/nativeDeps.js +1281 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +127 -0
- package/lib/server/screencast.js +214 -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/trace/recorder/snapshotter.js +147 -0
- package/lib/server/trace/recorder/snapshotterInjected.js +561 -0
- package/lib/server/trace/recorder/tracing.js +607 -0
- package/lib/server/trace/viewer/traceParser.js +72 -0
- package/lib/server/trace/viewer/traceViewer.js +244 -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 +139 -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 +123 -0
- package/lib/server/utils/fileUtils.js +191 -0
- package/lib/server/utils/happyEyeballs.js +207 -0
- package/lib/server/utils/hostPlatform.js +123 -0
- package/lib/server/utils/httpServer.js +205 -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 +244 -0
- package/lib/server/utils/nodePlatform.js +154 -0
- package/lib/server/utils/pipeTransport.js +84 -0
- package/lib/server/utils/processLauncher.js +243 -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/videoRecorder.js +133 -0
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +108 -0
- package/lib/server/webkit/wkBrowser.js +331 -0
- package/lib/server/webkit/wkConnection.js +144 -0
- package/lib/server/webkit/wkExecutionContext.js +154 -0
- package/lib/server/webkit/wkInput.js +181 -0
- package/lib/server/webkit/wkInterceptableRequest.js +197 -0
- package/lib/server/webkit/wkPage.js +1164 -0
- package/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/lib/server/webkit/wkWorkers.js +106 -0
- package/lib/serverRegistry.js +136 -0
- package/lib/third_party/pixelmatch.js +255 -0
- package/lib/tools/browserServerBackend.js +79 -0
- package/lib/tools/common.js +63 -0
- package/lib/tools/config.js +41 -0
- package/lib/tools/console.js +65 -0
- package/lib/tools/context.js +282 -0
- package/lib/tools/cookies.js +152 -0
- package/lib/tools/customDomLocatorCompiler.js +239 -0
- package/lib/tools/customDomResolverDiagnostics.js +100 -0
- package/lib/tools/customDomSnapshotFormatter.js +658 -0
- package/lib/tools/devtools.js +42 -0
- package/lib/tools/dialogs.js +59 -0
- package/lib/tools/evaluate.js +61 -0
- package/lib/tools/exports.js +57 -0
- package/lib/tools/files.js +58 -0
- package/lib/tools/form.js +63 -0
- package/lib/tools/keyboard.js +151 -0
- package/lib/tools/logFile.js +95 -0
- package/lib/tools/mouse.js +170 -0
- package/lib/tools/navigate.js +105 -0
- package/lib/tools/network.js +112 -0
- package/lib/tools/pdf.js +48 -0
- package/lib/tools/response.js +278 -0
- package/lib/tools/route.js +140 -0
- package/lib/tools/runCode.js +76 -0
- package/lib/tools/screenshot.js +87 -0
- package/lib/tools/sessionLog.js +75 -0
- package/lib/tools/snapshot.js +209 -0
- package/lib/tools/storage.js +67 -0
- package/lib/tools/tab.js +596 -0
- package/lib/tools/tabs.js +67 -0
- package/lib/tools/tool.js +47 -0
- package/lib/tools/tools.js +94 -0
- package/lib/tools/tracing.js +75 -0
- package/lib/tools/utils.js +88 -0
- package/lib/tools/verify.js +149 -0
- package/lib/tools/video.js +89 -0
- package/lib/tools/wait.js +63 -0
- package/lib/tools/webstorage.js +223 -0
- package/lib/utils/isomorphic/aiSnapshotTypes.js +16 -0
- package/lib/utils/isomorphic/ariaSnapshot.js +455 -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/imageUtils.js +141 -0
- package/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/lib/utils/isomorphic/locatorParser.js +176 -0
- package/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/lib/utils/isomorphic/lruCache.js +51 -0
- package/lib/utils/isomorphic/manualPromise.js +114 -0
- package/lib/utils/isomorphic/mimeType.js +464 -0
- package/lib/utils/isomorphic/multimap.js +80 -0
- package/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +345 -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 +204 -0
- package/lib/utils/isomorphic/time.js +49 -0
- package/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/lib/utils/isomorphic/trace/entries.js +16 -0
- package/lib/utils/isomorphic/trace/snapshotRenderer.js +502 -0
- package/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
- package/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
- package/lib/utils/isomorphic/trace/traceLoader.js +131 -0
- package/lib/utils/isomorphic/trace/traceModel.js +366 -0
- package/lib/utils/isomorphic/trace/traceModernizer.js +401 -0
- package/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
- package/lib/utils/isomorphic/traceUtils.js +58 -0
- package/lib/utils/isomorphic/types.js +16 -0
- package/lib/utils/isomorphic/urlMatch.js +243 -0
- package/lib/utils/isomorphic/utilityScriptSerializers.js +262 -0
- package/lib/utils/isomorphic/yaml.js +84 -0
- package/lib/utils.js +111 -0
- package/lib/utilsBundle.js +112 -0
- package/lib/utilsBundleImpl/index.js +218 -0
- package/lib/utilsBundleImpl/xdg-open +1066 -0
- package/lib/vite/devtools/assets/index-D3CVnoLM.css +1 -0
- package/lib/vite/devtools/assets/index-wqccfruE.js +50 -0
- package/lib/vite/devtools/index.html +28 -0
- package/lib/vite/htmlReport/index.html +84 -0
- package/lib/vite/recorder/assets/codeMirrorModule-4NapTJOb.js +32 -0
- package/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
- package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -0
- package/lib/vite/recorder/assets/index-CD9lKVjM.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-RgXeHFoQ.js +32 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-DP6vvJEM.js +269 -0
- package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
- package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/lib/vite/traceViewer/defaultSettingsView.DQ9U-ctL.css +1 -0
- package/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
- package/lib/vite/traceViewer/index.D8YUXFVt.js +2 -0
- package/lib/vite/traceViewer/index.html +43 -0
- package/lib/vite/traceViewer/manifest.webmanifest +16 -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 +5 -0
- package/lib/vite/traceViewer/uiMode.BIQFTUME.js +6 -0
- package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -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 +52 -0
- package/types/protocol.d.ts +24365 -0
- package/types/structs.d.ts +45 -0
- package/types/types.d.ts +23724 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var customDomSnapshotFormatter_exports = {};
|
|
20
|
+
__export(customDomSnapshotFormatter_exports, {
|
|
21
|
+
customDomStableLocatorKey: () => customDomStableLocatorKey,
|
|
22
|
+
formatCustomDomSnapshot: () => formatCustomDomSnapshot,
|
|
23
|
+
isCustomDomSnapshotEnvelope: () => isCustomDomSnapshotEnvelope
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(customDomSnapshotFormatter_exports);
|
|
26
|
+
const kCustomDomVerificationMarker = "[custom-dom]";
|
|
27
|
+
const kInputTypeToRole = {
|
|
28
|
+
button: "button",
|
|
29
|
+
checkbox: "checkbox",
|
|
30
|
+
email: "textbox",
|
|
31
|
+
number: "textbox",
|
|
32
|
+
password: "textbox",
|
|
33
|
+
radio: "radio",
|
|
34
|
+
reset: "button",
|
|
35
|
+
search: "textbox",
|
|
36
|
+
submit: "button",
|
|
37
|
+
tel: "textbox",
|
|
38
|
+
text: "textbox",
|
|
39
|
+
url: "textbox"
|
|
40
|
+
};
|
|
41
|
+
function isCustomDomSnapshotEnvelope(value) {
|
|
42
|
+
if (!value || typeof value !== "object")
|
|
43
|
+
return false;
|
|
44
|
+
const envelope = value;
|
|
45
|
+
if (envelope.backend !== "custom-dom")
|
|
46
|
+
return false;
|
|
47
|
+
const page = envelope.page;
|
|
48
|
+
if (!page || typeof page !== "object")
|
|
49
|
+
return false;
|
|
50
|
+
return !!page.frameTree;
|
|
51
|
+
}
|
|
52
|
+
function customDomStableLocatorKey(framePath, stableId) {
|
|
53
|
+
return `${framePath.join(".") || "root"}::${stableId}`;
|
|
54
|
+
}
|
|
55
|
+
function formatCustomDomSnapshot(envelope) {
|
|
56
|
+
const state = {
|
|
57
|
+
nextRef: 1,
|
|
58
|
+
aliasToStableId: /* @__PURE__ */ new Map(),
|
|
59
|
+
locatorPlans: /* @__PURE__ */ new Map()
|
|
60
|
+
};
|
|
61
|
+
const lines = renderFrameSnapshot(envelope.page.frameTree, [], "", state);
|
|
62
|
+
return {
|
|
63
|
+
snapshot: lines.join("\n"),
|
|
64
|
+
aliasToStableId: state.aliasToStableId,
|
|
65
|
+
locatorPlans: state.locatorPlans
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function renderFrameSnapshot(frame, framePath, indent, state) {
|
|
69
|
+
const root = asTreeNode(frame.dom);
|
|
70
|
+
if (!root)
|
|
71
|
+
return [];
|
|
72
|
+
let childFrameIndex = 0;
|
|
73
|
+
const lines = renderNode(root, true, indent);
|
|
74
|
+
while (childFrameIndex < frame.childFrames.length) {
|
|
75
|
+
const childFrame = frame.childFrames[childFrameIndex++];
|
|
76
|
+
const pathIndex = childFrame.childFrameIndex ?? childFrameIndex - 1;
|
|
77
|
+
lines.push(`${indent}- iframe:`);
|
|
78
|
+
lines.push(...renderFrameSnapshot(childFrame, [...framePath, pathIndex], indent + " ", state));
|
|
79
|
+
}
|
|
80
|
+
return lines;
|
|
81
|
+
function renderNode(node, isRoot, lineIndent) {
|
|
82
|
+
const tag = readString(node.tag)?.toLowerCase() || "node";
|
|
83
|
+
const ref = maybeAssignAlias(node, frame, framePath, state, isRoot, tag);
|
|
84
|
+
const { label, consumedChildAlt } = formatNodeLabel(node, tag, ref);
|
|
85
|
+
const nested = [];
|
|
86
|
+
for (const child of readChildren(node)) {
|
|
87
|
+
const compact = compactMediaChild(child, consumedChildAlt, lineIndent + " ");
|
|
88
|
+
if (compact !== void 0) {
|
|
89
|
+
if (compact)
|
|
90
|
+
nested.push(compact);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
nested.push(...renderNode(child, false, lineIndent + " "));
|
|
94
|
+
}
|
|
95
|
+
if (tag === "iframe" && childFrameIndex < frame.childFrames.length) {
|
|
96
|
+
const childFrame = frame.childFrames[childFrameIndex++];
|
|
97
|
+
const pathIndex = childFrame.childFrameIndex ?? childFrameIndex - 1;
|
|
98
|
+
nested.push(...renderFrameSnapshot(childFrame, [...framePath, pathIndex], lineIndent + " ", state));
|
|
99
|
+
}
|
|
100
|
+
const hasNested = nested.length > 0;
|
|
101
|
+
let line = `${lineIndent}- ${label}${hasNested ? ":" : ""}`;
|
|
102
|
+
if (isRoot)
|
|
103
|
+
line += ` ${kCustomDomVerificationMarker}`;
|
|
104
|
+
return [line, ...nested];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function maybeAssignAlias(node, frame, framePath, state, isRoot, tag) {
|
|
108
|
+
const stableId = readString(node.id);
|
|
109
|
+
if (!stableId)
|
|
110
|
+
return;
|
|
111
|
+
if (!shouldExposeRef(node, isRoot, tag))
|
|
112
|
+
return;
|
|
113
|
+
const locatorPlan = readRecord(frame.locatorPlans)?.[stableId];
|
|
114
|
+
if (!locatorPlan || typeof locatorPlan !== "object")
|
|
115
|
+
return;
|
|
116
|
+
const key = customDomStableLocatorKey(framePath, stableId);
|
|
117
|
+
if (!state.locatorPlans.has(key))
|
|
118
|
+
state.locatorPlans.set(key, locatorPlan);
|
|
119
|
+
const ref = `e${state.nextRef++}`;
|
|
120
|
+
state.aliasToStableId.set(ref, {
|
|
121
|
+
ref,
|
|
122
|
+
stableId,
|
|
123
|
+
frameId: frame.frameId,
|
|
124
|
+
framePath: [...framePath]
|
|
125
|
+
});
|
|
126
|
+
return ref;
|
|
127
|
+
}
|
|
128
|
+
function shouldExposeRef(node, isRoot, tag) {
|
|
129
|
+
if (isRoot)
|
|
130
|
+
return true;
|
|
131
|
+
if (readBoolean(node.isInteractive))
|
|
132
|
+
return true;
|
|
133
|
+
if (tag === "iframe")
|
|
134
|
+
return true;
|
|
135
|
+
if (readString(node.text))
|
|
136
|
+
return true;
|
|
137
|
+
if (readString(node.accessibleName))
|
|
138
|
+
return true;
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
function formatNodeLabel(node, tag, ref) {
|
|
142
|
+
const nodeRecord = node;
|
|
143
|
+
const attributes = readRecord(nodeRecord.attributes) || {};
|
|
144
|
+
const explicitRole = readString(nodeRecord.role) || readString(attributes.role);
|
|
145
|
+
const semantic = inferRole(tag, explicitRole, attributes);
|
|
146
|
+
const { name, consumedChildAlt, source: nameSource, extras: namingExtras } = resolveNodeName(node, tag, attributes);
|
|
147
|
+
const text = readString(nodeRecord.text);
|
|
148
|
+
const value = readString(attributes.value);
|
|
149
|
+
const actionHint = resolveActionHint(attributes.onclick);
|
|
150
|
+
const namingExtraKeys = new Set(namingExtras.map((extra) => extra.key));
|
|
151
|
+
const parts = [semantic.role];
|
|
152
|
+
if (name)
|
|
153
|
+
parts.push(quoteValue(name));
|
|
154
|
+
if (semantic.level !== void 0)
|
|
155
|
+
parts.push(`[level=${semantic.level}]`);
|
|
156
|
+
parts.push(...formatNamingExtraBadges(namingExtras));
|
|
157
|
+
parts.push(...formatControlBadges(tag, attributes, name, nameSource));
|
|
158
|
+
if (readBoolean(nodeRecord.isInteractive))
|
|
159
|
+
parts.push("[interactive]");
|
|
160
|
+
if (hasPointerCursor(nodeRecord, attributes, tag))
|
|
161
|
+
parts.push("[cursor=pointer]");
|
|
162
|
+
if (nodeRecord.isVisible === false)
|
|
163
|
+
parts.push("[hidden]");
|
|
164
|
+
if (readBoolean(nodeRecord.isFocused))
|
|
165
|
+
parts.push("[active]");
|
|
166
|
+
if (readBoolean(nodeRecord.isDisabled))
|
|
167
|
+
parts.push("[disabled]");
|
|
168
|
+
if (readBoolean(nodeRecord.isChecked))
|
|
169
|
+
parts.push("[checked]");
|
|
170
|
+
if (readBoolean(nodeRecord.isSelected))
|
|
171
|
+
parts.push("[selected]");
|
|
172
|
+
if (isContentEditable(attributes))
|
|
173
|
+
parts.push("[contenteditable]");
|
|
174
|
+
parts.push(...formatAriaBadges(attributes));
|
|
175
|
+
if (actionHint)
|
|
176
|
+
parts.push(`[action=${actionHint}]`);
|
|
177
|
+
const rawOnclick = formatRawOnclick(attributes.onclick);
|
|
178
|
+
if (rawOnclick)
|
|
179
|
+
parts.push(`[onclick=${quoteValue(rawOnclick)}]`);
|
|
180
|
+
parts.push(...formatStructuralHintBadges(nodeRecord, tag, semantic.role, attributes, name, explicitRole, namingExtraKeys));
|
|
181
|
+
if (ref)
|
|
182
|
+
parts.push(`[ref=${ref}]`);
|
|
183
|
+
const suffix = formatTextSuffix(node, semantic.role, value, text, name);
|
|
184
|
+
let label = parts.join(" ");
|
|
185
|
+
if (suffix)
|
|
186
|
+
label += `: ${suffix}`;
|
|
187
|
+
return { label, consumedChildAlt };
|
|
188
|
+
}
|
|
189
|
+
function inferRole(tag, explicitRole, attributes) {
|
|
190
|
+
if (explicitRole === "heading") {
|
|
191
|
+
const headingLevel = readHeadingLevel(attributes["aria-level"], tag);
|
|
192
|
+
return headingLevel === void 0 ? { role: explicitRole } : { role: explicitRole, level: headingLevel };
|
|
193
|
+
}
|
|
194
|
+
if (explicitRole)
|
|
195
|
+
return { role: explicitRole };
|
|
196
|
+
if (tag === "iframe")
|
|
197
|
+
return { role: "iframe" };
|
|
198
|
+
const heading = tag.match(/^h([1-6])$/);
|
|
199
|
+
if (heading)
|
|
200
|
+
return { role: "heading", level: Number(heading[1]) };
|
|
201
|
+
if (tag === "button")
|
|
202
|
+
return { role: "button" };
|
|
203
|
+
if (tag === "a")
|
|
204
|
+
return { role: "link" };
|
|
205
|
+
if (tag === "textarea")
|
|
206
|
+
return { role: "textbox" };
|
|
207
|
+
if (tag === "select")
|
|
208
|
+
return { role: "combobox" };
|
|
209
|
+
if (tag === "option")
|
|
210
|
+
return { role: "option" };
|
|
211
|
+
if (isContentEditable(attributes))
|
|
212
|
+
return { role: "textbox" };
|
|
213
|
+
if (tag === "input") {
|
|
214
|
+
const inputType = (readString(attributes.type) || "text").toLowerCase();
|
|
215
|
+
return { role: kInputTypeToRole[inputType] || "textbox" };
|
|
216
|
+
}
|
|
217
|
+
return { role: tag || "node" };
|
|
218
|
+
}
|
|
219
|
+
function formatTextSuffix(node, role, value, text, name) {
|
|
220
|
+
const normalizedValue = normalizeText(value);
|
|
221
|
+
const normalizedText = normalizeText(text);
|
|
222
|
+
const inlineHint = buildInlineTextHint(node, normalizedText);
|
|
223
|
+
let suffix;
|
|
224
|
+
if (role === "textbox" && normalizedValue !== void 0)
|
|
225
|
+
suffix = /^\d+(\.\d+)?$/.test(normalizedValue) ? quoteValue(normalizedValue) : normalizedValue;
|
|
226
|
+
else if (normalizedText !== void 0 && normalizedText !== name)
|
|
227
|
+
suffix = normalizedText;
|
|
228
|
+
else if (normalizedValue !== void 0 && normalizedValue !== name)
|
|
229
|
+
suffix = normalizedValue;
|
|
230
|
+
if (inlineHint) {
|
|
231
|
+
if (!suffix)
|
|
232
|
+
return inlineHint;
|
|
233
|
+
if (!suffix.includes(inlineHint))
|
|
234
|
+
return `${suffix} [inline: ${inlineHint}]`;
|
|
235
|
+
}
|
|
236
|
+
if (suffix !== void 0)
|
|
237
|
+
return suffix;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
function resolveNodeName(node, tag, attributes) {
|
|
241
|
+
const nodeRecord = node;
|
|
242
|
+
const accessibleName = normalizeText(readString(nodeRecord.accessibleName));
|
|
243
|
+
const text = normalizeText(readString(nodeRecord.text));
|
|
244
|
+
const ariaLabel = normalizeText(readString(attributes["aria-label"]));
|
|
245
|
+
const ariaLabelledBy = normalizeText(readString(attributes["aria-labelledby"]));
|
|
246
|
+
const alt = normalizeText(readString(attributes.alt));
|
|
247
|
+
const childAlt = readImmediateChildAlt(node);
|
|
248
|
+
const placeholder = normalizeText(readString(attributes.placeholder));
|
|
249
|
+
const title = normalizeText(readString(attributes.title));
|
|
250
|
+
const testIdHint = readPreferredTestId(attributes);
|
|
251
|
+
const formFieldName = normalizeText(readString(attributes.name));
|
|
252
|
+
const semanticClassName = readDescriptiveSemanticClassName(attributes.class);
|
|
253
|
+
const srcName = extractSourceName(attributes.src);
|
|
254
|
+
const candidates = [];
|
|
255
|
+
const pushCandidate = (value, source, badgeKey) => {
|
|
256
|
+
const normalized = normalizeText(value);
|
|
257
|
+
if (!normalized)
|
|
258
|
+
return;
|
|
259
|
+
candidates.push({ value: normalized, source, badgeKey });
|
|
260
|
+
};
|
|
261
|
+
pushCandidate(ariaLabel, "aria-label");
|
|
262
|
+
if (ariaLabelledBy && accessibleName)
|
|
263
|
+
pushCandidate(accessibleName, "aria-labelledby");
|
|
264
|
+
const explicitSources = [ariaLabel, alt, childAlt, placeholder, title, testIdHint?.value, formFieldName, semanticClassName, srcName, text];
|
|
265
|
+
if (accessibleName && !explicitSources.some((value) => valuesEquivalent(accessibleName, value)))
|
|
266
|
+
pushCandidate(accessibleName, "accessibleName");
|
|
267
|
+
pushCandidate(alt, "alt");
|
|
268
|
+
pushCandidate(childAlt, "child-alt");
|
|
269
|
+
pushCandidate(placeholder, "placeholder");
|
|
270
|
+
pushCandidate(title, "title", "title");
|
|
271
|
+
if (testIdHint)
|
|
272
|
+
pushCandidate(testIdHint.value, testIdHint.key, testIdHint.key);
|
|
273
|
+
pushCandidate(formFieldName, "name", "name");
|
|
274
|
+
if (tag === "img")
|
|
275
|
+
pushCandidate(srcName, "src", "src");
|
|
276
|
+
pushCandidate(text, "text");
|
|
277
|
+
if (!candidates.length)
|
|
278
|
+
return { extras: [] };
|
|
279
|
+
const [winner, ...rest] = candidates;
|
|
280
|
+
const extras = [];
|
|
281
|
+
for (const candidate of rest) {
|
|
282
|
+
if (!candidate.badgeKey)
|
|
283
|
+
continue;
|
|
284
|
+
if (valuesEquivalent(candidate.value, winner.value))
|
|
285
|
+
continue;
|
|
286
|
+
if (extras.some((extra) => extra.key === candidate.badgeKey && valuesEquivalent(extra.value, candidate.value)))
|
|
287
|
+
continue;
|
|
288
|
+
extras.push({ key: candidate.badgeKey, value: candidate.value });
|
|
289
|
+
}
|
|
290
|
+
const consumedChildAlt = childAlt && valuesEquivalent(childAlt, winner.value) ? childAlt : void 0;
|
|
291
|
+
return {
|
|
292
|
+
name: winner.value,
|
|
293
|
+
source: winner.source,
|
|
294
|
+
consumedChildAlt,
|
|
295
|
+
extras
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function readImmediateChildAlt(node) {
|
|
299
|
+
for (const child of readChildren(node)) {
|
|
300
|
+
const childRecord = child;
|
|
301
|
+
const childAttributes = readRecord(childRecord.attributes) || {};
|
|
302
|
+
const childAlt = normalizeText(readString(childAttributes.alt));
|
|
303
|
+
if (childAlt)
|
|
304
|
+
return childAlt;
|
|
305
|
+
}
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
function resolveActionHint(onclick) {
|
|
309
|
+
const raw = readString(onclick);
|
|
310
|
+
if (!raw)
|
|
311
|
+
return;
|
|
312
|
+
const normalized = raw.toLowerCase();
|
|
313
|
+
if (normalized === "event.stoppropagation()")
|
|
314
|
+
return;
|
|
315
|
+
if (normalized.includes("queryselector") && normalized.includes("dropdown-list"))
|
|
316
|
+
return "toggle-dropdown";
|
|
317
|
+
if (normalized.includes("classlist.toggle"))
|
|
318
|
+
return "toggle";
|
|
319
|
+
if (normalized.includes("style.display") && normalized.includes("none") && normalized.includes("block"))
|
|
320
|
+
return "toggle-visibility";
|
|
321
|
+
const alertMatch = raw.match(/alert\((['"`])(.+?)\1\)/i);
|
|
322
|
+
if (alertMatch) {
|
|
323
|
+
const action = normalizeActionHint(alertMatch[2].replace(/\bclicked\b/i, ""));
|
|
324
|
+
if (action)
|
|
325
|
+
return action;
|
|
326
|
+
}
|
|
327
|
+
return "onclick";
|
|
328
|
+
}
|
|
329
|
+
function formatRawOnclick(value) {
|
|
330
|
+
const raw = readString(value);
|
|
331
|
+
if (!raw)
|
|
332
|
+
return;
|
|
333
|
+
if (raw.length <= 50)
|
|
334
|
+
return raw;
|
|
335
|
+
return raw.slice(0, 47) + "...";
|
|
336
|
+
}
|
|
337
|
+
function normalizeActionHint(value) {
|
|
338
|
+
const normalized = normalizeText(value)?.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
339
|
+
if (!normalized)
|
|
340
|
+
return;
|
|
341
|
+
return normalized;
|
|
342
|
+
}
|
|
343
|
+
function formatNamingExtraBadges(extras) {
|
|
344
|
+
return extras.map((extra) => `[${extra.key}=${formatBadgeValue(extra.value)}]`);
|
|
345
|
+
}
|
|
346
|
+
function formatControlBadges(tag, attributes, name, nameSource) {
|
|
347
|
+
const parts = [];
|
|
348
|
+
const inputType = normalizeText(readString(attributes.type))?.toLowerCase();
|
|
349
|
+
if (tag === "input" && inputType && inputType !== "text")
|
|
350
|
+
parts.push(`[type=${formatBadgeValue(inputType)}]`);
|
|
351
|
+
const placeholder = normalizeText(readString(attributes.placeholder));
|
|
352
|
+
if (placeholder && nameSource !== "placeholder" && placeholder !== name)
|
|
353
|
+
parts.push(`[placeholder=${formatBadgeValue(placeholder)}]`);
|
|
354
|
+
if (hasTruthyAttribute(attributes, "required"))
|
|
355
|
+
parts.push("[required]");
|
|
356
|
+
if (hasTruthyAttribute(attributes, "readonly") || attributeEquals(attributes["aria-readonly"], "true"))
|
|
357
|
+
parts.push("[readonly]");
|
|
358
|
+
const boundedAttributes = [
|
|
359
|
+
{ key: "min", badge: "min" },
|
|
360
|
+
{ key: "max", badge: "max" },
|
|
361
|
+
{ key: "step", badge: "step" },
|
|
362
|
+
{ key: "minlength", badge: "minlength" },
|
|
363
|
+
{ key: "maxlength", badge: "maxlength" },
|
|
364
|
+
{ key: "pattern", badge: "pattern" }
|
|
365
|
+
];
|
|
366
|
+
for (const bounded of boundedAttributes) {
|
|
367
|
+
const value = readAttributeValue(attributes[bounded.key]);
|
|
368
|
+
if (value)
|
|
369
|
+
parts.push(`[${bounded.badge}=${formatBadgeValue(value)}]`);
|
|
370
|
+
}
|
|
371
|
+
return parts;
|
|
372
|
+
}
|
|
373
|
+
function formatAriaBadges(attributes) {
|
|
374
|
+
const parts = [];
|
|
375
|
+
const badges = [
|
|
376
|
+
{ key: "aria-expanded", badge: "expanded" },
|
|
377
|
+
{ key: "aria-haspopup", badge: "haspopup" },
|
|
378
|
+
{ key: "aria-controls", badge: "controls" },
|
|
379
|
+
{ key: "aria-describedby", badge: "describedby" },
|
|
380
|
+
{ key: "aria-labelledby", badge: "labelledby" }
|
|
381
|
+
];
|
|
382
|
+
for (const item of badges) {
|
|
383
|
+
const value = readAttributeValue(attributes[item.key]);
|
|
384
|
+
if (value)
|
|
385
|
+
parts.push(`[${item.badge}=${formatBadgeValue(value)}]`);
|
|
386
|
+
}
|
|
387
|
+
return parts;
|
|
388
|
+
}
|
|
389
|
+
function formatStructuralHintBadges(nodeRecord, tag, role, attributes, name, explicitRole, usedNamingExtraKeys) {
|
|
390
|
+
if (!isGenericContainerRole(tag, role) || explicitRole)
|
|
391
|
+
return [];
|
|
392
|
+
if (!readBoolean(nodeRecord.isInteractive) && nodeRecord.isVisible !== false)
|
|
393
|
+
return [];
|
|
394
|
+
const parts = [];
|
|
395
|
+
const classHint = readSemanticClassHint(attributes.class);
|
|
396
|
+
if (classHint && !usedNamingExtraKeys.has("class"))
|
|
397
|
+
parts.push(`[class=${formatBadgeValue(classHint)}]`);
|
|
398
|
+
for (const [key, value] of readAllowedDataHints(attributes)) {
|
|
399
|
+
if (usedNamingExtraKeys.has(key))
|
|
400
|
+
continue;
|
|
401
|
+
parts.push(`[${key}=${formatBadgeValue(value)}]`);
|
|
402
|
+
}
|
|
403
|
+
if (!parts.length)
|
|
404
|
+
return parts;
|
|
405
|
+
if (name && readBoolean(nodeRecord.isInteractive))
|
|
406
|
+
return parts.slice(0, 1);
|
|
407
|
+
return parts;
|
|
408
|
+
}
|
|
409
|
+
function buildInlineTextHint(node, existingText) {
|
|
410
|
+
const childTexts = [];
|
|
411
|
+
const seen = /* @__PURE__ */ new Set();
|
|
412
|
+
for (const child of readChildren(node)) {
|
|
413
|
+
const childRecord = child;
|
|
414
|
+
if (readBoolean(childRecord.isInteractive))
|
|
415
|
+
continue;
|
|
416
|
+
if (childRecord.isVisible === false)
|
|
417
|
+
continue;
|
|
418
|
+
if (!isInlineTextChild(childRecord))
|
|
419
|
+
continue;
|
|
420
|
+
const childText = normalizeText(readString(childRecord.text));
|
|
421
|
+
if (!childText)
|
|
422
|
+
continue;
|
|
423
|
+
if (containsText(existingText, childText))
|
|
424
|
+
continue;
|
|
425
|
+
const key = childText.toLowerCase();
|
|
426
|
+
if (seen.has(key))
|
|
427
|
+
continue;
|
|
428
|
+
seen.add(key);
|
|
429
|
+
childTexts.push(childText);
|
|
430
|
+
}
|
|
431
|
+
if (!childTexts.length)
|
|
432
|
+
return;
|
|
433
|
+
return childTexts.join(", ");
|
|
434
|
+
}
|
|
435
|
+
function isInlineTextChild(nodeRecord) {
|
|
436
|
+
const tag = readString(nodeRecord.tag)?.toLowerCase();
|
|
437
|
+
if (!tag || tag === "svg" || tag === "img")
|
|
438
|
+
return false;
|
|
439
|
+
const display = readString(readRecord(nodeRecord.computedStyle)?.display)?.toLowerCase();
|
|
440
|
+
if (display === "inline" || display === "inline-block")
|
|
441
|
+
return true;
|
|
442
|
+
return ["strong", "em", "b", "i", "mark", "small", "code"].includes(tag);
|
|
443
|
+
}
|
|
444
|
+
function containsText(haystack, needle) {
|
|
445
|
+
if (!haystack)
|
|
446
|
+
return false;
|
|
447
|
+
return haystack.toLowerCase().includes(needle.toLowerCase());
|
|
448
|
+
}
|
|
449
|
+
function isGenericContainerRole(tag, role) {
|
|
450
|
+
if (tag !== role)
|
|
451
|
+
return false;
|
|
452
|
+
return ["div", "span", "section", "article", "aside", "main", "header", "footer", "nav", "form", "li"].includes(tag);
|
|
453
|
+
}
|
|
454
|
+
function readSemanticClassHint(value) {
|
|
455
|
+
const className = readString(value);
|
|
456
|
+
if (!className)
|
|
457
|
+
return;
|
|
458
|
+
const semanticTokens = className.split(/\s+/).filter((token) => {
|
|
459
|
+
if (!token)
|
|
460
|
+
return false;
|
|
461
|
+
const normalized = token.toLowerCase();
|
|
462
|
+
if (normalized.length < 3)
|
|
463
|
+
return false;
|
|
464
|
+
if (/^(css|sc|jsx|chakra|mantine|ant|Mui|css-)/i.test(token))
|
|
465
|
+
return false;
|
|
466
|
+
if (/^[a-f0-9_-]{6,}$/i.test(token))
|
|
467
|
+
return false;
|
|
468
|
+
return /(icon|btn|button|toggle|switch|dropdown|menu|tab|modal|dialog|tooltip|popover|select|option|search|input|form|nav|sidebar|card|item|avatar|chip|badge|panel|list)/i.test(token);
|
|
469
|
+
});
|
|
470
|
+
if (!semanticTokens.length)
|
|
471
|
+
return;
|
|
472
|
+
return semanticTokens.join(" ");
|
|
473
|
+
}
|
|
474
|
+
function readDescriptiveSemanticClassName(value) {
|
|
475
|
+
const classHint = readSemanticClassHint(value);
|
|
476
|
+
if (!classHint)
|
|
477
|
+
return;
|
|
478
|
+
const normalized = classHint.toLowerCase().split(/\s+/);
|
|
479
|
+
const genericOnly = normalized.every((token) => ["icon", "icon-btn", "btn", "button", "item", "panel", "list", "card"].includes(token));
|
|
480
|
+
if (genericOnly)
|
|
481
|
+
return;
|
|
482
|
+
return classHint;
|
|
483
|
+
}
|
|
484
|
+
function readPreferredTestId(attributes) {
|
|
485
|
+
const keys = ["data-testid", "data-test-id", "data-test", "data-qa", "data-cy"];
|
|
486
|
+
for (const key of keys) {
|
|
487
|
+
const value = readAttributeValue(attributes[key]);
|
|
488
|
+
if (value)
|
|
489
|
+
return { key, value };
|
|
490
|
+
}
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
function readAllowedDataHints(attributes) {
|
|
494
|
+
const hints = [];
|
|
495
|
+
const allowedKeys = ["data-testid", "data-test-id", "data-test", "data-qa", "data-cy", "data-action", "data-tooltip", "data-type", "data-state", "data-label", "data-name"];
|
|
496
|
+
for (const key of allowedKeys) {
|
|
497
|
+
const value = readAttributeValue(attributes[key]);
|
|
498
|
+
if (value)
|
|
499
|
+
hints.push([key, value]);
|
|
500
|
+
}
|
|
501
|
+
return hints;
|
|
502
|
+
}
|
|
503
|
+
function hasTruthyAttribute(attributes, key) {
|
|
504
|
+
if (!Object.prototype.hasOwnProperty.call(attributes, key))
|
|
505
|
+
return false;
|
|
506
|
+
const value = attributes[key];
|
|
507
|
+
if (value === false || value === null || value === void 0)
|
|
508
|
+
return false;
|
|
509
|
+
if (typeof value === "string")
|
|
510
|
+
return value.toLowerCase() !== "false";
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
function attributeEquals(value, expected) {
|
|
514
|
+
return readAttributeValue(value)?.toLowerCase() === expected;
|
|
515
|
+
}
|
|
516
|
+
function readAttributeValue(value) {
|
|
517
|
+
if (typeof value === "string")
|
|
518
|
+
return normalizeText(value);
|
|
519
|
+
if (typeof value === "number" || typeof value === "bigint")
|
|
520
|
+
return String(value);
|
|
521
|
+
if (value === true)
|
|
522
|
+
return "true";
|
|
523
|
+
if (value === false)
|
|
524
|
+
return "false";
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
function formatBadgeValue(value) {
|
|
528
|
+
return /^[a-z0-9._:-]+$/i.test(value) ? value : quoteValue(value);
|
|
529
|
+
}
|
|
530
|
+
function hasPointerCursor(nodeRecord, attributes, tag) {
|
|
531
|
+
const computedCursor = readString(readRecord(nodeRecord.computedStyle)?.cursor);
|
|
532
|
+
const hasPointer = computedCursor === "pointer" || styleContainsPointerCursor(attributes.style);
|
|
533
|
+
if (!hasPointer)
|
|
534
|
+
return false;
|
|
535
|
+
if (readBoolean(nodeRecord.isInteractive))
|
|
536
|
+
return true;
|
|
537
|
+
if (hasInlineHandler(attributes))
|
|
538
|
+
return true;
|
|
539
|
+
if (tag === "a" || tag === "button" || tag === "summary")
|
|
540
|
+
return true;
|
|
541
|
+
if (readString(nodeRecord.text) || readString(nodeRecord.accessibleName))
|
|
542
|
+
return true;
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
function compactMediaChild(node, consumedChildAlt, indent) {
|
|
546
|
+
const nodeRecord = node;
|
|
547
|
+
const tag = readString(nodeRecord.tag)?.toLowerCase();
|
|
548
|
+
if (tag !== "svg" && tag !== "img")
|
|
549
|
+
return void 0;
|
|
550
|
+
if (tag === "svg")
|
|
551
|
+
return `${indent}- img [tag=svg]`;
|
|
552
|
+
const attributes = readRecord(nodeRecord.attributes) || {};
|
|
553
|
+
const alt = normalizeText(readString(attributes.alt));
|
|
554
|
+
const altBadge = alt && alt !== consumedChildAlt ? ` [alt=${quoteValue(alt)}]` : "";
|
|
555
|
+
return `${indent}- img${altBadge}`;
|
|
556
|
+
}
|
|
557
|
+
function quoteValue(value) {
|
|
558
|
+
return JSON.stringify(normalizeText(value) || value);
|
|
559
|
+
}
|
|
560
|
+
function normalizeText(value) {
|
|
561
|
+
if (!value)
|
|
562
|
+
return;
|
|
563
|
+
const normalized = value.replace(/\s+/g, " ").replace(/\s+([.,;:!?])/g, "$1").trim();
|
|
564
|
+
if (!normalized)
|
|
565
|
+
return;
|
|
566
|
+
if (normalized.length <= 200)
|
|
567
|
+
return normalized;
|
|
568
|
+
return normalized.slice(0, 197) + "...";
|
|
569
|
+
}
|
|
570
|
+
function isContentEditable(attributes) {
|
|
571
|
+
const value = readString(attributes.contenteditable);
|
|
572
|
+
return !!value && value.toLowerCase() !== "false";
|
|
573
|
+
}
|
|
574
|
+
function readChildren(node) {
|
|
575
|
+
const raw = node.children;
|
|
576
|
+
if (!Array.isArray(raw))
|
|
577
|
+
return [];
|
|
578
|
+
const children = [];
|
|
579
|
+
for (const child of raw) {
|
|
580
|
+
const parsed = asTreeNode(child);
|
|
581
|
+
if (parsed)
|
|
582
|
+
children.push(parsed);
|
|
583
|
+
}
|
|
584
|
+
return children;
|
|
585
|
+
}
|
|
586
|
+
function asTreeNode(value) {
|
|
587
|
+
if (!value || typeof value !== "object")
|
|
588
|
+
return;
|
|
589
|
+
return value;
|
|
590
|
+
}
|
|
591
|
+
function readRecord(value) {
|
|
592
|
+
if (!value || typeof value !== "object")
|
|
593
|
+
return;
|
|
594
|
+
return value;
|
|
595
|
+
}
|
|
596
|
+
function readString(value) {
|
|
597
|
+
if (typeof value !== "string")
|
|
598
|
+
return;
|
|
599
|
+
const trimmed = value.trim();
|
|
600
|
+
if (!trimmed)
|
|
601
|
+
return;
|
|
602
|
+
return trimmed;
|
|
603
|
+
}
|
|
604
|
+
function readBoolean(value) {
|
|
605
|
+
return value === true;
|
|
606
|
+
}
|
|
607
|
+
function readHeadingLevel(value, tag) {
|
|
608
|
+
if (typeof value === "number" && Number.isInteger(value) && value > 0)
|
|
609
|
+
return value;
|
|
610
|
+
if (typeof value === "string" && /^\d+$/.test(value))
|
|
611
|
+
return Number(value);
|
|
612
|
+
const heading = tag.match(/^h([1-6])$/);
|
|
613
|
+
if (heading)
|
|
614
|
+
return Number(heading[1]);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
function styleContainsPointerCursor(value) {
|
|
618
|
+
const style = readString(value);
|
|
619
|
+
if (!style)
|
|
620
|
+
return false;
|
|
621
|
+
return /(?:^|;)\s*cursor\s*:\s*pointer\s*(?:;|$)/i.test(style);
|
|
622
|
+
}
|
|
623
|
+
function hasInlineHandler(attributes) {
|
|
624
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
625
|
+
if (!key.startsWith("on"))
|
|
626
|
+
continue;
|
|
627
|
+
if (readAttributeValue(value))
|
|
628
|
+
return true;
|
|
629
|
+
}
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
function valuesEquivalent(left, right) {
|
|
633
|
+
if (!left || !right)
|
|
634
|
+
return false;
|
|
635
|
+
return comparableText(left) === comparableText(right);
|
|
636
|
+
}
|
|
637
|
+
function comparableText(value) {
|
|
638
|
+
return normalizeText(value)?.toLowerCase().replace(/['"`]/g, "").trim() || "";
|
|
639
|
+
}
|
|
640
|
+
function extractSourceName(value) {
|
|
641
|
+
const src = readString(value);
|
|
642
|
+
if (!src || src.startsWith("data:"))
|
|
643
|
+
return;
|
|
644
|
+
try {
|
|
645
|
+
const url = new URL(src, "http://example.invalid");
|
|
646
|
+
const pathname = url.pathname.split("/").pop();
|
|
647
|
+
return normalizeText(pathname || src);
|
|
648
|
+
} catch {
|
|
649
|
+
const fileName = src.split(/[/?#]/).filter(Boolean).pop();
|
|
650
|
+
return normalizeText(fileName);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
654
|
+
0 && (module.exports = {
|
|
655
|
+
customDomStableLocatorKey,
|
|
656
|
+
formatCustomDomSnapshot,
|
|
657
|
+
isCustomDomSnapshotEnvelope
|
|
658
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var devtools_exports = {};
|
|
20
|
+
__export(devtools_exports, {
|
|
21
|
+
default: () => devtools_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(devtools_exports);
|
|
24
|
+
var import_mcpBundle = require("../mcpBundle");
|
|
25
|
+
var import_tool = require("./tool");
|
|
26
|
+
const devtoolsConnect = (0, import_tool.defineTool)({
|
|
27
|
+
capability: "devtools",
|
|
28
|
+
skillOnly: true,
|
|
29
|
+
schema: {
|
|
30
|
+
name: "browser_devtools_start",
|
|
31
|
+
title: "Start browser DevTools",
|
|
32
|
+
description: "Start browser DevTools",
|
|
33
|
+
inputSchema: import_mcpBundle.z.object({}),
|
|
34
|
+
type: "action"
|
|
35
|
+
},
|
|
36
|
+
handle: async (context, params, response) => {
|
|
37
|
+
const browserContext = await context.ensureBrowserContext();
|
|
38
|
+
const { url } = await browserContext._devtoolsStart();
|
|
39
|
+
response.addTextResult("Server is listening on: " + url);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var devtools_default = [devtoolsConnect];
|