@yezack/chrome-devtools-mcp-108 0.0.0-stage → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/FORK-NOTICE.md +45 -0
  2. package/LICENSE +202 -0
  3. package/README.md +45 -2
  4. package/build/src/BrowserManager.js +401 -0
  5. package/build/src/McpContext.js +642 -0
  6. package/build/src/McpPage.js +850 -0
  7. package/build/src/McpResponse.js +1086 -0
  8. package/build/src/SlimMcpResponse.js +19 -0
  9. package/build/src/TextSnapshot.js +315 -0
  10. package/build/src/ToolHandler.js +322 -0
  11. package/build/src/bin/check-latest-version.js +51 -0
  12. package/build/src/bin/chrome-devtools-mcp-main.js +77 -0
  13. package/build/src/bin/chrome-devtools-mcp.js +23 -0
  14. package/build/src/bin/chrome-devtools.js +222 -0
  15. package/build/src/collectors/PageCollector.js +291 -0
  16. package/build/src/collectors/ServiceWorkerCollector.js +171 -0
  17. package/build/src/config/browser-options.js +125 -0
  18. package/build/src/config/category-options.js +89 -0
  19. package/build/src/config/cli-commands.js +26 -0
  20. package/build/src/config/cli-options.js +1473 -0
  21. package/build/src/config/mcp-options.js +417 -0
  22. package/build/src/daemon/client.js +221 -0
  23. package/build/src/daemon/daemon.js +266 -0
  24. package/build/src/daemon/types.js +7 -0
  25. package/build/src/daemon/utils.js +136 -0
  26. package/build/src/devtools/DevToolsCommentBridge.js +91 -0
  27. package/build/src/devtools/DevtoolsUtils.js +307 -0
  28. package/build/src/devtools/McpHostBindingAdapter.js +165 -0
  29. package/build/src/devtools/issueDescriptions.js +42 -0
  30. package/build/src/formatters/CommentFormatter.js +82 -0
  31. package/build/src/formatters/ConsoleFormatter.js +321 -0
  32. package/build/src/formatters/CssFormatter.js +812 -0
  33. package/build/src/formatters/HeapSnapshotFormatter.js +185 -0
  34. package/build/src/formatters/IssueFormatter.js +193 -0
  35. package/build/src/formatters/NetworkFormatter.js +241 -0
  36. package/build/src/formatters/SnapshotFormatter.js +135 -0
  37. package/build/src/index.js +237 -0
  38. package/build/src/processors/ChunkedTraceParser.js +361 -0
  39. package/build/src/processors/HeapSnapshotManager.js +270 -0
  40. package/build/src/processors/PerformanceTrace.js +132 -0
  41. package/build/src/telemetry/ClearcutLogger.js +242 -0
  42. package/build/src/telemetry/WatchdogClient.js +61 -0
  43. package/build/src/telemetry/errors.js +18 -0
  44. package/build/src/telemetry/flagUtils.js +90 -0
  45. package/build/src/telemetry/metricsRegistry.js +85 -0
  46. package/build/src/telemetry/persistence.js +82 -0
  47. package/build/src/telemetry/transformation.js +233 -0
  48. package/build/src/telemetry/types.js +36 -0
  49. package/build/src/telemetry/watchdog/ClearcutSender.js +205 -0
  50. package/build/src/telemetry/watchdog/main.js +128 -0
  51. package/build/src/third_party/THIRD_PARTY_NOTICES +4077 -0
  52. package/build/src/third_party/bundled-packages.json +12 -0
  53. package/build/src/third_party/devtools-formatter-worker.js +15494 -0
  54. package/build/src/third_party/devtools-heap-snapshot-worker.js +10979 -0
  55. package/build/src/third_party/index.js +200978 -0
  56. package/build/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
  57. package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
  58. package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
  59. package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
  60. package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
  61. package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
  62. package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
  63. package/build/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
  64. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
  65. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
  66. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
  67. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
  68. package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
  69. package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
  70. package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
  71. package/build/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
  72. package/build/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
  73. package/build/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
  74. package/build/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
  75. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
  76. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
  77. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
  78. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
  79. package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
  80. package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
  81. package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
  82. package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
  83. package/build/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
  84. package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
  85. package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
  86. package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
  87. package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
  88. package/build/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
  89. package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +4 -0
  90. package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +4 -0
  91. package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
  92. package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
  93. package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
  94. package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
  95. package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
  96. package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
  97. package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
  98. package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
  99. package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
  100. package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
  101. package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
  102. package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
  103. package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
  104. package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
  105. package/build/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
  106. package/build/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
  107. package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
  108. package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
  109. package/build/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
  110. package/build/src/third_party/issue-descriptions/deprecation.md +3 -0
  111. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
  112. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
  113. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
  114. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
  115. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
  116. package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
  117. package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
  118. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
  119. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
  120. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
  121. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
  122. package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
  123. package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
  124. package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
  125. package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
  126. package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
  127. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
  128. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
  129. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
  130. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
  131. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
  132. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
  133. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
  134. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
  135. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
  136. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
  137. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
  138. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
  139. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
  140. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
  141. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
  142. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
  143. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
  144. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
  145. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
  146. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
  147. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
  148. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
  149. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
  150. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
  151. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
  152. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
  153. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
  154. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
  155. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
  156. package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
  157. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
  158. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
  159. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
  160. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
  161. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
  162. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
  163. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
  164. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
  165. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
  166. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
  167. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
  168. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
  169. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
  170. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
  171. package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
  172. package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
  173. package/build/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
  174. package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
  175. package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
  176. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
  177. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
  178. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
  179. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
  180. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
  181. package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
  182. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  183. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  184. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  185. package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
  186. package/build/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
  187. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
  188. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
  189. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
  190. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
  191. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
  192. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
  193. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
  194. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
  195. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
  196. package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
  197. package/build/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
  198. package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
  199. package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
  200. package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
  201. package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
  202. package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
  203. package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
  204. package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
  205. package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
  206. package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
  207. package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
  208. package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
  209. package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
  210. package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
  211. package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
  212. package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
  213. package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
  214. package/build/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
  215. package/build/src/third_party/issue-descriptions/heavyAd.md +10 -0
  216. package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
  217. package/build/src/third_party/issue-descriptions/mixedContent.md +5 -0
  218. package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
  219. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
  220. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
  221. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
  222. package/build/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
  223. package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
  224. package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
  225. package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
  226. package/build/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
  227. package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
  228. package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
  229. package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
  230. package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
  231. package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
  232. package/build/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
  233. package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
  234. package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
  235. package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
  236. package/build/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
  237. package/build/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
  238. package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
  239. package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
  240. package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
  241. package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
  242. package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
  243. package/build/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
  244. package/build/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
  245. package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
  246. package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
  247. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
  248. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
  249. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
  250. package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
  251. package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
  252. package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
  253. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
  254. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
  255. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
  256. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
  257. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
  258. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
  259. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
  260. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
  261. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
  262. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
  263. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
  264. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  265. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
  266. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
  267. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  268. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
  269. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
  270. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
  271. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
  272. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
  273. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
  274. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
  275. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
  276. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
  277. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
  278. package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
  279. package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
  280. package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
  281. package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
  282. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
  283. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
  284. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
  285. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
  286. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
  287. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
  288. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
  289. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
  290. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
  291. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
  292. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
  293. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
  294. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
  295. package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +10 -0
  296. package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
  297. package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
  298. package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
  299. package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
  300. package/build/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
  301. package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
  302. package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
  303. package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
  304. package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
  305. package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
  306. package/build/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
  307. package/build/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
  308. package/build/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
  309. package/build/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
  310. package/build/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
  311. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +58435 -0
  312. package/build/src/tools/ToolDefinition.js +80 -0
  313. package/build/src/tools/categories.js +33 -0
  314. package/build/src/tools/comments.js +169 -0
  315. package/build/src/tools/console.js +104 -0
  316. package/build/src/tools/css.js +45 -0
  317. package/build/src/tools/emulation.js +84 -0
  318. package/build/src/tools/extensions.js +103 -0
  319. package/build/src/tools/input.js +652 -0
  320. package/build/src/tools/lighthouse.js +149 -0
  321. package/build/src/tools/memory.js +424 -0
  322. package/build/src/tools/network.js +128 -0
  323. package/build/src/tools/pages.js +363 -0
  324. package/build/src/tools/performance.js +212 -0
  325. package/build/src/tools/pwa.js +128 -0
  326. package/build/src/tools/screencast.js +119 -0
  327. package/build/src/tools/screenshot.js +277 -0
  328. package/build/src/tools/script.js +232 -0
  329. package/build/src/tools/slim/tools.js +96 -0
  330. package/build/src/tools/snapshot.js +63 -0
  331. package/build/src/tools/thirdPartyDeveloper.js +85 -0
  332. package/build/src/tools/tools.js +55 -0
  333. package/build/src/tools/webmcp.js +66 -0
  334. package/build/src/types.js +10 -0
  335. package/build/src/utils/WaitForHelper.js +316 -0
  336. package/build/src/utils/bytes.js +105 -0
  337. package/build/src/utils/check-for-updates.js +75 -0
  338. package/build/src/utils/files.js +57 -0
  339. package/build/src/utils/id.js +16 -0
  340. package/build/src/utils/keyboard.js +297 -0
  341. package/build/src/utils/logger.js +52 -0
  342. package/build/src/utils/pagination.js +50 -0
  343. package/build/src/utils/polyfill.js +11 -0
  344. package/build/src/utils/url.js +116 -0
  345. package/build/src/version.js +10 -0
  346. package/package.json +41 -4
  347. package/skills/a11y-debugging/SKILL.md +91 -0
  348. package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
  349. package/skills/chrome-devtools/SKILL.md +74 -0
  350. package/skills/chrome-devtools-cli/SKILL.md +194 -0
  351. package/skills/chrome-devtools-cli/references/installation.md +14 -0
  352. package/skills/cookie-debugging/SKILL.md +149 -0
  353. package/skills/debug-optimize-lcp/SKILL.md +121 -0
  354. package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
  355. package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
  356. package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
  357. package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
  358. package/skills/memory-leak-debugging/SKILL.md +58 -0
  359. package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
  360. package/skills/troubleshooting/SKILL.md +99 -0
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: cookie-debugging
3
+ description: Uses Chrome DevTools MCP for inspecting, debugging, and testing cookies, session state, authentication issues, and cookie consent compliance. Use when diagnosing 401/403 errors, authentication redirects, session expiration, Cookie/Set-Cookie header issues, cookie banner consent conformance, or third-party cookie/SameSite/Partitioned cookie warnings.
4
+ ---
5
+
6
+ ## Core Concepts
7
+
8
+ ### HttpOnly vs Client-Side Storage
9
+
10
+ Cookies marked `HttpOnly` cannot be accessed or modified by client-side JavaScript (`cookieStore` or `document.cookie`). However, the browser **automatically attaches active HttpOnly cookies to outgoing HTTP request headers (`Cookie`)**.
11
+
12
+ - To inspect current `HttpOnly` values: Look at the `Cookie` request header of any outgoing HTTP request via `get_network_request`.
13
+ - To inspect how cookies were created or configured: Look at the `Set-Cookie` response header of login/auth responses.
14
+ - To inspect non-`HttpOnly` cookies: Use `evaluate_script` with the modern `cookieStore` API (`async () => await cookieStore.getAll()`).
15
+
16
+ ### Session Strategy: Live Tab vs Isolated Context
17
+
18
+ Choose the right session environment to avoid state contamination (e.g., residual analytics or auth tokens):
19
+
20
+ | Strategy | When to Use | Setup / Teardown |
21
+ | :---------------------------------- | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ |
22
+ | **Live Tab (Active Page)** | Diagnosing an active user session, live 401/403 error, or current state. | Operates directly on the currently selected page. |
23
+ | **Clean-Slate (`isolatedContext`)** | Testing cookie consent banners, first-time visits, or zero-cookie guarantees. | Call `new_page` with a unique `isolatedContext` (e.g. `"consent-audit-1"`). When finished, call `close_page`. |
24
+
25
+ ### Client-Side Capabilities & Limitations
26
+
27
+ | Action | Client JavaScript (`cookieStore` / `document.cookie`) | DevTools Network & Context Tools |
28
+ | :--------------------------------------------------------------- | :---------------------------------------------------- | :------------------------------------------------------ |
29
+ | **Read Non-HttpOnly** | ✅ `async () => await cookieStore.getAll()` | ✅ `get_network_request` (Request `Cookie`) |
30
+ | **Read HttpOnly** | ❌ Blocked by browser security | ✅ `get_network_request` (Request `Cookie`) |
31
+ | **Inspect Attributes** (`Domain`, `Path`, `SameSite`, `Expires`) | ✅ `async () => await cookieStore.getAll()` | ✅ `get_network_request` (Response `Set-Cookie`) |
32
+ | **Modify / Delete Non-HttpOnly** | ✅ `async () => await cookieStore.set(...)` | N/A |
33
+ | **Modify / Delete HttpOnly** | ❌ **Silent failure** in JavaScript | ✅ Use `new_page(isolatedContext: ...)` for clean state |
34
+
35
+ > [!WARNING]
36
+ > Attempting to clear an `HttpOnly` cookie via JavaScript (`cookieStore.delete` or `document.cookie = "...; max-age=0"`) will silently fail. To test in an unauthenticated or fresh state, always spawn a new isolated context using `new_page` with `isolatedContext`.
37
+
38
+ ---
39
+
40
+ ## Workflow Patterns
41
+
42
+ ### 1. Diagnosing Authentication Failures & Redirects (401 / 403)
43
+
44
+ When an authenticated page request fails, returns 401/403, or redirects to login:
45
+
46
+ 1. **List Recent Requests**: Call `list_network_requests` with `includePreservedRequests: true`.
47
+ 2. **Find the Target Request**: Locate the failing request (401/403) or redirect (302/307).
48
+ 3. **Inspect Outgoing `Cookie` Header**: Call `get_network_request` with the `reqid`.
49
+ - Verify if the `Cookie` header was attached and whether required tokens (e.g. `SESSION_ID`, `auth_token`) were sent.
50
+ 4. **Trigger Active Inspection (If no recent request exists)**:
51
+ - If the cookie was set in a previous session and no network call is listed, trigger a request:
52
+ - Use `navigate_page` with `reload: true`, OR
53
+ - Call `evaluate_script` with `() => fetch(window.location.href)`
54
+ - Then call `get_network_request` on the new request to inspect the active `Cookie` header.
55
+ 5. **Trace the Setting Request**: If the cookie is missing or rejected:
56
+ - Check earlier login/handshake responses for `Set-Cookie` directives:
57
+ - **Path mismatch**: e.g., `Path=/api` when the request is to `/`.
58
+ - **Domain mismatch**: e.g., `Domain=api.example.com` preventing cookies on `sub.example.com`.
59
+ - **Secure flag on HTTP**: `Secure` cookies are never sent over unencrypted `http://`.
60
+ - **SameSite blocking**: `SameSite=Strict` cookies are omitted on cross-site navigations.
61
+ - **Expiration**: Check if `Expires` or `Max-Age` elapsed.
62
+
63
+ ### 2. Cookie Banner & Consent Conformance Testing
64
+
65
+ To verify that no non-essential or tracking cookies are set before consent or when declining:
66
+
67
+ 1. **Start Clean**: Open a fresh isolated context with a dedicated name:
68
+ ```json
69
+ {"url": "<PAGE_URL>", "isolatedContext": "consent-test-1"}
70
+ ```
71
+ 2. **Record Baseline Cookies**: Before interacting with the banner, run `evaluate_script` with `async () => await cookieStore.getAll()`.
72
+ 3. **Inspect Premature Network Requests & Issues**:
73
+ - Call `list_network_requests` to ensure no third-party tracking beacons fired before consent.
74
+ - Call `list_console_messages` with `types: ["issue"]` to check for tracking warnings.
75
+ 4. **Interact with Consent Banner**:
76
+ - Capture snapshot with `take_snapshot` to locate the "Decline" or "Reject All" button `uid`.
77
+ - Click the button with `click`.
78
+ 5. **Verify Cookie Difference**:
79
+ - Run `evaluate_script` with `async () => await cookieStore.getAll()` after clicking to assert that only strictly necessary or consent-state cookies exist.
80
+ 6. **Test Consent Revocation (Lifecycle Audit)**:
81
+ - When auditing consent withdrawal or preference changes:
82
+ - Locate and click the "Cookie Settings", "Manage Preferences", or footer privacy trigger (`take_snapshot` $\rightarrow$ `click`).
83
+ - Deselect non-essential categories or click "Revoke All" / "Save Preferences".
84
+ - Re-query `cookieStore.getAll()` to verify previously accepted non-essential cookies were cleared or expired.
85
+ - Call `list_network_requests` on subsequent actions to ensure tracking beacons are no longer fired.
86
+ 7. **Teardown Context**: Call `close_page` when the audit is complete to prevent leftover cookies from affecting subsequent tasks.
87
+
88
+ ### 3. Auditing Cookie Security, SameSite & CHIPS (Partitioned Cookies)
89
+
90
+ 1. **Fast-Track: Native DevTools Issues (Recommended)**:
91
+ - Call `list_console_messages` with:
92
+ ```json
93
+ {
94
+ "types": ["issue"],
95
+ "includePreservedMessages": true
96
+ }
97
+ ```
98
+ - Check for `CookieIssue` entries, such as:
99
+ - `SameSiteNoneInsecure`: `SameSite=None` without `Secure`.
100
+ - `ThirdPartyCookiePhaseout`: Third-party cookie blocked or restricted.
101
+ - `SchemefulSameSite`: Cross-scheme cookie issues.
102
+ - `PartitionedCookies`: Invalid CHIPS partitioning attributes.
103
+ 2. **Deep Audit: Lighthouse Third-Party Cookies**:
104
+ - Run `lighthouse_audit` with `mode: "navigation"` and `outputDirPath: "/tmp/lh-report"`.
105
+ - **Extract the specific cookie audit** without loading the full report into context:
106
+ ```bash
107
+ node -e "const r=require('/tmp/lh-report/report.json'); const a=r.audits['third-party-cookies']; console.log(JSON.stringify({score: a?.score, displayValue: a?.displayValue, items: a?.details?.items}))"
108
+ ```
109
+
110
+ ### 4. Client-Side Cookie Inspection & Manipulation
111
+
112
+ For client-accessible, non-`HttpOnly` cookies (e.g., UI preferences, non-sensitive feature flags):
113
+
114
+ 1. **Read Cookies & Attributes**:
115
+ - Use the modern asynchronous Cookie Store API:
116
+ ```js
117
+ async () => await cookieStore.getAll();
118
+ ```
119
+ - _Fallback for insecure HTTP origins_: `() => document.cookie`.
120
+ 2. **Set / Modify Cookie**:
121
+ - Set client cookie via `cookieStore`:
122
+ ```js
123
+ async () =>
124
+ await cookieStore.set({
125
+ name: 'theme',
126
+ value: 'dark',
127
+ expires: Date.now() + 86400000,
128
+ sameSite: 'lax',
129
+ });
130
+ ```
131
+ 3. **Delete Cookie**:
132
+ - Clear client cookie:
133
+ ```js
134
+ async () => await cookieStore.delete('theme');
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Troubleshooting
140
+
141
+ - **`cookieStore` is undefined**: `cookieStore` requires a Secure Context (`https://`, `localhost`, or `127.0.0.1`). On non-secure HTTP origins, use `() => document.cookie` or test over HTTPS.
142
+ - **`evaluate_script` returns empty / unresolved Promise**: `cookieStore` methods are asynchronous. Always wrap calls with `async () => await cookieStore.getAll()`.
143
+ - **Cookie not visible in JavaScript**: The cookie is marked `HttpOnly`. Trigger a network request and call `get_network_request` to view it in the `Cookie` request header.
144
+ - **JavaScript deletion did not remove cookie**: The cookie is `HttpOnly` or requires matching `Path` and `Domain` parameters. Use a fresh `isolatedContext` with `new_page` for a clean slate.
145
+ - **Cookie set in response but not sent in requests**:
146
+ - Verify if page is `http://` while cookie specifies `Secure`.
147
+ - Check if `Domain` restricts subdomains.
148
+ - Check `list_console_messages(types: ["issue"])` for browser rejection reasons.
149
+ - **Residual cookies contaminating audits**: Always use `new_page` with a unique `isolatedContext` when running compliance tests, and call `close_page` when done.
@@ -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,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,99 @@
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`, `gemini-extension.json`, `.claude/settings.json`, `.vscode/launch.json`, or `.gemini/settings.json`.
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
+
20
+ If you cannot find any of these files, only then should you ask the user to provide their configuration file content.
21
+
22
+ ### Step 2: Triage Common Connection Errors
23
+
24
+ Before reading documentation or suggesting configuration changes, check if the error message matches one of the following common patterns.
25
+
26
+ #### Error: `Could not find DevToolsActivePort`
27
+
28
+ 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.
29
+
30
+ 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:
31
+
32
+ 1. **Ask the user to confirm that the correct Chrome version** (e.g., "Chrome Canary" if the error mentions it) is currently running.
33
+ 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."
34
+ 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.
35
+ 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.
36
+
37
+ #### Symptom: Server starts but creates a new empty profile
38
+
39
+ 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.
40
+
41
+ - **Check for flag typos:** For example, `--autoBronnect` instead of `--autoConnect`.
42
+ - **Verify the configuration:** Ensure the arguments match the expected flags exactly.
43
+
44
+ #### Symptom: Missing Tools / Only 9 tools available
45
+
46
+ If the server starts successfully but only a limited subset of tools (like `list_pages`, `get_console_message`, `lighthouse_audit`, `take_heapsnapshot`) are available, this is likely because the MCP client is enforcing a **read-only mode**.
47
+
48
+ 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).
49
+
50
+ #### Symptom: Extension tools are missing or extensions fail to load
51
+
52
+ If the tools related to extensions (like `install_extension`) are not available, or if the extensions you load are not functioning:
53
+
54
+ 1. **Check for the `--categoryExtensions` flag**: Ensure this flag is passed in the MCP server configuration to enable the extension category tools.
55
+ 2. **Make sure the MCP server in configured to launch Chrome instead of connecting to an instance**: Chrome before 149 is not able to load extensions when connecting to an existing instance (`--auto-connect`, `--browserUrl`).
56
+
57
+ #### Other Common Errors
58
+
59
+ Identify other error messages from the failed tool call or the MCP initialization logs:
60
+
61
+ - `Target closed`
62
+ - "Tool not found" (check if they are using `--slim` which only enables navigation and screenshot tools).
63
+ - Missing `pageId`: Page-scoped tools require a `pageId` argument. Call `list_pages` to find active page IDs.
64
+ - `ProtocolError: Network.enable timed out` or `The socket connection was closed unexpectedly`
65
+ - `Error [ERR_MODULE_NOT_FOUND]: Cannot find module`
66
+ - Any sandboxing or host validation errors.
67
+
68
+ ### Step 3: Read Known Issues
69
+
70
+ Read the contents of https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/troubleshooting.md to map the error to a known issue. Pay close attention to:
71
+
72
+ - Sandboxing restrictions (macOS Seatbelt, Linux containers).
73
+ - WSL requirements.
74
+ - `--autoConnect` handshakes, timeouts, and requirements (requires **running** Chrome 144+).
75
+
76
+ ### Step 4: Formulate a Configuration
77
+
78
+ Based on the exact error and the user's environment (OS, MCP client), formulate the correct MCP configuration snippet. Check if they need to:
79
+
80
+ - Pass `--browser-url=http://127.0.0.1:9222` instead of `--autoConnect` (e.g. if they are in a sandboxed environment like Claude Desktop).
81
+ - 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`.**
82
+ - Add `--logFile <absolute_path_to_log_file>` to capture debug logs for analysis.
83
+ - Increase `startup_timeout_ms` (e.g. to 20000) if using Codex on Windows.
84
+
85
+ _If you are unsure of the user's configuration, ask the user to provide their current MCP server JSON configuration._
86
+
87
+ ### Step 5: Run Diagnostic Commands
88
+
89
+ If the issue is still unclear, run diagnostic commands to test the server directly:
90
+
91
+ - Run `npx chrome-devtools-mcp@latest --help` to verify the installation and Node.js environment.
92
+ - If you need more information, run `DEBUG=* npx chrome-devtools-mcp@latest --logFile=/tmp/cdm-test.log` to capture verbose logs. Analyze the output for errors.
93
+
94
+ ### Step 6: Check GitHub for Existing Issues
95
+
96
+ If https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/troubleshooting.md does not cover the specific error, check if the `gh` (GitHub CLI) tool is available in the environment. If so, search the GitHub repository for similar issues:
97
+ `gh issue list --repo ChromeDevTools/chrome-devtools-mcp --search "<error snippet>" --state all`
98
+
99
+ Alternatively, you can recommend that the user checks https://github.com/ChromeDevTools/chrome-devtools-mcp/issues and https://github.com/ChromeDevTools/chrome-devtools-mcp/discussions for help.