@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +223 -2
- package/out/Default/gen/src/ArcBrowser.js +128 -0
- package/out/Default/gen/src/BrowserManager.js +562 -0
- package/out/Default/gen/src/LogpointManager.js +287 -0
- package/out/Default/gen/src/McpContext.js +1031 -0
- package/out/Default/gen/src/McpPage.js +1427 -0
- package/out/Default/gen/src/McpResponse.js +1350 -0
- package/out/Default/gen/src/McpWorker.js +66 -0
- package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
- package/out/Default/gen/src/SlimMcpResponse.js +23 -0
- package/out/Default/gen/src/TextSnapshot.js +336 -0
- package/out/Default/gen/src/ToolHandler.js +531 -0
- package/out/Default/gen/src/bin/check-latest-version.js +53 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
- package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
- package/out/Default/gen/src/collectors/PageCollector.js +325 -0
- package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigLocator.js +70 -0
- package/out/Default/gen/src/config/ConfigParser.js +163 -0
- package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
- package/out/Default/gen/src/config/ServerConfig.js +284 -0
- package/out/Default/gen/src/config/browser-options.js +135 -0
- package/out/Default/gen/src/config/category-options.js +84 -0
- package/out/Default/gen/src/config/cli-commands.js +208 -0
- package/out/Default/gen/src/config/cli-options.js +2090 -0
- package/out/Default/gen/src/config/mcp-options.js +371 -0
- package/out/Default/gen/src/config/puppeteer-options.js +69 -0
- package/out/Default/gen/src/config/tool-options.js +60 -0
- package/out/Default/gen/src/daemon/client.js +281 -0
- package/out/Default/gen/src/daemon/daemon.js +280 -0
- package/out/Default/gen/src/daemon/types.js +7 -0
- package/out/Default/gen/src/daemon/utils.js +173 -0
- package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
- package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
- package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
- package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
- package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
- package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
- package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
- package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
- package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/formatters/constants.js +8 -0
- package/out/Default/gen/src/index.js +434 -0
- package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
- package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
- package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
- package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
- package/out/Default/gen/src/telemetry/errors.js +18 -0
- package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
- package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
- package/out/Default/gen/src/telemetry/persistence.js +82 -0
- package/out/Default/gen/src/telemetry/transformation.js +229 -0
- package/out/Default/gen/src/telemetry/types.js +36 -0
- package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
- package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
- package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
- package/out/Default/gen/src/third_party/browser.js +808 -0
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +139 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
- package/out/Default/gen/src/third_party/index.js +128 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -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/out/Default/gen/src/tools/categories.js +37 -0
- package/out/Default/gen/src/tools/comments.js +230 -0
- package/out/Default/gen/src/tools/console.js +122 -0
- package/out/Default/gen/src/tools/css.js +54 -0
- package/out/Default/gen/src/tools/emulation.js +98 -0
- package/out/Default/gen/src/tools/extensions.js +108 -0
- package/out/Default/gen/src/tools/input.js +658 -0
- package/out/Default/gen/src/tools/lighthouse.js +279 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/memory.js +531 -0
- package/out/Default/gen/src/tools/network.js +325 -0
- package/out/Default/gen/src/tools/pages.js +420 -0
- package/out/Default/gen/src/tools/performance.js +258 -0
- package/out/Default/gen/src/tools/pwa.js +152 -0
- package/out/Default/gen/src/tools/screencast.js +160 -0
- package/out/Default/gen/src/tools/screenshot.js +315 -0
- package/out/Default/gen/src/tools/script.js +319 -0
- package/out/Default/gen/src/tools/slim/tools.js +110 -0
- package/out/Default/gen/src/tools/snapshot.js +88 -0
- package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/out/Default/gen/src/tools/tools.js +72 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/out/Default/gen/src/tools/webmcp.js +55 -0
- package/out/Default/gen/src/types.js +21 -0
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
- package/out/Default/gen/src/utils/bytes.js +95 -0
- package/out/Default/gen/src/utils/check-for-updates.js +81 -0
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/out/Default/gen/src/utils/errorHandling.js +23 -0
- package/out/Default/gen/src/utils/files.js +81 -0
- package/out/Default/gen/src/utils/id.js +16 -0
- package/out/Default/gen/src/utils/keyboard.js +307 -0
- package/out/Default/gen/src/utils/logger.js +145 -0
- package/out/Default/gen/src/utils/logpoint.js +44 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/pagination.js +50 -0
- package/out/Default/gen/src/utils/polyfill.js +11 -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 +43 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/out/Default/gen/src/utils/url.js +311 -0
- package/out/Default/gen/src/version.js +11 -0
- package/package.json +125 -4
- package/skills/a11y-debugging/SKILL.md +86 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/arc-compatibility/SKILL.md +174 -0
- package/skills/arc-compatibility/SOURCES.md +238 -0
- package/skills/arc-compatibility/references/compatibility.md +115 -0
- package/skills/arc-compatibility/references/output-contract.md +62 -0
- package/skills/arc-compatibility/references/workflows.md +108 -0
- package/skills/chrome-devtools/SKILL.md +80 -0
- package/skills/chrome-devtools-cli/SKILL.md +208 -0
- package/skills/chrome-devtools-cli/references/installation.md +24 -0
- package/skills/cookie-debugging/SKILL.md +152 -0
- package/skills/debug-optimize-lcp/SKILL.md +121 -0
- package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
- package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
- package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
- package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
- package/skills/inspect-in-devtools/SKILL.md +82 -0
- package/skills/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +107 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { zod } from '../third_party/index.js';
|
|
7
|
+
import { zodTransform } from '../tools/ToolDefinition.js';
|
|
8
|
+
const BYTE_UNITS = {
|
|
9
|
+
b: 1,
|
|
10
|
+
byte: 1,
|
|
11
|
+
bytes: 1,
|
|
12
|
+
k: 1000,
|
|
13
|
+
kb: 1000,
|
|
14
|
+
kib: 1024,
|
|
15
|
+
m: 1000 * 1000,
|
|
16
|
+
mb: 1000 * 1000,
|
|
17
|
+
mib: 1024 * 1024,
|
|
18
|
+
g: 1000 * 1000 * 1000,
|
|
19
|
+
gb: 1000 * 1000 * 1000,
|
|
20
|
+
gib: 1024 * 1024 * 1024,
|
|
21
|
+
t: 1000 * 1000 * 1000 * 1000,
|
|
22
|
+
tb: 1000 * 1000 * 1000 * 1000,
|
|
23
|
+
tib: 1024 * 1024 * 1024 * 1024,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Parses a byte size string (e.g. "1M", "1MB", "500KB", "1.5GB", "1024") into bytes.
|
|
27
|
+
*/
|
|
28
|
+
export function parseByteSize(value) {
|
|
29
|
+
const trimmed = value.trim();
|
|
30
|
+
if (trimmed === '') {
|
|
31
|
+
throw new Error(`Invalid byte size: "${value}"`);
|
|
32
|
+
}
|
|
33
|
+
const match = trimmed.match(/^(\d+(?:\.\d+)?)\s*([a-zA-Z]+)?$/);
|
|
34
|
+
if (!match) {
|
|
35
|
+
throw new Error(`Invalid byte size format: "${value}". Expected a number or format like "1024", "1M", "1MB", "1G", "1GB".`);
|
|
36
|
+
}
|
|
37
|
+
const numMatch = match[1];
|
|
38
|
+
if (numMatch === undefined) {
|
|
39
|
+
throw new Error(`Invalid byte size: "${value}"`);
|
|
40
|
+
}
|
|
41
|
+
const num = Number(numMatch);
|
|
42
|
+
if (!Number.isFinite(num) || num < 0) {
|
|
43
|
+
throw new Error(`Invalid byte size: "${value}"`);
|
|
44
|
+
}
|
|
45
|
+
const unitMatch = match[2];
|
|
46
|
+
if (unitMatch === undefined) {
|
|
47
|
+
return Math.round(num);
|
|
48
|
+
}
|
|
49
|
+
const unit = unitMatch.toLowerCase();
|
|
50
|
+
const multiplier = BYTE_UNITS[unit];
|
|
51
|
+
if (multiplier === undefined) {
|
|
52
|
+
throw new Error(`Unknown unit "${unitMatch}" in "${value}". Supported units: B, KB, KiB, MB, MiB, GB, GiB, TB, TiB.`);
|
|
53
|
+
}
|
|
54
|
+
const bytes = Math.round(num * multiplier);
|
|
55
|
+
if (!Number.isFinite(bytes)) {
|
|
56
|
+
throw new Error(`Invalid byte size: "${value}"`);
|
|
57
|
+
}
|
|
58
|
+
return bytes;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parses an inclusive byte-size range (e.g. "1MB", "1MB-2MB", "-1MB", "1MB-").
|
|
62
|
+
*/
|
|
63
|
+
export function parseByteSizeRange(value) {
|
|
64
|
+
const trimmed = value.trim();
|
|
65
|
+
if (!trimmed.includes('-')) {
|
|
66
|
+
return { min: parseByteSize(trimmed), max: undefined };
|
|
67
|
+
}
|
|
68
|
+
const parts = trimmed.split('-');
|
|
69
|
+
if (parts.length !== 2) {
|
|
70
|
+
throw new Error(`Invalid byte size range: "${value}". Expected a size or range like "1MB", "1MB-2MB", "-1MB", or "1MB-".`);
|
|
71
|
+
}
|
|
72
|
+
const minValue = parts[0];
|
|
73
|
+
const maxValue = parts[1];
|
|
74
|
+
if (minValue === undefined || maxValue === undefined) {
|
|
75
|
+
throw new Error(`Invalid byte size range: "${value}"`);
|
|
76
|
+
}
|
|
77
|
+
const minText = minValue.trim();
|
|
78
|
+
const maxText = maxValue.trim();
|
|
79
|
+
if (minText === '' && maxText === '') {
|
|
80
|
+
throw new Error(`Invalid byte size range: "${value}". At least one bound is required.`);
|
|
81
|
+
}
|
|
82
|
+
const min = minText === '' ? 0 : parseByteSize(minText);
|
|
83
|
+
const max = maxText === '' ? undefined : parseByteSize(maxText);
|
|
84
|
+
if (max !== undefined && min > max) {
|
|
85
|
+
throw new Error(`Invalid byte size range: "${value}". The lower bound must not exceed the upper bound.`);
|
|
86
|
+
}
|
|
87
|
+
return { min, max };
|
|
88
|
+
}
|
|
89
|
+
export function byteSizeRangeSchema(description) {
|
|
90
|
+
return zod
|
|
91
|
+
.string()
|
|
92
|
+
.transform(zodTransform(parseByteSizeRange))
|
|
93
|
+
.describe(description);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import child_process from 'node:child_process';
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import process from 'node:process';
|
|
11
|
+
import { semver } from '../third_party/cli.js';
|
|
12
|
+
import { PACKAGE_NAME, VERSION } from '../version.js';
|
|
13
|
+
/**
|
|
14
|
+
* Notifies the user if an update is available.
|
|
15
|
+
* @param message The message to display in the update notification.
|
|
16
|
+
*/
|
|
17
|
+
let isChecking = false;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export function resetUpdateCheckFlagForTesting() {
|
|
20
|
+
isChecking = false;
|
|
21
|
+
}
|
|
22
|
+
export async function checkForUpdates(message) {
|
|
23
|
+
if (isChecking || process.env['CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS']) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
isChecking = true;
|
|
27
|
+
const cachePath = path.join(os.homedir(), '.cache', PACKAGE_NAME, 'latest.json');
|
|
28
|
+
let cachedVersion;
|
|
29
|
+
let stats;
|
|
30
|
+
try {
|
|
31
|
+
stats = await fs.stat(cachePath);
|
|
32
|
+
const data = await fs.readFile(cachePath, 'utf8');
|
|
33
|
+
const version = JSON.parse(data).version;
|
|
34
|
+
// A cache entry that is not a valid version would make `semver.lt` throw
|
|
35
|
+
// before the refresh below runs, so every start would fail on the same
|
|
36
|
+
// file. Ignore such an entry and let the refresh replace it.
|
|
37
|
+
if (typeof version === 'string' && semver.valid(version)) {
|
|
38
|
+
cachedVersion = version;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Ignore errors reading cache.
|
|
43
|
+
}
|
|
44
|
+
if (cachedVersion && semver.lt(VERSION, cachedVersion)) {
|
|
45
|
+
console.warn(`\nUpdate available: ${VERSION} -> ${cachedVersion}\n${message}\n`);
|
|
46
|
+
}
|
|
47
|
+
const now = Date.now();
|
|
48
|
+
if (stats && now - stats.mtimeMs < 24 * 60 * 60 * 1000) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Update mtime immediately to prevent multiple subprocesses.
|
|
52
|
+
try {
|
|
53
|
+
const parentDir = path.dirname(cachePath);
|
|
54
|
+
await fs.mkdir(parentDir, { recursive: true });
|
|
55
|
+
const nowTime = new Date();
|
|
56
|
+
if (stats) {
|
|
57
|
+
await fs.utimes(cachePath, nowTime, nowTime);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
await fs.writeFile(cachePath, JSON.stringify({ version: VERSION }));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Ignore errors.
|
|
65
|
+
}
|
|
66
|
+
// In a separate process, check the latest available version number
|
|
67
|
+
// and update the local snapshot accordingly.
|
|
68
|
+
const scriptPath = path.join(import.meta.dirname, '..', 'bin', 'check-latest-version.js');
|
|
69
|
+
try {
|
|
70
|
+
const child = child_process.spawn(process.execPath, [scriptPath, cachePath], {
|
|
71
|
+
detached: true,
|
|
72
|
+
stdio: 'ignore',
|
|
73
|
+
windowsHide: true,
|
|
74
|
+
});
|
|
75
|
+
child.unref();
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Fail silently in case of any errors.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=check-for-updates.js.map
|
|
@@ -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
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
import { logger } from './logger.js';
|
|
8
|
+
export function getErrorMessage(err) {
|
|
9
|
+
return err instanceof Error ? err.message : String(err);
|
|
10
|
+
}
|
|
11
|
+
export function toError(err) {
|
|
12
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
13
|
+
}
|
|
14
|
+
export function setupUnhandledRejectionHandler(onCrash) {
|
|
15
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
16
|
+
logger?.('Unhandled promise rejection:', promise, reason);
|
|
17
|
+
console.error('Unhandled promise rejection:', reason);
|
|
18
|
+
if (process.env['CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT'] === 'true') {
|
|
19
|
+
onCrash();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=errorHandling.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
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 os from 'node:os';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
export async function getTempFilePath(filename) {
|
|
11
|
+
// Reject names with directory components (e.g. `../x`) instead of writing
|
|
12
|
+
// the file somewhere other than the temp directory.
|
|
13
|
+
if (filename !== path.basename(filename) ||
|
|
14
|
+
filename === '' ||
|
|
15
|
+
filename === '.' ||
|
|
16
|
+
filename === '..') {
|
|
17
|
+
throw new Error(`Invalid temp file name "${filename}": it must not contain a directory.`);
|
|
18
|
+
}
|
|
19
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'chrome-devtools-mcp-'));
|
|
20
|
+
const filepath = path.join(dir, filename);
|
|
21
|
+
return filepath;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Converts a client-supplied `file:` URL to a path. On Windows, a URL with no
|
|
25
|
+
* host and no drive letter (`file:///home/user/project`) is read as a POSIX
|
|
26
|
+
* path instead of throwing: a WSL2 client sends such URLs to a Windows-side
|
|
27
|
+
* server. Callers resolve the result against the working directory, which for
|
|
28
|
+
* a server started from WSL is `\\wsl.localhost\<distro>\...`.
|
|
29
|
+
*/
|
|
30
|
+
export function fileUrlToPathWithPosixFallback(url, windows = process.platform === 'win32') {
|
|
31
|
+
const parsed = typeof url === 'string' ? new URL(url) : url;
|
|
32
|
+
const hasDriveLetter = /^\/[a-z](:|%3a)/i.test(parsed.pathname);
|
|
33
|
+
if (windows && parsed.hostname === '' && !hasDriveLetter) {
|
|
34
|
+
return fileURLToPath(parsed, { windows: false });
|
|
35
|
+
}
|
|
36
|
+
return fileURLToPath(parsed, { windows });
|
|
37
|
+
}
|
|
38
|
+
export async function resolveCanonicalPath(filePath) {
|
|
39
|
+
const absolutePath = path.resolve(filePath);
|
|
40
|
+
try {
|
|
41
|
+
// Get the true canonical path, resolving all symlinks.
|
|
42
|
+
return await fs.realpath(absolutePath);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
if (err &&
|
|
46
|
+
typeof err === 'object' &&
|
|
47
|
+
'code' in err &&
|
|
48
|
+
err.code === 'ENOENT') {
|
|
49
|
+
// Find the nearest existing ancestor directory on the filesystem.
|
|
50
|
+
let current = absolutePath;
|
|
51
|
+
const missingSegments = [];
|
|
52
|
+
while (true) {
|
|
53
|
+
const parent = path.dirname(current);
|
|
54
|
+
if (parent === current) {
|
|
55
|
+
// Reached root directory but still couldn't resolve anything.
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const canonicalParent = await fs.realpath(parent);
|
|
60
|
+
return path.join(canonicalParent, path.basename(current), ...missingSegments);
|
|
61
|
+
}
|
|
62
|
+
catch (parentErr) {
|
|
63
|
+
if (parentErr &&
|
|
64
|
+
typeof parentErr === 'object' &&
|
|
65
|
+
'code' in parentErr &&
|
|
66
|
+
parentErr.code === 'ENOENT') {
|
|
67
|
+
missingSegments.unshift(path.basename(current));
|
|
68
|
+
current = parent;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw parentErr;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export function createIdGenerator() {
|
|
7
|
+
let i = 1;
|
|
8
|
+
return () => {
|
|
9
|
+
if (i === Number.MAX_SAFE_INTEGER) {
|
|
10
|
+
i = 0;
|
|
11
|
+
}
|
|
12
|
+
return i++;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export const stableIdSymbol = Symbol('stableIdSymbol');
|
|
16
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
// See the KeyInput type for the list of supported keys.
|
|
7
|
+
const validKeys = new Set([
|
|
8
|
+
'0',
|
|
9
|
+
'1',
|
|
10
|
+
'2',
|
|
11
|
+
'3',
|
|
12
|
+
'4',
|
|
13
|
+
'5',
|
|
14
|
+
'6',
|
|
15
|
+
'7',
|
|
16
|
+
'8',
|
|
17
|
+
'9',
|
|
18
|
+
'Power',
|
|
19
|
+
'Eject',
|
|
20
|
+
'Abort',
|
|
21
|
+
'Help',
|
|
22
|
+
'Backspace',
|
|
23
|
+
'Tab',
|
|
24
|
+
'Numpad5',
|
|
25
|
+
'NumpadEnter',
|
|
26
|
+
'Enter',
|
|
27
|
+
'\r',
|
|
28
|
+
'\n',
|
|
29
|
+
'ShiftLeft',
|
|
30
|
+
'ShiftRight',
|
|
31
|
+
'ControlLeft',
|
|
32
|
+
'ControlRight',
|
|
33
|
+
'AltLeft',
|
|
34
|
+
'AltRight',
|
|
35
|
+
'Pause',
|
|
36
|
+
'CapsLock',
|
|
37
|
+
'Escape',
|
|
38
|
+
'Convert',
|
|
39
|
+
'NonConvert',
|
|
40
|
+
'Space',
|
|
41
|
+
'Numpad9',
|
|
42
|
+
'PageUp',
|
|
43
|
+
'Numpad3',
|
|
44
|
+
'PageDown',
|
|
45
|
+
'End',
|
|
46
|
+
'Numpad1',
|
|
47
|
+
'Home',
|
|
48
|
+
'Numpad7',
|
|
49
|
+
'ArrowLeft',
|
|
50
|
+
'Numpad4',
|
|
51
|
+
'Numpad8',
|
|
52
|
+
'ArrowUp',
|
|
53
|
+
'ArrowRight',
|
|
54
|
+
'Numpad6',
|
|
55
|
+
'Numpad2',
|
|
56
|
+
'ArrowDown',
|
|
57
|
+
'Select',
|
|
58
|
+
'Open',
|
|
59
|
+
'PrintScreen',
|
|
60
|
+
'Insert',
|
|
61
|
+
'Numpad0',
|
|
62
|
+
'Delete',
|
|
63
|
+
'NumpadDecimal',
|
|
64
|
+
'Digit0',
|
|
65
|
+
'Digit1',
|
|
66
|
+
'Digit2',
|
|
67
|
+
'Digit3',
|
|
68
|
+
'Digit4',
|
|
69
|
+
'Digit5',
|
|
70
|
+
'Digit6',
|
|
71
|
+
'Digit7',
|
|
72
|
+
'Digit8',
|
|
73
|
+
'Digit9',
|
|
74
|
+
'KeyA',
|
|
75
|
+
'KeyB',
|
|
76
|
+
'KeyC',
|
|
77
|
+
'KeyD',
|
|
78
|
+
'KeyE',
|
|
79
|
+
'KeyF',
|
|
80
|
+
'KeyG',
|
|
81
|
+
'KeyH',
|
|
82
|
+
'KeyI',
|
|
83
|
+
'KeyJ',
|
|
84
|
+
'KeyK',
|
|
85
|
+
'KeyL',
|
|
86
|
+
'KeyM',
|
|
87
|
+
'KeyN',
|
|
88
|
+
'KeyO',
|
|
89
|
+
'KeyP',
|
|
90
|
+
'KeyQ',
|
|
91
|
+
'KeyR',
|
|
92
|
+
'KeyS',
|
|
93
|
+
'KeyT',
|
|
94
|
+
'KeyU',
|
|
95
|
+
'KeyV',
|
|
96
|
+
'KeyW',
|
|
97
|
+
'KeyX',
|
|
98
|
+
'KeyY',
|
|
99
|
+
'KeyZ',
|
|
100
|
+
'MetaLeft',
|
|
101
|
+
'MetaRight',
|
|
102
|
+
'ContextMenu',
|
|
103
|
+
'NumpadMultiply',
|
|
104
|
+
'NumpadAdd',
|
|
105
|
+
'NumpadSubtract',
|
|
106
|
+
'NumpadDivide',
|
|
107
|
+
'F1',
|
|
108
|
+
'F2',
|
|
109
|
+
'F3',
|
|
110
|
+
'F4',
|
|
111
|
+
'F5',
|
|
112
|
+
'F6',
|
|
113
|
+
'F7',
|
|
114
|
+
'F8',
|
|
115
|
+
'F9',
|
|
116
|
+
'F10',
|
|
117
|
+
'F11',
|
|
118
|
+
'F12',
|
|
119
|
+
'F13',
|
|
120
|
+
'F14',
|
|
121
|
+
'F15',
|
|
122
|
+
'F16',
|
|
123
|
+
'F17',
|
|
124
|
+
'F18',
|
|
125
|
+
'F19',
|
|
126
|
+
'F20',
|
|
127
|
+
'F21',
|
|
128
|
+
'F22',
|
|
129
|
+
'F23',
|
|
130
|
+
'F24',
|
|
131
|
+
'NumLock',
|
|
132
|
+
'ScrollLock',
|
|
133
|
+
'AudioVolumeMute',
|
|
134
|
+
'AudioVolumeDown',
|
|
135
|
+
'AudioVolumeUp',
|
|
136
|
+
'MediaTrackNext',
|
|
137
|
+
'MediaTrackPrevious',
|
|
138
|
+
'MediaStop',
|
|
139
|
+
'MediaPlayPause',
|
|
140
|
+
'Semicolon',
|
|
141
|
+
'Equal',
|
|
142
|
+
'NumpadEqual',
|
|
143
|
+
'Comma',
|
|
144
|
+
'Minus',
|
|
145
|
+
'Period',
|
|
146
|
+
'Slash',
|
|
147
|
+
'Backquote',
|
|
148
|
+
'BracketLeft',
|
|
149
|
+
'Backslash',
|
|
150
|
+
'BracketRight',
|
|
151
|
+
'Quote',
|
|
152
|
+
'AltGraph',
|
|
153
|
+
'Props',
|
|
154
|
+
'Cancel',
|
|
155
|
+
'Clear',
|
|
156
|
+
'Shift',
|
|
157
|
+
'Control',
|
|
158
|
+
'Alt',
|
|
159
|
+
'Accept',
|
|
160
|
+
'ModeChange',
|
|
161
|
+
' ',
|
|
162
|
+
'Print',
|
|
163
|
+
'Execute',
|
|
164
|
+
'\u0000',
|
|
165
|
+
'a',
|
|
166
|
+
'b',
|
|
167
|
+
'c',
|
|
168
|
+
'd',
|
|
169
|
+
'e',
|
|
170
|
+
'f',
|
|
171
|
+
'g',
|
|
172
|
+
'h',
|
|
173
|
+
'i',
|
|
174
|
+
'j',
|
|
175
|
+
'k',
|
|
176
|
+
'l',
|
|
177
|
+
'm',
|
|
178
|
+
'n',
|
|
179
|
+
'o',
|
|
180
|
+
'p',
|
|
181
|
+
'q',
|
|
182
|
+
'r',
|
|
183
|
+
's',
|
|
184
|
+
't',
|
|
185
|
+
'u',
|
|
186
|
+
'v',
|
|
187
|
+
'w',
|
|
188
|
+
'x',
|
|
189
|
+
'y',
|
|
190
|
+
'z',
|
|
191
|
+
'Meta',
|
|
192
|
+
'*',
|
|
193
|
+
'+',
|
|
194
|
+
'-',
|
|
195
|
+
'/',
|
|
196
|
+
';',
|
|
197
|
+
'=',
|
|
198
|
+
',',
|
|
199
|
+
'.',
|
|
200
|
+
'`',
|
|
201
|
+
'[',
|
|
202
|
+
'\\',
|
|
203
|
+
']',
|
|
204
|
+
"'",
|
|
205
|
+
'Attn',
|
|
206
|
+
'CrSel',
|
|
207
|
+
'ExSel',
|
|
208
|
+
'EraseEof',
|
|
209
|
+
'Play',
|
|
210
|
+
'ZoomOut',
|
|
211
|
+
')',
|
|
212
|
+
'!',
|
|
213
|
+
'@',
|
|
214
|
+
'#',
|
|
215
|
+
'$',
|
|
216
|
+
'%',
|
|
217
|
+
'^',
|
|
218
|
+
'&',
|
|
219
|
+
'(',
|
|
220
|
+
'A',
|
|
221
|
+
'B',
|
|
222
|
+
'C',
|
|
223
|
+
'D',
|
|
224
|
+
'E',
|
|
225
|
+
'F',
|
|
226
|
+
'G',
|
|
227
|
+
'H',
|
|
228
|
+
'I',
|
|
229
|
+
'J',
|
|
230
|
+
'K',
|
|
231
|
+
'L',
|
|
232
|
+
'M',
|
|
233
|
+
'N',
|
|
234
|
+
'O',
|
|
235
|
+
'P',
|
|
236
|
+
'Q',
|
|
237
|
+
'R',
|
|
238
|
+
'S',
|
|
239
|
+
'T',
|
|
240
|
+
'U',
|
|
241
|
+
'V',
|
|
242
|
+
'W',
|
|
243
|
+
'X',
|
|
244
|
+
'Y',
|
|
245
|
+
'Z',
|
|
246
|
+
':',
|
|
247
|
+
'<',
|
|
248
|
+
'_',
|
|
249
|
+
'>',
|
|
250
|
+
'?',
|
|
251
|
+
'~',
|
|
252
|
+
'{',
|
|
253
|
+
'|',
|
|
254
|
+
'}',
|
|
255
|
+
'"',
|
|
256
|
+
'SoftLeft',
|
|
257
|
+
'SoftRight',
|
|
258
|
+
'Camera',
|
|
259
|
+
'Call',
|
|
260
|
+
'EndCall',
|
|
261
|
+
'VolumeDown',
|
|
262
|
+
'VolumeUp',
|
|
263
|
+
]);
|
|
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)) {
|
|
275
|
+
return key;
|
|
276
|
+
}
|
|
277
|
+
throw new Error(invalidKeyMessage(key));
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Returns the primary key, followed by modifiers in original order.
|
|
281
|
+
*/
|
|
282
|
+
export function parseKey(keyInput) {
|
|
283
|
+
let key = '';
|
|
284
|
+
const result = [];
|
|
285
|
+
for (const ch of keyInput) {
|
|
286
|
+
// Handle cases like Shift++.
|
|
287
|
+
if (ch === '+' && key) {
|
|
288
|
+
result.push(throwIfInvalidKey(key));
|
|
289
|
+
key = '';
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
key += ch;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (key) {
|
|
296
|
+
result.push(throwIfInvalidKey(key));
|
|
297
|
+
}
|
|
298
|
+
const primaryKey = result.at(-1);
|
|
299
|
+
if (primaryKey === undefined) {
|
|
300
|
+
throw new Error(`Key ${keyInput} could not be parsed.`);
|
|
301
|
+
}
|
|
302
|
+
if (new Set(result).size !== result.length) {
|
|
303
|
+
throw new Error(`Key ${keyInput} contains duplicate keys.`);
|
|
304
|
+
}
|
|
305
|
+
return [primaryKey, ...result.slice(0, -1)];
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=keyboard.js.map
|