chrome-devtools-mcp 1.6.0 → 1.8.0

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 (313) hide show
  1. package/README.md +73 -22
  2. package/build/src/McpContext.js +121 -44
  3. package/build/src/McpPage.js +230 -14
  4. package/build/src/McpResponse.js +209 -283
  5. package/build/src/SlimMcpResponse.js +1 -1
  6. package/build/src/TextSnapshot.js +80 -19
  7. package/build/src/ToolHandler.js +80 -15
  8. package/build/src/bin/chrome-devtools-mcp-main.js +3 -3
  9. package/build/src/bin/chrome-devtools.js +47 -32
  10. package/build/src/browser.js +3 -1
  11. package/build/src/{PageCollector.js → collectors/PageCollector.js} +15 -10
  12. package/build/src/{ServiceWorkerCollector.js → collectors/ServiceWorkerCollector.js} +1 -1
  13. package/build/src/{bin/chrome-devtools-cli-options.js → config/cli-options.js} +414 -23
  14. package/build/src/{bin/chrome-devtools-mcp-cli-options.js → config/mcp-options.js} +74 -9
  15. package/build/src/daemon/client.js +33 -2
  16. package/build/src/daemon/daemon.js +17 -13
  17. package/build/src/daemon/utils.js +18 -3
  18. package/build/src/devtools/DevtoolsUtils.js +9 -16
  19. package/build/src/formatters/ConsoleFormatter.js +43 -10
  20. package/build/src/formatters/HeapSnapshotFormatter.js +58 -13
  21. package/build/src/formatters/IssueFormatter.js +1 -1
  22. package/build/src/formatters/NetworkFormatter.js +7 -7
  23. package/build/src/index.js +34 -5
  24. package/build/src/{HeapSnapshotManager.js → processors/HeapSnapshotManager.js} +82 -27
  25. package/build/src/{trace-processing/parse.js → processors/PerformanceTrace.js} +1 -1
  26. package/build/src/telemetry/ClearcutLogger.js +16 -1
  27. package/build/src/telemetry/flagUtils.js +4 -3
  28. package/build/src/telemetry/transformation.js +30 -0
  29. package/build/src/telemetry/types.js +4 -0
  30. package/build/src/third_party/THIRD_PARTY_NOTICES +235 -113
  31. package/build/src/third_party/bundled-packages.json +6 -7
  32. package/build/src/third_party/devtools-formatter-worker.js +60 -19
  33. package/build/src/third_party/devtools-heap-snapshot-worker.js +657 -224
  34. package/build/src/third_party/index.js +62484 -43814
  35. package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +2 -2
  36. package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +3 -3
  37. package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +2 -2
  38. package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +1 -1
  39. package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +1 -1
  40. package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +2 -2
  41. package/build/src/third_party/issue-descriptions/LowTextContrast.md +1 -1
  42. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +1 -1
  43. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +1 -1
  44. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +1 -1
  45. package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +1 -1
  46. package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +3 -3
  47. package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +3 -3
  48. package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +1 -1
  49. package/build/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
  50. package/build/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
  51. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
  52. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +2 -2
  53. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +2 -2
  54. package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +3 -3
  55. package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +2 -2
  56. package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +2 -2
  57. package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +1 -1
  58. package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +3 -3
  59. package/build/src/third_party/issue-descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +1 -1
  60. package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +1 -1
  61. package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +1 -1
  62. package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +1 -1
  63. package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +1 -1
  64. package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +1 -1
  65. package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +2 -2
  66. package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +2 -2
  67. package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +1 -1
  68. package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +3 -3
  69. package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +1 -1
  70. package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +1 -1
  71. package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +1 -1
  72. package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +3 -3
  73. package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +2 -2
  74. package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +3 -3
  75. package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +4 -3
  76. package/build/src/third_party/issue-descriptions/cspEvalViolation.md +4 -4
  77. package/build/src/third_party/issue-descriptions/cspInlineViolation.md +2 -2
  78. package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +2 -2
  79. package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +4 -4
  80. package/build/src/third_party/issue-descriptions/cspURLViolation.md +4 -4
  81. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -1
  82. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -1
  83. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -1
  84. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -1
  85. package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -1
  86. package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -1
  87. package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -1
  88. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -1
  89. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -1
  90. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -1
  91. package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -1
  92. package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -1
  93. package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -1
  94. package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -1
  95. package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -1
  96. package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -1
  97. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -1
  98. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -1
  99. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -1
  100. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -1
  101. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -1
  102. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -1
  103. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -1
  104. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -1
  105. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -1
  106. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -1
  107. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -1
  108. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -1
  109. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -1
  110. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -1
  111. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -1
  112. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -1
  113. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -1
  114. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -1
  115. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -1
  116. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -1
  117. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -1
  118. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -1
  119. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -1
  120. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -1
  121. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -1
  122. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -1
  123. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -1
  124. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -1
  125. package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -1
  126. package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -1
  127. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -1
  128. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -1
  129. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -1
  130. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -1
  131. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -1
  132. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -1
  133. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -1
  134. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -1
  135. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -1
  136. package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -1
  137. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
  138. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -1
  139. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -1
  140. package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -1
  141. package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -1
  142. package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -1
  143. package/build/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
  144. package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -1
  145. package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -1
  146. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
  147. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -1
  148. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -1
  149. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -1
  150. package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -1
  151. package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -1
  152. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -1
  153. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -1
  154. package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -1
  155. package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -1
  156. package/build/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
  157. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -1
  158. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -1
  159. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -1
  160. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -1
  161. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -1
  162. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -1
  163. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -1
  164. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -1
  165. package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -1
  166. package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +2 -2
  167. package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +2 -2
  168. package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +1 -1
  169. package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +1 -1
  170. package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +2 -2
  171. package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +2 -2
  172. package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +1 -1
  173. package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +1 -1
  174. package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +2 -2
  175. package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +1 -1
  176. package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +1 -1
  177. package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +1 -1
  178. package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +1 -1
  179. package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +1 -1
  180. package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +2 -2
  181. package/build/src/third_party/issue-descriptions/heavyAd.md +1 -1
  182. package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
  183. package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +3 -3
  184. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +1 -1
  185. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +1 -1
  186. package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +1 -1
  187. package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +2 -2
  188. package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +2 -2
  189. package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +2 -2
  190. package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +1 -1
  191. package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +2 -2
  192. package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +2 -2
  193. package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +2 -2
  194. package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +2 -2
  195. package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +1 -1
  196. package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +2 -2
  197. package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +2 -2
  198. package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +2 -2
  199. package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +1 -1
  200. package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +2 -2
  201. package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +1 -1
  202. package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +1 -1
  203. package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +1 -1
  204. package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +1 -1
  205. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +1 -1
  206. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +1 -1
  207. package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +1 -1
  208. package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +1 -1
  209. package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +3 -3
  210. package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +1 -1
  211. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -1
  212. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +1 -1
  213. package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -1
  214. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -1
  215. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -1
  216. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +1 -1
  217. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +2 -2
  218. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -1
  219. package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +2 -2
  220. package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +4 -4
  221. package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +4 -4
  222. package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +1 -1
  223. package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +2 -2
  224. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +2 -2
  225. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +4 -4
  226. package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +4 -4
  227. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +1 -1
  228. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +2 -2
  229. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +1 -1
  230. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +1 -1
  231. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +2 -2
  232. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +5 -5
  233. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +3 -3
  234. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +2 -2
  235. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +2 -2
  236. package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +2 -2
  237. package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +4 -4
  238. package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +3 -3
  239. package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +2 -2
  240. package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +2 -2
  241. package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +1 -1
  242. package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +1 -1
  243. package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +2 -2
  244. package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +3 -3
  245. package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +2 -2
  246. package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +1 -1
  247. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +1125 -1027
  248. package/build/src/tools/categories.js +3 -0
  249. package/build/src/tools/console.js +9 -3
  250. package/build/src/tools/emulation.js +2 -2
  251. package/build/src/tools/extensions.js +7 -5
  252. package/build/src/tools/input.js +222 -120
  253. package/build/src/tools/lighthouse.js +3 -1
  254. package/build/src/tools/memory.js +144 -17
  255. package/build/src/tools/network.js +6 -3
  256. package/build/src/tools/pages.js +13 -16
  257. package/build/src/tools/performance.js +57 -46
  258. package/build/src/tools/pwa.js +128 -0
  259. package/build/src/tools/screencast.js +6 -4
  260. package/build/src/tools/screenshot.js +192 -84
  261. package/build/src/tools/script.js +118 -34
  262. package/build/src/tools/slim/tools.js +3 -3
  263. package/build/src/tools/snapshot.js +5 -3
  264. package/build/src/tools/thirdPartyDeveloper.js +2 -2
  265. package/build/src/tools/tools.js +2 -0
  266. package/build/src/tools/webmcp.js +2 -2
  267. package/build/src/utils/WaitForHelper.js +299 -0
  268. package/build/src/utils/bytes.js +105 -0
  269. package/build/src/utils/logger.js +25 -11
  270. package/build/src/utils/polyfill.js +6 -3
  271. package/build/src/utils/url.js +43 -0
  272. package/build/src/version.js +1 -1
  273. package/package.json +37 -25
  274. package/skills/a11y-debugging/SKILL.md +2 -0
  275. package/skills/chrome-devtools/SKILL.md +5 -4
  276. package/skills/chrome-devtools-cli/SKILL.md +109 -64
  277. package/skills/debug-optimize-lcp/SKILL.md +9 -9
  278. package/skills/memory-leak-debugging/SKILL.md +14 -18
  279. package/skills/memory-leak-debugging/references/common-leaks.md +1 -1
  280. package/skills/troubleshooting/SKILL.md +1 -0
  281. package/build/src/WaitForHelper.js +0 -200
  282. package/build/src/devtools/DevToolsConnectionAdapter.js +0 -70
  283. package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeRead.md +0 -8
  284. package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeSet.md +0 -8
  285. package/build/src/third_party/issue-descriptions/SameSiteExcludeNavigationContextDowngrade.md +0 -8
  286. package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeRead.md +0 -8
  287. package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeSet.md +0 -8
  288. package/build/src/third_party/issue-descriptions/SameSiteWarnStrictLaxDowngradeStrict.md +0 -8
  289. package/build/src/third_party/issue-descriptions/arInsecureContext.md +0 -7
  290. package/build/src/third_party/issue-descriptions/arInvalidInfoHeader.md +0 -5
  291. package/build/src/third_party/issue-descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  292. package/build/src/third_party/issue-descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  293. package/build/src/third_party/issue-descriptions/arInvalidRegisterSourceHeader.md +0 -5
  294. package/build/src/third_party/issue-descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  295. package/build/src/third_party/issue-descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  296. package/build/src/third_party/issue-descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  297. package/build/src/third_party/issue-descriptions/arNoRegisterOsSourceHeader.md +0 -5
  298. package/build/src/third_party/issue-descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  299. package/build/src/third_party/issue-descriptions/arNoRegisterSourceHeader.md +0 -5
  300. package/build/src/third_party/issue-descriptions/arNoRegisterTriggerHeader.md +0 -5
  301. package/build/src/third_party/issue-descriptions/arNoWebOrOsSupport.md +0 -4
  302. package/build/src/third_party/issue-descriptions/arOsSourceIgnored.md +0 -18
  303. package/build/src/third_party/issue-descriptions/arOsTriggerIgnored.md +0 -19
  304. package/build/src/third_party/issue-descriptions/arPermissionPolicyDisabled.md +0 -8
  305. package/build/src/third_party/issue-descriptions/arSourceAndTriggerHeaders.md +0 -9
  306. package/build/src/third_party/issue-descriptions/arSourceIgnored.md +0 -13
  307. package/build/src/third_party/issue-descriptions/arTriggerIgnored.md +0 -12
  308. package/build/src/third_party/issue-descriptions/arUntrustworthyReportingOrigin.md +0 -10
  309. package/build/src/third_party/issue-descriptions/arWebAndOsHeaders.md +0 -11
  310. package/build/src/utils/Mutex.js +0 -38
  311. package/build/src/utils/string.js +0 -37
  312. package/skills/memory-leak-debugging/references/compare_snapshots.js +0 -109
  313. package/skills/memory-leak-debugging/references/memlab.md +0 -29
@@ -11,9 +11,9 @@ _Note: If this is your very first time using the CLI, see [references/installati
11
11
 
12
12
  ## AI Workflow
13
13
 
14
- 1. **Execute**: Run tools directly (e.g., `chrome-devtools list_pages`). The background server starts implicitly; **do not** run `start`/`status`/`stop` before each use.
15
- 2. **Inspect**: Use `take_snapshot` to get an element `<uid>`.
16
- 3. **Act**: Use `click`, `fill`, etc. State persists across commands.
14
+ 1. **Execute**: Run tools directly. If you don't know the target page's ID, run `chrome-devtools list_pages` to find it. The background server starts implicitly; **do not** run `start`/`status`/`stop` before each use.
15
+ 2. **Inspect**: Use `chrome-devtools take_snapshot <pageId>` to get an element `<uid>`.
16
+ 3. **Act**: Use `chrome-devtools click <pageId> <uid>`, `chrome-devtools fill <pageId> <uid> <value>`, etc. State persists across commands.
17
17
 
18
18
  Snapshot example:
19
19
 
@@ -22,35 +22,45 @@ uid=1_0 RootWebArea "Example Domain" url="https://example.com/"
22
22
  uid=1_1 heading "Example Domain" level="1"
23
23
  ```
24
24
 
25
+ ## Permissions & File Access
26
+
27
+ By default, the server only has access to the **OS temp directory** (as defined by Node APIs, `os.tmpdir()`). File-saving parameters (`--filePath`, `--outputDirPath`) and `upload_file` outside the temp directory require unrestricted filesystem access:
28
+
29
+ ```bash
30
+ # Start daemon with full filesystem access
31
+ chrome-devtools start --allowUnrestrictedPaths=true
32
+ ```
33
+
25
34
  ## Command Usage
26
35
 
27
36
  ```sh
28
37
  chrome-devtools <tool> [arguments] [flags]
29
38
  ```
30
39
 
31
- Use `--help` on any command. Output defaults to Markdown, use `--output-format=json` for JSON.
40
+ - Required arguments are passed positionally; optional arguments use flags.
41
+ - Use `--help` on any command for usage details.
42
+ - Output defaults to plain Markdown-like text; pass `--output-format=json` for JSON.
32
43
 
33
44
  ## Input Automation (<uid> from snapshot)
34
45
 
35
46
  ```bash
36
- chrome-devtools take_snapshot --help # Help message for commands, works for any command.
37
- chrome-devtools take_snapshot # Take a text snapshot of the page to get UIDs for elements
38
- chrome-devtools click "id" # Clicks on the provided element
39
- chrome-devtools click "id" --dblClick true --includeSnapshot true # Double clicks and returns a snapshot
40
- chrome-devtools drag "src" "dst" # Drag an element onto another element
41
- chrome-devtools drag "src" "dst" --includeSnapshot true # Drag an element and return a snapshot
42
- chrome-devtools fill "id" "text" # Type text into an input or select an option
43
- chrome-devtools fill "id" "text" --includeSnapshot true # Fill an element and return a snapshot
44
- chrome-devtools handle_dialog accept # Handle a browser dialog
45
- chrome-devtools handle_dialog dismiss --promptText "hi" # Dismiss a dialog with prompt text
46
- chrome-devtools hover "id" # Hover over the provided element
47
- chrome-devtools hover "id" --includeSnapshot true # Hover over an element and return a snapshot
48
- chrome-devtools press_key "Enter" # Press a key or key combination
49
- chrome-devtools press_key "Control+A" --includeSnapshot true # Press a key and return a snapshot
50
- chrome-devtools type_text "hello" # Type text using keyboard into a focused input
51
- chrome-devtools type_text "hello" --submitKey "Enter" # Type text and press a submit key
52
- chrome-devtools upload_file "id" "file.txt" # Upload a file through a provided element
53
- chrome-devtools upload_file "id" "file.txt" --includeSnapshot true # Upload a file and return a snapshot
47
+ chrome-devtools take_snapshot 1 # Take a text snapshot of the page to get UIDs for elements
48
+ chrome-devtools click 1 "id" # Clicks on the provided element
49
+ chrome-devtools click 1 "id" --dblClick true --includeSnapshot true # Double clicks and returns a snapshot
50
+ chrome-devtools drag 1 "src" "dst" # Drag an element onto another element
51
+ chrome-devtools drag 1 "src" "dst" --includeSnapshot true # Drag an element and return a snapshot
52
+ chrome-devtools fill 1 "id" "text" # Type text into an input, textarea, or select an option
53
+ chrome-devtools fill 1 "id" "text" --includeSnapshot true # Fill an element and return a snapshot
54
+ chrome-devtools handle_dialog 1 accept # Handle a browser dialog (accept/dismiss)
55
+ chrome-devtools handle_dialog 1 dismiss --promptText "hi" # Dismiss a dialog with prompt text
56
+ chrome-devtools hover 1 "id" # Hover over the provided element
57
+ chrome-devtools hover 1 "id" --includeSnapshot true # Hover over an element and return a snapshot
58
+ chrome-devtools press_key 1 "Enter" # Press a key or key combination ("Control+A", "Escape")
59
+ chrome-devtools press_key 1 "Control+A" --includeSnapshot true # Press a key and return a snapshot
60
+ chrome-devtools type_text 1 "hello" # Type text using keyboard into a focused input
61
+ chrome-devtools type_text 1 "hello" --submitKey "Enter" # Type text and press a submit key
62
+ chrome-devtools upload_file 1 "id" "file.txt" # Upload a file through a provided element
63
+ chrome-devtools upload_file 1 "id" "file.txt" --includeSnapshot true # Upload a file and return a snapshot
54
64
  ```
55
65
 
56
66
  ## Navigation
@@ -58,11 +68,11 @@ chrome-devtools upload_file "id" "file.txt" --includeSnapshot true # Upload a fi
58
68
  ```bash
59
69
  chrome-devtools close_page 1 # Closes the page by its index
60
70
  chrome-devtools list_pages # Get a list of pages open in the browser
61
- chrome-devtools navigate_page --url "https://example.com" # Navigates the currently selected page to a URL
62
- chrome-devtools navigate_page --type "reload" --ignoreCache true # Reload page ignoring cache
63
- chrome-devtools navigate_page --url "https://example.com" --timeout 5000 # Navigate with a timeout
64
- chrome-devtools navigate_page --handleBeforeUnload "accept" # Handle before unload dialog
65
- chrome-devtools navigate_page --type "back" --initScript "foo()" # Navigate back and run an init script
71
+ chrome-devtools navigate_page 1 --url "https://example.com" # Navigates the currently selected page to a URL
72
+ chrome-devtools navigate_page 1 --type "reload" --ignoreCache true # Reload page ignoring cache
73
+ chrome-devtools navigate_page 1 --url "https://example.com" --timeout 5000 # Navigate with a timeout
74
+ chrome-devtools navigate_page 1 --handleBeforeUnload "accept" # Handle before unload dialog
75
+ chrome-devtools navigate_page 1 --type "back" --initScript "foo()" # Navigate back and run an init script
66
76
  chrome-devtools new_page "https://example.com" # Creates a new page
67
77
  chrome-devtools new_page "https://example.com" --background true --timeout 5000 # Create new page in background
68
78
  chrome-devtools new_page "https://example.com" --isolatedContext "ctx" # Create new page with isolated context
@@ -73,54 +83,75 @@ chrome-devtools select_page 1 --bringToFront true # Select a page and bring it t
73
83
  ## Emulation
74
84
 
75
85
  ```bash
76
- chrome-devtools emulate --networkConditions "Offline" # Emulate network conditions
77
- chrome-devtools emulate --cpuThrottlingRate 4 --geolocation "0x0" # Emulate CPU throttling and geolocation
78
- chrome-devtools emulate --colorScheme "dark" --viewport "1920x1080" # Emulate color scheme and viewport
79
- chrome-devtools emulate --userAgent "Mozilla/5.0..." # Emulate user agent
80
- chrome-devtools resize_page 1920 1080 # Resizes the selected page's window
86
+ chrome-devtools emulate 1 --networkConditions "Offline" # Emulate network conditions
87
+ chrome-devtools emulate 1 --cpuThrottlingRate 4 --geolocation "0x0" # Emulate CPU throttling and geolocation
88
+ chrome-devtools emulate 1 --colorScheme "dark" --viewport "1920x1080" # Emulate color scheme and viewport
89
+ chrome-devtools emulate 1 --userAgent "Mozilla/5.0..." # Emulate user agent
90
+ chrome-devtools resize_page 1 1920 1080 # Resizes the selected page's window
81
91
  ```
82
92
 
83
93
  ## Performance
84
94
 
85
95
  ```bash
86
- chrome-devtools performance_analyze_insight "1" "LCPBreakdown" # Get more details on a specific Performance Insight
87
- chrome-devtools performance_start_trace true false # Starts a performance trace recording
88
- chrome-devtools performance_start_trace true true --filePath t.gz # Start trace and save to a file
89
- chrome-devtools performance_stop_trace # Stops the active performance trace
90
- chrome-devtools performance_stop_trace --filePath "t.json" # Stop trace and save to a file
91
- chrome-devtools take_memory_snapshot "./snap.heapsnapshot" # Capture a memory heapsnapshot
96
+ chrome-devtools performance_analyze_insight 1 "1" "LCPBreakdown" # Get more details on a specific Performance Insight (pageId, insightSetId, insightName)
97
+ chrome-devtools performance_start_trace 1 --reload true --autoStop false # Starts a performance trace recording (reload, autoStop)
98
+ chrome-devtools performance_start_trace 1 --reload true --autoStop true --filePath "t.json.gz" # Start trace and save to a file
99
+ chrome-devtools performance_stop_trace 1 # Stops the active performance trace
100
+ chrome-devtools performance_stop_trace 1 --filePath "t.json.gz" # Stop trace and save to a file
101
+ ```
102
+
103
+ ## Memory
104
+
105
+ ```bash
106
+ chrome-devtools take_heapsnapshot 1 "./snap.heapsnapshot" # Capture a memory heap snapshot
107
+ ```
108
+
109
+ ### Memory Debugging (requires `--memoryDebugging=true`)
110
+
111
+ ```bash
112
+ chrome-devtools get_heapsnapshot_summary "./snap.heapsnapshot" # Get snapshot summary stats
113
+ chrome-devtools compare_heapsnapshots "./base.heapsnapshot" "./target.heapsnapshot" # Compare two snapshots
114
+ chrome-devtools get_heapsnapshot_class_nodes "./snap.heapsnapshot" "Array" # Inspect class instances
115
+ chrome-devtools get_heapsnapshot_details "./snap.heapsnapshot" 123 # Detailed object properties
116
+ chrome-devtools get_heapsnapshot_dominators "./snap.heapsnapshot" 123 # Dominator tree for node
117
+ chrome-devtools get_heapsnapshot_duplicate_strings "./snap.heapsnapshot" # Find duplicated strings
118
+ chrome-devtools get_heapsnapshot_edges "./snap.heapsnapshot" 123 # Node edges/references
119
+ chrome-devtools get_heapsnapshot_object_details "./snap.heapsnapshot" 123 # Object details by node ID
120
+ chrome-devtools get_heapsnapshot_retainers "./snap.heapsnapshot" 123 # Retaining objects
121
+ chrome-devtools get_heapsnapshot_retaining_paths "./snap.heapsnapshot" 123 # Shortest retaining paths
122
+ chrome-devtools close_heapsnapshot "./snap.heapsnapshot" # Free memory from loaded snapshot
92
123
  ```
93
124
 
94
125
  ## Network
95
126
 
96
127
  ```bash
97
- chrome-devtools get_network_request # Get the currently selected network request
98
- chrome-devtools get_network_request --reqid 1 --requestFilePath req.md # Get request by id and save to file
99
- chrome-devtools get_network_request --responseFilePath res.md # Save response body to file
100
- chrome-devtools list_network_requests # List all network requests
101
- chrome-devtools list_network_requests --pageSize 50 --pageIdx 0 # List network requests with pagination
102
- chrome-devtools list_network_requests --resourceTypes Fetch # Filter requests by resource type
103
- chrome-devtools list_network_requests --includePreservedRequests true # Include preserved requests
128
+ chrome-devtools get_network_request 1 # Get the currently selected network request for page 1
129
+ chrome-devtools get_network_request 1 --reqid 1 --requestFilePath "req.md" # Get request by id and save to file
130
+ chrome-devtools get_network_request 1 --responseFilePath "res.md" # Save response body to file
131
+ chrome-devtools list_network_requests 1 # List all network requests for page 1
132
+ chrome-devtools list_network_requests 1 --pageSize 50 --pageIdx 0 # List network requests with pagination
133
+ chrome-devtools list_network_requests 1 --resourceTypes Fetch # Filter requests by resource type
134
+ chrome-devtools list_network_requests 1 --includePreservedRequests true # Include preserved requests
104
135
  ```
105
136
 
106
137
  ## Debugging & Inspection
107
138
 
108
139
  ```bash
109
- chrome-devtools evaluate_script "() => document.title" # Evaluate a JavaScript function on the page
110
- chrome-devtools evaluate_script "(a) => a.innerText" --args 1_4 # Evaluate JS with UID arguments
111
- chrome-devtools get_console_message 1 # Gets a console message by its ID
112
- chrome-devtools lighthouse_audit --mode "navigation" # Run Lighthouse audit for navigation
113
- chrome-devtools lighthouse_audit --mode "snapshot" --device "mobile" # Run Lighthouse audit for a snapshot on mobile
114
- chrome-devtools lighthouse_audit --outputDirPath ./out # Run Lighthouse audit and save reports
115
- chrome-devtools list_console_messages # List all console messages
116
- chrome-devtools list_console_messages --pageSize 20 --pageIdx 1 # List console messages with pagination
117
- chrome-devtools list_console_messages --types error --types info # Filter console messages by type
118
- chrome-devtools list_console_messages --includePreservedMessages true # Include preserved messages
119
- chrome-devtools take_screenshot # Take a screenshot of the page viewport
120
- chrome-devtools take_screenshot --fullPage true --format "jpeg" --quality 80 # Take a full page screenshot as JPEG with quality
121
- chrome-devtools take_screenshot --uid "id" --filePath "s.png" # Take a screenshot of an element
122
- chrome-devtools take_snapshot # Take a text snapshot of the page from the a11y tree
123
- chrome-devtools take_snapshot --verbose true --filePath "s.txt" # Take a verbose snapshot and save to file
140
+ chrome-devtools evaluate_script "() => document.title" --pageId 1 # Evaluate a JavaScript function on page 1
141
+ chrome-devtools evaluate_script "(a) => a.innerText" --pageId 1 --args 1_4 # Evaluate JS with UID arguments on page 1
142
+ chrome-devtools get_console_message 1 1 # Gets a console message by its ID
143
+ chrome-devtools lighthouse_audit 1 --mode "navigation" # Run Lighthouse audit for navigation
144
+ chrome-devtools lighthouse_audit 1 --mode "snapshot" --device "mobile" # Run Lighthouse audit for a snapshot on mobile
145
+ chrome-devtools lighthouse_audit 1 --outputDirPath ./out # Run Lighthouse audit and save reports
146
+ chrome-devtools list_console_messages 1 # List all console messages
147
+ chrome-devtools list_console_messages 1 --pageSize 20 --pageIdx 1 # List console messages with pagination
148
+ chrome-devtools list_console_messages 1 --types error --types info # Filter console messages by type
149
+ chrome-devtools list_console_messages 1 --includePreservedMessages true # Include preserved messages
150
+ chrome-devtools take_screenshot 1 # Take a screenshot of the page viewport
151
+ chrome-devtools take_screenshot 1 --fullPage true --format "jpeg" --quality 80 # Take a full page screenshot as JPEG with quality
152
+ chrome-devtools take_screenshot 1 --uid "id" --filePath "s.png" # Take a screenshot of an element
153
+ chrome-devtools take_snapshot 1 # Take a text snapshot of the page from the a11y tree
154
+ chrome-devtools take_snapshot 1 --verbose true --filePath "s.txt" # Take a verbose snapshot and save to file
124
155
  ```
125
156
 
126
157
  ## Extensions
@@ -133,21 +164,35 @@ chrome-devtools reload_extension "extension_id" # Reloads an unpacked Chrome ext
133
164
  chrome-devtools trigger_extension_action "extension_id" # Triggers the default action of an extension by its ID
134
165
  ```
135
166
 
167
+ ## Progressive Web Apps (requires `--categoryPwa=true`)
168
+
169
+ ```bash
170
+ chrome-devtools install_pwa "https://example.com/" # Install PWA by manifest ID or URL
171
+ chrome-devtools launch_pwa "https://example.com/" # Launch installed PWA
172
+ chrome-devtools get_os_app_state "https://example.com/" # Get OS app installation state
173
+ chrome-devtools uninstall_pwa "https://example.com/" # Uninstall PWA and close windows
174
+ ```
175
+
136
176
  ## Experimental Features
137
177
 
138
178
  Experimental tools are disabled by default. Enable them with the corresponding flag during `start`.
139
179
 
140
180
  ```bash
141
- chrome-devtools click_at 100 200 # Clicks at the provided coordinates (requires --experimentalVision=true)
142
- chrome-devtools screencast_start # Starts a screencast recording (requires --experimentalScreencast=true and ffmpeg)
143
- chrome-devtools screencast_stop # Stops the active screencast
144
- chrome-devtools list_webmcp_tools # List all WebMCP tools (requires --categoryExperimentalWebmcp=true)
181
+ chrome-devtools click_at 1 100 200 # Clicks at the provided coordinates on page 1 (requires --experimentalVision=true)
182
+ chrome-devtools screencast_start 1 --filePath "screen.mp4" # Starts a screencast recording on page 1 (requires --experimentalScreencast=true and ffmpeg)
183
+ chrome-devtools screencast_stop 1 # Stops the active screencast on page 1
184
+ chrome-devtools list_webmcp_tools 1 # List all WebMCP tools on page 1 (requires --categoryExperimentalWebmcp=true)
185
+ chrome-devtools execute_webmcp_tool 1 "tool_name" --input '{"arg":"val"}' # Execute a WebMCP tool on page 1 (requires --categoryExperimentalWebmcp=true)
186
+ chrome-devtools list_3p_developer_tools 1 # List third-party developer tools on page 1 (requires --categoryExperimentalThirdParty=true)
187
+ chrome-devtools execute_3p_developer_tool 1 "tool_name" --params '{"arg":"val"}' # Execute third-party developer tool on page 1 (requires --categoryExperimentalThirdParty=true)
145
188
  ```
146
189
 
147
190
  ## Service Management
148
191
 
149
192
  ```bash
150
193
  chrome-devtools start # Start or restart chrome-devtools-mcp
194
+ chrome-devtools start --allowUnrestrictedPaths=true # Start with full filesystem access
195
+ chrome-devtools start --headless=false # Start with visible browser window
151
196
  chrome-devtools status # Checks if chrome-devtools-mcp is running
152
197
  chrome-devtools stop # Stop chrome-devtools-mcp if any
153
198
  ```
@@ -36,8 +36,8 @@ Follow these steps in order. Each step builds on the previous one.
36
36
 
37
37
  Navigate to the page, then record a trace with reload to capture the full page load including LCP:
38
38
 
39
- 1. `navigate_page` to the target URL.
40
- 2. `performance_start_trace` with `reload: true` and `autoStop: true`.
39
+ 1. `navigate_page` with `pageId` to the target URL.
40
+ 2. `performance_start_trace` with `pageId`, `reload: true` and `autoStop: true`.
41
41
 
42
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
43
 
@@ -50,11 +50,11 @@ Use `performance_analyze_insight` to drill into LCP-specific insights. Look for
50
50
  - **RenderBlocking** — Resources blocking the LCP element from rendering.
51
51
  - **LCPDiscovery** — Whether the LCP resource was discoverable early.
52
52
 
53
- Call `performance_analyze_insight` with the insight set ID and the insight name from the trace results.
53
+ Call `performance_analyze_insight` with `pageId`, the insight set ID, and the insight name from the trace results.
54
54
 
55
55
  ### Step 3: Identify the LCP Element
56
56
 
57
- Use `evaluate_script` with 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.
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
58
 
59
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
60
 
@@ -62,8 +62,8 @@ The `url` field tells you what resource to look for in the network waterfall. If
62
62
 
63
63
  Use `list_network_requests` to see when the LCP resource loaded relative to other resources:
64
64
 
65
- - Call `list_network_requests` filtered by `resourceTypes: ["Image", "Font"]` (adjust based on Step 3).
66
- - Then use `get_network_request` with the LCP resource's request ID for full details.
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
67
 
68
68
  **Key Checks:**
69
69
 
@@ -72,7 +72,7 @@ Use `list_network_requests` to see when the LCP resource loaded relative to othe
72
72
 
73
73
  ### Step 5: Inspect HTML for Common Issues
74
74
 
75
- Use `evaluate_script` with 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.
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
76
 
77
77
  ## Optimization Strategies
78
78
 
@@ -115,7 +115,7 @@ The HTML document itself takes too long to arrive.
115
115
 
116
116
  ## Verifying Fixes & Emulation
117
117
 
118
- - **Verification**: Re-run the trace (`performance_start_trace` with `reload: true`) and compare the new subpart breakdown. The bottleneck should shrink.
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
119
  - **Emulation**: Lab measurements differ from real-world experience. Use `emulate` to test under constraints:
120
- - `emulate` with `networkConditions: "Fast 3G"` and `cpuThrottlingRate: 4`.
120
+ - `emulate` with `pageId`, `networkConditions: "Fast 3G"` and `cpuThrottlingRate: 4`.
121
121
  - This surfaces issues visible only on slower connections/devices.
@@ -5,7 +5,7 @@ description: Diagnoses and resolves memory leaks in JavaScript/Node.js applicati
5
5
 
6
6
  # Memory Leak Debugging
7
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.
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
9
 
10
10
  ## Core Principles
11
11
 
@@ -20,39 +20,35 @@ This skill provides expert guidance and workflows for finding, diagnosing, and f
20
20
 
21
21
  When investigating a frontend web application memory leak, utilize the `chrome-devtools-mcp` tools to interact with the application and take snapshots.
22
22
 
23
- - Use tools like `click`, `navigate_page`, `fill`, etc., to manipulate the page into the desired state.
23
+ - Use page-scoped tools like `click`, `navigate_page`, `fill`, etc. (specifying `pageId`) to manipulate the page into the desired state.
24
24
  - Revert the page back to the original state after interactions to see if memory is released.
25
25
  - Repeat the same user interactions 10 times to amplify the leak.
26
- - Use `take_heapsnapshot` to save `.heapsnapshot` files to disk at baseline, target (after actions), and final (after reverting actions) states.
26
+ - Use `take_heapsnapshot` (with `pageId`) to save `.heapsnapshot` files to disk at baseline, target (after actions), and final (after reverting actions) states.
27
27
 
28
28
  ### 2. Comparing Snapshots
29
29
 
30
30
  Once you have generated `.heapsnapshot` files using `take_heapsnapshot`, compare them with Chrome DevTools MCP memory tools.
31
31
 
32
32
  - Start with `get_heapsnapshot_summary` for each snapshot to confirm that the files load and to compare high-level totals.
33
- - 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.
33
+ - 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`.
34
34
  - Use the summary output from `compare_heapsnapshots` before drilling into specific node IDs.
35
35
 
36
- ### 3. Inspecting Retainers
36
+ ### 3. Inspecting Retainers and Dominator Chains
37
37
 
38
- When a class or object type grows unexpectedly, inspect the retaining chain with the MCP tools before changing code.
38
+ When a class or object type grows unexpectedly, inspect the retaining chain and dominators with the MCP tools before changing code.
39
39
 
40
40
  - Use `get_heapsnapshot_class_nodes` to list instances of the suspicious class.
41
41
  - Use `get_heapsnapshot_retainers`, `get_heapsnapshot_retaining_paths`, `get_heapsnapshot_dominators`, and `get_heapsnapshot_edges` to understand why representative nodes are still reachable.
42
+ - Use `get_heapsnapshot_object_details` with a specific `nodeId` to retrieve detailed object metadata (size, type, distance, and DOM detachedness).
42
43
  - Use `get_heapsnapshot_duplicate_strings` when string growth dominates the diff.
43
44
  - 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.
44
45
 
45
- ### 4. External Tool Fallback
46
+ ### 4. Advanced Analysis and Categorized Filters
46
47
 
47
- If the built-in MCP memory tools are not enough, use external tools as a fallback rather than reading raw snapshots directly.
48
+ Use built-in MCP memory tools and filters to pinpoint specific leak categories directly without external tools.
48
49
 
49
- - Read [references/memlab.md](references/memlab.md) for how to use `memlab` to analyze generated heap snapshots.
50
- - If `memlab` is not available, use the fallback script in the references directory to compare two `.heapsnapshot` files and identify the top growing objects and common leak types.
51
-
52
- Run the fallback script using Node.js:
53
-
54
- ```bash
55
- node skills/memory-leak-debugging/references/compare_snapshots.js <baseline.heapsnapshot> <target.heapsnapshot>
56
- ```
57
-
58
- The script will analyze and output the top growing objects by size and highlight the 3 most common types of memory leaks (for example, detached DOM nodes, closures, and contexts) if they are present.
50
+ - Use `get_heapsnapshot_details` or `get_heapsnapshot_class_nodes` with `filterName` to target common leak causes:
51
+ - `objectsRetainedByDetachedDomNodes`: Identifies detached DOM elements retained in memory.
52
+ - `objectsRetainedByEventHandlers`: Identifies objects kept alive by unremoved event listeners.
53
+ - `objectsRetainedByContexts`: Identifies objects trapped in closures or execution contexts.
54
+ - `objectsRetainedByConsole`: Identifies objects retained by console logging.
@@ -1,6 +1,6 @@
1
1
  # Common Memory Leaks
2
2
 
3
- When analyzing a retainer trace from `memlab`, look for these common patterns in the codebase:
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
4
 
5
5
  ## 1. Uncleared Event Listeners
6
6
 
@@ -60,6 +60,7 @@ Identify other error messages from the failed tool call or the MCP initializatio
60
60
 
61
61
  - `Target closed`
62
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.
63
64
  - `ProtocolError: Network.enable timed out` or `The socket connection was closed unexpectedly`
64
65
  - `Error [ERR_MODULE_NOT_FOUND]: Cannot find module`
65
66
  - Any sandboxing or host validation errors.
@@ -1,200 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { logger } from './utils/logger.js';
7
- export class WaitForHelper {
8
- #abortController = new AbortController();
9
- #page;
10
- #stableDomTimeout;
11
- #stableDomFor;
12
- #expectNavigationIn;
13
- #navigationTimeout;
14
- #dialogOpened = false;
15
- #initialUrl;
16
- constructor(page, cpuTimeoutMultiplier, networkTimeoutMultiplier) {
17
- this.#stableDomTimeout = 3000 * cpuTimeoutMultiplier;
18
- this.#stableDomFor = 100 * cpuTimeoutMultiplier;
19
- this.#expectNavigationIn = 100 * cpuTimeoutMultiplier;
20
- this.#navigationTimeout = 3000 * networkTimeoutMultiplier;
21
- this.#page = page;
22
- this.#initialUrl = page.url();
23
- }
24
- /**
25
- * A wrapper that executes a action and waits for
26
- * a potential navigation, after which it waits
27
- * for the DOM to be stable before returning.
28
- */
29
- async waitForStableDom() {
30
- const stableDomObserver = await this.#page.evaluateHandle(timeout => {
31
- let timeoutId;
32
- function callback() {
33
- clearTimeout(timeoutId);
34
- timeoutId = setTimeout(() => {
35
- domObserver.resolver.resolve();
36
- domObserver.observer.disconnect();
37
- }, timeout);
38
- }
39
- const domObserver = {
40
- resolver: Promise.withResolvers(),
41
- observer: new MutationObserver(callback),
42
- };
43
- // It's possible that the DOM is not gonna change so we
44
- // need to start the timeout initially.
45
- callback();
46
- domObserver.observer.observe(document.body, {
47
- childList: true,
48
- subtree: true,
49
- attributes: true,
50
- });
51
- return domObserver;
52
- }, this.#stableDomFor);
53
- this.#abortController.signal.addEventListener('abort', async () => {
54
- try {
55
- await stableDomObserver.evaluate(observer => {
56
- observer.observer.disconnect();
57
- observer.resolver.resolve();
58
- });
59
- await stableDomObserver.dispose();
60
- }
61
- catch {
62
- // Ignored cleanup errors
63
- }
64
- });
65
- return Promise.race([
66
- stableDomObserver.evaluate(async (observer) => {
67
- return await observer.resolver.promise;
68
- }),
69
- this.timeout(this.#stableDomTimeout).then(() => {
70
- throw new Error('Timeout');
71
- }),
72
- ]);
73
- }
74
- async waitForNavigationStarted() {
75
- // Currently Puppeteer does not have API
76
- // For when a navigation is about to start
77
- const navigationStartedPromise = new Promise(resolve => {
78
- const listener = (event) => {
79
- if ([
80
- 'historySameDocument',
81
- 'historyDifferentDocument',
82
- 'sameDocument',
83
- ].includes(event.navigationType)) {
84
- resolve(false);
85
- return;
86
- }
87
- resolve(true);
88
- };
89
- this.#page._client().on('Page.frameStartedNavigating', listener);
90
- this.#abortController.signal.addEventListener('abort', () => {
91
- resolve(false);
92
- this.#page._client().off('Page.frameStartedNavigating', listener);
93
- });
94
- });
95
- return await Promise.race([
96
- navigationStartedPromise,
97
- this.timeout(this.#expectNavigationIn).then(() => false),
98
- ]);
99
- }
100
- timeout(time) {
101
- return new Promise(res => {
102
- const id = setTimeout(res, time);
103
- this.#abortController.signal.addEventListener('abort', () => {
104
- res();
105
- clearTimeout(id);
106
- });
107
- });
108
- }
109
- async waitForEventsAfterAction(action, options) {
110
- if (this.#abortController.signal.aborted) {
111
- throw new Error("Can't re-use a WaitForHelper");
112
- }
113
- if (options?.handleDialog) {
114
- const dialogHandler = (dialog) => {
115
- let actionToTake;
116
- if (typeof options.handleDialog === 'object') {
117
- actionToTake = options.handleDialog[dialog.type()];
118
- }
119
- else {
120
- actionToTake = options.handleDialog;
121
- }
122
- if (actionToTake) {
123
- this.#dialogOpened = true;
124
- if (actionToTake === 'dismiss') {
125
- void dialog.dismiss();
126
- }
127
- else if (actionToTake === 'accept') {
128
- void dialog.accept();
129
- }
130
- else {
131
- void dialog.accept(actionToTake);
132
- }
133
- }
134
- };
135
- this.#page.on('dialog', dialogHandler);
136
- this.#abortController.signal.addEventListener('abort', () => {
137
- this.#page.off('dialog', dialogHandler);
138
- });
139
- }
140
- const navigationFinished = this.waitForNavigationStarted()
141
- .then(navigationStated => {
142
- if (navigationStated) {
143
- return this.#page.waitForNavigation({
144
- timeout: options?.timeout ?? this.#navigationTimeout,
145
- signal: this.#abortController.signal,
146
- });
147
- }
148
- return;
149
- })
150
- .catch(error => logger?.(error));
151
- try {
152
- await action();
153
- }
154
- catch (error) {
155
- // Clear up pending promises
156
- this.#abortController.abort();
157
- throw error;
158
- }
159
- try {
160
- await navigationFinished;
161
- if (this.#dialogOpened) {
162
- return this.#getResult();
163
- }
164
- // Wait for stable dom after navigation so we execute in
165
- // the correct context
166
- await this.waitForStableDom();
167
- }
168
- catch (error) {
169
- logger?.(error);
170
- }
171
- finally {
172
- this.#abortController.abort();
173
- }
174
- return this.#getResult();
175
- }
176
- #getResult() {
177
- const urlAfterAction = this.#page.url();
178
- return {
179
- ...(urlAfterAction !== this.#initialUrl
180
- ? { navigatedToUrl: urlAfterAction }
181
- : {}),
182
- dialogHandled: this.#dialogOpened,
183
- };
184
- }
185
- }
186
- export function getNetworkMultiplierFromString(condition) {
187
- const puppeteerCondition = condition;
188
- switch (puppeteerCondition) {
189
- case 'Fast 4G':
190
- return 1;
191
- case 'Slow 4G':
192
- return 2.5;
193
- case 'Fast 3G':
194
- return 5;
195
- case 'Slow 3G':
196
- return 10;
197
- }
198
- return 1;
199
- }
200
- //# sourceMappingURL=WaitForHelper.js.map