@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,80 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { zod } from '../third_party/index.js';
7
+ export function defineTool(definition) {
8
+ return definition;
9
+ }
10
+ export function definePageTool(definition) {
11
+ return (args) => {
12
+ const tool = definition(args);
13
+ return {
14
+ ...tool,
15
+ schema: {
16
+ ...(args.pageIdRouting && !args.slim ? pageIdSchema : {}),
17
+ ...tool.schema,
18
+ },
19
+ pageScoped: true,
20
+ };
21
+ };
22
+ }
23
+ export const CLOSE_PAGE_ERROR = 'The last open page cannot be closed. It is fine to keep it open.';
24
+ export const pageIdSchema = {
25
+ pageId: zod.number().describe('Targets a specific page by ID.'),
26
+ };
27
+ export const timeoutSchema = {
28
+ timeout: zod
29
+ .number()
30
+ .int()
31
+ .transform(value => {
32
+ return value <= 0 ? undefined : value;
33
+ })
34
+ .optional()
35
+ .describe(`Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`),
36
+ };
37
+ export function viewportTransform(arg) {
38
+ if (!arg) {
39
+ return undefined;
40
+ }
41
+ const [dimensions, ...tags] = arg.split(',');
42
+ const isMobile = tags.includes('mobile');
43
+ const hasTouch = tags.includes('touch');
44
+ const isLandscape = tags.includes('landscape');
45
+ const [width, height, dpr] = dimensions.split('x').map(Number);
46
+ if (!Number.isFinite(width) || width <= 0) {
47
+ throw new Error(`Invalid viewport width "${width}". Expected format '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]' with a positive width.`);
48
+ }
49
+ if (!Number.isFinite(height) || height <= 0) {
50
+ throw new Error(`Invalid viewport height "${height}". Expected format '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]' with a positive height.`);
51
+ }
52
+ if (dpr !== undefined && (!Number.isFinite(dpr) || dpr <= 0)) {
53
+ throw new Error(`Invalid devicePixelRatio "${dpr}". Expected a positive number.`);
54
+ }
55
+ return {
56
+ width,
57
+ height,
58
+ deviceScaleFactor: dpr,
59
+ isMobile: isMobile,
60
+ isLandscape: isLandscape,
61
+ hasTouch: hasTouch,
62
+ };
63
+ }
64
+ export function geolocationTransform(arg) {
65
+ if (!arg) {
66
+ return undefined;
67
+ }
68
+ const [latitude, longitude] = arg.split(',').map(Number);
69
+ if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) {
70
+ throw new Error(`Invalid latitude "${latitude}". Latitude must be a number between -90 and 90.`);
71
+ }
72
+ if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180) {
73
+ throw new Error(`Invalid longitude "${longitude}". Longitude must be a number between -180 and 180.`);
74
+ }
75
+ return {
76
+ latitude,
77
+ longitude,
78
+ };
79
+ }
80
+ //# sourceMappingURL=ToolDefinition.js.map
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export var ToolCategory;
7
+ (function (ToolCategory) {
8
+ ToolCategory["INPUT"] = "input";
9
+ ToolCategory["NAVIGATION"] = "navigation";
10
+ ToolCategory["EMULATION"] = "emulation";
11
+ ToolCategory["PERFORMANCE"] = "performance";
12
+ ToolCategory["NETWORK"] = "network";
13
+ ToolCategory["DEBUGGING"] = "debugging";
14
+ ToolCategory["EXTENSIONS"] = "extensions";
15
+ ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
16
+ ToolCategory["MEMORY"] = "memory";
17
+ ToolCategory["WEBMCP"] = "experimentalWebmcp";
18
+ ToolCategory["PWA"] = "pwa";
19
+ })(ToolCategory || (ToolCategory = {}));
20
+ export const labels = {
21
+ [ToolCategory.INPUT]: 'Input automation',
22
+ [ToolCategory.NAVIGATION]: 'Navigation automation',
23
+ [ToolCategory.EMULATION]: 'Emulation',
24
+ [ToolCategory.PERFORMANCE]: 'Performance',
25
+ [ToolCategory.NETWORK]: 'Network',
26
+ [ToolCategory.DEBUGGING]: 'Debugging',
27
+ [ToolCategory.EXTENSIONS]: 'Extensions',
28
+ [ToolCategory.THIRD_PARTY]: 'Third-party',
29
+ [ToolCategory.MEMORY]: 'Memory',
30
+ [ToolCategory.WEBMCP]: 'WebMCP',
31
+ [ToolCategory.PWA]: 'Progressive Web Apps',
32
+ };
33
+ //# sourceMappingURL=categories.js.map
@@ -0,0 +1,169 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { zod } from '../third_party/index.js';
7
+ import { ToolCategory } from './categories.js';
8
+ import { definePageTool } from './ToolDefinition.js';
9
+ export const openDevtools = definePageTool(() => ({
10
+ name: 'open_devtools',
11
+ description: 'Open a DevTools window for the selected page.',
12
+ annotations: {
13
+ category: ToolCategory.DEBUGGING,
14
+ readOnlyHint: true,
15
+ conditions: ['devtoolsComments'],
16
+ },
17
+ schema: {},
18
+ blockedByDialog: false,
19
+ verifyFilesSchema: [],
20
+ handler: async (request, response) => {
21
+ const page = request.page;
22
+ try {
23
+ await page.openDevTools();
24
+ response.appendResponseLine('DevTools window opened successfully.');
25
+ }
26
+ catch (e) {
27
+ const message = e instanceof Error ? e.message : String(e);
28
+ response.appendResponseLine(`Failed to open DevTools: ${message}`);
29
+ }
30
+ response.setIncludePages(true);
31
+ },
32
+ }));
33
+ export const getDevtoolsComments = definePageTool(() => ({
34
+ name: 'get_devtools_comments',
35
+ description: 'Retrieve user comments from the DevTools window for the page.',
36
+ annotations: {
37
+ category: ToolCategory.DEBUGGING,
38
+ readOnlyHint: true,
39
+ conditions: ['devtoolsComments'],
40
+ },
41
+ schema: {},
42
+ blockedByDialog: false,
43
+ verifyFilesSchema: {},
44
+ handler: async (request, response) => {
45
+ const page = request.page;
46
+ const devtoolsPage = await page.getDevToolsPage();
47
+ if (!devtoolsPage) {
48
+ response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
49
+ return;
50
+ }
51
+ const bridge = await page.ensureDevToolsCommentBridge(devtoolsPage);
52
+ const threads = await bridge.getComments(devtoolsPage);
53
+ response.setDevToolsComments(threads);
54
+ },
55
+ }));
56
+ export const resolveDevtoolsComment = definePageTool(() => ({
57
+ name: 'resolve_devtools_comment',
58
+ description: 'Append an agent reply to a DevTools comment thread and mark it as resolved.',
59
+ annotations: {
60
+ category: ToolCategory.DEBUGGING,
61
+ readOnlyHint: false,
62
+ conditions: ['devtoolsComments'],
63
+ },
64
+ schema: {
65
+ threadId: zod
66
+ .string()
67
+ .describe('The unique identifier of the comment thread to resolve (e.g. "comment-1").'),
68
+ replyText: zod
69
+ .string()
70
+ .optional()
71
+ .describe('Optional reply explanation from the AI agent to append to the resolved comment thread.'),
72
+ },
73
+ blockedByDialog: false,
74
+ verifyFilesSchema: {},
75
+ handler: async (request, response) => {
76
+ const page = request.page;
77
+ const devtoolsPage = await page.getDevToolsPage();
78
+ if (!devtoolsPage) {
79
+ response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
80
+ return;
81
+ }
82
+ const { threadId, replyText } = request.params;
83
+ const success = await devtoolsPage.evaluate((id, reply) => {
84
+ return (window.universe?.cd4aBridge?.resolveCommentThread(id, reply) ?? false);
85
+ }, threadId, replyText);
86
+ if (success) {
87
+ response.appendResponseLine(`Comment thread ${threadId} resolved successfully.`);
88
+ if (replyText) {
89
+ response.appendResponseLine(`Agent reply added: "${replyText}"`);
90
+ }
91
+ }
92
+ else {
93
+ response.appendResponseLine(`Failed to resolve comment thread "${threadId}". Thread not found.`);
94
+ }
95
+ },
96
+ }));
97
+ export const revealInDevtools = definePageTool(() => ({
98
+ name: 'reveal_in_devtools',
99
+ description: 'Navigate DevTools to a specified panel and highlight a target DOM node or network request. The parameters uid and reqid are mutually exclusive.',
100
+ annotations: {
101
+ category: ToolCategory.DEBUGGING,
102
+ readOnlyHint: true,
103
+ conditions: ['devtoolsComments'],
104
+ },
105
+ schema: {
106
+ panelName: zod
107
+ .string()
108
+ .optional()
109
+ .describe('The target DevTools panel (e.g. "elements", "network", "sources", "console").'),
110
+ uid: zod
111
+ .string()
112
+ .optional()
113
+ .describe('Optional snapshot element UID to reveal in the Elements panel.'),
114
+ reqid: zod
115
+ .number()
116
+ .optional()
117
+ .describe('Optional network request ID to reveal in the Network panel.'),
118
+ },
119
+ blockedByDialog: false,
120
+ verifyFilesSchema: {},
121
+ handler: async (request, response) => {
122
+ const page = request.page;
123
+ const devtoolsPage = await page.getDevToolsPage();
124
+ if (!devtoolsPage) {
125
+ response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
126
+ return;
127
+ }
128
+ const { panelName, uid, reqid } = request.params;
129
+ let backendNodeId;
130
+ let targetId;
131
+ let networkRequestId;
132
+ if (uid) {
133
+ const resolved = await page.resolveUidToBackendNodeId(uid);
134
+ if (resolved) {
135
+ backendNodeId = resolved.backendNodeId;
136
+ targetId = resolved.targetId;
137
+ }
138
+ else {
139
+ response.appendResponseLine(`Warning: Could not resolve snapshot UID "${uid}" to a backend DOM node ID.`);
140
+ }
141
+ }
142
+ if (reqid !== undefined) {
143
+ const resolvedCdpRequestId = page.resolveReqidToCdpRequestId(reqid);
144
+ if (resolvedCdpRequestId !== undefined) {
145
+ networkRequestId = resolvedCdpRequestId;
146
+ }
147
+ else {
148
+ response.appendResponseLine(`Warning: Could not resolve network request ID ${reqid} to a CDP request ID.`);
149
+ }
150
+ }
151
+ await devtoolsPage.evaluate(async (panel, target) => {
152
+ await window.universe?.cd4aBridge?.reveal(panel, target);
153
+ }, panelName, { backendNodeId, targetId, networkRequestId });
154
+ let targetDesc = '';
155
+ if (uid && backendNodeId !== undefined) {
156
+ targetDesc = ` (revealing element ${uid} [backend node ${backendNodeId}])`;
157
+ }
158
+ else if (reqid !== undefined && networkRequestId) {
159
+ targetDesc = ` (revealing network request ${reqid} [${networkRequestId}])`;
160
+ }
161
+ if (panelName) {
162
+ response.appendResponseLine(`Navigated to ${panelName} panel${targetDesc} in DevTools.`);
163
+ }
164
+ else {
165
+ response.appendResponseLine(`Revealed target${targetDesc} in DevTools.`);
166
+ }
167
+ },
168
+ }));
169
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { zod } from '../third_party/index.js';
7
+ import { ToolCategory } from './categories.js';
8
+ import { definePageTool } from './ToolDefinition.js';
9
+ const FILTERABLE_MESSAGE_TYPES = [
10
+ 'log',
11
+ 'debug',
12
+ 'info',
13
+ 'error',
14
+ 'warn',
15
+ 'dir',
16
+ 'dirxml',
17
+ 'table',
18
+ 'trace',
19
+ 'clear',
20
+ 'startGroup',
21
+ 'startGroupCollapsed',
22
+ 'endGroup',
23
+ 'assert',
24
+ 'profile',
25
+ 'profileEnd',
26
+ 'count',
27
+ 'timeEnd',
28
+ 'verbose',
29
+ 'issue',
30
+ ];
31
+ const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
32
+ export const listConsoleMessages = definePageTool((cliArgs) => {
33
+ return {
34
+ name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
35
+ description: `List all console messages for the target page since the last navigation.${cliArgs?.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
36
+ annotations: {
37
+ category: ToolCategory.DEBUGGING,
38
+ readOnlyHint: true,
39
+ },
40
+ schema: {
41
+ pageSize: zod
42
+ .number()
43
+ .int()
44
+ .positive()
45
+ .optional()
46
+ .describe('Maximum number of messages to return. When omitted, returns all messages.'),
47
+ pageIdx: zod
48
+ .number()
49
+ .int()
50
+ .min(0)
51
+ .optional()
52
+ .describe('Page number to return (0-based). When omitted, returns the first page.'),
53
+ types: zod
54
+ .array(zod.enum(FILTERABLE_MESSAGE_TYPES))
55
+ .optional()
56
+ .describe('Filter messages to only return messages of the specified resource types. When omitted or empty, returns all messages.'),
57
+ includePreservedMessages: zod
58
+ .boolean()
59
+ .default(false)
60
+ .optional()
61
+ .describe('Set to true to return the preserved messages over the last 3 navigations.'),
62
+ includeStackTraces: zod
63
+ .boolean()
64
+ .default(false)
65
+ .optional()
66
+ .describe('Set to true to include the stack trace for each message when available. Increases the response size.'),
67
+ serviceWorkerId: zod
68
+ .string()
69
+ .optional()
70
+ .describe('Filter messages to only return messages of the specified service worker.'),
71
+ },
72
+ blockedByDialog: false,
73
+ verifyFilesSchema: {},
74
+ handler: async (request, response) => {
75
+ response.setIncludeConsoleData(true, {
76
+ pageSize: request.params.pageSize,
77
+ pageIdx: request.params.pageIdx,
78
+ types: request.params.types,
79
+ includePreservedMessages: request.params.includePreservedMessages,
80
+ includeStackTraces: request.params.includeStackTraces,
81
+ serviceWorkerId: request.params.serviceWorkerId,
82
+ });
83
+ },
84
+ };
85
+ });
86
+ export const getConsoleMessage = definePageTool(() => ({
87
+ name: 'get_console_message',
88
+ description: `Gets a console message by its ID. You can get all messages by calling ${LIST_CONSOLE_MESSAGES_TOOL_NAME}.`,
89
+ annotations: {
90
+ category: ToolCategory.DEBUGGING,
91
+ readOnlyHint: true,
92
+ },
93
+ schema: {
94
+ msgid: zod
95
+ .number()
96
+ .describe('The msgid of a console message on the page from the listed console messages'),
97
+ },
98
+ blockedByDialog: false,
99
+ verifyFilesSchema: {},
100
+ handler: async (request, response) => {
101
+ response.attachConsoleMessage(request.params.msgid);
102
+ },
103
+ }));
104
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { zod } from '../third_party/index.js';
7
+ import { ToolCategory } from './categories.js';
8
+ import { definePageTool } from './ToolDefinition.js';
9
+ export const getCssStyles = definePageTool(() => ({
10
+ name: 'get_css_styles',
11
+ description: `Retrieve matched CSS rules, inline styles, inherited styles, and cascade information for an element identified by its UID.
12
+ Use this tool to debug why specific CSS properties are applied, overridden, or conflicting. Results are paginated and return 10 rules per page by default; use pageIdx to page through the remaining rules. Requires a UID from take_snapshot.`,
13
+ annotations: {
14
+ category: ToolCategory.DEBUGGING,
15
+ readOnlyHint: true,
16
+ },
17
+ schema: {
18
+ uid: zod
19
+ .string()
20
+ .describe('The uid of the element on the page from the page content snapshot to inspect CSS styles for'),
21
+ pageSize: zod
22
+ .number()
23
+ .int()
24
+ .positive()
25
+ .default(10)
26
+ .describe('Maximum number of CSS rules to return per page. Defaults to 10.'),
27
+ pageIdx: zod
28
+ .number()
29
+ .int()
30
+ .min(0)
31
+ .default(0)
32
+ .describe('Page number to return (0-based). Defaults to 0 (the first page).'),
33
+ },
34
+ blockedByDialog: true,
35
+ verifyFilesSchema: {},
36
+ handler: async (request, response) => {
37
+ const matchedStyles = await request.page.getMatchedStylesForUid(request.params.uid);
38
+ response.setIncludeCssStyles(matchedStyles, {
39
+ uid: request.params.uid,
40
+ pageSize: request.params.pageSize,
41
+ pageIdx: request.params.pageIdx,
42
+ });
43
+ },
44
+ }));
45
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ *
6
+ */
7
+ import { zod, PredefinedNetworkConditions } from '../third_party/index.js';
8
+ import { ToolCategory } from './categories.js';
9
+ import { definePageTool, geolocationTransform, viewportTransform, } from './ToolDefinition.js';
10
+ function headerStringTransform(value) {
11
+ if (value === undefined) {
12
+ return undefined;
13
+ }
14
+ if (value === '') {
15
+ return {};
16
+ }
17
+ try {
18
+ const parsed = JSON.parse(value);
19
+ if (typeof parsed !== 'object' ||
20
+ parsed === null ||
21
+ Array.isArray(parsed)) {
22
+ throw new Error('Headers must be a JSON object');
23
+ }
24
+ return parsed;
25
+ }
26
+ catch (error) {
27
+ throw new Error(`Invalid JSON for headers: ${error instanceof Error ? error.message : String(error)}`);
28
+ }
29
+ }
30
+ const throttlingOptions = [
31
+ 'Offline',
32
+ ...Object.keys(PredefinedNetworkConditions),
33
+ ];
34
+ export const emulate = definePageTool(() => ({
35
+ name: 'emulate',
36
+ description: `Emulates various features on the target page.`,
37
+ annotations: {
38
+ category: ToolCategory.EMULATION,
39
+ readOnlyHint: false,
40
+ },
41
+ schema: {
42
+ networkConditions: zod
43
+ .enum(throttlingOptions)
44
+ .optional()
45
+ .describe(`Throttle network. Omit to disable throttling.`),
46
+ cpuThrottlingRate: zod
47
+ .number()
48
+ .min(1)
49
+ .max(20)
50
+ .optional()
51
+ .describe('Represents the CPU slowdown factor. Omit or set the rate to 1 to disable throttling'),
52
+ geolocation: zod
53
+ .string()
54
+ .transform(geolocationTransform)
55
+ .optional()
56
+ .describe('Geolocation (`<latitude>,<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override.'),
57
+ userAgent: zod
58
+ .string()
59
+ .optional()
60
+ .describe('User agent to emulate. Set to empty string to clear the user agent override.'),
61
+ colorScheme: zod
62
+ .enum(['dark', 'light', 'auto'])
63
+ .optional()
64
+ .describe('Emulate the dark or the light mode. Set to "auto" to reset to the default.'),
65
+ viewport: zod
66
+ .string()
67
+ .transform(viewportTransform)
68
+ .optional()
69
+ .describe(`Emulate device viewports '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'. 'touch' and 'mobile' to emulate mobile devices. 'landscape' to emulate landscape mode.`),
70
+ extraHttpHeaders: zod
71
+ .string()
72
+ .transform(headerStringTransform)
73
+ .optional()
74
+ .describe('Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers.'),
75
+ },
76
+ blockedByDialog: true,
77
+ verifyFilesSchema: {},
78
+ handler: async (request, response) => {
79
+ const page = request.page;
80
+ await page.emulate(request.params);
81
+ response.appendResponseLine('Emulation configured successfully');
82
+ },
83
+ }));
84
+ //# sourceMappingURL=emulation.js.map
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { zod } from '../third_party/index.js';
7
+ import { ToolCategory } from './categories.js';
8
+ import { defineTool } from './ToolDefinition.js';
9
+ export const installExtension = defineTool(() => ({
10
+ name: 'install_extension',
11
+ description: 'Installs a Chrome extension from the given path.',
12
+ annotations: {
13
+ category: ToolCategory.EXTENSIONS,
14
+ readOnlyHint: false,
15
+ },
16
+ schema: {
17
+ path: zod
18
+ .string()
19
+ .describe('Absolute path to the unpacked extension folder.'),
20
+ },
21
+ blockedByDialog: false,
22
+ verifyFilesSchema: {
23
+ path: { local: true },
24
+ },
25
+ handler: async (request, response, context) => {
26
+ const { path } = request.params;
27
+ const id = await context.installExtension(path);
28
+ response.appendResponseLine(`Extension installed. Id: ${id}`);
29
+ },
30
+ }));
31
+ export const uninstallExtension = defineTool(() => ({
32
+ name: 'uninstall_extension',
33
+ description: 'Uninstalls a Chrome extension by its ID.',
34
+ annotations: {
35
+ category: ToolCategory.EXTENSIONS,
36
+ readOnlyHint: false,
37
+ },
38
+ schema: {
39
+ id: zod.string().describe('ID of the extension to uninstall.'),
40
+ },
41
+ blockedByDialog: false,
42
+ verifyFilesSchema: {},
43
+ handler: async (request, response, context) => {
44
+ const { id } = request.params;
45
+ await context.uninstallExtension(id);
46
+ response.appendResponseLine(`Extension uninstalled. Id: ${id}`);
47
+ },
48
+ }));
49
+ export const listExtensions = defineTool(() => ({
50
+ name: 'list_extensions',
51
+ description: 'Lists all the Chrome extensions installed in the browser. This includes their name, ID, version, and enabled status.',
52
+ annotations: {
53
+ category: ToolCategory.EXTENSIONS,
54
+ readOnlyHint: true,
55
+ },
56
+ schema: {},
57
+ blockedByDialog: false,
58
+ verifyFilesSchema: {},
59
+ handler: async (_request, response) => {
60
+ response.setListExtensions();
61
+ },
62
+ }));
63
+ export const reloadExtension = defineTool(() => ({
64
+ name: 'reload_extension',
65
+ description: 'Reloads an unpacked Chrome extension by its ID.',
66
+ annotations: {
67
+ category: ToolCategory.EXTENSIONS,
68
+ readOnlyHint: false,
69
+ },
70
+ schema: {
71
+ id: zod.string().describe('ID of the extension to reload.'),
72
+ },
73
+ blockedByDialog: false,
74
+ verifyFilesSchema: {},
75
+ handler: async (request, response, context) => {
76
+ const { id } = request.params;
77
+ const extension = await context.getExtension(id);
78
+ if (!extension) {
79
+ throw new Error(`Extension with ID ${id} not found.`);
80
+ }
81
+ await context.installExtension(extension.path);
82
+ response.appendResponseLine('Extension reloaded.');
83
+ },
84
+ }));
85
+ export const triggerExtensionAction = defineTool(() => ({
86
+ name: 'trigger_extension_action',
87
+ description: 'Triggers the default action of an extension by its ID.',
88
+ annotations: {
89
+ category: ToolCategory.EXTENSIONS,
90
+ readOnlyHint: false,
91
+ },
92
+ schema: {
93
+ id: zod.string().describe('ID of the extension to trigger the action for.'),
94
+ },
95
+ blockedByDialog: false,
96
+ verifyFilesSchema: {},
97
+ handler: async (request, response, context) => {
98
+ const { id } = request.params;
99
+ await context.triggerExtensionAction(id);
100
+ response.appendResponseLine(`Extension action triggered for ID ${id}`);
101
+ },
102
+ }));
103
+ //# sourceMappingURL=extensions.js.map