chrome-devtools-mcp 1.11.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 +73 -21
- package/{build → out/Default/gen}/src/BrowserManager.js +49 -18
- package/out/Default/gen/src/LogpointManager.js +307 -0
- package/{build → out/Default/gen}/src/McpContext.js +439 -133
- package/{build → out/Default/gen}/src/McpPage.js +368 -59
- package/{build → out/Default/gen}/src/McpResponse.js +90 -47
- package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
- package/{build → out/Default/gen}/src/TextSnapshot.js +37 -18
- package/out/Default/gen/src/ToolHandler.js +512 -0
- package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +6 -4
- package/{build → out/Default/gen}/src/bin/chrome-devtools.js +4 -4
- package/{build → out/Default/gen}/src/collectors/PageCollector.js +28 -12
- package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +2 -2
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigParser.js +162 -0
- package/{build → out/Default/gen}/src/config/ConfigWatcher.js +3 -2
- package/out/Default/gen/src/config/ServerConfig.js +251 -0
- package/{build → out/Default/gen}/src/config/browser-options.js +13 -4
- package/{build → out/Default/gen}/src/config/category-options.js +10 -0
- package/{build → out/Default/gen}/src/config/cli-options.js +223 -22
- package/{build → out/Default/gen}/src/config/mcp-options.js +62 -36
- package/{build → out/Default/gen}/src/config/puppeteer-options.js +4 -2
- package/{build → out/Default/gen}/src/daemon/client.js +3 -3
- package/{build → out/Default/gen}/src/daemon/daemon.js +7 -3
- package/{build → out/Default/gen}/src/daemon/utils.js +2 -1
- package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +28 -5
- package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +94 -20
- package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +28 -1
- package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +14 -18
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +70 -17
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +13 -3
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/index.js +435 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +569 -0
- package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
- package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +796 -712
- 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/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
- package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
- package/{build → out/Default/gen}/src/tools/categories.js +4 -0
- package/{build → out/Default/gen}/src/tools/comments.js +46 -4
- package/{build → out/Default/gen}/src/tools/console.js +8 -6
- package/{build → out/Default/gen}/src/tools/css.js +1 -0
- package/{build → out/Default/gen}/src/tools/emulation.js +5 -4
- package/{build → out/Default/gen}/src/tools/extensions.js +6 -1
- package/{build → out/Default/gen}/src/tools/input.js +23 -28
- package/{build → out/Default/gen}/src/tools/lighthouse.js +30 -8
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/{build → out/Default/gen}/src/tools/memory.js +59 -53
- package/out/Default/gen/src/tools/network.js +260 -0
- package/{build → out/Default/gen}/src/tools/pages.js +48 -6
- package/{build → out/Default/gen}/src/tools/performance.js +33 -7
- package/{build → out/Default/gen}/src/tools/pwa.js +7 -0
- package/{build → out/Default/gen}/src/tools/screencast.js +3 -1
- package/{build → out/Default/gen}/src/tools/screenshot.js +23 -7
- package/{build → out/Default/gen}/src/tools/script.js +38 -6
- package/{build → out/Default/gen}/src/tools/slim/tools.js +21 -5
- package/{build → out/Default/gen}/src/tools/snapshot.js +29 -5
- package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +6 -20
- 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 +5 -19
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/{build → out/Default/gen}/src/utils/WaitForHelper.js +16 -2
- package/{build → out/Default/gen}/src/utils/bytes.js +2 -12
- package/{build → out/Default/gen}/src/utils/check-for-updates.js +8 -2
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
- package/{build → out/Default/gen}/src/utils/keyboard.js +15 -5
- package/out/Default/gen/src/utils/logger.js +131 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/out/Default/gen/src/utils/resourceType.js +27 -0
- package/out/Default/gen/src/utils/text.js +44 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/{build → out/Default/gen}/src/utils/url.js +73 -17
- package/{build → out/Default/gen}/src/version.js +1 -1
- package/package.json +26 -32
- package/skills/a11y-debugging/SKILL.md +3 -8
- package/skills/chrome-devtools/SKILL.md +2 -0
- package/skills/chrome-devtools-cli/SKILL.md +12 -1
- package/build/src/ToolHandler.js +0 -360
- package/build/src/config/ConfigParser.js +0 -264
- package/build/src/index.js +0 -282
- package/build/src/processors/HeapSnapshotManager.js +0 -307
- package/build/src/third_party/bundled-packages.json +0 -11
- package/build/src/third_party/devtools-formatter-worker.js +0 -16625
- package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12084
- package/build/src/third_party/index.js +0 -189603
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -58435
- package/build/src/tools/ToolDefinition.js +0 -92
- package/build/src/tools/network.js +0 -128
- package/build/src/utils/logger.js +0 -62
- package/build/src/utils/text.js +0 -15
- /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/bin/check-latest-version.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
- /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
- /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
- /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/types.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/CssFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.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/types.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/pagination.js +0 -0
- /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export function logCruxDisclaimer(args) {
|
|
7
|
+
if (!args.slim && args.performanceCrux) {
|
|
8
|
+
console.error(`Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data. To disable, run with --no-performance-crux.`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Prints the privacy disclaimers to stderr. Both the server and the CLI
|
|
13
|
+
* client call it. The CLI must not load `src/index.ts`, so this function
|
|
14
|
+
* lives in its own module.
|
|
15
|
+
*/
|
|
16
|
+
export const logDisclaimers = (args) => {
|
|
17
|
+
console.error(`chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect,
|
|
18
|
+
debug, and modify any data in the browser or DevTools.
|
|
19
|
+
Avoid sharing sensitive or personal information that you do not want to share with MCP clients.`);
|
|
20
|
+
logCruxDisclaimer(args);
|
|
21
|
+
if (!args.slim && args.usageStatistics) {
|
|
22
|
+
console.error(`
|
|
23
|
+
Google collects usage statistics to improve Chrome DevTools MCP. To opt-out, run with --no-usage-statistics.
|
|
24
|
+
For more details, visit: https://github.com/ChromeDevTools/chrome-devtools-mcp#usage-statistics`);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=disclaimers.js.map
|
|
@@ -8,6 +8,9 @@ import { logger } from './logger.js';
|
|
|
8
8
|
export function getErrorMessage(err) {
|
|
9
9
|
return err instanceof Error ? err.message : String(err);
|
|
10
10
|
}
|
|
11
|
+
export function toError(err) {
|
|
12
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
13
|
+
}
|
|
11
14
|
export function setupUnhandledRejectionHandler(onCrash) {
|
|
12
15
|
process.on('unhandledRejection', (reason, promise) => {
|
|
13
16
|
logger?.('Unhandled promise rejection:', promise, reason);
|
|
@@ -261,11 +261,20 @@ const validKeys = new Set([
|
|
|
261
261
|
'VolumeDown',
|
|
262
262
|
'VolumeUp',
|
|
263
263
|
]);
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Whether the string is a single valid key name (no `+` combinations).
|
|
266
|
+
*/
|
|
267
|
+
export function isValidKey(key) {
|
|
268
|
+
return validKeys.has(key);
|
|
269
|
+
}
|
|
270
|
+
function invalidKeyMessage(key) {
|
|
271
|
+
return `${key} is invalid. Valid keys are: ${Array.from(validKeys.values()).join(',')}.`;
|
|
272
|
+
}
|
|
273
|
+
export function throwIfInvalidKey(key) {
|
|
274
|
+
if (isValidKey(key)) {
|
|
266
275
|
return key;
|
|
267
276
|
}
|
|
268
|
-
throw new Error(
|
|
277
|
+
throw new Error(invalidKeyMessage(key));
|
|
269
278
|
}
|
|
270
279
|
/**
|
|
271
280
|
* Returns the primary key, followed by modifiers in original order.
|
|
@@ -286,12 +295,13 @@ export function parseKey(keyInput) {
|
|
|
286
295
|
if (key) {
|
|
287
296
|
result.push(throwIfInvalidKey(key));
|
|
288
297
|
}
|
|
289
|
-
|
|
298
|
+
const primaryKey = result.at(-1);
|
|
299
|
+
if (primaryKey === undefined) {
|
|
290
300
|
throw new Error(`Key ${keyInput} could not be parsed.`);
|
|
291
301
|
}
|
|
292
302
|
if (new Set(result).size !== result.length) {
|
|
293
303
|
throw new Error(`Key ${keyInput} contains duplicate keys.`);
|
|
294
304
|
}
|
|
295
|
-
return [
|
|
305
|
+
return [primaryKey, ...result.slice(0, -1)];
|
|
296
306
|
}
|
|
297
307
|
//# sourceMappingURL=keyboard.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import util from 'node:util';
|
|
8
|
+
const mcpDebugNamespace = 'mcp:log';
|
|
9
|
+
let logFileStream;
|
|
10
|
+
const debugLog = util.debuglog(mcpDebugNamespace);
|
|
11
|
+
export function saveLogsToFile(fileName) {
|
|
12
|
+
const logFile = fs.createWriteStream(fileName, { flags: 'a+' });
|
|
13
|
+
logFile.on('error', function (error) {
|
|
14
|
+
console.error(`Error when opening/writing to log file: ${error.message}`);
|
|
15
|
+
logFile.end();
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
18
|
+
logFileStream = logFile;
|
|
19
|
+
return logFile;
|
|
20
|
+
}
|
|
21
|
+
export function flushLogs(logFile, timeoutMs = 2000) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const timeout = setTimeout(reject, timeoutMs);
|
|
24
|
+
logFile.end(() => {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
resolve();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Encodes a value for interpolation into a one-line log or error message. The
|
|
32
|
+
* result is a JSON string literal that also escapes DEL, C1 controls and
|
|
33
|
+
* U+2028/U+2029, which JSON.stringify leaves raw but terminals and line
|
|
34
|
+
* readers act on.
|
|
35
|
+
*/
|
|
36
|
+
export function escapeForLog(value) {
|
|
37
|
+
return JSON.stringify(value).replace(/[\u007f-\u009f\u2028\u2029]/g, char => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Redact credentials from URLs used in connection and diagnostic logs.
|
|
41
|
+
* The URL passed to Puppeteer is never modified.
|
|
42
|
+
*/
|
|
43
|
+
export function redactUrlForLogging(value) {
|
|
44
|
+
try {
|
|
45
|
+
const url = new URL(value);
|
|
46
|
+
url.username = '';
|
|
47
|
+
url.password = '';
|
|
48
|
+
if (url.search) {
|
|
49
|
+
url.search = '?REDACTED';
|
|
50
|
+
}
|
|
51
|
+
return url.toString();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Unparseable URLs might still contain credentials. Fail closed.
|
|
55
|
+
return '[REDACTED]';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Return a redacted copy of the Puppeteer connection options for logging.
|
|
60
|
+
* Keep the actual headers and connection URLs intact for Puppeteer.
|
|
61
|
+
*/
|
|
62
|
+
export function redactConnectOptionsForLogging(options) {
|
|
63
|
+
return {
|
|
64
|
+
...options,
|
|
65
|
+
...(options.headers
|
|
66
|
+
? {
|
|
67
|
+
headers: Object.fromEntries(Object.keys(options.headers).map(name => [name, '[REDACTED]'])),
|
|
68
|
+
}
|
|
69
|
+
: {}),
|
|
70
|
+
...(options.browserWSEndpoint
|
|
71
|
+
? { browserWSEndpoint: redactUrlForLogging(options.browserWSEndpoint) }
|
|
72
|
+
: {}),
|
|
73
|
+
...(options.browserURL
|
|
74
|
+
? { browserURL: redactUrlForLogging(options.browserURL) }
|
|
75
|
+
: {}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Filter sensitive CLI arguments in the daemon startup log only.
|
|
80
|
+
* Spawn still receives the original arguments unchanged.
|
|
81
|
+
*/
|
|
82
|
+
export function redactDaemonArgsForLogging(args) {
|
|
83
|
+
const headersFlag = /^--ws-?headers$/i;
|
|
84
|
+
const endpointFlag = /^--(?:ws-?endpoint|browser-?url)$/i;
|
|
85
|
+
return args.map((arg, index) => {
|
|
86
|
+
const previous = args[index - 1] ?? '';
|
|
87
|
+
if (headersFlag.test(previous)) {
|
|
88
|
+
return '[REDACTED]';
|
|
89
|
+
}
|
|
90
|
+
if (endpointFlag.test(previous)) {
|
|
91
|
+
return redactUrlForLogging(arg);
|
|
92
|
+
}
|
|
93
|
+
const equalsAt = arg.indexOf('=');
|
|
94
|
+
if (equalsAt === -1) {
|
|
95
|
+
return arg;
|
|
96
|
+
}
|
|
97
|
+
const flag = arg.slice(0, equalsAt);
|
|
98
|
+
const value = arg.slice(equalsAt + 1);
|
|
99
|
+
if (headersFlag.test(flag)) {
|
|
100
|
+
return `${flag}=[REDACTED]`;
|
|
101
|
+
}
|
|
102
|
+
if (endpointFlag.test(flag)) {
|
|
103
|
+
return `${flag}=${redactUrlForLogging(value)}`;
|
|
104
|
+
}
|
|
105
|
+
return arg;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export const logger = (...args) => {
|
|
109
|
+
if (logFileStream) {
|
|
110
|
+
logFileStream.write(`${new Date().toISOString()} ${mcpDebugNamespace} ${util.format(...args)}\n`);
|
|
111
|
+
}
|
|
112
|
+
else if (debugLog.enabled) {
|
|
113
|
+
debugLog('%s %s', new Date().toISOString(), util.format(...args));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
export const puppeteerLogger = (prefix) => {
|
|
117
|
+
const dbg = util.debuglog(prefix);
|
|
118
|
+
if (!dbg.enabled) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const stream = logFileStream;
|
|
122
|
+
if (stream) {
|
|
123
|
+
return (...args) => {
|
|
124
|
+
stream.write(`${new Date().toISOString()} ${prefix} ${util.format(...args)}\n`);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return (...args) => {
|
|
128
|
+
dbg('%s %s', new Date().toISOString(), util.format(...args));
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { URLPattern } from '../third_party/cli.js';
|
|
7
|
+
import { redactUrlForLogging } from './logger.js';
|
|
8
|
+
const CROSS_ORIGIN_REDIRECT_HEADERS = new Set([
|
|
9
|
+
'accept',
|
|
10
|
+
'accept-language',
|
|
11
|
+
'cache-control',
|
|
12
|
+
'origin',
|
|
13
|
+
'pragma',
|
|
14
|
+
'range',
|
|
15
|
+
'user-agent',
|
|
16
|
+
]);
|
|
17
|
+
export function getRedirectHeaders(sourceUrl, targetUrl, originalHeaders) {
|
|
18
|
+
const sameOrigin = sourceUrl.origin === targetUrl.origin;
|
|
19
|
+
const headers = {};
|
|
20
|
+
for (const [name, value] of Object.entries(originalHeaders)) {
|
|
21
|
+
const lowerName = name.toLowerCase();
|
|
22
|
+
if (lowerName === 'accept-encoding') {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (sameOrigin || CROSS_ORIGIN_REDIRECT_HEADERS.has(lowerName)) {
|
|
26
|
+
headers[name] = value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return headers;
|
|
30
|
+
}
|
|
31
|
+
export function validateUrlNotBlocked(url, blocklist) {
|
|
32
|
+
for (const block of blocklist ?? []) {
|
|
33
|
+
if (new URLPattern(block).test(url)) {
|
|
34
|
+
throw new Error('Blocked by blocklist: ' + redactUrlForLogging(url.href));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function validateNetworkUrl(url, policy) {
|
|
39
|
+
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
40
|
+
throw new Error('Unsupported URL protocol: ' + url.protocol);
|
|
41
|
+
}
|
|
42
|
+
validateUrlNotBlocked(url, policy.blockedUrlPattern);
|
|
43
|
+
if (policy.allowedUrlPattern &&
|
|
44
|
+
!policy.allowedUrlPattern.some(allow => new URLPattern(allow).test(url))) {
|
|
45
|
+
throw new Error('Not allowed by allowlist: ' + redactUrlForLogging(url.href));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function fetchWithValidatedRedirects(url, options) {
|
|
49
|
+
const redirectStatuses = new Set([301, 302, 303, 307, 308]);
|
|
50
|
+
const maxRedirects = 20;
|
|
51
|
+
let currentUrl = url;
|
|
52
|
+
let headers = options.headers
|
|
53
|
+
? Object.fromEntries(new Headers(options.headers))
|
|
54
|
+
: undefined;
|
|
55
|
+
for (let redirectCount = 0;; redirectCount++) {
|
|
56
|
+
validateNetworkUrl(currentUrl, options.policy);
|
|
57
|
+
const response = await fetch(currentUrl, {
|
|
58
|
+
redirect: 'manual',
|
|
59
|
+
...(options.method ? { method: options.method } : {}),
|
|
60
|
+
...(headers ? { headers } : {}),
|
|
61
|
+
});
|
|
62
|
+
if (!redirectStatuses.has(response.status)) {
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
const location = response.headers.get('location');
|
|
66
|
+
await response.body?.cancel();
|
|
67
|
+
if (!location) {
|
|
68
|
+
throw new Error('Redirect has no Location header: ' +
|
|
69
|
+
redactUrlForLogging(currentUrl.href));
|
|
70
|
+
}
|
|
71
|
+
if (redirectCount >= maxRedirects) {
|
|
72
|
+
throw new Error('Too many redirects loading resource: ' + redactUrlForLogging(url.href));
|
|
73
|
+
}
|
|
74
|
+
const nextUrl = new URL(location, currentUrl);
|
|
75
|
+
if (headers) {
|
|
76
|
+
headers = getRedirectHeaders(currentUrl, nextUrl, headers);
|
|
77
|
+
}
|
|
78
|
+
currentUrl = nextUrl;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export function raceWithSignal(promise, signal) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
const onAbort = () => {
|
|
9
|
+
reject(signal.reason);
|
|
10
|
+
};
|
|
11
|
+
if (signal.aborted) {
|
|
12
|
+
onAbort();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
16
|
+
}
|
|
17
|
+
Promise.resolve(promise).then(value => {
|
|
18
|
+
signal.removeEventListener('abort', onAbort);
|
|
19
|
+
resolve(value);
|
|
20
|
+
}, error => {
|
|
21
|
+
signal.removeEventListener('abort', onAbort);
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=raceWithSignal.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The resource type a request is filtered by. Chrome reports CORS preflights
|
|
8
|
+
* and `<link rel=prefetch>` requests as `Other`, so `resourceTypes: ['preflight']`
|
|
9
|
+
* and `['prefetch']` could never match. Those two are recognised from the
|
|
10
|
+
* headers Chrome sends with them; every other type is Chrome's own.
|
|
11
|
+
*/
|
|
12
|
+
export function getFilterableResourceType(request) {
|
|
13
|
+
const type = request.resourceType();
|
|
14
|
+
if (type !== 'other') {
|
|
15
|
+
return type;
|
|
16
|
+
}
|
|
17
|
+
const headers = request.headers();
|
|
18
|
+
if (request.method() === 'OPTIONS' &&
|
|
19
|
+
headers['access-control-request-method'] !== undefined) {
|
|
20
|
+
return 'preflight';
|
|
21
|
+
}
|
|
22
|
+
if (/^prefetch\b/i.test(headers['sec-purpose'] ?? '')) {
|
|
23
|
+
return 'prefetch';
|
|
24
|
+
}
|
|
25
|
+
return type;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=resourceType.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DevTools } from '../third_party/index.js';
|
|
7
|
+
const { StringUtilities } = DevTools.Platform;
|
|
8
|
+
const VALID_PLACEHOLDER_MATCH_PATTERN = /\{(PLACEHOLDER_[a-zA-Z][a-zA-Z0-9_]*)\}/g;
|
|
9
|
+
export function substitutePlaceholders(rawMarkdown, substitutions) {
|
|
10
|
+
if (!substitutions) {
|
|
11
|
+
return rawMarkdown;
|
|
12
|
+
}
|
|
13
|
+
return rawMarkdown.replace(VALID_PLACEHOLDER_MATCH_PATTERN, (_, placeholder) => {
|
|
14
|
+
return substitutions.get(placeholder) ?? '';
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Truncates `text` to at most `maxLength` UTF-16 code units and appends
|
|
19
|
+
* `ellipsis` when anything was cut off. The cut uses devtools-frontend's
|
|
20
|
+
* `StringUtilities.truncateToCodeUnitLength`, which moves back to the last
|
|
21
|
+
* grapheme boundary at or before the limit, so surrogate pairs and emoji
|
|
22
|
+
* sequences stay whole and the result never contains a lone surrogate, which
|
|
23
|
+
* `JSON.stringify` serializes as an escape like `\ud83d` that strict JSON
|
|
24
|
+
* parsers (such as the one the Python MCP SDK uses) reject.
|
|
25
|
+
*
|
|
26
|
+
* With `includeEllipsisInLength`, the ellipsis counts toward `maxLength`.
|
|
27
|
+
*/
|
|
28
|
+
export function truncateText(text, maxLength, { ellipsis = '...', includeEllipsisInLength = false, } = {}) {
|
|
29
|
+
if (text.length <= maxLength) {
|
|
30
|
+
return text;
|
|
31
|
+
}
|
|
32
|
+
const keep = includeEllipsisInLength
|
|
33
|
+
? Math.max(0, maxLength - ellipsis.length)
|
|
34
|
+
: maxLength;
|
|
35
|
+
return StringUtilities.truncateToCodeUnitLength(text, keep) + ellipsis;
|
|
36
|
+
}
|
|
37
|
+
const URL_SIZE_LIMIT = 255;
|
|
38
|
+
/**
|
|
39
|
+
* Truncates a URL for tool output, such as a `data:` URL with a base64 payload.
|
|
40
|
+
*/
|
|
41
|
+
export function truncateUrl(url) {
|
|
42
|
+
return truncateText(url, URL_SIZE_LIMIT, { ellipsis: '... <truncated>' });
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Deferred } from '../third_party/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Rejects with a Puppeteer `TimeoutError` with `message` if `promise` does not
|
|
9
|
+
* settle within `timeout` ms. The timer is cleared when the race settles.
|
|
10
|
+
*/
|
|
11
|
+
export async function withTimeout(promise, options) {
|
|
12
|
+
return await Deferred.race([promise, Deferred.create(options)]);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=timeout.js.map
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
// Node 22 has no global URLPattern. The CLI bundle exports Puppeteer's
|
|
7
|
+
// polyfill, so this module does not need the full third-party bundle.
|
|
8
|
+
import { URLPattern } from '../third_party/cli.js';
|
|
6
9
|
const ALLOWED_PROTOCOLS = new Set(['http:', 'https:', 'ws:', 'wss:']);
|
|
7
10
|
const IPV4_LOOPBACK_REGEX = /^127(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/;
|
|
11
|
+
const IPV4_MAPPED_LOOPBACK_REGEX = /^\[::ffff:7f[0-9a-f]{2}:[0-9a-f]{1,4}\]$/;
|
|
8
12
|
/**
|
|
9
13
|
* Determines whether a given URL string points to a localhost / loopback address.
|
|
10
14
|
*
|
|
@@ -38,8 +42,42 @@ export function isLocalhost(url) {
|
|
|
38
42
|
if (IPV4_LOOPBACK_REGEX.test(hostname)) {
|
|
39
43
|
return true;
|
|
40
44
|
}
|
|
45
|
+
// 4. Check IPv4-mapped IPv6 loopback. URL serializes [::ffff:127.0.0.1]
|
|
46
|
+
// as [::ffff:7f00:1].
|
|
47
|
+
if (IPV4_MAPPED_LOOPBACK_REGEX.test(hostname)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
41
50
|
return false;
|
|
42
51
|
}
|
|
52
|
+
// URL serializes `0`, `0x0` and `0.0` as 0.0.0.0, `[::0]` as [::], and
|
|
53
|
+
// [::ffff:0.0.0.0] as [::ffff:0:0].
|
|
54
|
+
const UNSPECIFIED_HOSTNAMES = new Set(['0.0.0.0', '[::]', '[::ffff:0:0]']);
|
|
55
|
+
/**
|
|
56
|
+
* Determines whether a browser endpoint URL points to the local machine.
|
|
57
|
+
*
|
|
58
|
+
* In addition to {@link isLocalhost}, this accepts the unspecified addresses
|
|
59
|
+
* 0.0.0.0 and [::]. A connection to an unspecified address reaches the local
|
|
60
|
+
* machine.
|
|
61
|
+
*
|
|
62
|
+
* @param url The browser endpoint URL (for example, a WebSocket endpoint).
|
|
63
|
+
* @returns true if the endpoint is on the local machine.
|
|
64
|
+
*/
|
|
65
|
+
export function isLocalBrowserEndpoint(url) {
|
|
66
|
+
if (isLocalhost(url)) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
let parsed;
|
|
70
|
+
try {
|
|
71
|
+
parsed = new URL(url);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return UNSPECIFIED_HOSTNAMES.has(parsed.hostname);
|
|
80
|
+
}
|
|
43
81
|
/**
|
|
44
82
|
* Determines whether a URL is allowed for navigation and page tracking.
|
|
45
83
|
*
|
|
@@ -153,17 +191,23 @@ export function validateUrlPatterns(patterns, flagName) {
|
|
|
153
191
|
}
|
|
154
192
|
}
|
|
155
193
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* `view-source:` wraps another URL and Chrome resolves the inner
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
194
|
+
* Unwraps nested `view-source:` prefixes so every scheme check below runs
|
|
195
|
+
* against the URL Chrome will actually resolve and load — not the
|
|
196
|
+
* wrapper. `view-source:` wraps another URL and Chrome resolves the inner
|
|
197
|
+
* target (potentially through multiple levels of wrapping), so
|
|
198
|
+
* `view-source:file:///etc/passwd` reads the file just as
|
|
199
|
+
* `file:///etc/passwd` does, and `view-source:devtools://devtools/...`
|
|
200
|
+
* loads under the `devtools://devtools` origin just as the bare
|
|
201
|
+
* `devtools:` URL would. The inner URL is re-parsed rather than
|
|
202
|
+
* string-matched so that an uppercase inner scheme
|
|
203
|
+
* (`view-source:FILE:///etc/passwd`) is normalised.
|
|
162
204
|
*
|
|
163
|
-
* @param url The already-parsed URL to
|
|
164
|
-
* @returns
|
|
205
|
+
* @param url The already-parsed URL to unwrap.
|
|
206
|
+
* @returns The fully unwrapped URL, or the original URL unchanged if it
|
|
207
|
+
* is not `view-source:`. Returns null if any wrapped layer is not itself
|
|
208
|
+
* a valid URL.
|
|
165
209
|
*/
|
|
166
|
-
function
|
|
210
|
+
function unwrapViewSource(url) {
|
|
167
211
|
let current = url;
|
|
168
212
|
// Bounded in case of a pathologically nested `view-source:` chain.
|
|
169
213
|
for (let i = 0; i < 5 && current.protocol === 'view-source:'; i++) {
|
|
@@ -171,14 +215,19 @@ function targetsFileScheme(url) {
|
|
|
171
215
|
current = new URL(current.pathname);
|
|
172
216
|
}
|
|
173
217
|
catch {
|
|
174
|
-
return
|
|
218
|
+
return null;
|
|
175
219
|
}
|
|
176
220
|
}
|
|
177
|
-
return current.protocol === '
|
|
221
|
+
return current.protocol === 'view-source:' ? null : current;
|
|
178
222
|
}
|
|
179
223
|
/**
|
|
180
224
|
* Validates a URL string by parsing it with `new URL` and checking for disallowed protocols and restricted schemes.
|
|
181
225
|
*
|
|
226
|
+
* Any `view-source:` wrapping is unwrapped first (see {@link unwrapViewSource}),
|
|
227
|
+
* since Chrome resolves the wrapper at navigation time and loads the page
|
|
228
|
+
* under the wrapped URL's own origin, so every scheme check below must run
|
|
229
|
+
* against the unwrapped target rather than the outer `view-source:` URL.
|
|
230
|
+
*
|
|
182
231
|
* @param url The URL string to validate.
|
|
183
232
|
* @param options Options object containing javascriptEvaluation, categoryExtensions and fileNavigations.
|
|
184
233
|
* @returns The parsed URL.
|
|
@@ -194,18 +243,25 @@ export function validateUrl(url, options) {
|
|
|
194
243
|
catch {
|
|
195
244
|
throw new Error(`Invalid URL: "${url}". URLs must be valid according to the URL standard.`);
|
|
196
245
|
}
|
|
246
|
+
const target = unwrapViewSource(parsed);
|
|
247
|
+
if (!target) {
|
|
248
|
+
throw new Error(`Invalid URL: "${url}". The view-source: wrapped content is not a valid URL.`);
|
|
249
|
+
}
|
|
197
250
|
if (javascriptEvaluation === false &&
|
|
198
|
-
DISALLOWED_PROTOCOLS.has(
|
|
199
|
-
throw new Error(`Navigating to ${
|
|
251
|
+
DISALLOWED_PROTOCOLS.has(target.protocol)) {
|
|
252
|
+
throw new Error(`Navigating to ${target.protocol} URLs is not allowed when JavaScript evaluation is disabled.`);
|
|
200
253
|
}
|
|
201
|
-
if (fileNavigations === false &&
|
|
254
|
+
if (fileNavigations === false && target.protocol === 'file:') {
|
|
202
255
|
throw new Error(`Navigating to file: URLs is not allowed when --file-navigations is disabled.`);
|
|
203
256
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
257
|
+
if (target.protocol === 'devtools:') {
|
|
258
|
+
throw new Error(`Navigating to devtools: URLs is not allowed.`);
|
|
259
|
+
}
|
|
260
|
+
if (!isAllowedUrl(target.href, { categoryExtensions })) {
|
|
261
|
+
if (target.protocol === 'chrome-extension:') {
|
|
206
262
|
throw new Error(`Navigating to chrome-extension: URLs is not allowed without --categoryExtensions.`);
|
|
207
263
|
}
|
|
208
|
-
throw new Error(`Navigating to ${
|
|
264
|
+
throw new Error(`Navigating to ${target.protocol} URLs is not allowed.`);
|
|
209
265
|
}
|
|
210
266
|
return parsed;
|
|
211
267
|
}
|
package/package.json
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "MCP server for Chrome DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"chrome-devtools-mcp": "./
|
|
8
|
-
"chrome-devtools": "./
|
|
7
|
+
"chrome-devtools-mcp": "./out/Default/gen/src/bin/chrome-devtools-mcp.js",
|
|
8
|
+
"chrome-devtools": "./out/Default/gen/src/bin/chrome-devtools.js"
|
|
9
9
|
},
|
|
10
|
-
"main": "./
|
|
10
|
+
"main": "./out/Default/gen/src/index.js",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"cli:generate": "node scripts/generate-cli.ts",
|
|
13
|
-
"clean": "node
|
|
13
|
+
"clean": "node scripts/clean.ts",
|
|
14
14
|
"clean:submodules": "node scripts/clean-submodules.ts",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"typecheck": "tsc --noEmit",
|
|
15
|
+
"build": "node scripts/ninja.ts",
|
|
16
|
+
"typecheck": "node scripts/ninja.ts",
|
|
18
17
|
"format": "eslint --cache --fix . && prettier --write --cache .",
|
|
19
18
|
"check-format": "eslint --cache . && prettier --check --cache .",
|
|
20
19
|
"gen": "npm run build && npm run cli:generate && npm run docs:generate && npm run update-metrics && npm run format",
|
|
21
20
|
"docs:generate": "node scripts/generate-docs.ts",
|
|
22
|
-
"start": "npm run build && node
|
|
23
|
-
"start-debug": "NODE_DEBUG=mcp:* npm run build && node
|
|
24
|
-
"test": "npm run build && node scripts/test.js
|
|
25
|
-
"test:no-build": "node scripts/test.js
|
|
26
|
-
"test:notices": "npm run bundle && node scripts/test.js tests/third_party_notices.test.ts",
|
|
27
|
-
"test:notices:no-build": "node scripts/test.js tests/third_party_notices.test.ts",
|
|
21
|
+
"start": "npm run build && node out/Default/gen/src/bin/chrome-devtools-mcp.js",
|
|
22
|
+
"start-debug": "NODE_DEBUG=mcp:* npm run build && node out/Default/gen/src/bin/chrome-devtools-mcp.js",
|
|
23
|
+
"test": "npm run build && node scripts/test.js",
|
|
24
|
+
"test:no-build": "node scripts/test.js",
|
|
28
25
|
"test:only": "npm run build && node scripts/test.js --test-only",
|
|
29
26
|
"test:update-snapshots": "npm run build && node scripts/test.js --test-update-snapshots",
|
|
30
27
|
"prepare": "node scripts/prepare.ts",
|
|
31
|
-
"
|
|
28
|
+
"gn:gen": "node scripts/gn-gen.ts",
|
|
29
|
+
"sync": "npm ci && git submodule update --init && node scripts/gclient-sync.ts",
|
|
32
30
|
"verify-server-json-version": "node scripts/verify-server-json-version.ts",
|
|
33
31
|
"update-lighthouse": "node scripts/update-lighthouse.ts",
|
|
34
32
|
"update-metrics": "node scripts/update_metrics.ts",
|
|
@@ -39,11 +37,15 @@
|
|
|
39
37
|
"test:memory": "npm run build && node scripts/profile/profile_mcp.ts --threshold-percentage 1"
|
|
40
38
|
},
|
|
41
39
|
"files": [
|
|
42
|
-
"
|
|
40
|
+
"out/Default/gen/src",
|
|
43
41
|
"LICENSE",
|
|
44
42
|
"skills",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
43
|
+
"!**/*.tsbuildinfo",
|
|
44
|
+
"!**/*.js.map",
|
|
45
|
+
"!**/*.d.ts",
|
|
46
|
+
"!**/*-tsconfig*.json",
|
|
47
|
+
"!**/*.stamp",
|
|
48
|
+
"!**/*.d"
|
|
47
49
|
],
|
|
48
50
|
"repository": "ChromeDevTools/chrome-devtools-mcp",
|
|
49
51
|
"author": "Google LLC",
|
|
@@ -56,23 +58,18 @@
|
|
|
56
58
|
"devDependencies": {
|
|
57
59
|
"@blackwell-systems/gcf": "^2.2.2",
|
|
58
60
|
"@google/genai": "^2.0.1",
|
|
59
|
-
"@modelcontextprotocol/client": "2.
|
|
60
|
-
"@modelcontextprotocol/core": "2.
|
|
61
|
-
"@modelcontextprotocol/server": "2.
|
|
62
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
63
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
64
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
61
|
+
"@modelcontextprotocol/client": "2.4.0",
|
|
62
|
+
"@modelcontextprotocol/core": "2.4.0",
|
|
63
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
65
64
|
"@stylistic/eslint-plugin": "^5.4.0",
|
|
66
65
|
"@toon-format/toon": "^4.1.0",
|
|
67
|
-
"@types/filesystem": "^0.0.36",
|
|
68
66
|
"@types/node": "^26.0.0",
|
|
69
67
|
"@types/semver": "^7.7.1",
|
|
70
68
|
"@types/sinon": "^22.0.0",
|
|
71
69
|
"@types/yargs": "^17.0.33",
|
|
72
70
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
73
71
|
"@typescript-eslint/parser": "^8.43.0",
|
|
74
|
-
"
|
|
75
|
-
"core-js": "3.50.0",
|
|
72
|
+
"core-js": "3.51.0",
|
|
76
73
|
"eslint": "^10.7.0",
|
|
77
74
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
78
75
|
"eslint-plugin-eslint-plugin": "^7.6.2",
|
|
@@ -80,12 +77,9 @@
|
|
|
80
77
|
"eslint-plugin-jsdoc": "^65.2.0",
|
|
81
78
|
"eslint-plugin-mocha": "^12.0.2",
|
|
82
79
|
"globals": "^17.0.0",
|
|
83
|
-
"lighthouse": "13.
|
|
80
|
+
"lighthouse": "13.6.0",
|
|
84
81
|
"prettier": "^3.6.2",
|
|
85
|
-
"puppeteer": "25.
|
|
86
|
-
"rollup": "4.64.2",
|
|
87
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
88
|
-
"rollup-plugin-license": "^3.6.0",
|
|
82
|
+
"puppeteer": "25.17.0",
|
|
89
83
|
"semver": "^7.7.4",
|
|
90
84
|
"sinon": "^22.0.0",
|
|
91
85
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|