@yezack/chrome-devtools-mcp-108 0.0.0-stage → 1.10.2
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/FORK-NOTICE.md +45 -0
- package/LICENSE +202 -0
- package/README.md +45 -2
- package/build/src/BrowserManager.js +401 -0
- package/build/src/McpContext.js +642 -0
- package/build/src/McpPage.js +850 -0
- package/build/src/McpResponse.js +1086 -0
- package/build/src/SlimMcpResponse.js +19 -0
- package/build/src/TextSnapshot.js +315 -0
- package/build/src/ToolHandler.js +322 -0
- package/build/src/bin/check-latest-version.js +51 -0
- package/build/src/bin/chrome-devtools-mcp-main.js +77 -0
- package/build/src/bin/chrome-devtools-mcp.js +23 -0
- package/build/src/bin/chrome-devtools.js +222 -0
- package/build/src/collectors/PageCollector.js +291 -0
- package/build/src/collectors/ServiceWorkerCollector.js +171 -0
- package/build/src/config/browser-options.js +125 -0
- package/build/src/config/category-options.js +89 -0
- package/build/src/config/cli-commands.js +26 -0
- package/build/src/config/cli-options.js +1473 -0
- package/build/src/config/mcp-options.js +417 -0
- package/build/src/daemon/client.js +221 -0
- package/build/src/daemon/daemon.js +266 -0
- package/build/src/daemon/types.js +7 -0
- package/build/src/daemon/utils.js +136 -0
- package/build/src/devtools/DevToolsCommentBridge.js +91 -0
- package/build/src/devtools/DevtoolsUtils.js +307 -0
- package/build/src/devtools/McpHostBindingAdapter.js +165 -0
- package/build/src/devtools/issueDescriptions.js +42 -0
- package/build/src/formatters/CommentFormatter.js +82 -0
- package/build/src/formatters/ConsoleFormatter.js +321 -0
- package/build/src/formatters/CssFormatter.js +812 -0
- package/build/src/formatters/HeapSnapshotFormatter.js +185 -0
- package/build/src/formatters/IssueFormatter.js +193 -0
- package/build/src/formatters/NetworkFormatter.js +241 -0
- package/build/src/formatters/SnapshotFormatter.js +135 -0
- package/build/src/index.js +237 -0
- package/build/src/processors/ChunkedTraceParser.js +361 -0
- package/build/src/processors/HeapSnapshotManager.js +270 -0
- package/build/src/processors/PerformanceTrace.js +132 -0
- package/build/src/telemetry/ClearcutLogger.js +242 -0
- package/build/src/telemetry/WatchdogClient.js +61 -0
- package/build/src/telemetry/errors.js +18 -0
- package/build/src/telemetry/flagUtils.js +90 -0
- package/build/src/telemetry/metricsRegistry.js +85 -0
- package/build/src/telemetry/persistence.js +82 -0
- package/build/src/telemetry/transformation.js +233 -0
- package/build/src/telemetry/types.js +36 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +205 -0
- package/build/src/telemetry/watchdog/main.js +128 -0
- package/build/src/third_party/THIRD_PARTY_NOTICES +4077 -0
- package/build/src/third_party/bundled-packages.json +12 -0
- package/build/src/third_party/devtools-formatter-worker.js +15494 -0
- package/build/src/third_party/devtools-heap-snapshot-worker.js +10979 -0
- package/build/src/third_party/index.js +200978 -0
- package/build/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/build/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/build/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/build/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +4 -0
- package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +4 -0
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/build/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/build/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/build/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/build/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/build/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/build/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/build/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/build/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/build/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/build/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/build/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/build/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +10 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/build/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +58435 -0
- package/build/src/tools/ToolDefinition.js +80 -0
- package/build/src/tools/categories.js +33 -0
- package/build/src/tools/comments.js +169 -0
- package/build/src/tools/console.js +104 -0
- package/build/src/tools/css.js +45 -0
- package/build/src/tools/emulation.js +84 -0
- package/build/src/tools/extensions.js +103 -0
- package/build/src/tools/input.js +652 -0
- package/build/src/tools/lighthouse.js +149 -0
- package/build/src/tools/memory.js +424 -0
- package/build/src/tools/network.js +128 -0
- package/build/src/tools/pages.js +363 -0
- package/build/src/tools/performance.js +212 -0
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +119 -0
- package/build/src/tools/screenshot.js +277 -0
- package/build/src/tools/script.js +232 -0
- package/build/src/tools/slim/tools.js +96 -0
- package/build/src/tools/snapshot.js +63 -0
- package/build/src/tools/thirdPartyDeveloper.js +85 -0
- package/build/src/tools/tools.js +55 -0
- package/build/src/tools/webmcp.js +66 -0
- package/build/src/types.js +10 -0
- package/build/src/utils/WaitForHelper.js +316 -0
- package/build/src/utils/bytes.js +105 -0
- package/build/src/utils/check-for-updates.js +75 -0
- package/build/src/utils/files.js +57 -0
- package/build/src/utils/id.js +16 -0
- package/build/src/utils/keyboard.js +297 -0
- package/build/src/utils/logger.js +52 -0
- package/build/src/utils/pagination.js +50 -0
- package/build/src/utils/polyfill.js +11 -0
- package/build/src/utils/url.js +116 -0
- package/build/src/version.js +10 -0
- package/package.json +41 -4
- package/skills/a11y-debugging/SKILL.md +91 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/chrome-devtools/SKILL.md +74 -0
- package/skills/chrome-devtools-cli/SKILL.md +194 -0
- package/skills/chrome-devtools-cli/references/installation.md +14 -0
- package/skills/cookie-debugging/SKILL.md +149 -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/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +99 -0
|
@@ -0,0 +1,75 @@
|
|
|
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/index.js';
|
|
12
|
+
import { 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 Reset flag for tests only. */
|
|
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', 'chrome-devtools-mcp', '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
|
+
cachedVersion = JSON.parse(data).version;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Ignore errors reading cache.
|
|
37
|
+
}
|
|
38
|
+
if (cachedVersion && semver.lt(VERSION, cachedVersion)) {
|
|
39
|
+
console.warn(`\nUpdate available: ${VERSION} -> ${cachedVersion}\n${message}\n`);
|
|
40
|
+
}
|
|
41
|
+
const now = Date.now();
|
|
42
|
+
if (stats && now - stats.mtimeMs < 24 * 60 * 60 * 1000) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// Update mtime immediately to prevent multiple subprocesses.
|
|
46
|
+
try {
|
|
47
|
+
const parentDir = path.dirname(cachePath);
|
|
48
|
+
await fs.mkdir(parentDir, { recursive: true });
|
|
49
|
+
const nowTime = new Date();
|
|
50
|
+
if (stats) {
|
|
51
|
+
await fs.utimes(cachePath, nowTime, nowTime);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
await fs.writeFile(cachePath, JSON.stringify({ version: VERSION }));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Ignore errors.
|
|
59
|
+
}
|
|
60
|
+
// In a separate process, check the latest available version number
|
|
61
|
+
// and update the local snapshot accordingly.
|
|
62
|
+
const scriptPath = path.join(import.meta.dirname, '..', 'bin', 'check-latest-version.js');
|
|
63
|
+
try {
|
|
64
|
+
const child = child_process.spawn(process.execPath, [scriptPath, cachePath], {
|
|
65
|
+
detached: true,
|
|
66
|
+
stdio: 'ignore',
|
|
67
|
+
windowsHide: true,
|
|
68
|
+
});
|
|
69
|
+
child.unref();
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Fail silently in case of any errors.
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=check-for-updates.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
export async function getTempFilePath(filename) {
|
|
10
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'chrome-devtools-mcp-'));
|
|
11
|
+
const filepath = path.join(dir, filename);
|
|
12
|
+
return filepath;
|
|
13
|
+
}
|
|
14
|
+
export async function resolveCanonicalPath(filePath) {
|
|
15
|
+
const absolutePath = path.resolve(filePath);
|
|
16
|
+
try {
|
|
17
|
+
// Get the true canonical path, resolving all symlinks.
|
|
18
|
+
return await fs.realpath(absolutePath);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
if (err &&
|
|
22
|
+
typeof err === 'object' &&
|
|
23
|
+
'code' in err &&
|
|
24
|
+
err.code === 'ENOENT') {
|
|
25
|
+
// Find the nearest existing ancestor directory on the filesystem.
|
|
26
|
+
let current = absolutePath;
|
|
27
|
+
const missingSegments = [];
|
|
28
|
+
while (true) {
|
|
29
|
+
const parent = path.dirname(current);
|
|
30
|
+
if (parent === current) {
|
|
31
|
+
// Reached root directory but still couldn't resolve anything.
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const canonicalParent = await fs.realpath(parent);
|
|
36
|
+
return path.join(canonicalParent, path.basename(current), ...missingSegments);
|
|
37
|
+
}
|
|
38
|
+
catch (parentErr) {
|
|
39
|
+
if (parentErr &&
|
|
40
|
+
typeof parentErr === 'object' &&
|
|
41
|
+
'code' in parentErr &&
|
|
42
|
+
parentErr.code === 'ENOENT') {
|
|
43
|
+
missingSegments.unshift(path.basename(current));
|
|
44
|
+
current = parent;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw parentErr;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# 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,297 @@
|
|
|
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
|
+
function throwIfInvalidKey(key) {
|
|
265
|
+
if (validKeys.has(key)) {
|
|
266
|
+
return key;
|
|
267
|
+
}
|
|
268
|
+
throw new Error(`${key} is invalid. Valid keys are: ${Array.from(validKeys.values()).join(',')}.`);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Returns the primary key, followed by modifiers in original order.
|
|
272
|
+
*/
|
|
273
|
+
export function parseKey(keyInput) {
|
|
274
|
+
let key = '';
|
|
275
|
+
const result = [];
|
|
276
|
+
for (const ch of keyInput) {
|
|
277
|
+
// Handle cases like Shift++.
|
|
278
|
+
if (ch === '+' && key) {
|
|
279
|
+
result.push(throwIfInvalidKey(key));
|
|
280
|
+
key = '';
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
key += ch;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (key) {
|
|
287
|
+
result.push(throwIfInvalidKey(key));
|
|
288
|
+
}
|
|
289
|
+
if (result.length === 0) {
|
|
290
|
+
throw new Error(`Key ${keyInput} could not be parsed.`);
|
|
291
|
+
}
|
|
292
|
+
if (new Set(result).size !== result.length) {
|
|
293
|
+
throw new Error(`Key ${keyInput} contains duplicate keys.`);
|
|
294
|
+
}
|
|
295
|
+
return [result.at(-1), ...result.slice(0, -1)];
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=keyboard.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
export const logger = (...args) => {
|
|
31
|
+
if (logFileStream) {
|
|
32
|
+
logFileStream.write(`${new Date().toISOString()} ${mcpDebugNamespace} ${util.format(...args)}\n`);
|
|
33
|
+
}
|
|
34
|
+
else if (_debugLog.enabled) {
|
|
35
|
+
_debugLog('%s %s', new Date().toISOString(), util.format(...args));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const puppeteerLogger = (prefix) => {
|
|
39
|
+
const dbg = util.debuglog(prefix);
|
|
40
|
+
if (!dbg.enabled) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (logFileStream) {
|
|
44
|
+
return (...args) => {
|
|
45
|
+
logFileStream.write(`${new Date().toISOString()} ${prefix} ${util.format(...args)}\n`);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return (...args) => {
|
|
49
|
+
dbg('%s %s', new Date().toISOString(), util.format(...args));
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
const DEFAULT_PAGE_SIZE = 20;
|
|
7
|
+
export function paginate(items, options) {
|
|
8
|
+
const total = items.length;
|
|
9
|
+
if (!options || noPaginationOptions(options)) {
|
|
10
|
+
return {
|
|
11
|
+
items,
|
|
12
|
+
currentPage: 0,
|
|
13
|
+
totalPages: 1,
|
|
14
|
+
hasNextPage: false,
|
|
15
|
+
hasPreviousPage: false,
|
|
16
|
+
startIndex: 0,
|
|
17
|
+
endIndex: total,
|
|
18
|
+
invalidPage: false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
22
|
+
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
23
|
+
const { currentPage, invalidPage } = resolvePageIndex(options.pageIdx, totalPages);
|
|
24
|
+
const startIndex = currentPage * pageSize;
|
|
25
|
+
const pageItems = items.slice(startIndex, startIndex + pageSize);
|
|
26
|
+
const endIndex = startIndex + pageItems.length;
|
|
27
|
+
return {
|
|
28
|
+
items: pageItems,
|
|
29
|
+
currentPage,
|
|
30
|
+
totalPages,
|
|
31
|
+
hasNextPage: currentPage < totalPages - 1,
|
|
32
|
+
hasPreviousPage: currentPage > 0,
|
|
33
|
+
startIndex,
|
|
34
|
+
endIndex,
|
|
35
|
+
invalidPage,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function noPaginationOptions(options) {
|
|
39
|
+
return options.pageSize === undefined && options.pageIdx === undefined;
|
|
40
|
+
}
|
|
41
|
+
function resolvePageIndex(pageIdx, totalPages) {
|
|
42
|
+
if (pageIdx === undefined) {
|
|
43
|
+
return { currentPage: 0, invalidPage: false };
|
|
44
|
+
}
|
|
45
|
+
if (pageIdx < 0 || pageIdx >= totalPages) {
|
|
46
|
+
return { currentPage: 0, invalidPage: true };
|
|
47
|
+
}
|
|
48
|
+
return { currentPage: pageIdx, invalidPage: false };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DisposableStack, AsyncDisposableStack, SuppressedError, } from '../third_party/index.js';
|
|
7
|
+
globalThis.DisposableStack ??= DisposableStack;
|
|
8
|
+
globalThis.AsyncDisposableStack ??= AsyncDisposableStack;
|
|
9
|
+
// @ts-expect-error Type mismatch between puppeteer-core and node for SuppressedError.
|
|
10
|
+
globalThis.SuppressedError ??= SuppressedError;
|
|
11
|
+
//# sourceMappingURL=polyfill.js.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
const ALLOWED_PROTOCOLS = new Set(['http:', 'https:', 'ws:', 'wss:']);
|
|
7
|
+
const IPV4_LOOPBACK_REGEX = /^127(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/;
|
|
8
|
+
/**
|
|
9
|
+
* Determines whether a given URL string points to a localhost / loopback address.
|
|
10
|
+
*
|
|
11
|
+
* @param url The URL string to test.
|
|
12
|
+
* @returns true if the URL is a valid network URL pointing to localhost or a loopback IP.
|
|
13
|
+
*/
|
|
14
|
+
export function isLocalhost(url) {
|
|
15
|
+
if (!url || typeof url !== 'string' || url.trim() === '') {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = new URL(url);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const hostname = parsed.hostname.toLowerCase().replace(/\.$/, '');
|
|
29
|
+
// 1. Check localhost and RFC 6761 *.localhost subdomains
|
|
30
|
+
if (hostname === 'localhost' || hostname.endsWith('.localhost')) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
// 2. Check IPv6 loopback ([::1] as returned by URL.hostname, or ::1)
|
|
34
|
+
if (hostname === '[::1]' || hostname === '::1') {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
// 3. Check IPv4 loopback (127.0.0.0/8)
|
|
38
|
+
if (IPV4_LOOPBACK_REGEX.test(hostname)) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Determines whether a URL is allowed for navigation and page tracking.
|
|
45
|
+
*
|
|
46
|
+
* Disallowed schemes:
|
|
47
|
+
* - chrome: (except chrome://newtab/ and chrome://inspect*)
|
|
48
|
+
* - chrome-untrusted:
|
|
49
|
+
* - chrome-extension: (unless categoryExtensions is true)
|
|
50
|
+
*
|
|
51
|
+
* @param url The URL string to test.
|
|
52
|
+
* @param options Configuration specifying whether extensions are enabled.
|
|
53
|
+
* @returns true if the URL is allowed.
|
|
54
|
+
*/
|
|
55
|
+
export function isAllowedUrl(url, options) {
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = new URL(url);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (parsed.protocol === 'chrome:') {
|
|
64
|
+
const host = parsed.hostname.toLowerCase();
|
|
65
|
+
const path = parsed.pathname.toLowerCase();
|
|
66
|
+
if (host === 'newtab' || host === 'new-tab-page' || host === 'inspect') {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (host === '' &&
|
|
70
|
+
(path === 'newtab' ||
|
|
71
|
+
path === 'new-tab-page' ||
|
|
72
|
+
path.startsWith('inspect'))) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (parsed.protocol === 'chrome:' ||
|
|
77
|
+
parsed.protocol === 'chrome-untrusted:') {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (!options.categoryExtensions && parsed.protocol === 'chrome-extension:') {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
const DISALLOWED_PROTOCOLS = new Set(['javascript:', 'data:', 'vbscript:']);
|
|
86
|
+
/**
|
|
87
|
+
* Validates a URL string by parsing it with `new URL` and checking for disallowed protocols and restricted schemes.
|
|
88
|
+
*
|
|
89
|
+
* @param url The URL string to validate.
|
|
90
|
+
* @param options Options object containing javascriptEvaluation and categoryExtensions.
|
|
91
|
+
* @returns The parsed URL.
|
|
92
|
+
* @throws Error if the URL does not parse with `new URL`, or if JavaScript evaluation is disabled and a disallowed URL is passed,
|
|
93
|
+
* or if navigating to a restricted scheme.
|
|
94
|
+
*/
|
|
95
|
+
export function validateUrl(url, options) {
|
|
96
|
+
const { javascriptEvaluation, categoryExtensions } = options;
|
|
97
|
+
let parsed;
|
|
98
|
+
try {
|
|
99
|
+
parsed = new URL(url);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
throw new Error(`Invalid URL: "${url}". URLs must be valid according to the URL standard.`);
|
|
103
|
+
}
|
|
104
|
+
if (javascriptEvaluation === false &&
|
|
105
|
+
DISALLOWED_PROTOCOLS.has(parsed.protocol)) {
|
|
106
|
+
throw new Error(`Navigating to ${parsed.protocol} URLs is not allowed when JavaScript evaluation is disabled.`);
|
|
107
|
+
}
|
|
108
|
+
if (!isAllowedUrl(url, { categoryExtensions })) {
|
|
109
|
+
if (parsed.protocol === 'chrome-extension:') {
|
|
110
|
+
throw new Error(`Navigating to chrome-extension: URLs is not allowed without --categoryExtensions.`);
|
|
111
|
+
}
|
|
112
|
+
throw new Error(`Navigating to ${parsed.protocol} URLs is not allowed.`);
|
|
113
|
+
}
|
|
114
|
+
return parsed;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
// If moved update release-please config
|
|
7
|
+
// x-release-please-start-version
|
|
8
|
+
export const VERSION = '1.10.1';
|
|
9
|
+
// x-release-please-end
|
|
10
|
+
//# sourceMappingURL=version.js.map
|