@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +223 -2
- package/out/Default/gen/src/ArcBrowser.js +128 -0
- package/out/Default/gen/src/BrowserManager.js +562 -0
- package/out/Default/gen/src/LogpointManager.js +287 -0
- package/out/Default/gen/src/McpContext.js +1031 -0
- package/out/Default/gen/src/McpPage.js +1427 -0
- package/out/Default/gen/src/McpResponse.js +1350 -0
- package/out/Default/gen/src/McpWorker.js +66 -0
- package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
- package/out/Default/gen/src/SlimMcpResponse.js +23 -0
- package/out/Default/gen/src/TextSnapshot.js +336 -0
- package/out/Default/gen/src/ToolHandler.js +531 -0
- package/out/Default/gen/src/bin/check-latest-version.js +53 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
- package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
- package/out/Default/gen/src/collectors/PageCollector.js +325 -0
- package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigLocator.js +70 -0
- package/out/Default/gen/src/config/ConfigParser.js +163 -0
- package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
- package/out/Default/gen/src/config/ServerConfig.js +284 -0
- package/out/Default/gen/src/config/browser-options.js +135 -0
- package/out/Default/gen/src/config/category-options.js +84 -0
- package/out/Default/gen/src/config/cli-commands.js +208 -0
- package/out/Default/gen/src/config/cli-options.js +2090 -0
- package/out/Default/gen/src/config/mcp-options.js +371 -0
- package/out/Default/gen/src/config/puppeteer-options.js +69 -0
- package/out/Default/gen/src/config/tool-options.js +60 -0
- package/out/Default/gen/src/daemon/client.js +281 -0
- package/out/Default/gen/src/daemon/daemon.js +280 -0
- package/out/Default/gen/src/daemon/types.js +7 -0
- package/out/Default/gen/src/daemon/utils.js +173 -0
- package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
- package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
- package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
- package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
- package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
- package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
- package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
- package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
- package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/formatters/constants.js +8 -0
- package/out/Default/gen/src/index.js +434 -0
- package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
- package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
- package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
- package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
- package/out/Default/gen/src/telemetry/errors.js +18 -0
- package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
- package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
- package/out/Default/gen/src/telemetry/persistence.js +82 -0
- package/out/Default/gen/src/telemetry/transformation.js +229 -0
- package/out/Default/gen/src/telemetry/types.js +36 -0
- package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
- package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
- package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
- package/out/Default/gen/src/third_party/browser.js +808 -0
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +139 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
- package/out/Default/gen/src/third_party/index.js +128 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
- package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
- package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
- package/out/Default/gen/src/tools/categories.js +37 -0
- package/out/Default/gen/src/tools/comments.js +230 -0
- package/out/Default/gen/src/tools/console.js +122 -0
- package/out/Default/gen/src/tools/css.js +54 -0
- package/out/Default/gen/src/tools/emulation.js +98 -0
- package/out/Default/gen/src/tools/extensions.js +108 -0
- package/out/Default/gen/src/tools/input.js +658 -0
- package/out/Default/gen/src/tools/lighthouse.js +279 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/memory.js +531 -0
- package/out/Default/gen/src/tools/network.js +325 -0
- package/out/Default/gen/src/tools/pages.js +420 -0
- package/out/Default/gen/src/tools/performance.js +258 -0
- package/out/Default/gen/src/tools/pwa.js +152 -0
- package/out/Default/gen/src/tools/screencast.js +160 -0
- package/out/Default/gen/src/tools/screenshot.js +315 -0
- package/out/Default/gen/src/tools/script.js +319 -0
- package/out/Default/gen/src/tools/slim/tools.js +110 -0
- package/out/Default/gen/src/tools/snapshot.js +88 -0
- package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/out/Default/gen/src/tools/tools.js +72 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/out/Default/gen/src/tools/webmcp.js +55 -0
- package/out/Default/gen/src/types.js +21 -0
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
- package/out/Default/gen/src/utils/bytes.js +95 -0
- package/out/Default/gen/src/utils/check-for-updates.js +81 -0
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/out/Default/gen/src/utils/errorHandling.js +23 -0
- package/out/Default/gen/src/utils/files.js +81 -0
- package/out/Default/gen/src/utils/id.js +16 -0
- package/out/Default/gen/src/utils/keyboard.js +307 -0
- package/out/Default/gen/src/utils/logger.js +145 -0
- package/out/Default/gen/src/utils/logpoint.js +44 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/pagination.js +50 -0
- package/out/Default/gen/src/utils/polyfill.js +11 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/out/Default/gen/src/utils/resourceType.js +27 -0
- package/out/Default/gen/src/utils/text.js +43 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/out/Default/gen/src/utils/url.js +311 -0
- package/out/Default/gen/src/version.js +11 -0
- package/package.json +125 -4
- package/skills/a11y-debugging/SKILL.md +86 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/arc-compatibility/SKILL.md +174 -0
- package/skills/arc-compatibility/SOURCES.md +238 -0
- package/skills/arc-compatibility/references/compatibility.md +115 -0
- package/skills/arc-compatibility/references/output-contract.md +62 -0
- package/skills/arc-compatibility/references/workflows.md +108 -0
- package/skills/chrome-devtools/SKILL.md +80 -0
- package/skills/chrome-devtools-cli/SKILL.md +208 -0
- package/skills/chrome-devtools-cli/references/installation.md +24 -0
- package/skills/cookie-debugging/SKILL.md +152 -0
- package/skills/debug-optimize-lcp/SKILL.md +121 -0
- package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
- package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
- package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
- package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
- package/skills/inspect-in-devtools/SKILL.md +82 -0
- package/skills/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +107 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-optimize-lcp
|
|
3
|
+
description: Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions "largest contentful paint", "page load speed", "CWV", or wants to improve how fast their hero image or main content renders.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## What is LCP and why it matters
|
|
7
|
+
|
|
8
|
+
Largest Contentful Paint (LCP) measures how quickly a page's main content becomes visible. It's the time from navigation start until the largest image or text block renders in the viewport.
|
|
9
|
+
|
|
10
|
+
- **Good**: 2.5 seconds or less
|
|
11
|
+
- **Needs improvement**: 2.5–4.0 seconds
|
|
12
|
+
- **Poor**: greater than 4.0 seconds
|
|
13
|
+
|
|
14
|
+
LCP is a Core Web Vital that directly affects user experience and search ranking. On 73% of mobile pages, the LCP element is an image.
|
|
15
|
+
|
|
16
|
+
## LCP Subparts Breakdown
|
|
17
|
+
|
|
18
|
+
Every page's LCP breaks down into four sequential subparts with no gaps or overlaps. Understanding which subpart is the bottleneck is the key to effective optimization.
|
|
19
|
+
|
|
20
|
+
| Subpart | Ideal % of LCP | What it measures |
|
|
21
|
+
| ----------------------------- | -------------- | ---------------------------------------------- |
|
|
22
|
+
| **Time to First Byte (TTFB)** | ~40% | Navigation start → first byte of HTML received |
|
|
23
|
+
| **Resource load delay** | <10% | TTFB → browser starts loading the LCP resource |
|
|
24
|
+
| **Resource load duration** | ~40% | Time to download the LCP resource |
|
|
25
|
+
| **Element render delay** | <10% | LCP resource downloaded → LCP element rendered |
|
|
26
|
+
|
|
27
|
+
The "delay" subparts should be as close to zero as possible. If either delay subpart is large relative to the total LCP, that's the first place to optimize.
|
|
28
|
+
|
|
29
|
+
**Common Pitfall**: Optimizing one subpart (like compressing an image to reduce load duration) without checking others. If render delay is the real bottleneck, a smaller image won't help — the saved time just shifts to render delay.
|
|
30
|
+
|
|
31
|
+
## Debugging Workflow
|
|
32
|
+
|
|
33
|
+
Follow these steps in order. Each step builds on the previous one.
|
|
34
|
+
|
|
35
|
+
### Step 1: Record a Performance Trace
|
|
36
|
+
|
|
37
|
+
Navigate to the page, then record a trace with reload to capture the full page load including LCP:
|
|
38
|
+
|
|
39
|
+
1. `navigate_page` with `pageId` to the target URL.
|
|
40
|
+
2. `performance_start_trace` with `pageId`, `reload: true` and `autoStop: true`.
|
|
41
|
+
|
|
42
|
+
The trace results will include LCP timing and available insight sets. Note the insight set IDs from the output — you'll need them in the next step.
|
|
43
|
+
|
|
44
|
+
### Step 2: Analyze LCP Insights
|
|
45
|
+
|
|
46
|
+
Use `performance_analyze_insight` to drill into LCP-specific insights. Look for these insight names in the trace results:
|
|
47
|
+
|
|
48
|
+
- **LCPBreakdown** — Shows the four LCP subparts with timing for each.
|
|
49
|
+
- **DocumentLatency** — Server response time issues affecting TTFB.
|
|
50
|
+
- **RenderBlocking** — Resources blocking the LCP element from rendering.
|
|
51
|
+
- **LCPDiscovery** — Whether the LCP resource was discoverable early.
|
|
52
|
+
|
|
53
|
+
Call `performance_analyze_insight` with `pageId`, the insight set ID, and the insight name from the trace results.
|
|
54
|
+
|
|
55
|
+
### Step 3: Identify the LCP Element
|
|
56
|
+
|
|
57
|
+
Use `evaluate_script` (with `pageId`) and the **"Identify LCP Element" snippet** found in [references/lcp-snippets.md](references/lcp-snippets.md) to reveal the LCP element's tag, resource URL, and raw timing data.
|
|
58
|
+
|
|
59
|
+
The `url` field tells you what resource to look for in the network waterfall. If `url` is empty, the LCP element is text-based (no resource to load).
|
|
60
|
+
|
|
61
|
+
### Step 4: Check the Network Waterfall
|
|
62
|
+
|
|
63
|
+
Use `list_network_requests` to see when the LCP resource loaded relative to other resources:
|
|
64
|
+
|
|
65
|
+
- Call `list_network_requests` with `pageId` filtered by `resourceTypes: ["image", "font"]` (adjust based on Step 3).
|
|
66
|
+
- Then use `get_network_request` with `pageId` and the LCP resource's request ID for full details.
|
|
67
|
+
|
|
68
|
+
**Key Checks:**
|
|
69
|
+
|
|
70
|
+
- **Start Time**: Compare against the HTML document and the first resource. If the LCP resource starts much later than the first resource, there's resource load delay to eliminate.
|
|
71
|
+
- **Duration**: A large resource load duration suggests the file is too big or the server is slow.
|
|
72
|
+
|
|
73
|
+
### Step 5: Inspect HTML for Common Issues
|
|
74
|
+
|
|
75
|
+
Use `evaluate_script` (with `pageId`) and the **"Audit Common Issues" snippet** found in [references/lcp-snippets.md](references/lcp-snippets.md) to check for lazy-loaded images in the viewport, missing fetchpriority, and render-blocking scripts.
|
|
76
|
+
|
|
77
|
+
## Optimization Strategies
|
|
78
|
+
|
|
79
|
+
After identifying the bottleneck subpart, apply these prioritized fixes.
|
|
80
|
+
|
|
81
|
+
### 1. Eliminate Resource Load Delay (target: <10%)
|
|
82
|
+
|
|
83
|
+
The most common bottleneck. The LCP resource should start loading immediately.
|
|
84
|
+
|
|
85
|
+
- **Root Cause**: LCP image loaded via JS/CSS, `data-src` usage, or `loading="lazy"`.
|
|
86
|
+
- **Fix**: Use standard `<img>` with `src`. **Never** lazy-load the LCP image.
|
|
87
|
+
- **Fix**: Add `<link rel="preload" fetchpriority="high">` if the image isn't discoverable in HTML.
|
|
88
|
+
- **Fix**: Add `fetchpriority="high"` to the LCP `<img>` tag.
|
|
89
|
+
|
|
90
|
+
### 2. Eliminate Element Render Delay (target: <10%)
|
|
91
|
+
|
|
92
|
+
The element should render immediately after loading.
|
|
93
|
+
|
|
94
|
+
- **Root Cause**: Large stylesheets, synchronous scripts in `<head>`, or main thread blocking.
|
|
95
|
+
- **Fix**: Inline critical CSS, defer non-critical CSS/JS.
|
|
96
|
+
- **Fix**: Break up long tasks blocking the main thread.
|
|
97
|
+
- **Fix**: Use Server-Side Rendering (SSR) so the element exists in initial HTML.
|
|
98
|
+
|
|
99
|
+
### 3. Reduce Resource Load Duration (target: ~40%)
|
|
100
|
+
|
|
101
|
+
Make the resource smaller or faster to deliver.
|
|
102
|
+
|
|
103
|
+
- **Fix**: Use modern formats (WebP, AVIF) and responsive images (`srcset`).
|
|
104
|
+
- **Fix**: Serve from a CDN.
|
|
105
|
+
- **Fix**: Set `Cache-Control` headers.
|
|
106
|
+
- **Fix**: Use `font-display: swap` if LCP is text blocked by a web font.
|
|
107
|
+
|
|
108
|
+
### 4. Reduce TTFB (target: ~40%)
|
|
109
|
+
|
|
110
|
+
The HTML document itself takes too long to arrive.
|
|
111
|
+
|
|
112
|
+
- **Fix**: Minimize redirects and optimize server response time.
|
|
113
|
+
- **Fix**: Cache HTML at the edge (CDN).
|
|
114
|
+
- **Fix**: Ensure pages are eligible for back/forward cache (bfcache).
|
|
115
|
+
|
|
116
|
+
## Verifying Fixes & Emulation
|
|
117
|
+
|
|
118
|
+
- **Verification**: Re-run the trace (`performance_start_trace` with `pageId` and `reload: true`) and compare the new subpart breakdown. The bottleneck should shrink.
|
|
119
|
+
- **Emulation**: Lab measurements differ from real-world experience. Use `emulate` to test under constraints:
|
|
120
|
+
- `emulate` with `pageId`, `networkConditions: "Fast 3G"` and `cpuThrottlingRate: 4`.
|
|
121
|
+
- This surfaces issues visible only on slower connections/devices.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Elements and Size for LCP
|
|
2
|
+
|
|
3
|
+
## What Elements are Considered?
|
|
4
|
+
|
|
5
|
+
The types of elements considered for Largest Contentful Paint (LCP) are:
|
|
6
|
+
|
|
7
|
+
- **`<img>` elements**: The first frame presentation time is used for animated content like GIFs.
|
|
8
|
+
- **`<image>` elements** inside an `<svg>` element.
|
|
9
|
+
- **`<video>` elements**: The poster image load time or first frame presentation time, whichever is earlier.
|
|
10
|
+
- **Background images**: Elements with a background image loaded using `url()`.
|
|
11
|
+
- **Block-level elements**: Containing text nodes or other inline-level text element children.
|
|
12
|
+
|
|
13
|
+
## Heuristics to Exclude Non-Contentful Elements
|
|
14
|
+
|
|
15
|
+
Chromium-based browsers use heuristics to exclude:
|
|
16
|
+
|
|
17
|
+
- Elements with **opacity of 0**.
|
|
18
|
+
- Elements that **cover the full viewport** (likely background).
|
|
19
|
+
- **Placeholder images** or low-entropy images.
|
|
20
|
+
|
|
21
|
+
## How is an Element's Size Determined?
|
|
22
|
+
|
|
23
|
+
- **Visible Area**: Typically the size visible within the viewport. Extending outside, clipped, or overflow portions don't count.
|
|
24
|
+
- **Image Elements**: Either the visible size or the intrinsic size, whichever is smaller.
|
|
25
|
+
- **Text Elements**: The smallest rectangle containing all text nodes.
|
|
26
|
+
- **Exclusions**: Margin, padding, and borders are not considered toward the size.
|
|
27
|
+
- **Containment**: Every text node belongs to its closest block-level ancestor element.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Largest Contentful Paint (LCP) Breakdown
|
|
2
|
+
|
|
3
|
+
LCP measures the time from when the user initiates loading the page until the largest image or text block is rendered within the viewport. To provide a good user experience, sites should strive to have an LCP of 2.5 seconds or less for at least 75% of page visits.
|
|
4
|
+
|
|
5
|
+
## The Four Subparts of LCP
|
|
6
|
+
|
|
7
|
+
Every page's LCP consists of these four subcategories. There's no gap or overlap between them, and they add up to the full LCP time.
|
|
8
|
+
|
|
9
|
+
| LCP subpart | % of LCP (Optimal) | Description |
|
|
10
|
+
| ----------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| **Time to First Byte (TTFB)** | ~40% | The time from when the user initiates loading the page until the browser receives the first byte of the HTML document response. |
|
|
12
|
+
| **Resource load delay** | <10% | The time between TTFB and when the browser starts loading the LCP resource. If the LCP element doesn't require a resource load (e.g., system font text), this time is 0. |
|
|
13
|
+
| **Resource load duration** | ~40% | The duration of time it takes to load the LCP resource itself. If the LCP element doesn't require a resource load, this time is 0. |
|
|
14
|
+
| **Element render delay** | <10% | The time between when the LCP resource finishes loading and the LCP element rendering fully. |
|
|
15
|
+
|
|
16
|
+
## Why the Breakdown Matters
|
|
17
|
+
|
|
18
|
+
Optimizing for LCP requires identifying which of these subparts is the bottleneck:
|
|
19
|
+
|
|
20
|
+
- **Large delta between TTFB and FCP**: Indicates the browser needs to download a lot of render-blocking assets or complete a lot of work (e.g., client-side rendering).
|
|
21
|
+
- **Large delta between FCP and LCP**: Indicates the LCP resource is not immediately available for the browser to prioritize or the browser is completing other work before it can display the LCP content.
|
|
22
|
+
- **Large resource load delay**: Indicates the resource is not discoverable early or is deprioritized.
|
|
23
|
+
- **Large element render delay**: Indicates rendering is blocked by stylesheets, scripts, or long tasks.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# LCP Debugging Snippets
|
|
2
|
+
|
|
3
|
+
Use these JavaScript snippets with the `evaluate_script` tool to extract deep insights from the page.
|
|
4
|
+
|
|
5
|
+
## 1. Identify LCP Element
|
|
6
|
+
|
|
7
|
+
Use this snippet to identify the LCP element and get raw timing data from the Performance API.
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
async () => {
|
|
11
|
+
return await new Promise(resolve => {
|
|
12
|
+
new PerformanceObserver(list => {
|
|
13
|
+
const entries = list.getEntries();
|
|
14
|
+
const last = entries[entries.length - 1];
|
|
15
|
+
resolve({
|
|
16
|
+
element: last.element?.tagName,
|
|
17
|
+
id: last.element?.id,
|
|
18
|
+
className: last.element?.className,
|
|
19
|
+
url: last.url,
|
|
20
|
+
startTime: last.startTime,
|
|
21
|
+
renderTime: last.renderTime,
|
|
22
|
+
loadTime: last.loadTime,
|
|
23
|
+
size: last.size,
|
|
24
|
+
});
|
|
25
|
+
}).observe({type: 'largest-contentful-paint', buffered: true});
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 2. Audit Common Issues
|
|
31
|
+
|
|
32
|
+
Use this snippet to check for common DOM-based LCP issues (lazy loading, priority).
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
() => {
|
|
36
|
+
const issues = [];
|
|
37
|
+
|
|
38
|
+
// Check for lazy-loaded images in viewport
|
|
39
|
+
document.querySelectorAll('img[loading="lazy"]').forEach(img => {
|
|
40
|
+
const rect = img.getBoundingClientRect();
|
|
41
|
+
if (rect.top < window.innerHeight) {
|
|
42
|
+
issues.push({
|
|
43
|
+
issue: 'lazy-loaded image in viewport',
|
|
44
|
+
element: img.outerHTML.substring(0, 200),
|
|
45
|
+
fix: 'Remove loading="lazy" from this image — it is in the initial viewport and may be the LCP element',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Check for LCP-candidate images missing fetchpriority
|
|
51
|
+
document.querySelectorAll('img:not([fetchpriority])').forEach(img => {
|
|
52
|
+
const rect = img.getBoundingClientRect();
|
|
53
|
+
if (rect.top < window.innerHeight && rect.width * rect.height > 50000) {
|
|
54
|
+
issues.push({
|
|
55
|
+
issue: 'large viewport image without fetchpriority',
|
|
56
|
+
element: img.outerHTML.substring(0, 200),
|
|
57
|
+
fix: 'Add fetchpriority="high" to this image — it is large and visible in the initial viewport',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Check for render-blocking scripts in head
|
|
63
|
+
document
|
|
64
|
+
.querySelectorAll(
|
|
65
|
+
'head script:not([async]):not([defer]):not([type="module"])',
|
|
66
|
+
)
|
|
67
|
+
.forEach(script => {
|
|
68
|
+
if (script.src) {
|
|
69
|
+
issues.push({
|
|
70
|
+
issue: 'render-blocking script in head',
|
|
71
|
+
element: script.outerHTML.substring(0, 200),
|
|
72
|
+
fix: 'Add async or defer attribute, or move to end of body',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
return {issueCount: issues.length, issues};
|
|
78
|
+
};
|
|
79
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# LCP Optimization Strategies
|
|
2
|
+
|
|
3
|
+
## 1. Eliminate Resource Load Delay
|
|
4
|
+
|
|
5
|
+
**Goal**: Ensure the LCP resource starts loading as early as possible.
|
|
6
|
+
|
|
7
|
+
- **Early Discovery**: Ensure the LCP resource is discoverable in the initial HTML document response (not dynamically added by JS or hidden in `data-src`).
|
|
8
|
+
- **Preload**: Use `<link rel="preload">` with `fetchpriority="high"` for critical images or fonts.
|
|
9
|
+
- **Avoid Lazy Loading**: Never set `loading="lazy"` on the LCP image.
|
|
10
|
+
- **Fetch Priority**: Use `fetchpriority="high"` on the `<img>` tag.
|
|
11
|
+
- **Same Origin**: Host critical resources on the same origin or use `<link rel="preconnect">`.
|
|
12
|
+
|
|
13
|
+
## 2. Eliminate Element Render Delay
|
|
14
|
+
|
|
15
|
+
**Goal**: Ensure the LCP element can render immediately after its resource has finished loading.
|
|
16
|
+
|
|
17
|
+
- **Minimize Render-Blocking CSS**: Inline critical CSS and defer non-critical CSS. Ensure the stylesheet is smaller than the LCP resource.
|
|
18
|
+
- **Minimize Render-Blocking JS**: Avoid synchronous scripts in the `<head>`. Inline very small scripts.
|
|
19
|
+
- **Server-Side Rendering (SSR)**: Deliver the full HTML markup from the server so image resources are discoverable immediately.
|
|
20
|
+
- **Break Up Long Tasks**: Prevent large JavaScript tasks from blocking the main thread during rendering.
|
|
21
|
+
|
|
22
|
+
## 3. Reduce Resource Load Duration
|
|
23
|
+
|
|
24
|
+
**Goal**: Reduce the time spent transferring the bytes of the resource.
|
|
25
|
+
|
|
26
|
+
- **Optimize Resource Size**: Serve optimal image sizes, use modern formats (AVIF, WebP), and compress images/fonts.
|
|
27
|
+
- **Geographic Proximity (CDN)**: Use a Content Delivery Network to get servers closer to users.
|
|
28
|
+
- **Reduce Contention**: Use `fetchpriority="high"` to prevent lower-priority resources from competing for bandwidth.
|
|
29
|
+
- **Caching**: Use efficient `Cache-Control` policies.
|
|
30
|
+
|
|
31
|
+
## 4. Reduce Time to First Byte (TTFB)
|
|
32
|
+
|
|
33
|
+
**Goal**: Deliver the initial HTML as quickly as possible.
|
|
34
|
+
|
|
35
|
+
- **Minimize Redirects**: Avoid multiple redirects from advertisements or shortened links.
|
|
36
|
+
- **CDN Caching**: Cache static HTML documents at the edge.
|
|
37
|
+
- **Edge Computing**: Move dynamic logic to the edge to avoid trips to the origin server.
|
|
38
|
+
- **Back/Forward Cache**: Ensure pages are eligible for bfcache.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: inspect-in-devtools
|
|
3
|
+
description: Use this skill to connect to the Chrome DevTools UI for interactive debugging, UI/UX review, Q&A, showing elements/network requests/panels to the user, inspecting the user's current DevTools selection, and addressing or polling for DevTools UI comment threads.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug, Review, and Q&A in DevTools
|
|
7
|
+
|
|
8
|
+
Use this skill to:
|
|
9
|
+
|
|
10
|
+
1. **Show a target to the user**: Open DevTools and reveal a panel, a DOM element, or a network request.
|
|
11
|
+
2. **Inspect the user's selection**: Read the element or network request that the user selected in DevTools.
|
|
12
|
+
3. **Address DevTools comments**: Fetch comment threads, answer questions or apply fixes, and resolve the threads.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- **Chrome version**: Chrome M159 or later.
|
|
17
|
+
- **Required flag**: `--devtools-comments` in the MCP server config. Without it, `open_devtools`, `reveal_in_devtools`, `get_devtools_comments`, and `resolve_devtools_comment` are not available.
|
|
18
|
+
- **Headed browser**: Chrome must not run in `--headless` mode.
|
|
19
|
+
- **Page targeting**: All tools require a `pageId` from `list_pages` or `new_page`.
|
|
20
|
+
|
|
21
|
+
## Workflows
|
|
22
|
+
|
|
23
|
+
### 1. Open DevTools
|
|
24
|
+
|
|
25
|
+
Call `open_devtools` with `pageId`. Do this before you call `reveal_in_devtools`, `get_devtools_comments`, or `resolve_devtools_comment`.
|
|
26
|
+
|
|
27
|
+
### 2. Reveal a panel, element, or network request
|
|
28
|
+
|
|
29
|
+
Call `reveal_in_devtools` with `pageId` and these optional parameters:
|
|
30
|
+
|
|
31
|
+
- `panelName`: `"elements"`, `"network"`, `"sources"`, or `"console"`. Pass it alone to switch panels.
|
|
32
|
+
- `uid`: Element `uid` from `take_snapshot`. Reveals the element in the Elements panel.
|
|
33
|
+
- `reqid`: Request `reqid` from `list_network_requests`. Reveals the request in the Network panel.
|
|
34
|
+
|
|
35
|
+
`uid` and `reqid` are mutually exclusive.
|
|
36
|
+
|
|
37
|
+
### 3. Inspect the user's selection
|
|
38
|
+
|
|
39
|
+
- **DOM element**: Call `take_snapshot`. The snapshot marks the element selected in the Elements panel. Pass its `uid` to `get_css_styles`, `take_screenshot`, or `evaluate_script`.
|
|
40
|
+
- **Network request**: Call `get_network_request` and omit `reqid`. It returns the request selected in the Network panel.
|
|
41
|
+
|
|
42
|
+
### 4. Handle comment threads
|
|
43
|
+
|
|
44
|
+
Select the mode from the user's request.
|
|
45
|
+
|
|
46
|
+
#### Mode A: One-shot (comments already exist)
|
|
47
|
+
|
|
48
|
+
Use this mode when the user says the comments are already in DevTools, or asks you not to poll.
|
|
49
|
+
|
|
50
|
+
1. Call `get_devtools_comments` once.
|
|
51
|
+
2. Process and resolve each returned thread.
|
|
52
|
+
3. Summarize your changes and answers in chat, then end your turn. Do **not** poll.
|
|
53
|
+
|
|
54
|
+
#### Mode B: Watch (wait for user feedback)
|
|
55
|
+
|
|
56
|
+
Use this mode when the user asks you to wait while they debug, review, or add comments.
|
|
57
|
+
|
|
58
|
+
1. Call `get_devtools_comments` immediately.
|
|
59
|
+
2. While the result is `"No open DevTools comments found."`, wait 10 seconds, then call it again. Call it immediately if a `"DevTools comment threads updated"` notification arrives.
|
|
60
|
+
3. Stop after 12 consecutive empty polls (about 2 minutes) or when the user asks you to stop.
|
|
61
|
+
4. When threads appear, process and resolve them. Then reset the empty-poll counter and continue polling.
|
|
62
|
+
|
|
63
|
+
Rules for polling:
|
|
64
|
+
|
|
65
|
+
- **Use a background sub-agent** when sub-agent tools are available, so the main thread stays responsive. The sub-agent returns the threads to the main agent, or resolves them itself if it has workspace and MCP tools.
|
|
66
|
+
- **Poll inline** only when sub-agent tools are unavailable. Do not end your turn early.
|
|
67
|
+
- **Never call `get_devtools_comments` back-to-back** without the 10-second delay.
|
|
68
|
+
|
|
69
|
+
#### Process and resolve a thread
|
|
70
|
+
|
|
71
|
+
For each `### Thread: <id>`:
|
|
72
|
+
|
|
73
|
+
1. **Inspect the anchored target**:
|
|
74
|
+
- `Related element uid`: Use `get_css_styles`, `take_snapshot`, or `take_screenshot` with the `uid`.
|
|
75
|
+
- `Related network reqid`: Use `get_network_request` with the `reqid`.
|
|
76
|
+
- Optionally call `reveal_in_devtools` to show the target to the user.
|
|
77
|
+
2. **Address the comment**:
|
|
78
|
+
- For a code or styling request, apply the fix in the workspace. Reload and verify the page if needed.
|
|
79
|
+
- For a question or root-cause investigation, collect diagnostic data. Do not make unnecessary code edits.
|
|
80
|
+
3. **Resolve**: Call `resolve_devtools_comment` with `pageId`, `threadId`, and `replyText`:
|
|
81
|
+
- For a question or root cause, write a detailed answer.
|
|
82
|
+
- For a straightforward fix, write 1–2 sentences that state the change and the file.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-leak-debugging
|
|
3
|
+
description: Diagnoses and resolves memory leaks in JavaScript/Node.js applications. Use when a user reports high memory usage, OOM errors, or wants to capture, compare, or inspect heap snapshots with Chrome DevTools MCP memory tools.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Leak Debugging
|
|
7
|
+
|
|
8
|
+
This skill provides expert guidance and workflows for finding, diagnosing, and fixing memory leaks in JavaScript and Node.js applications using Chrome DevTools MCP tools.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
Advanced memory debugging tools (`compare_heapsnapshots`, `get_heapsnapshot_details`, etc.) are only available when the server is started with the `--memoryDebugging` flag. First check if these tools are available; if not, try to read the MCP configuration file to check if `--memoryDebugging` is enabled.
|
|
13
|
+
|
|
14
|
+
## Core Principles
|
|
15
|
+
|
|
16
|
+
- **Prefer MCP memory tools:** Do NOT attempt to read raw `.heapsnapshot` files directly, as they are extremely large and will consume too many tokens. Use the Chrome DevTools MCP heap snapshot tools to summarize, compare, and inspect snapshots.
|
|
17
|
+
- **Isolate the Leak:** Determine if the leak is in the browser (client-side) or Node.js (server-side).
|
|
18
|
+
- **Common Culprits:** Look for detached DOM nodes, unhandled closures, global variables, event listeners not being removed, and caches growing unbounded. _Note: Detached DOM nodes are sometimes intentional caches; always ask the user before nulling them._
|
|
19
|
+
- **Close Loaded Snapshots:** Heap snapshots can be large. After completing an investigation, use `close_heapsnapshot` for each loaded snapshot to release memory held by the MCP server.
|
|
20
|
+
|
|
21
|
+
## Workflows
|
|
22
|
+
|
|
23
|
+
### 1. Capturing Snapshots
|
|
24
|
+
|
|
25
|
+
When investigating a frontend web application memory leak, utilize the `chrome-devtools-mcp` tools to interact with the application and take snapshots.
|
|
26
|
+
|
|
27
|
+
- Use page-scoped tools like `click`, `navigate_page`, `fill`, etc. (specifying `pageId`) to manipulate the page into the desired state.
|
|
28
|
+
- Revert the page back to the original state after interactions to see if memory is released.
|
|
29
|
+
- Repeat the same user interactions 10 times to amplify the leak.
|
|
30
|
+
- Use `take_heapsnapshot` (with `pageId`) to save `.heapsnapshot` files to disk at baseline, target (after actions), and final (after reverting actions) states.
|
|
31
|
+
|
|
32
|
+
### 2. Comparing Snapshots
|
|
33
|
+
|
|
34
|
+
Once you have generated `.heapsnapshot` files using `take_heapsnapshot`, compare them with Chrome DevTools MCP memory tools.
|
|
35
|
+
|
|
36
|
+
- Start with `get_heapsnapshot_summary` for each snapshot to confirm that the files load and to compare high-level totals.
|
|
37
|
+
- Use `compare_heapsnapshots` to compare baseline and target snapshots. Start without `classIndex` for the summary diff, then request detailed class diffs only for suspicious growth by specifying `classIndex`.
|
|
38
|
+
- Use the summary output from `compare_heapsnapshots` before drilling into specific node IDs.
|
|
39
|
+
|
|
40
|
+
### 3. Inspecting Retainers and Dominator Chains
|
|
41
|
+
|
|
42
|
+
When a class or object type grows unexpectedly, inspect the retaining chain and dominators with the MCP tools before changing code.
|
|
43
|
+
|
|
44
|
+
- Use `get_heapsnapshot_class_nodes` to list instances of the suspicious class.
|
|
45
|
+
- Use `get_heapsnapshot_retainers`, `get_heapsnapshot_retaining_paths`, `get_heapsnapshot_dominators`, and `get_heapsnapshot_edges` to understand why representative nodes are still reachable.
|
|
46
|
+
- Use `get_heapsnapshot_object_details` with a specific `nodeId` to retrieve detailed object metadata (size, type, distance, and DOM detachedness).
|
|
47
|
+
- Use `get_heapsnapshot_duplicate_strings` when string growth dominates the diff.
|
|
48
|
+
- Read [references/common-leaks.md](references/common-leaks.md) for examples of common memory leaks and how to fix them after the retaining path points at application code.
|
|
49
|
+
|
|
50
|
+
### 4. Advanced Analysis and Categorized Filters
|
|
51
|
+
|
|
52
|
+
Use built-in MCP memory tools and filters to pinpoint specific leak categories directly without external tools.
|
|
53
|
+
|
|
54
|
+
- Use `get_heapsnapshot_details` or `get_heapsnapshot_class_nodes` with `filterName` to target common leak causes:
|
|
55
|
+
- `objectsRetainedByDetachedDomNodes`: Identifies detached DOM elements retained in memory.
|
|
56
|
+
- `objectsRetainedByEventHandlers`: Identifies objects kept alive by unremoved event listeners.
|
|
57
|
+
- `objectsRetainedByContexts`: Identifies objects trapped in closures or execution contexts.
|
|
58
|
+
- `objectsRetainedByConsole`: Identifies objects retained by console logging.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Common Memory Leaks
|
|
2
|
+
|
|
3
|
+
When analyzing retaining paths, dominator chains, or class diffs with Chrome DevTools MCP memory tools, look for these common patterns in the codebase:
|
|
4
|
+
|
|
5
|
+
## 1. Uncleared Event Listeners
|
|
6
|
+
|
|
7
|
+
Event listeners attached to global objects (like `window` or `document`) or long-living objects prevent garbage collection of the objects referenced in their callbacks.
|
|
8
|
+
|
|
9
|
+
**Fix:** Always call `removeEventListener` when a component unmounts or the listener is no longer needed.
|
|
10
|
+
|
|
11
|
+
## 2. Detached DOM Nodes
|
|
12
|
+
|
|
13
|
+
A DOM node is removed from the document tree but is still referenced by a JavaScript variable. While detachedness is a good signal for a memory leak, it's not always a bug. For example, websites sometimes intentionally cache detached navigation trees.
|
|
14
|
+
|
|
15
|
+
**Fix:** Signal the detached nodes to the user first. **Ask the user first** before nulling the references or changing the code, as the detached nodes might be part of an intentional cache. If confirmed as a leak, ensure variables holding DOM references are set to `null` when the node is removed, or limit their scope.
|
|
16
|
+
|
|
17
|
+
## 3. Unintentional Global Variables
|
|
18
|
+
|
|
19
|
+
Variables declared without `var`, `let`, or `const` (in non-strict mode) or explicitly attached to `window` remain in memory forever.
|
|
20
|
+
|
|
21
|
+
**Fix:** Use strict mode, properly declare variables, and avoid global state.
|
|
22
|
+
|
|
23
|
+
## 4. Closures
|
|
24
|
+
|
|
25
|
+
Closures can unintentionally keep references to large objects in their outer scope.
|
|
26
|
+
|
|
27
|
+
**Fix:** Nullify large objects when they are no longer needed, or refactor the closure to not capture unnecessary variables.
|
|
28
|
+
|
|
29
|
+
## 5. Unbounded Caches or Arrays
|
|
30
|
+
|
|
31
|
+
Data structures used for caching (like objects, Arrays, or Maps) that grow without limits.
|
|
32
|
+
|
|
33
|
+
**Fix:** Implement caching limits, use LRU caches, or use `WeakMap`/`WeakSet` for data associated with object lifecycles.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: troubleshooting
|
|
3
|
+
description: Uses Chrome DevTools MCP and documentation to troubleshoot connection and target issues. Trigger this skill when list_pages, new_page, or navigate_page fail, or when the server initialization fails.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Troubleshooting Wizard
|
|
7
|
+
|
|
8
|
+
You are acting as a troubleshooting wizard to help the user configure and fix their Chrome DevTools MCP server setup. When this skill is triggered (e.g., because `list_pages`, `new_page`, or `navigate_page` failed, or the server wouldn't start), follow this step-by-step diagnostic process:
|
|
9
|
+
|
|
10
|
+
### Step 1: Find and Read Configuration
|
|
11
|
+
|
|
12
|
+
Your first action should be to locate and read the MCP configuration file. Search for the following files in the user's workspace: `.mcp.json`, `.vscode/mcp.json`, `gemini-extension.json`, or `.gemini/settings.json` (or user-scoped files such as `~/.claude.json` if accessible).
|
|
13
|
+
|
|
14
|
+
If you find a configuration file, read and interpret it to identify potential issues such as:
|
|
15
|
+
|
|
16
|
+
- Incorrect arguments or flags.
|
|
17
|
+
- Missing environment variables.
|
|
18
|
+
- Usage of `--autoConnect` in incompatible environments.
|
|
19
|
+
- The actual executable/package identity: preserve this fork's local build or
|
|
20
|
+
verified `@chenpx976/chrome-devtools-mcp` release. An unscoped official npm
|
|
21
|
+
command does not provide this Arc adaptation. The scoped package is not yet
|
|
22
|
+
published or verified; use the local build until release verification.
|
|
23
|
+
|
|
24
|
+
If you cannot find any of these files, only then should you ask the user to provide their configuration file content.
|
|
25
|
+
|
|
26
|
+
### Step 2: Triage Common Connection Errors
|
|
27
|
+
|
|
28
|
+
Before reading documentation or suggesting configuration changes, check if the error message matches one of the following common patterns.
|
|
29
|
+
|
|
30
|
+
#### Error: `Could not find DevToolsActivePort`
|
|
31
|
+
|
|
32
|
+
This error is highly specific to the `--autoConnect` feature. It means the MCP server cannot find the file created by a running, debuggable Chrome instance. This is not a generic connection failure.
|
|
33
|
+
|
|
34
|
+
Your primary goal is to guide the user to ensure Chrome is running and properly configured. Do not immediately suggest switching to `--browserUrl`. Follow this exact sequence:
|
|
35
|
+
|
|
36
|
+
1. **Ask the user to confirm that the correct Chrome version** (e.g., "Chrome Canary" if the error mentions it) is currently running.
|
|
37
|
+
2. **If the user confirms it is running, instruct them to enable remote debugging.** Be very specific about the URL and the action: "Please open a new tab in Chrome, navigate to `chrome://inspect/#remote-debugging`, and make sure the 'Enable remote debugging' checkbox is checked."
|
|
38
|
+
3. **Once the user confirms both steps, your only next action should be to call the `list_pages` tool.** This is the simplest and safest way to verify if the connection is now successful. Do not retry the original, more complex command yet.
|
|
39
|
+
4. **If `list_pages` succeeds, the problem is resolved.** If it still fails with the same error, then you can proceed to the more advanced steps like suggesting `--browserUrl` or checking for sandboxing issues.
|
|
40
|
+
|
|
41
|
+
#### Symptom: Server starts but creates a new empty profile
|
|
42
|
+
|
|
43
|
+
If the server starts successfully but `list_pages` returns an empty list or creates a new profile instead of connecting to the existing Chrome instance, check for typos in the arguments.
|
|
44
|
+
|
|
45
|
+
- **Check for flag typos:** For example, `--autoBronnect` instead of `--autoConnect`.
|
|
46
|
+
- **Verify the configuration:** Ensure the arguments match the expected flags exactly.
|
|
47
|
+
|
|
48
|
+
#### Symptom: Missing Tools / Only a few tools available
|
|
49
|
+
|
|
50
|
+
If the server starts successfully but only a limited subset of tools (like `list_pages`, `list_console_messages`, `get_console_message`, `list_network_requests`) are available, this is likely because the MCP client is enforcing a **read-only mode**.
|
|
51
|
+
|
|
52
|
+
All tools in `chrome-devtools-mcp` are annotated with `readOnlyHint: true` (for safe, non-modifying tools) or `readOnlyHint: false` (for tools that modify browser state, like `emulate`, `click`, `navigate_page`). To access the full suite of tools, the user must disable read-only mode in their MCP client (e.g., by exiting "Plan Mode" in Gemini CLI or adjusting their client's tool safety settings).
|
|
53
|
+
|
|
54
|
+
#### Symptom: Extension tools are missing or extensions fail to load
|
|
55
|
+
|
|
56
|
+
If the tools related to extensions (like `install_extension`) are not available, or if the extensions you load are not functioning:
|
|
57
|
+
|
|
58
|
+
1. **Check for the `--categoryExtensions` flag**: Ensure this flag is passed in the MCP server configuration to enable the extension category tools.
|
|
59
|
+
|
|
60
|
+
#### Other Common Errors
|
|
61
|
+
|
|
62
|
+
Identify other error messages from the failed tool call or the MCP initialization logs:
|
|
63
|
+
|
|
64
|
+
- `Target closed`
|
|
65
|
+
- "Tool not found" (check if they are using `--slim` which only enables navigation, script evaluation and screenshot tools).
|
|
66
|
+
- Missing `pageId`: Page-scoped tools require a `pageId` argument. Call `list_pages` to find active page IDs.
|
|
67
|
+
- `ProtocolError: Network.enable timed out` or `The socket connection was closed unexpectedly`
|
|
68
|
+
- `Error [ERR_MODULE_NOT_FOUND]: Cannot find module`
|
|
69
|
+
- Any sandboxing or host validation errors.
|
|
70
|
+
|
|
71
|
+
### Step 3: Read Known Issues
|
|
72
|
+
|
|
73
|
+
Read https://github.com/chenpx976/chrome-devtools-mcp/blob/arc-support/docs/troubleshooting.md to map the error to a known issue. Pay close attention to:
|
|
74
|
+
|
|
75
|
+
- Sandboxing restrictions (macOS Seatbelt, Linux containers).
|
|
76
|
+
- WSL requirements.
|
|
77
|
+
- `--autoConnect` handshakes, timeouts, and requirements (requires **running** Chrome 144+).
|
|
78
|
+
|
|
79
|
+
### Step 4: Formulate a Configuration
|
|
80
|
+
|
|
81
|
+
Based on the exact error and the user's environment (OS, MCP client), formulate the correct MCP configuration snippet. Check if they need to:
|
|
82
|
+
|
|
83
|
+
- Pass `--browser-url=http://127.0.0.1:9222` instead of `--autoConnect` (e.g. if they are in a sandboxed environment like Claude Desktop).
|
|
84
|
+
- Enable remote debugging in Chrome (`chrome://inspect/#remote-debugging`) and accept the connection prompt. **Ask the user to verify this is enabled if using `--autoConnect`.**
|
|
85
|
+
- Add `--logFile <absolute_path_to_log_file>` to capture debug logs for analysis.
|
|
86
|
+
- Increase `startup_timeout_ms` (e.g. to 20000) if using Codex on Windows.
|
|
87
|
+
|
|
88
|
+
_If you are unsure of the user's configuration, ask the user to provide their current MCP server JSON configuration._
|
|
89
|
+
|
|
90
|
+
### Step 5: Run Diagnostic Commands
|
|
91
|
+
|
|
92
|
+
If the issue is still unclear, test the configured artifact directly. For a
|
|
93
|
+
local build, use its actual `node` entry. For a verified scoped release:
|
|
94
|
+
|
|
95
|
+
- Run `npx @chenpx976/chrome-devtools-mcp@<verified-version> --help` to check the same package and Node.js environment as the client.
|
|
96
|
+
- If needed, run it with `NODE_DEBUG=*` and `--logFile=/tmp/cdm-test.log`, preserving the configured Arc/endpoint arguments. Analyze errors without switching to the official package or silently launching a different browser.
|
|
97
|
+
|
|
98
|
+
### Step 6: Check GitHub for Existing Issues
|
|
99
|
+
|
|
100
|
+
If the fork's troubleshooting guide does not cover the error, search its
|
|
101
|
+
repository when `gh` is available:
|
|
102
|
+
`gh issue list --repo chenpx976/chrome-devtools-mcp --search "<error snippet>" --state all`
|
|
103
|
+
|
|
104
|
+
For shared Chrome behavior, also consult the actual
|
|
105
|
+
[upstream issues](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues)
|
|
106
|
+
and [discussions](https://github.com/ChromeDevTools/chrome-devtools-mcp/discussions).
|
|
107
|
+
Keep upstream issue citations attached to their original repository.
|