@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +223 -2
  3. package/out/Default/gen/src/ArcBrowser.js +128 -0
  4. package/out/Default/gen/src/BrowserManager.js +562 -0
  5. package/out/Default/gen/src/LogpointManager.js +287 -0
  6. package/out/Default/gen/src/McpContext.js +1031 -0
  7. package/out/Default/gen/src/McpPage.js +1427 -0
  8. package/out/Default/gen/src/McpResponse.js +1350 -0
  9. package/out/Default/gen/src/McpWorker.js +66 -0
  10. package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
  11. package/out/Default/gen/src/SlimMcpResponse.js +23 -0
  12. package/out/Default/gen/src/TextSnapshot.js +336 -0
  13. package/out/Default/gen/src/ToolHandler.js +531 -0
  14. package/out/Default/gen/src/bin/check-latest-version.js +53 -0
  15. package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
  16. package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
  17. package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
  18. package/out/Default/gen/src/collectors/PageCollector.js +325 -0
  19. package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
  20. package/out/Default/gen/src/collectors/constants.js +7 -0
  21. package/out/Default/gen/src/config/ConfigLocator.js +70 -0
  22. package/out/Default/gen/src/config/ConfigParser.js +163 -0
  23. package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
  24. package/out/Default/gen/src/config/ServerConfig.js +284 -0
  25. package/out/Default/gen/src/config/browser-options.js +135 -0
  26. package/out/Default/gen/src/config/category-options.js +84 -0
  27. package/out/Default/gen/src/config/cli-commands.js +208 -0
  28. package/out/Default/gen/src/config/cli-options.js +2090 -0
  29. package/out/Default/gen/src/config/mcp-options.js +371 -0
  30. package/out/Default/gen/src/config/puppeteer-options.js +69 -0
  31. package/out/Default/gen/src/config/tool-options.js +60 -0
  32. package/out/Default/gen/src/daemon/client.js +281 -0
  33. package/out/Default/gen/src/daemon/daemon.js +280 -0
  34. package/out/Default/gen/src/daemon/types.js +7 -0
  35. package/out/Default/gen/src/daemon/utils.js +173 -0
  36. package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
  37. package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
  38. package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
  39. package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
  40. package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
  41. package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
  42. package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
  43. package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
  44. package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
  45. package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
  46. package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
  47. package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
  48. package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
  49. package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
  50. package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
  51. package/out/Default/gen/src/formatters/constants.js +8 -0
  52. package/out/Default/gen/src/index.js +434 -0
  53. package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
  54. package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
  55. package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
  56. package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
  57. package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
  58. package/out/Default/gen/src/telemetry/errors.js +18 -0
  59. package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
  60. package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
  61. package/out/Default/gen/src/telemetry/persistence.js +82 -0
  62. package/out/Default/gen/src/telemetry/transformation.js +229 -0
  63. package/out/Default/gen/src/telemetry/types.js +36 -0
  64. package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
  65. package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
  66. package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
  67. package/out/Default/gen/src/third_party/browser.js +808 -0
  68. package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
  69. package/out/Default/gen/src/third_party/cli.js +139 -0
  70. package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
  71. package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
  72. package/out/Default/gen/src/third_party/index.js +128 -0
  73. package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
  74. package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
  75. package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
  76. package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
  77. package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
  78. package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
  79. package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
  80. package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
  81. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
  82. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
  83. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
  84. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
  85. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
  86. package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
  87. package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
  88. package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
  89. package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
  90. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
  91. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
  92. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
  93. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
  94. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
  95. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
  96. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
  97. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
  98. package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
  99. package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
  100. package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
  101. package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
  102. package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
  103. package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
  104. package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
  105. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
  106. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
  107. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
  108. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
  109. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
  110. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
  111. package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
  112. package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
  113. package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
  114. package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
  115. package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
  116. package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
  117. package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
  118. package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
  119. package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
  120. package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
  121. package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
  122. package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
  123. package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
  124. package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
  125. package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
  126. package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
  127. package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
  128. package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
  129. package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
  130. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
  131. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
  132. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
  133. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
  134. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
  135. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
  136. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
  137. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
  138. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
  139. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
  140. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
  141. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
  142. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
  143. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
  144. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
  145. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
  146. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
  147. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
  148. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
  149. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
  150. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
  151. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
  152. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
  153. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
  154. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
  155. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
  156. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
  157. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
  158. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
  159. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
  160. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
  161. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
  162. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
  163. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
  164. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
  165. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
  166. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
  167. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
  168. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
  169. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
  170. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
  171. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
  172. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
  173. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
  174. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
  175. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
  176. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
  177. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
  178. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
  179. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
  180. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
  181. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
  182. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
  183. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
  184. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
  185. package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
  186. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
  187. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
  188. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
  189. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
  190. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
  191. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
  192. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
  193. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
  194. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
  195. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
  196. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
  197. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
  198. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
  199. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
  200. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
  201. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  202. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  203. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  204. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
  205. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
  206. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
  207. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
  208. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
  209. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
  210. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
  211. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
  212. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
  213. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
  214. package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
  215. package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
  216. package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
  217. package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
  218. package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
  219. package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
  220. package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
  221. package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
  222. package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
  223. package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
  224. package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
  225. package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
  226. package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
  227. package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
  228. package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
  229. package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
  230. package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
  231. package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
  232. package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
  233. package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
  234. package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
  235. package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
  236. package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
  237. package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
  238. package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
  239. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
  240. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
  241. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
  242. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
  243. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
  244. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
  245. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
  246. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
  247. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
  248. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
  249. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
  250. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
  251. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
  252. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
  253. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
  254. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
  255. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
  256. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
  257. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
  258. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
  259. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
  260. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
  261. package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
  262. package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
  263. package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
  264. package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
  265. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
  266. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
  267. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
  268. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
  269. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
  270. package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
  271. package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
  272. package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
  273. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
  274. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
  275. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
  276. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
  277. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
  278. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
  279. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
  280. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
  281. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
  282. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
  283. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
  284. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  285. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
  286. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
  287. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  288. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
  289. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
  290. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
  291. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
  292. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
  293. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
  294. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
  295. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
  296. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
  297. package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
  298. package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
  299. package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
  300. package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
  301. package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
  302. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
  303. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
  304. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
  305. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
  306. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
  307. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
  308. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
  309. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
  310. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
  311. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
  312. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
  313. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
  314. package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
  315. package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
  316. package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
  317. package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
  318. package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
  319. package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
  320. package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
  321. package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
  322. package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
  323. package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
  324. package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
  325. package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
  326. package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
  327. package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
  328. package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
  329. package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
  330. package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
  331. package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
  332. package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
  333. package/out/Default/gen/src/tools/categories.js +37 -0
  334. package/out/Default/gen/src/tools/comments.js +230 -0
  335. package/out/Default/gen/src/tools/console.js +122 -0
  336. package/out/Default/gen/src/tools/css.js +54 -0
  337. package/out/Default/gen/src/tools/emulation.js +98 -0
  338. package/out/Default/gen/src/tools/extensions.js +108 -0
  339. package/out/Default/gen/src/tools/input.js +658 -0
  340. package/out/Default/gen/src/tools/lighthouse.js +279 -0
  341. package/out/Default/gen/src/tools/logpoints.js +51 -0
  342. package/out/Default/gen/src/tools/memory.js +531 -0
  343. package/out/Default/gen/src/tools/network.js +325 -0
  344. package/out/Default/gen/src/tools/pages.js +420 -0
  345. package/out/Default/gen/src/tools/performance.js +258 -0
  346. package/out/Default/gen/src/tools/pwa.js +152 -0
  347. package/out/Default/gen/src/tools/screencast.js +160 -0
  348. package/out/Default/gen/src/tools/screenshot.js +315 -0
  349. package/out/Default/gen/src/tools/script.js +319 -0
  350. package/out/Default/gen/src/tools/slim/tools.js +110 -0
  351. package/out/Default/gen/src/tools/snapshot.js +88 -0
  352. package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
  353. package/out/Default/gen/src/tools/toolNames.js +10 -0
  354. package/out/Default/gen/src/tools/tools.js +72 -0
  355. package/out/Default/gen/src/tools/webauthn.js +51 -0
  356. package/out/Default/gen/src/tools/webmcp.js +55 -0
  357. package/out/Default/gen/src/types.js +21 -0
  358. package/out/Default/gen/src/utils/TaskRunner.js +151 -0
  359. package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
  360. package/out/Default/gen/src/utils/bytes.js +95 -0
  361. package/out/Default/gen/src/utils/check-for-updates.js +81 -0
  362. package/out/Default/gen/src/utils/disclaimers.js +27 -0
  363. package/out/Default/gen/src/utils/errorHandling.js +23 -0
  364. package/out/Default/gen/src/utils/files.js +81 -0
  365. package/out/Default/gen/src/utils/id.js +16 -0
  366. package/out/Default/gen/src/utils/keyboard.js +307 -0
  367. package/out/Default/gen/src/utils/logger.js +145 -0
  368. package/out/Default/gen/src/utils/logpoint.js +44 -0
  369. package/out/Default/gen/src/utils/network.js +81 -0
  370. package/out/Default/gen/src/utils/pagination.js +50 -0
  371. package/out/Default/gen/src/utils/polyfill.js +11 -0
  372. package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
  373. package/out/Default/gen/src/utils/resourceType.js +27 -0
  374. package/out/Default/gen/src/utils/text.js +43 -0
  375. package/out/Default/gen/src/utils/timeout.js +14 -0
  376. package/out/Default/gen/src/utils/url.js +311 -0
  377. package/out/Default/gen/src/version.js +11 -0
  378. package/package.json +125 -4
  379. package/skills/a11y-debugging/SKILL.md +86 -0
  380. package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
  381. package/skills/arc-compatibility/SKILL.md +174 -0
  382. package/skills/arc-compatibility/SOURCES.md +238 -0
  383. package/skills/arc-compatibility/references/compatibility.md +115 -0
  384. package/skills/arc-compatibility/references/output-contract.md +62 -0
  385. package/skills/arc-compatibility/references/workflows.md +108 -0
  386. package/skills/chrome-devtools/SKILL.md +80 -0
  387. package/skills/chrome-devtools-cli/SKILL.md +208 -0
  388. package/skills/chrome-devtools-cli/references/installation.md +24 -0
  389. package/skills/cookie-debugging/SKILL.md +152 -0
  390. package/skills/debug-optimize-lcp/SKILL.md +121 -0
  391. package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
  392. package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
  393. package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
  394. package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
  395. package/skills/inspect-in-devtools/SKILL.md +82 -0
  396. package/skills/memory-leak-debugging/SKILL.md +58 -0
  397. package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
  398. package/skills/troubleshooting/SKILL.md +107 -0
@@ -0,0 +1,152 @@
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 { validateUrl } from '../utils/url.js';
8
+ import { ToolCategory } from './categories.js';
9
+ import { defineTool } from './ToolDefinition.js';
10
+ function validatePwaUrl(url, args) {
11
+ validateUrl(url, {
12
+ javascriptEvaluation: args.javascriptEvaluation,
13
+ categoryExtensions: args.categoryExtensions,
14
+ fileNavigations: args.fileNavigations,
15
+ });
16
+ }
17
+ const manifestIdSchema = zod
18
+ .string()
19
+ .describe('The manifest ID of the web app: the resolved `id` member of its manifest. ' +
20
+ 'If `id` is omitted, it defaults to the resolved `start_url` ' +
21
+ '(e.g. "https://example.com/"). See https://w3c.github.io/manifest/#id-member.');
22
+ const displayModeSchema = zod
23
+ .enum(['standalone', 'browser'])
24
+ .optional()
25
+ .describe('Optional user display mode preference applied after install. ' +
26
+ '"standalone" opens the app in its own window; "browser" opens it as a ' +
27
+ 'tab. Installs via the PWA CDP domain default to "browser" because they ' +
28
+ 'do not simulate the install dialog, so pass "standalone" to get an ' +
29
+ 'app-window experience.');
30
+ export const installPwa = defineTool((args) => ({
31
+ name: 'install_pwa',
32
+ description: 'Installs a Progressive Web App (PWA) identified by its manifest ID. ' +
33
+ 'This installs through the PWA CDP domain without a user gesture or install ' +
34
+ 'dialog. DevTools installs default to browser display mode.',
35
+ annotations: {
36
+ category: ToolCategory.PWA,
37
+ readOnlyHint: false,
38
+ },
39
+ schema: {
40
+ manifestId: manifestIdSchema,
41
+ installUrlOrBundleUrl: zod
42
+ .string()
43
+ .describe('The location of the app or bundle. For a normal site this is the page ' +
44
+ 'URL; for an Isolated Web App it can be a file:// or http(s):// ' +
45
+ 'signed web bundle.'),
46
+ displayMode: displayModeSchema,
47
+ },
48
+ blockedByDialog: false,
49
+ concurrency: 'exclusive',
50
+ // We do not validate file paths for remote browser instances
51
+ // because they are on the remote host and not accessed by the MCP server.
52
+ verifyFilesSchema: {
53
+ installUrlOrBundleUrl: {
54
+ local: true,
55
+ remote: false,
56
+ // May be an http(s):// or file:// signed web bundle URL handed to the
57
+ // browser, so allow URLs through; a plain path is still validated.
58
+ allowUrl: true,
59
+ },
60
+ },
61
+ handler: async (request, response, context) => {
62
+ const { manifestId, installUrlOrBundleUrl, displayMode } = request.params;
63
+ // Without an install URL, the browser installs from the manifest ID.
64
+ validatePwaUrl(manifestId, args);
65
+ // A plain file path is not a URL and was already confined to the roots.
66
+ if (installUrlOrBundleUrl && URL.canParse(installUrlOrBundleUrl)) {
67
+ validatePwaUrl(installUrlOrBundleUrl, args);
68
+ }
69
+ await context.installPWA({
70
+ manifestId,
71
+ installUrlOrBundleUrl,
72
+ displayMode,
73
+ });
74
+ response.appendResponseLine(`Installed PWA with manifest ID: ${manifestId}`);
75
+ if (displayMode) {
76
+ response.appendResponseLine(`Display mode set to: ${displayMode}`);
77
+ }
78
+ },
79
+ }));
80
+ export const uninstallPwa = defineTool(() => ({
81
+ name: 'uninstall_pwa',
82
+ description: 'Uninstalls a Progressive Web App identified by its manifest ID and ' +
83
+ 'closes any open app windows.',
84
+ annotations: {
85
+ category: ToolCategory.PWA,
86
+ readOnlyHint: false,
87
+ },
88
+ schema: {
89
+ manifestId: manifestIdSchema,
90
+ },
91
+ blockedByDialog: false,
92
+ concurrency: 'exclusive',
93
+ verifyFilesSchema: {},
94
+ handler: async (request, response, context) => {
95
+ const { manifestId } = request.params;
96
+ await context.uninstallPWA({ manifestId });
97
+ response.appendResponseLine(`Uninstalled PWA with manifest ID: ${manifestId}`);
98
+ response.setIncludePages(true);
99
+ },
100
+ }));
101
+ export const launchPwa = defineTool((args) => ({
102
+ name: 'launch_pwa',
103
+ description: 'Launches an installed Progressive Web App using its saved display mode. ' +
104
+ 'Optionally opens a specific URL within the same app instead of the default ' +
105
+ 'start URL.',
106
+ annotations: {
107
+ category: ToolCategory.PWA,
108
+ readOnlyHint: false,
109
+ },
110
+ schema: {
111
+ manifestId: manifestIdSchema,
112
+ url: zod
113
+ .string()
114
+ .optional()
115
+ .describe('Optional URL within the app to open instead of the default start URL.'),
116
+ },
117
+ blockedByDialog: false,
118
+ concurrency: 'exclusive',
119
+ verifyFilesSchema: {},
120
+ handler: async (request, response, context) => {
121
+ const { manifestId, url } = request.params;
122
+ if (url !== undefined) {
123
+ validatePwaUrl(url, args);
124
+ }
125
+ const page = await context.launchPWA({ manifestId, url });
126
+ response.appendResponseLine(`Launched PWA with manifest ID: ${manifestId} (${page.url()})`);
127
+ response.setIncludePages(true);
128
+ },
129
+ }));
130
+ export const getOsAppState = defineTool(() => ({
131
+ name: 'get_os_app_state',
132
+ description: 'Returns the OS integration state (badge count and registered file ' +
133
+ 'handlers) for an installed web app, identified by its manifest ID.',
134
+ annotations: {
135
+ category: ToolCategory.PWA,
136
+ readOnlyHint: true,
137
+ },
138
+ schema: {
139
+ manifestId: manifestIdSchema,
140
+ },
141
+ blockedByDialog: false,
142
+ concurrency: 'exclusive',
143
+ verifyFilesSchema: {},
144
+ handler: async (request, response, context) => {
145
+ const { manifestId } = request.params;
146
+ const state = await context.getPWAState({ manifestId });
147
+ response.appendResponseLine(`OS app state for manifest ID: ${manifestId}`);
148
+ response.appendResponseLine(`Badge count: ${state.badgeCount}`);
149
+ response.appendResponseLine(`File handlers: ${JSON.stringify(state.fileHandlers)}`);
150
+ },
151
+ }));
152
+ //# sourceMappingURL=pwa.js.map
@@ -0,0 +1,160 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import fs from 'node:fs/promises';
7
+ import os from 'node:os';
8
+ import path from 'node:path';
9
+ import { zod } from '../third_party/index.js';
10
+ import { ToolCategory } from './categories.js';
11
+ import { definePageTool } from './ToolDefinition.js';
12
+ async function generateTempFilePath() {
13
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'chrome-devtools-mcp-'));
14
+ return path.join(dir, `screencast.mp4`);
15
+ }
16
+ const supportedExtensions = ['.webm', '.mp4'];
17
+ /**
18
+ * Resolves the output extension for the legacy ffmpeg-based recorder.
19
+ *
20
+ * Matches the extension case-insensitively so e.g. `.WEBM` is recognized as
21
+ * WebM. An explicitly requested but unsupported extension is rejected rather
22
+ * than being silently rewritten to `.mp4` (which would change both the format
23
+ * and the output path from what was requested). A missing extension falls
24
+ * back to `.mp4`. The matched extension is normalized to lower case.
25
+ */
26
+ function getLegacyExtension(filePath) {
27
+ const requestedExtension = path.extname(filePath);
28
+ const matchedExtension = supportedExtensions.find(supportedExtension => supportedExtension === requestedExtension.toLowerCase());
29
+ if (!matchedExtension && requestedExtension !== '') {
30
+ throw new Error(`Unsupported screencast file extension "${requestedExtension}". ` +
31
+ `Supported formats: ${supportedExtensions.join(', ')} (case-insensitive).`);
32
+ }
33
+ return matchedExtension ?? '.mp4';
34
+ }
35
+ /**
36
+ * Returns the size of the page viewport in device pixels.
37
+ */
38
+ async function getPagePixelSize(pptrPage) {
39
+ const { width, height, dpr } = await pptrPage.evaluate(() => ({
40
+ width: window.innerWidth,
41
+ height: window.innerHeight,
42
+ dpr: window.devicePixelRatio,
43
+ }));
44
+ return {
45
+ maxWidth: Math.max(1, Math.round(width * dpr)),
46
+ maxHeight: Math.max(1, Math.round(height * dpr)),
47
+ };
48
+ }
49
+ export const startScreencast = definePageTool((args) => ({
50
+ name: 'screencast_start',
51
+ description: `Starts recording a screencast (video) of the target page.`,
52
+ annotations: {
53
+ category: ToolCategory.DEBUGGING,
54
+ readOnlyHint: false,
55
+ },
56
+ schema: {
57
+ filePath: zod
58
+ .string()
59
+ .optional()
60
+ .describe(args?.experimentalScreencast
61
+ ? `Output file path (${supportedExtensions.join(',')} are supported). Uses mkdtemp to generate a unique path if not provided.`
62
+ : 'Output file path (.mp4). Uses mkdtemp to generate a unique path if not provided.'),
63
+ },
64
+ blockedByDialog: false,
65
+ concurrency: 'exclusive',
66
+ verifyFilesSchema: {
67
+ filePath: true,
68
+ },
69
+ handler: async (request, response, context) => {
70
+ const page = request.page;
71
+ if (page.getScreenRecorder() !== null) {
72
+ response.appendResponseLine('Error: a screencast recording is already in progress. Use screencast_stop to stop it before starting a new one.');
73
+ return;
74
+ }
75
+ const requestedFilePath = request.params.filePath;
76
+ const filePath = requestedFilePath ?? (await generateTempFilePath());
77
+ // The built-in Chrome recorder (page.record) always produces mp4. The
78
+ // legacy ffmpeg recorder (page.screencast) also supports WebM.
79
+ const useLegacy = Boolean(args?.experimentalScreencast);
80
+ const extension = useLegacy ? getLegacyExtension(filePath) : '.mp4';
81
+ const resolvedPath = await context.ensureExtension(filePath, extension);
82
+ let recorder;
83
+ try {
84
+ if (useLegacy) {
85
+ const format = extension === '.webm' ? 'webm' : 'mp4';
86
+ recorder = await page.pptrPage.screencast({
87
+ path: resolvedPath,
88
+ format,
89
+ ffmpegPath: args?.experimentalFfmpegPath,
90
+ fps: args?.screencastFps,
91
+ });
92
+ }
93
+ else {
94
+ // Without explicit limits Chrome downscales frames to a small default
95
+ // size. Record at the actual device pixel size of the page instead.
96
+ const { maxWidth, maxHeight } = await getPagePixelSize(page.pptrPage);
97
+ recorder = await page.pptrPage.record({
98
+ path: resolvedPath,
99
+ fps: args?.screencastFps,
100
+ maxWidth,
101
+ maxHeight,
102
+ });
103
+ }
104
+ }
105
+ catch (err) {
106
+ // If we generated a temporary directory for this recording, remove it so
107
+ // a failed start (e.g. ffmpeg missing) does not leak an empty directory.
108
+ if (requestedFilePath === undefined) {
109
+ try {
110
+ await fs.rm(path.dirname(resolvedPath), {
111
+ recursive: true,
112
+ force: true,
113
+ });
114
+ }
115
+ catch {
116
+ // no-op
117
+ }
118
+ }
119
+ const message = err instanceof Error ? err.message : String(err);
120
+ if (message.includes('ENOENT') && message.includes('ffmpeg')) {
121
+ throw new Error('ffmpeg is required for screencast recording but was not found. ' +
122
+ 'Install ffmpeg (https://ffmpeg.org/) and ensure it is available in your PATH.');
123
+ }
124
+ if (message.includes('Page.startScreenRecording')) {
125
+ throw new Error('The connected Chrome does not support screen recording. Update Chrome to a newer version.');
126
+ }
127
+ throw err;
128
+ }
129
+ page.setScreenRecorder({ recorder, filePath: resolvedPath });
130
+ response.appendResponseLine(`Screencast recording started. The recording will be saved to ${resolvedPath}. Use ${stopScreencast(args).name} to stop recording.`);
131
+ },
132
+ }));
133
+ export const stopScreencast = definePageTool(() => ({
134
+ name: 'screencast_stop',
135
+ description: 'Stops the active screencast recording on the target page.',
136
+ annotations: {
137
+ category: ToolCategory.DEBUGGING,
138
+ readOnlyHint: false,
139
+ },
140
+ schema: {},
141
+ blockedByDialog: false,
142
+ concurrency: 'exclusive',
143
+ verifyFilesSchema: {},
144
+ handler: async (request, response) => {
145
+ const page = request.page;
146
+ const data = page.getScreenRecorder();
147
+ if (!data) {
148
+ response.appendResponseLine('Error: no active screencast recording to stop.');
149
+ return;
150
+ }
151
+ try {
152
+ await data.recorder.stop();
153
+ response.appendResponseLine(`The screencast recording has been stopped and saved to ${data.filePath}.`);
154
+ }
155
+ finally {
156
+ page.setScreenRecorder(null);
157
+ }
158
+ },
159
+ }));
160
+ //# sourceMappingURL=screencast.js.map
@@ -0,0 +1,315 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
7
+ if (value !== null && value !== void 0) {
8
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
9
+ var dispose, inner;
10
+ if (async) {
11
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
12
+ dispose = value[Symbol.asyncDispose];
13
+ }
14
+ if (dispose === void 0) {
15
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
16
+ dispose = value[Symbol.dispose];
17
+ if (async) inner = dispose;
18
+ }
19
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
20
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
21
+ env.stack.push({ value: value, dispose: dispose, async: async });
22
+ }
23
+ else if (async) {
24
+ env.stack.push({ async: true });
25
+ }
26
+ return value;
27
+ };
28
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
29
+ return function (env) {
30
+ function fail(e) {
31
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
32
+ env.hasError = true;
33
+ }
34
+ var r, s = 0;
35
+ function next() {
36
+ while (r = env.stack.pop()) {
37
+ try {
38
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
39
+ if (r.dispose) {
40
+ var result = r.dispose.call(r.value);
41
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
42
+ }
43
+ else s |= 1;
44
+ }
45
+ catch (e) {
46
+ fail(e);
47
+ }
48
+ }
49
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
50
+ if (env.hasError) throw env.error;
51
+ }
52
+ return next();
53
+ };
54
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
55
+ var e = new Error(message);
56
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
+ });
58
+ import { zod } from '../third_party/index.js';
59
+ import { ToolCategory } from './categories.js';
60
+ import { definePageTool } from './ToolDefinition.js';
61
+ const MAX_CHROMIUM_SCREENSHOT_DIMENSION = 16384;
62
+ async function getSourceBox(page, element, fullPage) {
63
+ if (element) {
64
+ const viewport = page.viewport();
65
+ const [box, metrics] = await Promise.all([
66
+ element.boundingBox(),
67
+ page.evaluate(() => ({
68
+ x: window.scrollX,
69
+ y: window.scrollY,
70
+ devicePixelRatio: window.devicePixelRatio,
71
+ })),
72
+ ]);
73
+ return box
74
+ ? {
75
+ ...box,
76
+ x: box.x + metrics.x,
77
+ y: box.y + metrics.y,
78
+ devicePixelRatio: viewport
79
+ ? (viewport.deviceScaleFactor ?? 1)
80
+ : metrics.devicePixelRatio,
81
+ }
82
+ : undefined;
83
+ }
84
+ if (fullPage) {
85
+ const dims = await page.evaluate(() => ({
86
+ width: Math.max(document.documentElement.scrollWidth, document.body?.scrollWidth ?? 0),
87
+ height: Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight ?? 0),
88
+ devicePixelRatio: window.devicePixelRatio,
89
+ }));
90
+ if (dims.width <= 0 || dims.height <= 0) {
91
+ return undefined;
92
+ }
93
+ return {
94
+ x: 0,
95
+ y: 0,
96
+ width: dims.width,
97
+ height: dims.height,
98
+ devicePixelRatio: dims.devicePixelRatio,
99
+ };
100
+ }
101
+ const viewport = page.viewport();
102
+ // Clips use page coordinates. Read the scroll offset alongside the native
103
+ // dimensions used when no viewport is emulated.
104
+ const dims = await page.evaluate(() => ({
105
+ x: window.scrollX,
106
+ y: window.scrollY,
107
+ width: window.innerWidth,
108
+ height: window.innerHeight,
109
+ devicePixelRatio: window.devicePixelRatio,
110
+ }));
111
+ if (viewport) {
112
+ return {
113
+ x: dims.x,
114
+ y: dims.y,
115
+ width: viewport.width,
116
+ height: viewport.height,
117
+ devicePixelRatio: viewport.deviceScaleFactor ?? 1,
118
+ };
119
+ }
120
+ // The browser is launched and connected with `defaultViewport: null`, so
121
+ // `page.viewport()` stays null until something emulates one. Fall back to the
122
+ // window's own dimensions, which is the area a viewport screenshot captures.
123
+ if (dims.width <= 0 || dims.height <= 0) {
124
+ return undefined;
125
+ }
126
+ return {
127
+ x: dims.x,
128
+ y: dims.y,
129
+ width: dims.width,
130
+ height: dims.height,
131
+ devicePixelRatio: dims.devicePixelRatio,
132
+ };
133
+ }
134
+ function computeDownscaleClip(box, maxWidth, maxHeight) {
135
+ const widthScale = maxWidth !== undefined
136
+ ? Math.min(1, maxWidth / (box.width * box.devicePixelRatio))
137
+ : 1;
138
+ const heightScale = maxHeight !== undefined
139
+ ? Math.min(1, maxHeight / (box.height * box.devicePixelRatio))
140
+ : 1;
141
+ const scale = Math.min(widthScale, heightScale);
142
+ if (scale >= 1) {
143
+ return undefined;
144
+ }
145
+ // Skip degenerate sub-pixel results.
146
+ if (Math.round(box.width * box.devicePixelRatio * scale) < 1 ||
147
+ Math.round(box.height * box.devicePixelRatio * scale) < 1) {
148
+ return undefined;
149
+ }
150
+ return {
151
+ x: box.x,
152
+ y: box.y,
153
+ width: box.width,
154
+ height: box.height,
155
+ scale,
156
+ };
157
+ }
158
+ export const screenshot = definePageTool((args) => {
159
+ const { screenshotFormat, screenshotQuality, screenshotMaxWidth, screenshotMaxHeight, } = args;
160
+ const defaultFormat = screenshotFormat ?? 'png';
161
+ return {
162
+ name: 'take_screenshot',
163
+ description: `Take a screenshot of the page or element.`,
164
+ annotations: {
165
+ category: ToolCategory.DEBUGGING,
166
+ // Not read-only due to filePath param.
167
+ readOnlyHint: false,
168
+ },
169
+ schema: {
170
+ format: zod
171
+ .enum(['png', 'jpeg', 'webp'])
172
+ .default(defaultFormat)
173
+ .describe(`Type of format to save the screenshot as. Default is "${defaultFormat}"`),
174
+ quality: zod
175
+ .number()
176
+ .min(0)
177
+ .max(100)
178
+ .optional()
179
+ .describe('Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.'),
180
+ uid: zod
181
+ .string()
182
+ .optional()
183
+ .describe('The uid of an element on the page from the page content snapshot. If omitted, takes a page screenshot.'),
184
+ fullPage: zod
185
+ .boolean()
186
+ .optional()
187
+ .describe('If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.'),
188
+ omitBackground: zod
189
+ .boolean()
190
+ .optional()
191
+ .describe('Hide the default white background, allowing transparent PNG and WebP screenshots. Does not remove CSS backgrounds. Ignored for JPEG.'),
192
+ filePath: zod
193
+ .string()
194
+ .optional()
195
+ .describe('The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.'),
196
+ },
197
+ blockedByDialog: true,
198
+ concurrency: 'page',
199
+ verifyFilesSchema: {
200
+ filePath: true,
201
+ },
202
+ handler: async (request, response, context) => {
203
+ const env_1 = { stack: [], error: void 0, hasError: false };
204
+ try {
205
+ if (request.params.uid && request.params.fullPage) {
206
+ throw new Error('Providing both "uid" and "fullPage" is not allowed.');
207
+ }
208
+ const page = request.page.pptrPage;
209
+ const element = __addDisposableResource(env_1, request.params.uid
210
+ ? await request.page.getElementByUid(request.params.uid)
211
+ : undefined, false);
212
+ const format = request.params.format;
213
+ const quality = format === 'png'
214
+ ? undefined
215
+ : (request.params.quality ?? screenshotQuality);
216
+ const fullPage = request.params.fullPage ?? false;
217
+ // `getElementByUid` mints a fresh ElementHandle per call, so dispose it
218
+ // once the capture is done to avoid leaking a remote object for the life
219
+ // of the page's execution context.
220
+ let screenshot;
221
+ // Compute a downscale clip when --screenshot-max-width or
222
+ // --screenshot-max-height is set and the source exceeds either bound.
223
+ // The smaller scale factor wins so both bounds are respected while
224
+ // preserving aspect ratio.
225
+ let clip;
226
+ const shouldInspectBox = fullPage ||
227
+ element !== undefined ||
228
+ screenshotMaxWidth !== undefined ||
229
+ screenshotMaxHeight !== undefined;
230
+ const box = shouldInspectBox
231
+ ? await getSourceBox(page, element, fullPage)
232
+ : undefined;
233
+ if (box &&
234
+ (screenshotMaxWidth !== undefined ||
235
+ screenshotMaxHeight !== undefined)) {
236
+ clip = computeDownscaleClip(box, screenshotMaxWidth, screenshotMaxHeight);
237
+ }
238
+ if (clip) {
239
+ // page.screenshot with clip lets the CDP scale param downscale the
240
+ // capture for viewport, full-page and element shots alike. We rely on
241
+ // Puppeteer's default of captureBeyondViewport=true when a clip is
242
+ // present so element/full-page captures below the fold still work.
243
+ screenshot = await page.screenshot({
244
+ type: format,
245
+ quality,
246
+ optimizeForSpeed: true,
247
+ omitBackground: request.params.omitBackground,
248
+ clip,
249
+ });
250
+ }
251
+ else if (element) {
252
+ screenshot = await element.screenshot({
253
+ type: format,
254
+ quality,
255
+ optimizeForSpeed: true,
256
+ omitBackground: request.params.omitBackground,
257
+ });
258
+ }
259
+ else {
260
+ screenshot = await page.screenshot({
261
+ type: format,
262
+ fullPage,
263
+ quality,
264
+ optimizeForSpeed: true,
265
+ omitBackground: request.params.omitBackground,
266
+ });
267
+ }
268
+ if (request.params.uid) {
269
+ response.appendResponseLine(`Took a screenshot of node with uid "${request.params.uid}".`);
270
+ }
271
+ else if (fullPage) {
272
+ response.appendResponseLine('Took a screenshot of the full current page.');
273
+ }
274
+ else {
275
+ response.appendResponseLine("Took a screenshot of the current page's viewport.");
276
+ }
277
+ // Narrow `format` at the point of use: in the factory form of
278
+ // definePageTool TS widens the Schema generic, which loses the literal
279
+ // union from zod.enum on request.params.format.
280
+ const extension = format === 'jpeg' ? '.jpeg' : format === 'webp' ? '.webp' : '.png';
281
+ if (request.params.filePath) {
282
+ const result = await context.saveFile(screenshot, request.params.filePath, extension);
283
+ response.appendResponseLine(`Saved screenshot to ${result.filename}.`);
284
+ }
285
+ else if (screenshot.length >= 2_000_000) {
286
+ const { filepath } = await context.saveTemporaryFile(screenshot, `screenshot${extension}`);
287
+ response.appendResponseLine(`Saved screenshot to ${filepath}.`);
288
+ }
289
+ else {
290
+ response.attachImage({
291
+ mimeType: `image/${format}`,
292
+ data: Buffer.from(screenshot).toString('base64'),
293
+ });
294
+ }
295
+ if (box) {
296
+ const effectiveScale = clip?.scale ?? 1;
297
+ const effectiveWidth = box.width * box.devicePixelRatio * effectiveScale;
298
+ const effectiveHeight = box.height * box.devicePixelRatio * effectiveScale;
299
+ if (effectiveWidth > MAX_CHROMIUM_SCREENSHOT_DIMENSION ||
300
+ effectiveHeight > MAX_CHROMIUM_SCREENSHOT_DIMENSION) {
301
+ response.appendResponseLine(`Warning: Screenshot dimensions exceed the maximum capturable dimension of ${MAX_CHROMIUM_SCREENSHOT_DIMENSION}px. Content beyond 16384px may repeat or be corrupted due to browser texture limits. Set --screenshotMaxHeight or --screenshotMaxWidth to downscale.`);
302
+ }
303
+ }
304
+ }
305
+ catch (e_1) {
306
+ env_1.error = e_1;
307
+ env_1.hasError = true;
308
+ }
309
+ finally {
310
+ __disposeResources(env_1);
311
+ }
312
+ },
313
+ };
314
+ });
315
+ //# sourceMappingURL=screenshot.js.map