chrome-devtools-mcp 1.12.0 → 1.13.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/README.md +1 -1
- package/{build → out/Default/gen}/src/BrowserManager.js +22 -0
- package/out/Default/gen/src/LogpointManager.js +307 -0
- package/{build → out/Default/gen}/src/McpContext.js +10 -52
- package/{build → out/Default/gen}/src/McpPage.js +181 -2
- package/{build → out/Default/gen}/src/McpResponse.js +29 -3
- package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
- package/{build → out/Default/gen}/src/ToolHandler.js +53 -22
- package/{build → out/Default/gen}/src/collectors/PageCollector.js +15 -3
- package/{build → out/Default/gen}/src/config/ConfigParser.js +4 -1
- package/{build → out/Default/gen}/src/config/category-options.js +10 -0
- package/{build → out/Default/gen}/src/config/cli-options.js +188 -3
- package/{build → out/Default/gen}/src/config/mcp-options.js +1 -1
- package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +45 -8
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +16 -2
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/{build → out/Default/gen}/src/index.js +2 -1
- package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
- package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +354 -367
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +9023 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
- package/out/Default/gen/src/third_party/index.js +201574 -0
- package/{build → out/Default/gen}/src/third_party/lighthouse-devtools-mcp-bundle.js +11034 -11476
- package/{build → out/Default/gen}/src/tools/ToolDefinition.js +66 -56
- package/{build → out/Default/gen}/src/tools/categories.js +4 -0
- package/{build → out/Default/gen}/src/tools/comments.js +4 -1
- package/{build → out/Default/gen}/src/tools/console.js +2 -2
- package/{build → out/Default/gen}/src/tools/extensions.js +1 -1
- package/{build → out/Default/gen}/src/tools/input.js +9 -29
- package/{build → out/Default/gen}/src/tools/lighthouse.js +6 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/network.js +260 -0
- package/{build → out/Default/gen}/src/tools/performance.js +26 -3
- package/{build → out/Default/gen}/src/tools/snapshot.js +20 -6
- package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +3 -19
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/{build → out/Default/gen}/src/tools/tools.js +4 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/{build → out/Default/gen}/src/tools/webmcp.js +3 -19
- package/{build → out/Default/gen}/src/utils/TaskRunner.js +31 -16
- package/{build → out/Default/gen}/src/utils/WaitForHelper.js +15 -1
- package/{build → out/Default/gen}/src/utils/check-for-updates.js +7 -1
- package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
- package/{build → out/Default/gen}/src/utils/keyboard.js +5 -7
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/{build → out/Default/gen}/src/utils/url.js +33 -18
- package/{build → out/Default/gen}/src/version.js +1 -1
- package/package.json +25 -32
- package/skills/chrome-devtools/SKILL.md +2 -0
- package/skills/chrome-devtools-cli/SKILL.md +12 -1
- package/build/src/third_party/bundled-packages.json +0 -11
- package/build/src/third_party/cli.js +0 -9239
- package/build/src/third_party/devtools-formatter-worker.js +0 -17276
- package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12255
- package/build/src/third_party/index.js +0 -186086
- package/build/src/tools/network.js +0 -129
- /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
- /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
- /package/{build → out/Default/gen}/src/TextSnapshot.js +0 -0
- /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools.js +0 -0
- /package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +0 -0
- /package/{build → out/Default/gen}/src/collectors/constants.js +0 -0
- /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
- /package/{build → out/Default/gen}/src/config/ConfigWatcher.js +0 -0
- /package/{build → out/Default/gen}/src/config/ServerConfig.js +0 -0
- /package/{build → out/Default/gen}/src/config/browser-options.js +0 -0
- /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
- /package/{build → out/Default/gen}/src/config/puppeteer-options.js +0 -0
- /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/client.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/daemon.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/utils.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/RemoteObjectFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
- /package/{build → out/Default/gen}/src/processors/HeapSnapshotManager.js +0 -0
- /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/tools/css.js +0 -0
- /package/{build → out/Default/gen}/src/tools/emulation.js +0 -0
- /package/{build → out/Default/gen}/src/tools/memory.js +0 -0
- /package/{build → out/Default/gen}/src/tools/pages.js +0 -0
- /package/{build → out/Default/gen}/src/tools/pwa.js +0 -0
- /package/{build → out/Default/gen}/src/tools/screencast.js +0 -0
- /package/{build → out/Default/gen}/src/tools/screenshot.js +0 -0
- /package/{build → out/Default/gen}/src/tools/script.js +0 -0
- /package/{build → out/Default/gen}/src/tools/slim/tools.js +0 -0
- /package/{build → out/Default/gen}/src/types.js +0 -0
- /package/{build → out/Default/gen}/src/utils/bytes.js +0 -0
- /package/{build → out/Default/gen}/src/utils/disclaimers.js +0 -0
- /package/{build → out/Default/gen}/src/utils/files.js +0 -0
- /package/{build → out/Default/gen}/src/utils/id.js +0 -0
- /package/{build → out/Default/gen}/src/utils/logger.js +0 -0
- /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
- /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
- /package/{build → out/Default/gen}/src/utils/resourceType.js +0 -0
- /package/{build → out/Default/gen}/src/utils/text.js +0 -0
- /package/{build → out/Default/gen}/src/utils/timeout.js +0 -0
|
@@ -52,10 +52,21 @@ export function zodTransform(transform) {
|
|
|
52
52
|
return transform(arg);
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
if (error instanceof zod.ZodError) {
|
|
56
|
+
for (const issue of error.issues) {
|
|
57
|
+
ctx.addIssue({
|
|
58
|
+
code: 'custom',
|
|
59
|
+
message: issue.message,
|
|
60
|
+
path: issue.path,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
ctx.addIssue({
|
|
66
|
+
code: 'custom',
|
|
67
|
+
message: error instanceof Error ? error.message : String(error),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
59
70
|
return zod.NEVER;
|
|
60
71
|
}
|
|
61
72
|
};
|
|
@@ -64,61 +75,61 @@ export const timeoutSchema = {
|
|
|
64
75
|
timeout: zod
|
|
65
76
|
.number()
|
|
66
77
|
.int()
|
|
67
|
-
.transform(
|
|
78
|
+
.transform(value => {
|
|
68
79
|
return value <= 0 ? undefined : value;
|
|
69
|
-
})
|
|
80
|
+
})
|
|
70
81
|
.optional()
|
|
71
82
|
.describe(`Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`),
|
|
72
83
|
};
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
const integerStringSchema = zod
|
|
85
|
+
.string()
|
|
86
|
+
.regex(/^[+-]?\d+$/, 'Expected an integer')
|
|
87
|
+
.pipe(zod.coerce.number());
|
|
88
|
+
const decimalStringSchema = zod
|
|
89
|
+
.string()
|
|
90
|
+
.regex(/^[+-]?\d+(\.\d+)?$/, 'Expected a number')
|
|
91
|
+
.pipe(zod.coerce.number());
|
|
92
|
+
/* eslint-disable @local/enforce-zod-schema */
|
|
93
|
+
const geolocationSchema = zod.object({
|
|
94
|
+
latitude: decimalStringSchema.pipe(zod.number().min(-90).max(90)),
|
|
95
|
+
longitude: decimalStringSchema.pipe(zod.number().min(-180).max(180)),
|
|
96
|
+
});
|
|
97
|
+
const VIEWPORT_FORMAT = '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]';
|
|
98
|
+
const viewportTagSchema = zod.enum(['mobile', 'touch', 'landscape'], {
|
|
99
|
+
error: issue => `Invalid viewport option "${String(issue.input)}". Expected "mobile", "touch", or "landscape" in '${VIEWPORT_FORMAT}'.`,
|
|
100
|
+
});
|
|
101
|
+
// CDP's Emulation.setDeviceMetricsOverride takes integer width and height.
|
|
102
|
+
const viewportSchema = zod.object({
|
|
103
|
+
width: integerStringSchema.pipe(zod.number().int().positive()),
|
|
104
|
+
height: integerStringSchema.pipe(zod.number().int().positive()),
|
|
105
|
+
deviceScaleFactor: decimalStringSchema
|
|
106
|
+
.pipe(zod.number().positive())
|
|
107
|
+
.optional(),
|
|
108
|
+
isMobile: zod.boolean().optional(),
|
|
109
|
+
isLandscape: zod.boolean().optional(),
|
|
110
|
+
hasTouch: zod.boolean().optional(),
|
|
111
|
+
});
|
|
112
|
+
/* eslint-enable @local/enforce-zod-schema */
|
|
81
113
|
export function viewportTransform(arg) {
|
|
82
114
|
if (!arg) {
|
|
83
115
|
return undefined;
|
|
84
116
|
}
|
|
85
117
|
const [dimensions, ...tags] = arg.split(',');
|
|
86
118
|
for (const tag of tags) {
|
|
87
|
-
|
|
88
|
-
throw new Error(`Invalid viewport tag "${tag}". Expected format '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'.`);
|
|
89
|
-
}
|
|
119
|
+
viewportTagSchema.parse(tag);
|
|
90
120
|
}
|
|
91
|
-
const isMobile = tags.includes('mobile');
|
|
92
|
-
const hasTouch = tags.includes('touch');
|
|
93
|
-
const isLandscape = tags.includes('landscape');
|
|
94
121
|
const dimParts = dimensions.split('x');
|
|
95
122
|
if (dimParts.length !== 2 && dimParts.length !== 3) {
|
|
96
|
-
throw new Error(`Invalid viewport dimensions "${dimensions}". Expected format '
|
|
97
|
-
}
|
|
98
|
-
const width = parseDecimal(dimParts[0], 'viewport width');
|
|
99
|
-
if (!Number.isFinite(width) || width <= 0) {
|
|
100
|
-
throw new Error(`Invalid viewport width "${width}". Expected format '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]' with a positive width.`);
|
|
101
|
-
}
|
|
102
|
-
const height = parseDecimal(dimParts[1], 'viewport height');
|
|
103
|
-
if (!Number.isFinite(height) || height <= 0) {
|
|
104
|
-
throw new Error(`Invalid viewport height "${height}". Expected format '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]' with a positive height.`);
|
|
105
|
-
}
|
|
106
|
-
let deviceScaleFactor;
|
|
107
|
-
if (dimParts.length === 3) {
|
|
108
|
-
const dpr = parseDecimal(dimParts[2], 'devicePixelRatio');
|
|
109
|
-
if (!Number.isFinite(dpr) || dpr <= 0) {
|
|
110
|
-
throw new Error(`Invalid devicePixelRatio "${dpr}". Expected a positive number.`);
|
|
111
|
-
}
|
|
112
|
-
deviceScaleFactor = dpr;
|
|
123
|
+
throw new Error(`Invalid viewport dimensions "${dimensions}". Expected format '${VIEWPORT_FORMAT}'.`);
|
|
113
124
|
}
|
|
114
|
-
return {
|
|
115
|
-
width,
|
|
116
|
-
height,
|
|
117
|
-
deviceScaleFactor,
|
|
118
|
-
isMobile,
|
|
119
|
-
isLandscape,
|
|
120
|
-
hasTouch,
|
|
121
|
-
};
|
|
125
|
+
return viewportSchema.parse({
|
|
126
|
+
width: dimParts[0],
|
|
127
|
+
height: dimParts[1],
|
|
128
|
+
deviceScaleFactor: dimParts[2],
|
|
129
|
+
isMobile: tags.includes('mobile'),
|
|
130
|
+
isLandscape: tags.includes('landscape'),
|
|
131
|
+
hasTouch: tags.includes('touch'),
|
|
132
|
+
});
|
|
122
133
|
}
|
|
123
134
|
export function geolocationTransform(arg) {
|
|
124
135
|
if (!arg) {
|
|
@@ -128,18 +139,17 @@ export function geolocationTransform(arg) {
|
|
|
128
139
|
if (parts.length !== 2) {
|
|
129
140
|
throw new Error(`Invalid geolocation "${arg}". Expected '<latitude>,<longitude>'.`);
|
|
130
141
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
return geolocationSchema.parse({
|
|
143
|
+
latitude: parts[0],
|
|
144
|
+
longitude: parts[1],
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const jsonObjectSchema = zod.record(zod.string(), zod.unknown());
|
|
148
|
+
export function jsonObjectTransform(arg) {
|
|
149
|
+
if (!arg) {
|
|
150
|
+
return undefined;
|
|
138
151
|
}
|
|
139
|
-
return
|
|
140
|
-
latitude,
|
|
141
|
-
longitude,
|
|
142
|
-
};
|
|
152
|
+
return jsonObjectSchema.parse(JSON.parse(arg));
|
|
143
153
|
}
|
|
144
154
|
export function isSlimTool(tool) {
|
|
145
155
|
return Boolean(tool.annotations.conditions?.includes('slim'));
|
|
@@ -10,12 +10,14 @@ export var ToolCategory;
|
|
|
10
10
|
ToolCategory["EMULATION"] = "emulation";
|
|
11
11
|
ToolCategory["PERFORMANCE"] = "performance";
|
|
12
12
|
ToolCategory["NETWORK"] = "network";
|
|
13
|
+
ToolCategory["NETWORK_MOCKS"] = "networkMocks";
|
|
13
14
|
ToolCategory["DEBUGGING"] = "debugging";
|
|
14
15
|
ToolCategory["EXTENSIONS"] = "extensions";
|
|
15
16
|
ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
|
|
16
17
|
ToolCategory["MEMORY"] = "memory";
|
|
17
18
|
ToolCategory["WEBMCP"] = "experimentalWebmcp";
|
|
18
19
|
ToolCategory["PWA"] = "pwa";
|
|
20
|
+
ToolCategory["WEBAUTHN"] = "webauthn";
|
|
19
21
|
})(ToolCategory || (ToolCategory = {}));
|
|
20
22
|
export const labels = {
|
|
21
23
|
[ToolCategory.INPUT]: 'Input automation',
|
|
@@ -23,11 +25,13 @@ export const labels = {
|
|
|
23
25
|
[ToolCategory.EMULATION]: 'Emulation',
|
|
24
26
|
[ToolCategory.PERFORMANCE]: 'Performance',
|
|
25
27
|
[ToolCategory.NETWORK]: 'Network',
|
|
28
|
+
[ToolCategory.NETWORK_MOCKS]: 'Network mocks',
|
|
26
29
|
[ToolCategory.DEBUGGING]: 'Debugging',
|
|
27
30
|
[ToolCategory.EXTENSIONS]: 'Extensions',
|
|
28
31
|
[ToolCategory.THIRD_PARTY]: 'Third-party',
|
|
29
32
|
[ToolCategory.MEMORY]: 'Memory',
|
|
30
33
|
[ToolCategory.WEBMCP]: 'WebMCP',
|
|
31
34
|
[ToolCategory.PWA]: 'Progressive Web Apps',
|
|
35
|
+
[ToolCategory.WEBAUTHN]: 'WebAuthn',
|
|
32
36
|
};
|
|
33
37
|
//# sourceMappingURL=categories.js.map
|
|
@@ -22,7 +22,10 @@ export const openDevtools = definePageTool(() => ({
|
|
|
22
22
|
handler: async (request, response) => {
|
|
23
23
|
const page = request.page;
|
|
24
24
|
try {
|
|
25
|
-
await page.openDevTools();
|
|
25
|
+
const devtoolsPage = await page.openDevTools();
|
|
26
|
+
if (devtoolsPage) {
|
|
27
|
+
await page.ensureDevToolsCommentBridge(devtoolsPage);
|
|
28
|
+
}
|
|
26
29
|
response.appendResponseLine('DevTools window opened successfully.');
|
|
27
30
|
}
|
|
28
31
|
catch (e) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
8
|
import { definePageTool } from './ToolDefinition.js';
|
|
9
|
+
import { GET_CONSOLE_MESSAGE_TOOL_NAME, LIST_CONSOLE_MESSAGES_TOOL_NAME, } from './toolNames.js';
|
|
9
10
|
const FILTERABLE_MESSAGE_TYPES = [
|
|
10
11
|
'log',
|
|
11
12
|
'debug',
|
|
@@ -28,7 +29,6 @@ const FILTERABLE_MESSAGE_TYPES = [
|
|
|
28
29
|
'verbose',
|
|
29
30
|
'issue',
|
|
30
31
|
];
|
|
31
|
-
const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
|
|
32
32
|
export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
33
33
|
return {
|
|
34
34
|
name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
|
|
@@ -85,7 +85,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
87
|
export const getConsoleMessage = definePageTool(() => ({
|
|
88
|
-
name:
|
|
88
|
+
name: GET_CONSOLE_MESSAGE_TOOL_NAME,
|
|
89
89
|
description: `Gets a console message by its ID. You can get all messages by calling ${LIST_CONSOLE_MESSAGES_TOOL_NAME}.`,
|
|
90
90
|
annotations: {
|
|
91
91
|
category: ToolCategory.DEBUGGING,
|
|
@@ -50,7 +50,7 @@ export const uninstallExtension = defineTool(() => ({
|
|
|
50
50
|
}));
|
|
51
51
|
export const listExtensions = defineTool(() => ({
|
|
52
52
|
name: 'list_extensions',
|
|
53
|
-
description: 'Lists
|
|
53
|
+
description: 'Lists the unpacked Chrome extensions loaded in the browser. This includes their name, ID, version, and enabled status. Extensions installed from the Chrome Web Store are not included.',
|
|
54
54
|
annotations: {
|
|
55
55
|
category: ToolCategory.EXTENSIONS,
|
|
56
56
|
readOnlyHint: true,
|
|
@@ -56,10 +56,11 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
56
56
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
57
57
|
});
|
|
58
58
|
import { TimeoutError, zod, } from '../third_party/index.js';
|
|
59
|
-
import {
|
|
59
|
+
import { parseKey, throwIfInvalidKey } from '../utils/keyboard.js';
|
|
60
60
|
import { logger } from '../utils/logger.js';
|
|
61
|
+
import { raceWithSignal } from '../utils/raceWithSignal.js';
|
|
61
62
|
import { ToolCategory } from './categories.js';
|
|
62
|
-
import { definePageTool, } from './ToolDefinition.js';
|
|
63
|
+
import { definePageTool, zodTransform, } from './ToolDefinition.js';
|
|
63
64
|
const dblClickSchema = zod
|
|
64
65
|
.boolean()
|
|
65
66
|
.optional()
|
|
@@ -71,9 +72,7 @@ const includeSnapshotSchema = zod
|
|
|
71
72
|
const submitKeySchema = zod
|
|
72
73
|
.string()
|
|
73
74
|
// An empty string means no submit key, as before.
|
|
74
|
-
.
|
|
75
|
-
error: issue => invalidKeyMessage(String(issue.input)),
|
|
76
|
-
})
|
|
75
|
+
.transform(zodTransform((key) => key === '' ? undefined : throwIfInvalidKey(key)))
|
|
77
76
|
.optional()
|
|
78
77
|
.describe('Optional key to press after typing. E.g., "Enter", "Tab", "Escape"');
|
|
79
78
|
/**
|
|
@@ -272,24 +271,6 @@ export const hover = definePageTool(() => ({
|
|
|
272
271
|
}
|
|
273
272
|
},
|
|
274
273
|
}));
|
|
275
|
-
function raceWithSignal(promise, signal) {
|
|
276
|
-
if (signal.aborted) {
|
|
277
|
-
return Promise.reject(signal.reason);
|
|
278
|
-
}
|
|
279
|
-
return new Promise((resolve, reject) => {
|
|
280
|
-
const onAbort = () => {
|
|
281
|
-
reject(signal.reason);
|
|
282
|
-
};
|
|
283
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
284
|
-
Promise.resolve(promise).then(value => {
|
|
285
|
-
signal.removeEventListener('abort', onAbort);
|
|
286
|
-
resolve(value);
|
|
287
|
-
}, error => {
|
|
288
|
-
signal.removeEventListener('abort', onAbort);
|
|
289
|
-
reject(error);
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
274
|
// The AXNode for an option doesn't contain its `value`. We set text content of the option as value.
|
|
294
275
|
// If the form is a combobox, we need to find the correct option by its text value.
|
|
295
276
|
// To do that, loop through the children while checking which child's text matches the requested value (requested value is actually the text content).
|
|
@@ -463,8 +444,7 @@ export const typeText = definePageTool(() => ({
|
|
|
463
444
|
const submitKey = request.params.submitKey;
|
|
464
445
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
465
446
|
await page.pptrPage.keyboard.type(request.params.text);
|
|
466
|
-
|
|
467
|
-
if (submitKey && isValidKey(submitKey)) {
|
|
447
|
+
if (submitKey) {
|
|
468
448
|
await page.pptrPage.keyboard.press(submitKey);
|
|
469
449
|
}
|
|
470
450
|
});
|
|
@@ -626,7 +606,7 @@ export const uploadFile = definePageTool(() => ({
|
|
|
626
606
|
}));
|
|
627
607
|
export const pressKey = definePageTool(() => ({
|
|
628
608
|
name: 'press_key',
|
|
629
|
-
description: `Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations).`,
|
|
609
|
+
description: `Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native <select> elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.`,
|
|
630
610
|
annotations: {
|
|
631
611
|
category: ToolCategory.INPUT,
|
|
632
612
|
readOnlyHint: false,
|
|
@@ -634,6 +614,7 @@ export const pressKey = definePageTool(() => ({
|
|
|
634
614
|
schema: {
|
|
635
615
|
key: zod
|
|
636
616
|
.string()
|
|
617
|
+
.transform(zodTransform(parseKey))
|
|
637
618
|
.describe('A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta'),
|
|
638
619
|
includeSnapshot: includeSnapshotSchema,
|
|
639
620
|
},
|
|
@@ -642,8 +623,7 @@ export const pressKey = definePageTool(() => ({
|
|
|
642
623
|
verifyFilesSchema: {},
|
|
643
624
|
handler: async (request, response) => {
|
|
644
625
|
const page = request.page;
|
|
645
|
-
const
|
|
646
|
-
const [key, ...modifiers] = tokens;
|
|
626
|
+
const [key, ...modifiers] = request.params.key;
|
|
647
627
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
648
628
|
const heldModifiers = [];
|
|
649
629
|
try {
|
|
@@ -662,7 +642,7 @@ export const pressKey = definePageTool(() => ({
|
|
|
662
642
|
}
|
|
663
643
|
}
|
|
664
644
|
});
|
|
665
|
-
response.appendResponseLine(`Successfully pressed key: ${
|
|
645
|
+
response.appendResponseLine(`Successfully pressed key: ${[...modifiers, key].join('+')}`);
|
|
666
646
|
response.attachWaitForResult(result);
|
|
667
647
|
if (request.params.includeSnapshot) {
|
|
668
648
|
response.includeSnapshot();
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import path from 'node:path';
|
|
7
|
+
import { NetworkOverridesFormatter } from '../formatters/NetworkOverridesFormatter.js';
|
|
7
8
|
import { generateReport, zod, } from '../third_party/index.js';
|
|
8
9
|
import { ToolCategory } from './categories.js';
|
|
9
10
|
import { startTrace } from './performance.js';
|
|
@@ -217,6 +218,11 @@ export const lighthouseAudit = definePageTool((args) => ({
|
|
|
217
218
|
await page.restoreEmulation();
|
|
218
219
|
}
|
|
219
220
|
const lhr = result.lhr;
|
|
221
|
+
const { warning } = new NetworkOverridesFormatter(page.listNetworkMocks()).toJSON();
|
|
222
|
+
if (warning) {
|
|
223
|
+
lhr.runWarnings.push(warning);
|
|
224
|
+
response.appendResponseLine(warning);
|
|
225
|
+
}
|
|
220
226
|
const reportPaths = [];
|
|
221
227
|
const encoder = new TextEncoder();
|
|
222
228
|
const savePromises = formats.map(async (format) => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { LogpointFormatter } from '../formatters/LogpointFormatter.js';
|
|
7
|
+
import { LOGPOINT_FORMAT, LogpointError, parseLogpoint, } from '../LogpointManager.js';
|
|
8
|
+
import { zod } from '../third_party/index.js';
|
|
9
|
+
import { ToolCategory } from './categories.js';
|
|
10
|
+
import { definePageTool } from './ToolDefinition.js';
|
|
11
|
+
import { GET_CONSOLE_MESSAGE_TOOL_NAME, LIST_CONSOLE_MESSAGES_TOOL_NAME, } from './toolNames.js';
|
|
12
|
+
const SET_LOGPOINTS_TOOL_NAME = 'set_logpoints';
|
|
13
|
+
export const setLogpoints = definePageTool(() => ({
|
|
14
|
+
name: SET_LOGPOINTS_TOOL_NAME,
|
|
15
|
+
description: `Set the complete set of logpoints of the selected page: logpoints not in the list are removed, new ones are added, and an empty list removes all. A logpoint logs expressions to the console every time a line executes, without pausing or changing the source, like logpoints in the DevTools Sources panel. Locations are script URLs or original source files resolved through source maps (not available with --no-source-maps; scripts in workers and out-of-process iframes are not supported). A location in a generated script moves to its original source line when a source map covers it, and locations on the same line become one logpoint with the last expression. Output appears in ${LIST_CONSOLE_MESSAGES_TOOL_NAME}; an expression that throws produces an error message without text. Logpoints survive reloads and navigations until removed or the page is closed. The response lists the resulting logpoints and where they are bound.`,
|
|
16
|
+
annotations: {
|
|
17
|
+
category: ToolCategory.DEBUGGING,
|
|
18
|
+
readOnlyHint: false,
|
|
19
|
+
conditions: ['javascriptEvaluation'],
|
|
20
|
+
},
|
|
21
|
+
schema: {
|
|
22
|
+
logpoints: zod
|
|
23
|
+
.array(zod.string())
|
|
24
|
+
.describe(`Logpoints formatted as ${LOGPOINT_FORMAT}. The url is a script URL or the path of an original source file from a source map, exact or as a path suffix (e.g. "src/app.ts"). Line and column numbers are 1-based in the coordinates of the url; a line without executable code moves to the next possible location. The expression is evaluated like console.log() arguments in the scope of the location, where local variables are accessible by their original names, and runs before the line executes, so a variable declared on that line is not set yet. ${LIST_CONSOLE_MESSAGES_TOOL_NAME} shows objects as [object Object]: read them with ${GET_CONSOLE_MESSAGE_TOOL_NAME}, or log JSON.stringify(value) for plain data. Example: "src/cart.ts:42 'cart total:', cart.total, cart.items.length". Pass an empty array to remove all logpoints.`),
|
|
25
|
+
},
|
|
26
|
+
blockedByDialog: false,
|
|
27
|
+
concurrency: 'page',
|
|
28
|
+
verifyFilesSchema: {},
|
|
29
|
+
handler: async (request, response) => {
|
|
30
|
+
let logpoints;
|
|
31
|
+
try {
|
|
32
|
+
logpoints = await request.page.setLogpoints(request.params.logpoints.map(parseLogpoint));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof LogpointError) {
|
|
36
|
+
// The other logpoints were applied; report the resulting state.
|
|
37
|
+
response.appendResponseLine(new LogpointFormatter(error.logpoints).toString());
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
response.appendResponseLine(new LogpointFormatter(logpoints).toString());
|
|
42
|
+
if (logpoints.length === 0) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (logpoints.some(logpoint => logpoint.sourceMapped)) {
|
|
46
|
+
response.appendResponseLine('Source-mapped locations are re-resolved automatically when a matching source map loads again (for example after a reload with a regenerated bundle). Note: on the first page load after a rebuild, code that runs during the load itself is not logged yet; if a load-time logpoint stays silent right after a rebuild, reload once more before concluding that the line does not run.');
|
|
47
|
+
}
|
|
48
|
+
response.appendResponseLine(`Logged output appears in ${LIST_CONSOLE_MESSAGES_TOOL_NAME} once a line executes; objects show as [object Object] there, ${GET_CONSOLE_MESSAGE_TOOL_NAME} shows them as JSON.`);
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
//# sourceMappingURL=logpoints.js.map
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import { NetworkOverridesFormatter } from '../formatters/NetworkOverridesFormatter.js';
|
|
8
|
+
import { zod } from '../third_party/index.js';
|
|
9
|
+
import { validateUrlPatterns } from '../utils/url.js';
|
|
10
|
+
import { ToolCategory } from './categories.js';
|
|
11
|
+
import { definePageTool } from './ToolDefinition.js';
|
|
12
|
+
const FILTERABLE_RESOURCE_TYPES = [
|
|
13
|
+
'document',
|
|
14
|
+
'stylesheet',
|
|
15
|
+
'image',
|
|
16
|
+
'media',
|
|
17
|
+
'font',
|
|
18
|
+
'script',
|
|
19
|
+
'texttrack',
|
|
20
|
+
'xhr',
|
|
21
|
+
'fetch',
|
|
22
|
+
'prefetch',
|
|
23
|
+
'eventsource',
|
|
24
|
+
'manifest',
|
|
25
|
+
'signedexchange',
|
|
26
|
+
'ping',
|
|
27
|
+
'cspviolationreport',
|
|
28
|
+
'preflight',
|
|
29
|
+
'fedcm',
|
|
30
|
+
'other',
|
|
31
|
+
];
|
|
32
|
+
export const listNetworkRequests = definePageTool((args) => ({
|
|
33
|
+
name: 'list_network_requests',
|
|
34
|
+
description: `Lists the most recent requests for the target page since the last navigation.`,
|
|
35
|
+
annotations: {
|
|
36
|
+
category: ToolCategory.NETWORK,
|
|
37
|
+
readOnlyHint: true,
|
|
38
|
+
},
|
|
39
|
+
schema: {
|
|
40
|
+
pageSize: zod
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.positive()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Maximum number of requests to return. When omitted, returns all requests.'),
|
|
46
|
+
pageIdx: zod
|
|
47
|
+
.number()
|
|
48
|
+
.int()
|
|
49
|
+
.min(0)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.'),
|
|
52
|
+
resourceTypes: zod
|
|
53
|
+
.array(zod.enum(FILTERABLE_RESOURCE_TYPES))
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests.'),
|
|
56
|
+
includePreservedRequests: zod
|
|
57
|
+
.boolean()
|
|
58
|
+
.default(false)
|
|
59
|
+
.optional()
|
|
60
|
+
.describe(`Set to true to return the preserved requests over the last ${args.maxNavigationSaved} navigations.`),
|
|
61
|
+
},
|
|
62
|
+
blockedByDialog: false,
|
|
63
|
+
concurrency: 'page',
|
|
64
|
+
verifyFilesSchema: {},
|
|
65
|
+
handler: async (request, response) => {
|
|
66
|
+
const data = await request.page.getDevToolsData();
|
|
67
|
+
response.attachDevToolsData(data);
|
|
68
|
+
const reqid = data?.cdpRequestId
|
|
69
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
70
|
+
: undefined;
|
|
71
|
+
response.setIncludeNetworkRequests(true, {
|
|
72
|
+
pageSize: request.params.pageSize,
|
|
73
|
+
pageIdx: request.params.pageIdx,
|
|
74
|
+
resourceTypes: request.params.resourceTypes,
|
|
75
|
+
includePreservedRequests: request.params.includePreservedRequests,
|
|
76
|
+
networkRequestIdInDevToolsUI: reqid,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
}));
|
|
80
|
+
export const getNetworkRequest = definePageTool(() => ({
|
|
81
|
+
name: 'get_network_request',
|
|
82
|
+
description: `Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).`,
|
|
83
|
+
annotations: {
|
|
84
|
+
category: ToolCategory.NETWORK,
|
|
85
|
+
readOnlyHint: false,
|
|
86
|
+
},
|
|
87
|
+
schema: {
|
|
88
|
+
reqid: zod
|
|
89
|
+
.number()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe('The reqid of the network request. If omitted returns the currently selected request in the DevTools Network panel.'),
|
|
92
|
+
requestFilePath: zod
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('The absolute or relative path to a .network-request file to save the request body to. If omitted, the body is returned inline.'),
|
|
96
|
+
responseFilePath: zod
|
|
97
|
+
.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('The absolute or relative path to a .network-response file to save the response body to. If omitted, the body is returned inline.'),
|
|
100
|
+
},
|
|
101
|
+
blockedByDialog: true,
|
|
102
|
+
concurrency: 'page',
|
|
103
|
+
verifyFilesSchema: {
|
|
104
|
+
requestFilePath: true,
|
|
105
|
+
responseFilePath: true,
|
|
106
|
+
},
|
|
107
|
+
handler: async (request, response) => {
|
|
108
|
+
if (request.params.reqid) {
|
|
109
|
+
response.attachNetworkRequest(request.params.reqid, {
|
|
110
|
+
requestFilePath: request.params.requestFilePath,
|
|
111
|
+
responseFilePath: request.params.responseFilePath,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const data = await request.page.getDevToolsData();
|
|
116
|
+
response.attachDevToolsData(data);
|
|
117
|
+
const reqid = data?.cdpRequestId
|
|
118
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
119
|
+
: undefined;
|
|
120
|
+
if (reqid) {
|
|
121
|
+
response.attachNetworkRequest(reqid, {
|
|
122
|
+
requestFilePath: request.params.requestFilePath,
|
|
123
|
+
responseFilePath: request.params.responseFilePath,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
response.appendResponseLine(`Nothing is currently selected in the DevTools Network panel.`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
}));
|
|
132
|
+
const mockFilterSchema = {
|
|
133
|
+
route: zod
|
|
134
|
+
.string()
|
|
135
|
+
.trim()
|
|
136
|
+
.min(1)
|
|
137
|
+
.refine(value => !value.startsWith('/'), 'route must be an absolute URLPattern, such as https://example.com/app.js or *://*:*/app.js.')
|
|
138
|
+
.superRefine((value, context) => {
|
|
139
|
+
try {
|
|
140
|
+
validateUrlPatterns([value], 'route');
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
context.addIssue({
|
|
144
|
+
code: 'custom',
|
|
145
|
+
message: error instanceof Error ? error.message : String(error),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
.optional()
|
|
150
|
+
.describe('Absolute URLPattern, e.g. https://example.com/app.js ' +
|
|
151
|
+
'or `*://*:*/app.js`. Use `*` for wildcards; ' +
|
|
152
|
+
'omitted query strings match any query. Regex and `:name` groups ' +
|
|
153
|
+
'are rejected. Inspection and removal compare the stored pattern ' +
|
|
154
|
+
'exactly. Omit to inspect/remove all routes or match any URL.'),
|
|
155
|
+
resourceType: zod
|
|
156
|
+
.enum(FILTERABLE_RESOURCE_TYPES)
|
|
157
|
+
.optional()
|
|
158
|
+
.describe('Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.'),
|
|
159
|
+
};
|
|
160
|
+
const mockNetworkSchema = zod
|
|
161
|
+
// eslint-disable-next-line @local/enforce-zod-schema -- Flat parameters.
|
|
162
|
+
.object({
|
|
163
|
+
...mockFilterSchema,
|
|
164
|
+
body: zod
|
|
165
|
+
.string()
|
|
166
|
+
.trim()
|
|
167
|
+
.min(1)
|
|
168
|
+
.optional()
|
|
169
|
+
.describe('Local response body file, revalidated and reread for every request. Content-Type follows its extension. Mutually exclusive with upstream.'),
|
|
170
|
+
upstream: zod
|
|
171
|
+
.url({ protocol: /^https?$/ })
|
|
172
|
+
.optional()
|
|
173
|
+
.describe('Absolute HTTP(S) replacement URL for GET/HEAD requests. URL allowlists and blocklists apply to this URL and every redirect. Mutually exclusive with body.'),
|
|
174
|
+
})
|
|
175
|
+
.refine(params => params.body === undefined || params.upstream === undefined, {
|
|
176
|
+
message: 'body and upstream are mutually exclusive.',
|
|
177
|
+
path: ['upstream'],
|
|
178
|
+
});
|
|
179
|
+
export const mockNetwork = definePageTool(() => ({
|
|
180
|
+
name: 'mock_network',
|
|
181
|
+
description: 'Inspect or update network mocks for a page. With no actions, list mocks ' +
|
|
182
|
+
'matching the supplied filters, or all mocks when no filters are given. ' +
|
|
183
|
+
'Providing body or upstream updates the exact route/resourceType pair. ' +
|
|
184
|
+
'An omitted route matches any URL. Other mocks are preserved. ' +
|
|
185
|
+
'The most recently updated matching mock wins and persists across ' +
|
|
186
|
+
'navigations. Configure before navigating or reloading; inspection shows ' +
|
|
187
|
+
'hit counts and replacement errors. Upstream responses use server-side ' +
|
|
188
|
+
'GET/HEAD fetches. Changes are rejected during ' +
|
|
189
|
+
'a performance trace. Mocks disable the page HTTP cache and intercept ' +
|
|
190
|
+
'every request, affecting measurements. Service workers can bypass mocks. ' +
|
|
191
|
+
'Use remove_network_mock to remove mocks.',
|
|
192
|
+
annotations: {
|
|
193
|
+
category: ToolCategory.NETWORK_MOCKS,
|
|
194
|
+
readOnlyHint: false,
|
|
195
|
+
},
|
|
196
|
+
schema: mockNetworkSchema.shape,
|
|
197
|
+
blockedByDialog: false,
|
|
198
|
+
verifyFilesSchema: { body: true },
|
|
199
|
+
concurrency: 'page',
|
|
200
|
+
handler: async (request, response, context) => {
|
|
201
|
+
const params = mockNetworkSchema.parse(request.params);
|
|
202
|
+
const filter = {
|
|
203
|
+
urlPattern: params.route,
|
|
204
|
+
resourceType: params.resourceType,
|
|
205
|
+
};
|
|
206
|
+
let input;
|
|
207
|
+
if (params.upstream !== undefined) {
|
|
208
|
+
input = { ...filter, kind: 'upstream', upstreamUrl: params.upstream };
|
|
209
|
+
}
|
|
210
|
+
else if (params.body !== undefined) {
|
|
211
|
+
const responseFilePath = params.body;
|
|
212
|
+
input = {
|
|
213
|
+
...filter,
|
|
214
|
+
kind: 'file',
|
|
215
|
+
responseFilePath,
|
|
216
|
+
loadResponseFile: async () => {
|
|
217
|
+
const validatedPath = await context.validatePath(responseFilePath);
|
|
218
|
+
return await fs.readFile(validatedPath);
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
let overrides;
|
|
223
|
+
if (input) {
|
|
224
|
+
overrides = [await request.page.mockNetwork(input)];
|
|
225
|
+
response.appendResponseLine('Network mock configured. Reload or navigate the page to apply it.');
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
overrides = request.page.listNetworkMocks(filter);
|
|
229
|
+
}
|
|
230
|
+
if (overrides.length === 0) {
|
|
231
|
+
response.appendResponseLine('No network mocks match these filters.');
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
response.appendResponseLine(new NetworkOverridesFormatter(overrides).toString());
|
|
235
|
+
},
|
|
236
|
+
}));
|
|
237
|
+
export const removeNetworkMock = definePageTool(() => ({
|
|
238
|
+
name: 'remove_network_mock',
|
|
239
|
+
description: 'Remove network mocks matching the supplied stored route and/or resource ' +
|
|
240
|
+
'type. Route patterns are compared exactly, not applied as wildcards to ' +
|
|
241
|
+
'other patterns. Omit both filters to remove all mocks for the page. ' +
|
|
242
|
+
'Removing the last mock restores the HTTP cache and stops interception. ' +
|
|
243
|
+
'Changes are rejected during a performance trace.',
|
|
244
|
+
annotations: {
|
|
245
|
+
category: ToolCategory.NETWORK_MOCKS,
|
|
246
|
+
readOnlyHint: false,
|
|
247
|
+
},
|
|
248
|
+
schema: mockFilterSchema,
|
|
249
|
+
blockedByDialog: false,
|
|
250
|
+
verifyFilesSchema: {},
|
|
251
|
+
concurrency: 'page',
|
|
252
|
+
handler: async (request, response) => {
|
|
253
|
+
const count = await request.page.removeNetworkMocks({
|
|
254
|
+
urlPattern: request.params.route,
|
|
255
|
+
resourceType: request.params.resourceType,
|
|
256
|
+
});
|
|
257
|
+
response.appendResponseLine(`Removed ${count} network ${count === 1 ? 'mock' : 'mocks'}.`);
|
|
258
|
+
},
|
|
259
|
+
}));
|
|
260
|
+
//# sourceMappingURL=network.js.map
|