@yezack/chrome-devtools-mcp-108 0.0.0-stage → 1.10.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/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,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DevTools } from '../third_party/index.js';
|
|
7
|
+
import { stableIdSymbol } from '../utils/id.js';
|
|
8
|
+
const { formatBytesToKb } = DevTools.I18n.ByteUtilities;
|
|
9
|
+
export function isNodeLike(item) {
|
|
10
|
+
return (typeof item === 'object' && item !== null && 'id' in item && 'name' in item);
|
|
11
|
+
}
|
|
12
|
+
export function isEdgeLike(item) {
|
|
13
|
+
return (typeof item === 'object' &&
|
|
14
|
+
item !== null &&
|
|
15
|
+
'name' in item &&
|
|
16
|
+
'node' in item &&
|
|
17
|
+
'type' in item &&
|
|
18
|
+
typeof item.node === 'object' &&
|
|
19
|
+
item.node !== null &&
|
|
20
|
+
'id' in item.node &&
|
|
21
|
+
'name' in item.node);
|
|
22
|
+
}
|
|
23
|
+
export class HeapSnapshotFormatter {
|
|
24
|
+
#aggregates;
|
|
25
|
+
constructor(aggregates) {
|
|
26
|
+
this.#aggregates = aggregates;
|
|
27
|
+
}
|
|
28
|
+
static formatNodes(items) {
|
|
29
|
+
const lines = [];
|
|
30
|
+
if (items.length > 0) {
|
|
31
|
+
const firstItem = items[0];
|
|
32
|
+
if (isNodeLike(firstItem)) {
|
|
33
|
+
lines.push('nodeId,nodeName,type,distance,selfSize,retainedSize');
|
|
34
|
+
}
|
|
35
|
+
else if (isEdgeLike(firstItem)) {
|
|
36
|
+
lines.push('name,type,nodeId,nodeName,selfSize,retainedSize');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
for (const item of items) {
|
|
40
|
+
if (isNodeLike(item)) {
|
|
41
|
+
lines.push(`${item.id},${item.name},${item.type},${item.distance},${formatBytesToKb(item.selfSize)},${formatBytesToKb(item.retainedSize)}`);
|
|
42
|
+
}
|
|
43
|
+
else if (isEdgeLike(item)) {
|
|
44
|
+
lines.push(`${item.name},${item.type},${item.node.id},${item.node.name},${formatBytesToKb(item.node.selfSize)},${formatBytesToKb(item.node.retainedSize)}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return lines.join('\n');
|
|
48
|
+
}
|
|
49
|
+
static formatRetainingPaths(retainingPaths) {
|
|
50
|
+
const lines = [];
|
|
51
|
+
function formatEdge(edge, depth) {
|
|
52
|
+
const indent = ' '.repeat(depth);
|
|
53
|
+
lines.push(`${indent}<- @${edge.nodeId} ${edge.nodeName} via ${edge.edgeType} ${edge.edgeName} (distance: ${edge.distance})`);
|
|
54
|
+
for (const child of edge.children) {
|
|
55
|
+
formatEdge(child, depth + 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
for (const path of retainingPaths) {
|
|
59
|
+
formatEdge(path, 0);
|
|
60
|
+
}
|
|
61
|
+
return lines.join('\n');
|
|
62
|
+
}
|
|
63
|
+
static formatDominators(dominators) {
|
|
64
|
+
const lines = [];
|
|
65
|
+
lines.push('nodeId,nodeName,selfSize,retainedSize');
|
|
66
|
+
for (const node of dominators) {
|
|
67
|
+
lines.push(`${node.nodeId},${node.nodeName},${formatBytesToKb(node.selfSize)},${formatBytesToKb(node.retainedSize)}`);
|
|
68
|
+
}
|
|
69
|
+
return lines.join('\n');
|
|
70
|
+
}
|
|
71
|
+
static formatDuplicateStrings(groups) {
|
|
72
|
+
const lines = [];
|
|
73
|
+
lines.push('value,count,totalSelfSize,totalRetainedSize,truncated,nodeIds');
|
|
74
|
+
for (const group of groups) {
|
|
75
|
+
const nodeIds = group.nodes.map(n => `@${n.id}`).join(' ');
|
|
76
|
+
const truncated = group.truncated ?? false;
|
|
77
|
+
lines.push(`${JSON.stringify(group.value)},${group.count},${formatBytesToKb(group.totalSelfSize)},${formatBytesToKb(group.totalRetainedSize)},${truncated},${nodeIds}`);
|
|
78
|
+
}
|
|
79
|
+
return lines.join('\n');
|
|
80
|
+
}
|
|
81
|
+
static formatNativeContextSizes(sizes) {
|
|
82
|
+
const lines = [];
|
|
83
|
+
lines.push('nodeId,nodeName,selfSize,retainedSize,attributedSize');
|
|
84
|
+
const sortedContexts = [...sizes.nativeContexts].sort((a, b) => b.attributedSize - a.attributedSize);
|
|
85
|
+
for (const nc of sortedContexts) {
|
|
86
|
+
lines.push(`${nc.nodeId},${nc.nodeName},${formatBytesToKb(nc.selfSize)},${formatBytesToKb(nc.retainedSize)},${formatBytesToKb(nc.attributedSize)}`);
|
|
87
|
+
}
|
|
88
|
+
lines.push(`Shared Size: ${formatBytesToKb(sizes.sharedSize)}`);
|
|
89
|
+
lines.push(`Unattributed Size: ${formatBytesToKb(sizes.noAttributionSize)}`);
|
|
90
|
+
return lines.join('\n');
|
|
91
|
+
}
|
|
92
|
+
static formatRetainedByContextSummary(summary) {
|
|
93
|
+
const lines = [];
|
|
94
|
+
lines.push(`Context count: ${summary.contextCount}`);
|
|
95
|
+
lines.push(`Retained by context size: ${formatBytesToKb(summary.retainedByContextSize)} (${summary.retainedByContextCount} objects)`);
|
|
96
|
+
lines.push(`Not retained by context size: ${formatBytesToKb(summary.notRetainedByContextSize)} (${summary.notRetainedByContextCount} objects)`);
|
|
97
|
+
lines.push(`Total size: ${formatBytesToKb(summary.totalSize)}`);
|
|
98
|
+
return lines.join('\n');
|
|
99
|
+
}
|
|
100
|
+
#getSortedAggregates() {
|
|
101
|
+
return Object.values(this.#aggregates).sort((a, b) => b.maxRet - a.maxRet);
|
|
102
|
+
}
|
|
103
|
+
toString() {
|
|
104
|
+
const sorted = this.#getSortedAggregates();
|
|
105
|
+
const lines = [];
|
|
106
|
+
lines.push('id,name,count,selfSize,retainedSize');
|
|
107
|
+
for (const info of sorted) {
|
|
108
|
+
const id = info[stableIdSymbol] ?? '';
|
|
109
|
+
lines.push(`${id},${info.name},${info.count},${formatBytesToKb(info.self)},${formatBytesToKb(info.maxRet)}`);
|
|
110
|
+
}
|
|
111
|
+
return lines.join('\n');
|
|
112
|
+
}
|
|
113
|
+
toJSON() {
|
|
114
|
+
const sorted = this.#getSortedAggregates();
|
|
115
|
+
return sorted.map(info => ({
|
|
116
|
+
id: info[stableIdSymbol],
|
|
117
|
+
className: info.name,
|
|
118
|
+
count: info.count,
|
|
119
|
+
selfSize: formatBytesToKb(info.self),
|
|
120
|
+
retainedSize: formatBytesToKb(info.maxRet),
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
static sort(aggregates) {
|
|
124
|
+
return Object.entries(aggregates).sort((a, b) => b[1].maxRet - a[1].maxRet);
|
|
125
|
+
}
|
|
126
|
+
static formatDiffSummary(diffs) {
|
|
127
|
+
const lines = [];
|
|
128
|
+
lines.push('index,className,addedCount,removedCount,countDelta,addedSize,removedSize,sizeDelta');
|
|
129
|
+
let index = 0;
|
|
130
|
+
for (const diff of diffs) {
|
|
131
|
+
lines.push(`${index},${diff.className},${diff.addedCount},${diff.removedCount},${diff.countDelta},${formatBytesToKb(diff.addedSize)},${formatBytesToKb(diff.removedSize)},${formatBytesToKb(diff.sizeDelta)}`);
|
|
132
|
+
index++;
|
|
133
|
+
}
|
|
134
|
+
return lines.join('\n');
|
|
135
|
+
}
|
|
136
|
+
static formatDiffDetails(diff) {
|
|
137
|
+
const lines = [];
|
|
138
|
+
lines.push(`${diff.className}: # new: ${diff.addedCount}, # deleted: ${diff.removedCount}, # delta: ${formatSignedCount(diff.countDelta)}, alloc size: ${formatSignedSize(diff.addedSize)}, freed size: ${formatSignedSize(diff.removedSize)}, size delta: ${formatSignedSize(diff.sizeDelta)}`);
|
|
139
|
+
const addedIds = diff.addedIds;
|
|
140
|
+
const addedSelfSizes = diff.addedSelfSizes;
|
|
141
|
+
const deletedIds = diff.deletedIds;
|
|
142
|
+
const deletedSelfSizes = diff.deletedSelfSizes;
|
|
143
|
+
lines.push(`Objects:`);
|
|
144
|
+
for (let i = 0; i < addedIds.length; i++) {
|
|
145
|
+
lines.push(` + @${addedIds[i]} (self_size: ${formatBytesToKb(addedSelfSizes[i])})`);
|
|
146
|
+
}
|
|
147
|
+
for (let i = 0; i < deletedIds.length; i++) {
|
|
148
|
+
lines.push(` - @${deletedIds[i]} (self_size: ${formatBytesToKb(deletedSelfSizes[i])})`);
|
|
149
|
+
}
|
|
150
|
+
return lines.join('\n');
|
|
151
|
+
}
|
|
152
|
+
static formatObjectInfo(info) {
|
|
153
|
+
const lines = [
|
|
154
|
+
`id: @${info.id}`,
|
|
155
|
+
`name: ${info.name}`,
|
|
156
|
+
`type: ${info.type}`,
|
|
157
|
+
`detachedness: ${formatDOMLinkState(info.detachedness)}`,
|
|
158
|
+
`selfSize: ${formatBytesToKb(info.selfSize)}`,
|
|
159
|
+
`retainedSize: ${formatBytesToKb(info.retainedSize)}`,
|
|
160
|
+
`distance: ${info.distance}`,
|
|
161
|
+
`edgeCount: ${info.edgeCount}`,
|
|
162
|
+
`retainerCount: ${info.retainerCount}`,
|
|
163
|
+
];
|
|
164
|
+
return lines.join('\n');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function formatDOMLinkState(state) {
|
|
168
|
+
switch (state) {
|
|
169
|
+
case 1 /* DevTools.HeapSnapshotModel.HeapSnapshotModel.DOMLinkState.ATTACHED */:
|
|
170
|
+
return 'attached';
|
|
171
|
+
case 2 /* DevTools.HeapSnapshotModel.HeapSnapshotModel.DOMLinkState.DETACHED */:
|
|
172
|
+
return 'detached';
|
|
173
|
+
case 0 /* DevTools.HeapSnapshotModel.HeapSnapshotModel.DOMLinkState.UNKNOWN */:
|
|
174
|
+
default:
|
|
175
|
+
return 'unknown';
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function formatSignedCount(n) {
|
|
179
|
+
return n > 0 ? `+${n}` : `${n}`;
|
|
180
|
+
}
|
|
181
|
+
function formatSignedSize(bytes) {
|
|
182
|
+
const formatted = formatBytesToKb(bytes);
|
|
183
|
+
return bytes > 0 ? `+${formatted}` : formatted;
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=HeapSnapshotFormatter.js.map
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ISSUE_UTILS } from '../devtools/issueDescriptions.js';
|
|
7
|
+
import { DevTools } from '../third_party/index.js';
|
|
8
|
+
import { logger } from '../utils/logger.js';
|
|
9
|
+
export class IssueFormatter {
|
|
10
|
+
#issue;
|
|
11
|
+
#options;
|
|
12
|
+
constructor(issue, options) {
|
|
13
|
+
this.#issue = issue;
|
|
14
|
+
this.#options = options;
|
|
15
|
+
}
|
|
16
|
+
toString() {
|
|
17
|
+
return convertIssueConciseToString(this.toJSON());
|
|
18
|
+
}
|
|
19
|
+
toStringDetailed() {
|
|
20
|
+
return convertIssueDetailedToString(this.toJSONDetailed());
|
|
21
|
+
}
|
|
22
|
+
toJSON() {
|
|
23
|
+
return {
|
|
24
|
+
type: 'issue',
|
|
25
|
+
title: this.#getTitle(),
|
|
26
|
+
count: this.#issue.getAggregatedIssuesCount(),
|
|
27
|
+
id: this.#options.id,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
toJSONDetailed() {
|
|
31
|
+
return {
|
|
32
|
+
id: this.#options.id,
|
|
33
|
+
type: 'issue',
|
|
34
|
+
count: this.#issue.getAggregatedIssuesCount(),
|
|
35
|
+
title: this.#getTitle(),
|
|
36
|
+
description: this.#getDescription(),
|
|
37
|
+
links: this.#issue.getDescription()?.links,
|
|
38
|
+
affectedResources: this.#getAffectedResources(),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
#getAffectedResources() {
|
|
42
|
+
const issues = this.#issue.getAllIssues();
|
|
43
|
+
const affectedResources = [];
|
|
44
|
+
for (const singleIssue of issues) {
|
|
45
|
+
const details = singleIssue.details();
|
|
46
|
+
if (!details) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
// We send the remaining details as untyped JSON because the DevTools
|
|
50
|
+
// frontend code is currently not re-usable.
|
|
51
|
+
const data = structuredClone(details);
|
|
52
|
+
let uid;
|
|
53
|
+
let request;
|
|
54
|
+
if ('violatingNodeId' in details &&
|
|
55
|
+
details.violatingNodeId &&
|
|
56
|
+
this.#options.elementIdResolver) {
|
|
57
|
+
uid = this.#options.elementIdResolver(details.violatingNodeId);
|
|
58
|
+
delete data.violatingNodeId;
|
|
59
|
+
}
|
|
60
|
+
if ('nodeId' in details &&
|
|
61
|
+
details.nodeId &&
|
|
62
|
+
this.#options.elementIdResolver) {
|
|
63
|
+
uid = this.#options.elementIdResolver(details.nodeId);
|
|
64
|
+
delete data.nodeId;
|
|
65
|
+
}
|
|
66
|
+
if ('documentNodeId' in details &&
|
|
67
|
+
details.documentNodeId &&
|
|
68
|
+
this.#options.elementIdResolver) {
|
|
69
|
+
uid = this.#options.elementIdResolver(details.documentNodeId);
|
|
70
|
+
delete data.documentNodeId;
|
|
71
|
+
}
|
|
72
|
+
if ('request' in details && details.request) {
|
|
73
|
+
request = details.request.url;
|
|
74
|
+
if (details.request.requestId && this.#options.requestIdResolver) {
|
|
75
|
+
const resolvedId = this.#options.requestIdResolver(details.request.requestId);
|
|
76
|
+
if (resolvedId) {
|
|
77
|
+
request = resolvedId;
|
|
78
|
+
const requestData = data.request;
|
|
79
|
+
delete requestData.requestId;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// These fields has no use for the MCP client (redundant or irrelevant).
|
|
84
|
+
delete data.errorType;
|
|
85
|
+
delete data.frameId;
|
|
86
|
+
affectedResources.push({
|
|
87
|
+
uid,
|
|
88
|
+
data: data,
|
|
89
|
+
request,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return affectedResources;
|
|
93
|
+
}
|
|
94
|
+
isValid() {
|
|
95
|
+
return this.#getTitle() !== undefined;
|
|
96
|
+
}
|
|
97
|
+
// Helper to extract title
|
|
98
|
+
#getTitle() {
|
|
99
|
+
const markdownDescription = this.#issue.getDescription();
|
|
100
|
+
const filename = markdownDescription?.file;
|
|
101
|
+
if (!filename) {
|
|
102
|
+
logger?.(`no description found for issue:` + this.#issue.code());
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
// We already have the description logic in #getDescription, but title extraction is separate
|
|
106
|
+
// We can reuse the logic or cache it.
|
|
107
|
+
// Ideally we should process markdown once.
|
|
108
|
+
const rawMarkdown = ISSUE_UTILS.getIssueDescription(filename);
|
|
109
|
+
if (!rawMarkdown) {
|
|
110
|
+
logger?.(`no markdown ${filename} found for issue:` + this.#issue.code());
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const processedMarkdown = DevTools.MarkdownIssueDescription.substitutePlaceholders(rawMarkdown, markdownDescription?.substitutions);
|
|
115
|
+
const markdownAst = DevTools.Marked.Marked.lexer(processedMarkdown);
|
|
116
|
+
const title = DevTools.MarkdownIssueDescription.findTitleFromMarkdownAst(markdownAst);
|
|
117
|
+
if (!title) {
|
|
118
|
+
logger?.('cannot read issue title from ' + filename);
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return title;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
logger?.('error parsing markdown for issue ' + this.#issue.code());
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
#getDescription() {
|
|
129
|
+
const markdownDescription = this.#issue.getDescription();
|
|
130
|
+
const filename = markdownDescription?.file;
|
|
131
|
+
if (!filename) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const rawMarkdown = ISSUE_UTILS.getIssueDescription(filename);
|
|
135
|
+
if (!rawMarkdown) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
return DevTools.MarkdownIssueDescription.substitutePlaceholders(rawMarkdown, markdownDescription?.substitutions);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function convertIssueConciseToString(issue) {
|
|
147
|
+
return `msgid=${issue.id} [issue] ${issue.title ?? 'Unknown Issue'} (count: ${issue.count})`;
|
|
148
|
+
}
|
|
149
|
+
function convertIssueDetailedToString(issue) {
|
|
150
|
+
const result = [];
|
|
151
|
+
result.push(`ID: ${issue.id}`);
|
|
152
|
+
const bodyParts = [];
|
|
153
|
+
const description = issue.description;
|
|
154
|
+
let processedMarkdown = description?.trim();
|
|
155
|
+
// Remove heading in order not to conflict with the whole console message response markdown
|
|
156
|
+
if (processedMarkdown?.startsWith('# ')) {
|
|
157
|
+
processedMarkdown = processedMarkdown.substring(2).trimStart();
|
|
158
|
+
}
|
|
159
|
+
if (processedMarkdown) {
|
|
160
|
+
bodyParts.push(processedMarkdown);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
bodyParts.push(issue.title ?? 'Unknown Issue');
|
|
164
|
+
}
|
|
165
|
+
const links = issue.links;
|
|
166
|
+
if (links && links.length > 0) {
|
|
167
|
+
bodyParts.push('Learn more:');
|
|
168
|
+
for (const link of links) {
|
|
169
|
+
bodyParts.push(`[${link.linkTitle}](${link.link})`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const affectedResources = issue.affectedResources;
|
|
173
|
+
if (affectedResources.length) {
|
|
174
|
+
bodyParts.push('### Affected resources');
|
|
175
|
+
bodyParts.push(...affectedResources.map(item => {
|
|
176
|
+
const details = [];
|
|
177
|
+
if (item.uid) {
|
|
178
|
+
details.push(`uid=${item.uid}`);
|
|
179
|
+
}
|
|
180
|
+
if (item.request) {
|
|
181
|
+
details.push((typeof item.request === 'number' ? `reqid=` : 'url=') +
|
|
182
|
+
item.request);
|
|
183
|
+
}
|
|
184
|
+
if (item.data) {
|
|
185
|
+
details.push(`data=${JSON.stringify(item.data)}`);
|
|
186
|
+
}
|
|
187
|
+
return details.join(' ');
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
result.push(`Message: issue> ${bodyParts.join('\n')}`);
|
|
191
|
+
return result.join('\n');
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=IssueFormatter.js.map
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
* */
|
|
6
|
+
import { isUtf8 } from 'node:buffer';
|
|
7
|
+
import { DevTools, } from '../third_party/index.js';
|
|
8
|
+
const BODY_CONTEXT_SIZE_LIMIT = 10000;
|
|
9
|
+
const URL_CONTEXT_SIZE_LIMIT = 255;
|
|
10
|
+
export class NetworkFormatter {
|
|
11
|
+
#request;
|
|
12
|
+
#options;
|
|
13
|
+
#requestBody;
|
|
14
|
+
#responseBody;
|
|
15
|
+
#requestBodyFilePath;
|
|
16
|
+
#responseBodyFilePath;
|
|
17
|
+
constructor(request, options) {
|
|
18
|
+
this.#request = request;
|
|
19
|
+
this.#options = options;
|
|
20
|
+
}
|
|
21
|
+
static async from(request, options) {
|
|
22
|
+
const instance = new NetworkFormatter(request, options);
|
|
23
|
+
if (options.fetchData) {
|
|
24
|
+
await instance.#loadDetailedData();
|
|
25
|
+
}
|
|
26
|
+
return instance;
|
|
27
|
+
}
|
|
28
|
+
async #loadDetailedData() {
|
|
29
|
+
// Load Request Body
|
|
30
|
+
if (this.#request.hasPostData()) {
|
|
31
|
+
let data;
|
|
32
|
+
try {
|
|
33
|
+
data =
|
|
34
|
+
this.#request.postData() ?? (await this.#request.fetchPostData());
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Ignore parsing errors
|
|
38
|
+
}
|
|
39
|
+
const requestBodyNotAvailableMessage = '<Request body not available anymore>';
|
|
40
|
+
if (this.#options.requestFilePath) {
|
|
41
|
+
if (!this.#options.saveFile) {
|
|
42
|
+
throw new Error('Unable to save the request body to a file: no saveFile callback was configured.');
|
|
43
|
+
}
|
|
44
|
+
if (data) {
|
|
45
|
+
const result = await this.#options.saveFile(Buffer.from(data), this.#options.requestFilePath, '.network-request');
|
|
46
|
+
this.#requestBodyFilePath = result.filename;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.#requestBody = requestBodyNotAvailableMessage;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (data) {
|
|
54
|
+
this.#requestBody = getSizeLimitedString(data, BODY_CONTEXT_SIZE_LIMIT);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.#requestBody = requestBodyNotAvailableMessage;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Load Response Body
|
|
62
|
+
const response = this.#request.response();
|
|
63
|
+
if (response) {
|
|
64
|
+
const responseBodyNotAvailableMessage = '<Response body not available anymore>';
|
|
65
|
+
if (this.#options.responseFilePath) {
|
|
66
|
+
try {
|
|
67
|
+
const buffer = await response.buffer();
|
|
68
|
+
if (!this.#options.saveFile) {
|
|
69
|
+
throw new Error('Unable to save the response body to a file: no saveFile callback was configured.');
|
|
70
|
+
}
|
|
71
|
+
const result = await this.#options.saveFile(buffer, this.#options.responseFilePath, '.network-response');
|
|
72
|
+
this.#responseBodyFilePath = result.filename;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Flatten error handling for buffer() failure and save failure
|
|
76
|
+
}
|
|
77
|
+
if (!this.#responseBodyFilePath) {
|
|
78
|
+
this.#responseBody = responseBodyNotAvailableMessage;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.#responseBody = await this.#getFormattedResponseBody(response, BODY_CONTEXT_SIZE_LIMIT);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
toString() {
|
|
87
|
+
return convertNetworkRequestConciseToString(this.toJSON());
|
|
88
|
+
}
|
|
89
|
+
toStringDetailed() {
|
|
90
|
+
return convertNetworkRequestDetailedToStringDetailed(this.toJSONDetailed());
|
|
91
|
+
}
|
|
92
|
+
toJSON() {
|
|
93
|
+
return {
|
|
94
|
+
requestId: this.#options.requestId,
|
|
95
|
+
method: this.#request.method(),
|
|
96
|
+
url: this.#request.url(),
|
|
97
|
+
status: this.#getStatusFromRequest(this.#request),
|
|
98
|
+
selectedInDevToolsUI: this.#options.selectedInDevToolsUI,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
#redactNetworkHeaders(headers) {
|
|
102
|
+
const headersList = Object.entries(headers).map(item => {
|
|
103
|
+
return { name: item[0], value: item[1] };
|
|
104
|
+
});
|
|
105
|
+
const redacted = DevTools.NetworkRequestFormatter.sanitizeHeaders(headersList);
|
|
106
|
+
return redacted.reduce((acc, item) => {
|
|
107
|
+
acc[item.name] = item.value;
|
|
108
|
+
return acc;
|
|
109
|
+
}, {});
|
|
110
|
+
}
|
|
111
|
+
toJSONDetailed() {
|
|
112
|
+
const redirectChain = this.#request.redirectChain();
|
|
113
|
+
const formattedRedirectChain = redirectChain.reverse().map(request => {
|
|
114
|
+
const id = this.#options.requestIdResolver
|
|
115
|
+
? this.#options.requestIdResolver(request)
|
|
116
|
+
: undefined;
|
|
117
|
+
const formatter = new NetworkFormatter(request, {
|
|
118
|
+
requestId: id,
|
|
119
|
+
saveFile: this.#options.saveFile,
|
|
120
|
+
redactNetworkHeaders: this.#options.redactNetworkHeaders,
|
|
121
|
+
});
|
|
122
|
+
return formatter.toJSON();
|
|
123
|
+
});
|
|
124
|
+
const responseHeaders = this.#request.response()?.headers();
|
|
125
|
+
return {
|
|
126
|
+
...this.toJSON(),
|
|
127
|
+
requestHeaders: this.#options.redactNetworkHeaders
|
|
128
|
+
? this.#redactNetworkHeaders(this.#request.headers())
|
|
129
|
+
: this.#request.headers(),
|
|
130
|
+
requestBody: this.#requestBody,
|
|
131
|
+
requestBodyFilePath: this.#requestBodyFilePath,
|
|
132
|
+
responseHeaders: this.#options.redactNetworkHeaders && responseHeaders
|
|
133
|
+
? this.#redactNetworkHeaders(responseHeaders)
|
|
134
|
+
: this.#request.response()?.headers(),
|
|
135
|
+
responseBody: this.#responseBody,
|
|
136
|
+
responseBodyFilePath: this.#responseBodyFilePath,
|
|
137
|
+
failure: this.#request.failure()?.errorText,
|
|
138
|
+
redirectChain: formattedRedirectChain.length
|
|
139
|
+
? formattedRedirectChain
|
|
140
|
+
: undefined,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
#getStatusFromRequest(request) {
|
|
144
|
+
const httpResponse = request.response();
|
|
145
|
+
const failure = request.failure();
|
|
146
|
+
let status;
|
|
147
|
+
if (httpResponse) {
|
|
148
|
+
status = httpResponse.status().toString();
|
|
149
|
+
}
|
|
150
|
+
else if (failure) {
|
|
151
|
+
status = failure.errorText;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
status = 'pending';
|
|
155
|
+
}
|
|
156
|
+
return status;
|
|
157
|
+
}
|
|
158
|
+
async #getFormattedResponseBody(httpResponse, sizeLimit = BODY_CONTEXT_SIZE_LIMIT) {
|
|
159
|
+
try {
|
|
160
|
+
const responseBuffer = await httpResponse.buffer();
|
|
161
|
+
if (isUtf8(responseBuffer)) {
|
|
162
|
+
const responseAsTest = responseBuffer.toString('utf-8');
|
|
163
|
+
if (responseAsTest.length === 0) {
|
|
164
|
+
return '<empty response>';
|
|
165
|
+
}
|
|
166
|
+
return getSizeLimitedString(responseAsTest, sizeLimit);
|
|
167
|
+
}
|
|
168
|
+
return '<binary data>';
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return '<not available anymore>';
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function getSizeLimitedString(text, sizeLimit) {
|
|
176
|
+
if (text.length > sizeLimit) {
|
|
177
|
+
return text.substring(0, sizeLimit) + '... <truncated>';
|
|
178
|
+
}
|
|
179
|
+
return text;
|
|
180
|
+
}
|
|
181
|
+
function convertNetworkRequestConciseToString(data) {
|
|
182
|
+
// Long URLs (e.g., data: URLs) bloat the concise list output. The full URL
|
|
183
|
+
// remains available via the detailed view and the structured content.
|
|
184
|
+
const url = getSizeLimitedString(data.url, URL_CONTEXT_SIZE_LIMIT);
|
|
185
|
+
return `reqid=${data.requestId} ${data.method} ${url} [${data.status}]${data.selectedInDevToolsUI ? ` [selected in the DevTools Network panel]` : ''}`;
|
|
186
|
+
}
|
|
187
|
+
function formatHeaders(headers) {
|
|
188
|
+
const response = [];
|
|
189
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
190
|
+
response.push(`- ${name}:${value}`);
|
|
191
|
+
}
|
|
192
|
+
return response;
|
|
193
|
+
}
|
|
194
|
+
function convertNetworkRequestDetailedToStringDetailed(data) {
|
|
195
|
+
const response = [];
|
|
196
|
+
response.push(`## Request ${data.url}`);
|
|
197
|
+
response.push(`Status: ${data.status}`);
|
|
198
|
+
response.push(`### Request Headers`);
|
|
199
|
+
for (const line of formatHeaders(data.requestHeaders)) {
|
|
200
|
+
response.push(line);
|
|
201
|
+
}
|
|
202
|
+
if (data.requestBody) {
|
|
203
|
+
response.push(`### Request Body`);
|
|
204
|
+
response.push(data.requestBody);
|
|
205
|
+
}
|
|
206
|
+
else if (data.requestBodyFilePath) {
|
|
207
|
+
response.push(`### Request Body`);
|
|
208
|
+
response.push(`Saved to ${data.requestBodyFilePath}.`);
|
|
209
|
+
}
|
|
210
|
+
if (data.responseHeaders) {
|
|
211
|
+
response.push(`### Response Headers`);
|
|
212
|
+
for (const line of formatHeaders(data.responseHeaders)) {
|
|
213
|
+
response.push(line);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (data.responseBody) {
|
|
217
|
+
response.push(`### Response Body`);
|
|
218
|
+
response.push(data.responseBody);
|
|
219
|
+
}
|
|
220
|
+
else if (data.responseBodyFilePath) {
|
|
221
|
+
response.push(`### Response Body`);
|
|
222
|
+
response.push(`Saved to ${data.responseBodyFilePath}.`);
|
|
223
|
+
}
|
|
224
|
+
if (data.failure) {
|
|
225
|
+
response.push(`### Request failed with`);
|
|
226
|
+
response.push(data.failure);
|
|
227
|
+
}
|
|
228
|
+
const redirectChain = data.redirectChain;
|
|
229
|
+
if (redirectChain?.length) {
|
|
230
|
+
response.push(`### Redirect chain`);
|
|
231
|
+
let indent = 0;
|
|
232
|
+
// `redirectChain` is already ordered by toJSONDetailed(); don't reverse it
|
|
233
|
+
// again here or the text output contradicts structuredContent (the JSON).
|
|
234
|
+
for (const request of redirectChain) {
|
|
235
|
+
response.push(`${' '.repeat(indent)}${convertNetworkRequestConciseToString(request)}`);
|
|
236
|
+
indent++;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return response.join('\n');
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=NetworkFormatter.js.map
|