chrome-devtools-mcp 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. package/README.md +73 -21
  2. package/{build → out/Default/gen}/src/BrowserManager.js +49 -18
  3. package/out/Default/gen/src/LogpointManager.js +307 -0
  4. package/{build → out/Default/gen}/src/McpContext.js +439 -133
  5. package/{build → out/Default/gen}/src/McpPage.js +368 -59
  6. package/{build → out/Default/gen}/src/McpResponse.js +90 -47
  7. package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
  8. package/{build → out/Default/gen}/src/TextSnapshot.js +37 -18
  9. package/out/Default/gen/src/ToolHandler.js +512 -0
  10. package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +6 -4
  11. package/{build → out/Default/gen}/src/bin/chrome-devtools.js +4 -4
  12. package/{build → out/Default/gen}/src/collectors/PageCollector.js +28 -12
  13. package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +2 -2
  14. package/out/Default/gen/src/collectors/constants.js +7 -0
  15. package/out/Default/gen/src/config/ConfigParser.js +162 -0
  16. package/{build → out/Default/gen}/src/config/ConfigWatcher.js +3 -2
  17. package/out/Default/gen/src/config/ServerConfig.js +251 -0
  18. package/{build → out/Default/gen}/src/config/browser-options.js +13 -4
  19. package/{build → out/Default/gen}/src/config/category-options.js +10 -0
  20. package/{build → out/Default/gen}/src/config/cli-options.js +223 -22
  21. package/{build → out/Default/gen}/src/config/mcp-options.js +62 -36
  22. package/{build → out/Default/gen}/src/config/puppeteer-options.js +4 -2
  23. package/{build → out/Default/gen}/src/daemon/client.js +3 -3
  24. package/{build → out/Default/gen}/src/daemon/daemon.js +7 -3
  25. package/{build → out/Default/gen}/src/daemon/utils.js +2 -1
  26. package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +28 -5
  27. package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +94 -20
  28. package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +28 -1
  29. package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +14 -18
  30. package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
  31. package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +70 -17
  32. package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
  33. package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
  34. package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +13 -3
  35. package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
  36. package/out/Default/gen/src/index.js +435 -0
  37. package/out/Default/gen/src/processors/HeapSnapshotManager.js +569 -0
  38. package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
  39. package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +796 -712
  40. package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
  41. package/out/Default/gen/src/third_party/cli.js +9023 -0
  42. package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
  43. package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
  44. package/out/Default/gen/src/third_party/index.js +201574 -0
  45. package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
  46. package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
  47. package/{build → out/Default/gen}/src/tools/categories.js +4 -0
  48. package/{build → out/Default/gen}/src/tools/comments.js +46 -4
  49. package/{build → out/Default/gen}/src/tools/console.js +8 -6
  50. package/{build → out/Default/gen}/src/tools/css.js +1 -0
  51. package/{build → out/Default/gen}/src/tools/emulation.js +5 -4
  52. package/{build → out/Default/gen}/src/tools/extensions.js +6 -1
  53. package/{build → out/Default/gen}/src/tools/input.js +23 -28
  54. package/{build → out/Default/gen}/src/tools/lighthouse.js +30 -8
  55. package/out/Default/gen/src/tools/logpoints.js +51 -0
  56. package/{build → out/Default/gen}/src/tools/memory.js +59 -53
  57. package/out/Default/gen/src/tools/network.js +260 -0
  58. package/{build → out/Default/gen}/src/tools/pages.js +48 -6
  59. package/{build → out/Default/gen}/src/tools/performance.js +33 -7
  60. package/{build → out/Default/gen}/src/tools/pwa.js +7 -0
  61. package/{build → out/Default/gen}/src/tools/screencast.js +3 -1
  62. package/{build → out/Default/gen}/src/tools/screenshot.js +23 -7
  63. package/{build → out/Default/gen}/src/tools/script.js +38 -6
  64. package/{build → out/Default/gen}/src/tools/slim/tools.js +21 -5
  65. package/{build → out/Default/gen}/src/tools/snapshot.js +29 -5
  66. package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +6 -20
  67. package/out/Default/gen/src/tools/toolNames.js +10 -0
  68. package/{build → out/Default/gen}/src/tools/tools.js +4 -0
  69. package/out/Default/gen/src/tools/webauthn.js +51 -0
  70. package/{build → out/Default/gen}/src/tools/webmcp.js +5 -19
  71. package/out/Default/gen/src/utils/TaskRunner.js +151 -0
  72. package/{build → out/Default/gen}/src/utils/WaitForHelper.js +16 -2
  73. package/{build → out/Default/gen}/src/utils/bytes.js +2 -12
  74. package/{build → out/Default/gen}/src/utils/check-for-updates.js +8 -2
  75. package/out/Default/gen/src/utils/disclaimers.js +27 -0
  76. package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
  77. package/{build → out/Default/gen}/src/utils/keyboard.js +15 -5
  78. package/out/Default/gen/src/utils/logger.js +131 -0
  79. package/out/Default/gen/src/utils/network.js +81 -0
  80. package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
  81. package/out/Default/gen/src/utils/resourceType.js +27 -0
  82. package/out/Default/gen/src/utils/text.js +44 -0
  83. package/out/Default/gen/src/utils/timeout.js +14 -0
  84. package/{build → out/Default/gen}/src/utils/url.js +73 -17
  85. package/{build → out/Default/gen}/src/version.js +1 -1
  86. package/package.json +26 -32
  87. package/skills/a11y-debugging/SKILL.md +3 -8
  88. package/skills/chrome-devtools/SKILL.md +2 -0
  89. package/skills/chrome-devtools-cli/SKILL.md +12 -1
  90. package/build/src/ToolHandler.js +0 -360
  91. package/build/src/config/ConfigParser.js +0 -264
  92. package/build/src/index.js +0 -282
  93. package/build/src/processors/HeapSnapshotManager.js +0 -307
  94. package/build/src/third_party/bundled-packages.json +0 -11
  95. package/build/src/third_party/devtools-formatter-worker.js +0 -16625
  96. package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12084
  97. package/build/src/third_party/index.js +0 -189603
  98. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -58435
  99. package/build/src/tools/ToolDefinition.js +0 -92
  100. package/build/src/tools/network.js +0 -128
  101. package/build/src/utils/logger.js +0 -62
  102. package/build/src/utils/text.js +0 -15
  103. /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
  104. /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
  105. /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
  106. /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
  107. /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
  108. /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
  109. /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
  110. /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
  111. /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
  112. /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
  113. /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
  114. /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
  115. /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
  116. /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
  117. /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
  118. /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
  119. /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
  120. /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
  121. /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
  122. /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
  123. /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
  124. /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
  125. /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
  126. /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
  127. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
  128. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
  129. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
  130. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
  131. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
  132. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
  133. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
  134. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
  135. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
  136. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
  137. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
  138. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
  139. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
  140. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
  141. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
  142. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
  143. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
  144. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
  145. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
  146. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
  147. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
  148. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
  149. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
  150. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
  151. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
  152. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
  153. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
  154. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
  155. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
  156. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
  157. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
  158. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
  159. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
  160. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
  161. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
  162. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
  163. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
  164. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
  165. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
  166. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
  167. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
  168. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
  169. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
  170. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
  171. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
  172. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
  173. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
  174. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
  175. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
  176. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
  177. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
  178. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
  179. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
  180. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
  181. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
  182. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
  183. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
  184. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
  185. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
  186. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
  187. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
  188. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
  189. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
  190. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
  191. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
  192. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
  193. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
  194. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
  195. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
  196. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
  197. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
  198. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
  199. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
  200. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
  201. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
  202. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
  203. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
  204. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
  205. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
  206. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
  207. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
  208. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
  209. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
  210. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
  211. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
  212. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
  213. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
  214. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
  215. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
  216. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
  217. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
  218. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
  219. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
  220. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
  221. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
  222. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
  223. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
  224. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
  225. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
  226. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
  227. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
  228. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
  229. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
  230. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
  231. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
  232. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
  233. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
  234. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
  235. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
  236. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
  237. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
  238. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
  239. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
  240. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
  241. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
  242. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
  243. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
  244. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
  245. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
  246. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
  247. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
  248. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
  249. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
  250. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
  251. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
  252. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
  253. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
  254. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
  255. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
  256. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
  257. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
  258. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
  259. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
  260. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
  261. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
  262. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
  263. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
  264. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
  265. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
  266. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
  267. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
  268. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
  269. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
  270. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
  271. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
  272. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
  273. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
  274. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
  275. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
  276. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
  277. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
  278. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
  279. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
  280. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
  281. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
  282. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
  283. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
  284. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
  285. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
  286. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
  287. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
  288. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
  289. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
  290. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
  291. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
  292. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
  293. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
  294. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
  295. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
  296. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
  297. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
  298. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
  299. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
  300. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
  301. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
  302. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
  303. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
  304. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
  305. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
  306. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
  307. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
  308. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
  309. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
  310. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
  311. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
  312. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
  313. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
  314. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
  315. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
  316. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
  317. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
  318. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
  319. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
  320. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
  321. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
  322. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
  323. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
  324. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
  325. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
  326. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
  327. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
  328. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
  329. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
  330. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
  331. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
  332. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
  333. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
  334. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
  335. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
  336. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
  337. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
  338. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
  339. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
  340. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
  341. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
  342. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
  343. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
  344. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
  345. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
  346. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
  347. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
  348. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
  349. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
  350. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
  351. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
  352. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
  353. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
  354. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
  355. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
  356. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
  357. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
  358. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
  359. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
  360. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
  361. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
  362. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
  363. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
  364. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
  365. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
  366. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
  367. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
  368. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
  369. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
  370. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
  371. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
  372. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
  373. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
  374. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
  375. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
  376. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
  377. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
  378. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
  379. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
  380. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
  381. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
  382. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
  383. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
  384. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
  385. /package/{build → out/Default/gen}/src/types.js +0 -0
  386. /package/{build → out/Default/gen}/src/utils/files.js +0 -0
  387. /package/{build → out/Default/gen}/src/utils/id.js +0 -0
  388. /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
  389. /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import fs from 'node:fs/promises';
7
+ import { NetworkOverridesFormatter } from '../formatters/NetworkOverridesFormatter.js';
8
+ import { zod } from '../third_party/index.js';
9
+ import { validateUrlPatterns } from '../utils/url.js';
10
+ import { ToolCategory } from './categories.js';
11
+ import { definePageTool } from './ToolDefinition.js';
12
+ const FILTERABLE_RESOURCE_TYPES = [
13
+ 'document',
14
+ 'stylesheet',
15
+ 'image',
16
+ 'media',
17
+ 'font',
18
+ 'script',
19
+ 'texttrack',
20
+ 'xhr',
21
+ 'fetch',
22
+ 'prefetch',
23
+ 'eventsource',
24
+ 'manifest',
25
+ 'signedexchange',
26
+ 'ping',
27
+ 'cspviolationreport',
28
+ 'preflight',
29
+ 'fedcm',
30
+ 'other',
31
+ ];
32
+ export const listNetworkRequests = definePageTool((args) => ({
33
+ name: 'list_network_requests',
34
+ description: `Lists the most recent requests for the target page since the last navigation.`,
35
+ annotations: {
36
+ category: ToolCategory.NETWORK,
37
+ readOnlyHint: true,
38
+ },
39
+ schema: {
40
+ pageSize: zod
41
+ .number()
42
+ .int()
43
+ .positive()
44
+ .optional()
45
+ .describe('Maximum number of requests to return. When omitted, returns all requests.'),
46
+ pageIdx: zod
47
+ .number()
48
+ .int()
49
+ .min(0)
50
+ .optional()
51
+ .describe('Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.'),
52
+ resourceTypes: zod
53
+ .array(zod.enum(FILTERABLE_RESOURCE_TYPES))
54
+ .optional()
55
+ .describe('Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests.'),
56
+ includePreservedRequests: zod
57
+ .boolean()
58
+ .default(false)
59
+ .optional()
60
+ .describe(`Set to true to return the preserved requests over the last ${args.maxNavigationSaved} navigations.`),
61
+ },
62
+ blockedByDialog: false,
63
+ concurrency: 'page',
64
+ verifyFilesSchema: {},
65
+ handler: async (request, response) => {
66
+ const data = await request.page.getDevToolsData();
67
+ response.attachDevToolsData(data);
68
+ const reqid = data?.cdpRequestId
69
+ ? request.page.resolveCdpRequestId(data.cdpRequestId)
70
+ : undefined;
71
+ response.setIncludeNetworkRequests(true, {
72
+ pageSize: request.params.pageSize,
73
+ pageIdx: request.params.pageIdx,
74
+ resourceTypes: request.params.resourceTypes,
75
+ includePreservedRequests: request.params.includePreservedRequests,
76
+ networkRequestIdInDevToolsUI: reqid,
77
+ });
78
+ },
79
+ }));
80
+ export const getNetworkRequest = definePageTool(() => ({
81
+ name: 'get_network_request',
82
+ description: `Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).`,
83
+ annotations: {
84
+ category: ToolCategory.NETWORK,
85
+ readOnlyHint: false,
86
+ },
87
+ schema: {
88
+ reqid: zod
89
+ .number()
90
+ .optional()
91
+ .describe('The reqid of the network request. If omitted returns the currently selected request in the DevTools Network panel.'),
92
+ requestFilePath: zod
93
+ .string()
94
+ .optional()
95
+ .describe('The absolute or relative path to a .network-request file to save the request body to. If omitted, the body is returned inline.'),
96
+ responseFilePath: zod
97
+ .string()
98
+ .optional()
99
+ .describe('The absolute or relative path to a .network-response file to save the response body to. If omitted, the body is returned inline.'),
100
+ },
101
+ blockedByDialog: true,
102
+ concurrency: 'page',
103
+ verifyFilesSchema: {
104
+ requestFilePath: true,
105
+ responseFilePath: true,
106
+ },
107
+ handler: async (request, response) => {
108
+ if (request.params.reqid) {
109
+ response.attachNetworkRequest(request.params.reqid, {
110
+ requestFilePath: request.params.requestFilePath,
111
+ responseFilePath: request.params.responseFilePath,
112
+ });
113
+ }
114
+ else {
115
+ const data = await request.page.getDevToolsData();
116
+ response.attachDevToolsData(data);
117
+ const reqid = data?.cdpRequestId
118
+ ? request.page.resolveCdpRequestId(data.cdpRequestId)
119
+ : undefined;
120
+ if (reqid) {
121
+ response.attachNetworkRequest(reqid, {
122
+ requestFilePath: request.params.requestFilePath,
123
+ responseFilePath: request.params.responseFilePath,
124
+ });
125
+ }
126
+ else {
127
+ response.appendResponseLine(`Nothing is currently selected in the DevTools Network panel.`);
128
+ }
129
+ }
130
+ },
131
+ }));
132
+ const mockFilterSchema = {
133
+ route: zod
134
+ .string()
135
+ .trim()
136
+ .min(1)
137
+ .refine(value => !value.startsWith('/'), 'route must be an absolute URLPattern, such as https://example.com/app.js or *://*:*/app.js.')
138
+ .superRefine((value, context) => {
139
+ try {
140
+ validateUrlPatterns([value], 'route');
141
+ }
142
+ catch (error) {
143
+ context.addIssue({
144
+ code: 'custom',
145
+ message: error instanceof Error ? error.message : String(error),
146
+ });
147
+ }
148
+ })
149
+ .optional()
150
+ .describe('Absolute URLPattern, e.g. https://example.com/app.js ' +
151
+ 'or `*://*:*/app.js`. Use `*` for wildcards; ' +
152
+ 'omitted query strings match any query. Regex and `:name` groups ' +
153
+ 'are rejected. Inspection and removal compare the stored pattern ' +
154
+ 'exactly. Omit to inspect/remove all routes or match any URL.'),
155
+ resourceType: zod
156
+ .enum(FILTERABLE_RESOURCE_TYPES)
157
+ .optional()
158
+ .describe('Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.'),
159
+ };
160
+ const mockNetworkSchema = zod
161
+ // eslint-disable-next-line @local/enforce-zod-schema -- Flat parameters.
162
+ .object({
163
+ ...mockFilterSchema,
164
+ body: zod
165
+ .string()
166
+ .trim()
167
+ .min(1)
168
+ .optional()
169
+ .describe('Local response body file, revalidated and reread for every request. Content-Type follows its extension. Mutually exclusive with upstream.'),
170
+ upstream: zod
171
+ .url({ protocol: /^https?$/ })
172
+ .optional()
173
+ .describe('Absolute HTTP(S) replacement URL for GET/HEAD requests. URL allowlists and blocklists apply to this URL and every redirect. Mutually exclusive with body.'),
174
+ })
175
+ .refine(params => params.body === undefined || params.upstream === undefined, {
176
+ message: 'body and upstream are mutually exclusive.',
177
+ path: ['upstream'],
178
+ });
179
+ export const mockNetwork = definePageTool(() => ({
180
+ name: 'mock_network',
181
+ description: 'Inspect or update network mocks for a page. With no actions, list mocks ' +
182
+ 'matching the supplied filters, or all mocks when no filters are given. ' +
183
+ 'Providing body or upstream updates the exact route/resourceType pair. ' +
184
+ 'An omitted route matches any URL. Other mocks are preserved. ' +
185
+ 'The most recently updated matching mock wins and persists across ' +
186
+ 'navigations. Configure before navigating or reloading; inspection shows ' +
187
+ 'hit counts and replacement errors. Upstream responses use server-side ' +
188
+ 'GET/HEAD fetches. Changes are rejected during ' +
189
+ 'a performance trace. Mocks disable the page HTTP cache and intercept ' +
190
+ 'every request, affecting measurements. Service workers can bypass mocks. ' +
191
+ 'Use remove_network_mock to remove mocks.',
192
+ annotations: {
193
+ category: ToolCategory.NETWORK_MOCKS,
194
+ readOnlyHint: false,
195
+ },
196
+ schema: mockNetworkSchema.shape,
197
+ blockedByDialog: false,
198
+ verifyFilesSchema: { body: true },
199
+ concurrency: 'page',
200
+ handler: async (request, response, context) => {
201
+ const params = mockNetworkSchema.parse(request.params);
202
+ const filter = {
203
+ urlPattern: params.route,
204
+ resourceType: params.resourceType,
205
+ };
206
+ let input;
207
+ if (params.upstream !== undefined) {
208
+ input = { ...filter, kind: 'upstream', upstreamUrl: params.upstream };
209
+ }
210
+ else if (params.body !== undefined) {
211
+ const responseFilePath = params.body;
212
+ input = {
213
+ ...filter,
214
+ kind: 'file',
215
+ responseFilePath,
216
+ loadResponseFile: async () => {
217
+ const validatedPath = await context.validatePath(responseFilePath);
218
+ return await fs.readFile(validatedPath);
219
+ },
220
+ };
221
+ }
222
+ let overrides;
223
+ if (input) {
224
+ overrides = [await request.page.mockNetwork(input)];
225
+ response.appendResponseLine('Network mock configured. Reload or navigate the page to apply it.');
226
+ }
227
+ else {
228
+ overrides = request.page.listNetworkMocks(filter);
229
+ }
230
+ if (overrides.length === 0) {
231
+ response.appendResponseLine('No network mocks match these filters.');
232
+ return;
233
+ }
234
+ response.appendResponseLine(new NetworkOverridesFormatter(overrides).toString());
235
+ },
236
+ }));
237
+ export const removeNetworkMock = definePageTool(() => ({
238
+ name: 'remove_network_mock',
239
+ description: 'Remove network mocks matching the supplied stored route and/or resource ' +
240
+ 'type. Route patterns are compared exactly, not applied as wildcards to ' +
241
+ 'other patterns. Omit both filters to remove all mocks for the page. ' +
242
+ 'Removing the last mock restores the HTTP cache and stops interception. ' +
243
+ 'Changes are rejected during a performance trace.',
244
+ annotations: {
245
+ category: ToolCategory.NETWORK_MOCKS,
246
+ readOnlyHint: false,
247
+ },
248
+ schema: mockFilterSchema,
249
+ blockedByDialog: false,
250
+ verifyFilesSchema: {},
251
+ concurrency: 'page',
252
+ handler: async (request, response) => {
253
+ const count = await request.page.removeNetworkMocks({
254
+ urlPattern: request.params.route,
255
+ resourceType: request.params.resourceType,
256
+ });
257
+ response.appendResponseLine(`Removed ${count} network ${count === 1 ? 'mock' : 'mocks'}.`);
258
+ },
259
+ }));
260
+ //# sourceMappingURL=network.js.map
@@ -18,6 +18,7 @@ export const listPages = defineTool((args) => {
18
18
  },
19
19
  schema: {},
20
20
  blockedByDialog: false,
21
+ concurrency: 'exclusive',
21
22
  verifyFilesSchema: {},
22
23
  handler: async (_request, response) => {
23
24
  response.setIncludePages(true);
@@ -43,10 +44,11 @@ export const selectPage = defineTool((args) => ({
43
44
  .describe('Whether to focus the page and bring it to the top.'),
44
45
  },
45
46
  blockedByDialog: false,
47
+ concurrency: 'exclusive',
46
48
  verifyFilesSchema: {},
47
49
  handler: async (request, response, context) => {
48
50
  const page = context.getPageById(request.params.pageId);
49
- await page.init();
51
+ await page.init({ emulateFocus: true });
50
52
  context.selectPage(page);
51
53
  response.setIncludePages(true);
52
54
  response.setListThirdPartyDeveloperTools();
@@ -69,6 +71,7 @@ export const closePage = defineTool(() => ({
69
71
  .describe('The ID of the page to close. Call list_pages to list pages.'),
70
72
  },
71
73
  blockedByDialog: false,
74
+ concurrency: 'exclusive',
72
75
  verifyFilesSchema: {},
73
76
  handler: async (request, response, context) => {
74
77
  try {
@@ -109,6 +112,7 @@ export const newPage = defineTool((args) => {
109
112
  ...timeoutSchema,
110
113
  },
111
114
  blockedByDialog: false,
115
+ concurrency: 'exclusive',
112
116
  verifyFilesSchema: {},
113
117
  handler: async (request, response, context) => {
114
118
  validateUrl(request.params.url, {
@@ -116,12 +120,46 @@ export const newPage = defineTool((args) => {
116
120
  categoryExtensions: args?.categoryExtensions,
117
121
  fileNavigations: args?.fileNavigations,
118
122
  });
123
+ let previousPage;
124
+ try {
125
+ previousPage = context.getSelectedMcpPage();
126
+ }
127
+ catch {
128
+ // Nothing is selected, so there is no selection to restore on failure.
129
+ }
119
130
  const page = await context.newPage(request.params.background, request.params.isolatedContext);
120
- await page.waitForEventsAfterAction(async () => {
121
- await page.pptrPage.goto(request.params.url, {
122
- timeout: request.params.timeout,
123
- });
124
- }, { timeout: request.params.timeout });
131
+ try {
132
+ await page.waitForEventsAfterAction(async () => {
133
+ await page.pptrPage.goto(request.params.url, {
134
+ timeout: request.params.timeout,
135
+ });
136
+ }, { timeout: request.params.timeout });
137
+ }
138
+ catch (error) {
139
+ // A dialog-blocked load stays open for handle_dialog. Otherwise cleanup is
140
+ // best-effort: the navigation error is always what gets rethrown.
141
+ if (page.getDialog()) {
142
+ response.setIncludePages(true);
143
+ }
144
+ else {
145
+ try {
146
+ if (previousPage && !previousPage.isClosed()) {
147
+ context.selectPage(previousPage);
148
+ }
149
+ }
150
+ catch {
151
+ // Keep the new tab selected.
152
+ }
153
+ try {
154
+ await context.closePage(page.id);
155
+ }
156
+ catch {
157
+ // The tab survived, so list pages to tell the caller its pageId.
158
+ response.setIncludePages(true);
159
+ }
160
+ }
161
+ throw error;
162
+ }
125
163
  response.setIncludePages(true);
126
164
  response.setListThirdPartyDeveloperTools();
127
165
  },
@@ -160,6 +198,7 @@ export const navigatePage = definePageTool((args) => {
160
198
  ...timeoutSchema,
161
199
  },
162
200
  blockedByDialog: false,
201
+ concurrency: 'page',
163
202
  verifyFilesSchema: {},
164
203
  handler: async (request, response) => {
165
204
  const page = request.page;
@@ -267,6 +306,7 @@ export const resizePage = definePageTool(() => ({
267
306
  height: zod.number().int().positive().describe('Page height'),
268
307
  },
269
308
  blockedByDialog: false,
309
+ concurrency: 'exclusive',
270
310
  verifyFilesSchema: {},
271
311
  handler: async (request, response) => {
272
312
  const page = request.page;
@@ -310,6 +350,7 @@ export const handleDialog = definePageTool(() => ({
310
350
  .describe('Optional prompt text to enter into the dialog.'),
311
351
  },
312
352
  blockedByDialog: false,
353
+ concurrency: 'page',
313
354
  verifyFilesSchema: {},
314
355
  handler: async (request, response) => {
315
356
  const page = request.page;
@@ -355,6 +396,7 @@ export const getTabId = definePageTool(() => ({
355
396
  },
356
397
  schema: {},
357
398
  blockedByDialog: false,
399
+ concurrency: 'page',
358
400
  verifyFilesSchema: {},
359
401
  handler: async (request, response) => {
360
402
  const page = request.page;
@@ -7,8 +7,9 @@ import zlib from 'node:zlib';
7
7
  import { zod, DevTools } from '../third_party/index.js';
8
8
  import { parseRawTraceBuffer, traceResultIsSuccess, } from '../processors/PerformanceTrace.js';
9
9
  import { logger } from '../utils/logger.js';
10
+ import { NetworkOverridesFormatter } from '../formatters/NetworkOverridesFormatter.js';
10
11
  import { ToolCategory } from './categories.js';
11
- import { definePageTool } from './ToolDefinition.js';
12
+ import { definePageTool, } from './ToolDefinition.js';
12
13
  const filePathSchema = zod
13
14
  .string()
14
15
  .optional()
@@ -32,10 +33,11 @@ export const startTrace = definePageTool(() => ({
32
33
  ignoreCache: zod
33
34
  .boolean()
34
35
  .optional()
35
- .describe('Whether to bypass the HTTP cache when reloading the page, to measure a cold page load. Only applies if reload is true.'),
36
+ .describe('Whether to bypass the HTTP cache when reloading the page, to measure a cold page load. Only applies if reload is true. Active network mocks always disable the page HTTP cache.'),
36
37
  filePath: filePathSchema,
37
38
  },
38
39
  blockedByDialog: true,
40
+ concurrency: 'exclusive',
39
41
  verifyFilesSchema: {
40
42
  filePath: true,
41
43
  },
@@ -44,8 +46,13 @@ export const startTrace = definePageTool(() => ({
44
46
  response.appendResponseLine('Error: a performance trace is already running. Use performance_stop_trace to stop it. Only one trace can be running at any given time.');
45
47
  return;
46
48
  }
47
- context.setIsRunningPerformanceTrace(true);
48
49
  const page = request.page;
50
+ const networkOverrides = page.listNetworkMocks();
51
+ const { warning } = new NetworkOverridesFormatter(networkOverrides).toJSON();
52
+ if (warning) {
53
+ response.appendResponseLine(warning);
54
+ }
55
+ page.setIsRunningPerformanceTrace(true);
49
56
  const pageUrlForTracing = page.pptrPage.url();
50
57
  try {
51
58
  if (request.params.reload) {
@@ -67,7 +74,7 @@ export const startTrace = definePageTool(() => ({
67
74
  bufferSize: 1200 * 1000,
68
75
  });
69
76
  if (request.params.reload) {
70
- const ignoreCache = request.params.ignoreCache ?? false;
77
+ const ignoreCache = request.params.ignoreCache === true && networkOverrides.length === 0;
71
78
  if (ignoreCache) {
72
79
  // Disable the HTTP cache so that the main document and all
73
80
  // subresources are fetched from the network, like a hard reload.
@@ -106,13 +113,13 @@ export const startTrace = definePageTool(() => ({
106
113
  catch {
107
114
  // Tracing may not have started yet; ignore.
108
115
  }
109
- context.setIsRunningPerformanceTrace(false);
116
+ page.setIsRunningPerformanceTrace(false);
110
117
  }
111
118
  throw error;
112
119
  }
113
120
  },
114
121
  }));
115
- export const stopTrace = definePageTool(() => ({
122
+ export const stopTrace = definePageTool((args) => ({
116
123
  name: 'performance_stop_trace',
117
124
  description: 'Stop the active performance trace recording on the target webpage.',
118
125
  annotations: {
@@ -123,6 +130,7 @@ export const stopTrace = definePageTool(() => ({
123
130
  filePath: filePathSchema,
124
131
  },
125
132
  blockedByDialog: true,
133
+ concurrency: 'exclusive',
126
134
  verifyFilesSchema: {
127
135
  filePath: true,
128
136
  },
@@ -132,6 +140,23 @@ export const stopTrace = definePageTool(() => ({
132
140
  return;
133
141
  }
134
142
  const page = request.page;
143
+ if (!page.isRunningPerformanceTrace()) {
144
+ const tracedPage = context
145
+ .getPages()
146
+ .find(p => p.isRunningPerformanceTrace());
147
+ const pageHint = tracedPage ? ` on page ${tracedPage.id}` : '';
148
+ const actionHint = tracedPage
149
+ ? args.pageIdRouting
150
+ ? `Pass pageId: ${tracedPage.id} to performance_stop_trace to stop it.`
151
+ : `Select page ${tracedPage.id} with select_page first, then call performance_stop_trace.`
152
+ : 'Select the page that started the trace and try again.';
153
+ response.appendResponseLine(`Error: the active performance trace is running${pageHint}, not on page ${page.id}. ${actionHint}`);
154
+ return;
155
+ }
156
+ const { warning } = new NetworkOverridesFormatter(page.listNetworkMocks()).toJSON();
157
+ if (warning) {
158
+ response.appendResponseLine(warning);
159
+ }
135
160
  await stopTracingAndAppendOutput(page, response, context, request.params.filePath);
136
161
  },
137
162
  }));
@@ -151,6 +176,7 @@ export const analyzeInsight = definePageTool(() => ({
151
176
  .describe('The name of the Insight you want more information on. For example: "DocumentLatency" or "LCPBreakdown"'),
152
177
  },
153
178
  blockedByDialog: false,
179
+ concurrency: 'exclusive',
154
180
  verifyFilesSchema: {},
155
181
  handler: async (request, response, context) => {
156
182
  const lastRecording = context.recordedTraces().at(-1);
@@ -198,7 +224,7 @@ async function stopTracingAndAppendOutput(page, response, context, filePath) {
198
224
  }
199
225
  }
200
226
  finally {
201
- context.setIsRunningPerformanceTrace(false);
227
+ page.setIsRunningPerformanceTrace(false);
202
228
  }
203
229
  }
204
230
  /** We tell CrUXManager to fetch data so it's available when DevTools.PerformanceTraceFormatter is invoked */
@@ -38,12 +38,16 @@ export const installPwa = defineTool(() => ({
38
38
  displayMode: displayModeSchema,
39
39
  },
40
40
  blockedByDialog: false,
41
+ concurrency: 'exclusive',
41
42
  // We do not validate file paths for remote browser instances
42
43
  // because they are on the remote host and not accessed by the MCP server.
43
44
  verifyFilesSchema: {
44
45
  installUrlOrBundleUrl: {
45
46
  local: true,
46
47
  remote: false,
48
+ // May be an http(s):// or file:// signed web bundle URL handed to the
49
+ // browser, so allow URLs through; a plain path is still validated.
50
+ allowUrl: true,
47
51
  },
48
52
  },
49
53
  handler: async (request, response, context) => {
@@ -71,6 +75,7 @@ export const uninstallPwa = defineTool(() => ({
71
75
  manifestId: manifestIdSchema,
72
76
  },
73
77
  blockedByDialog: false,
78
+ concurrency: 'exclusive',
74
79
  verifyFilesSchema: {},
75
80
  handler: async (request, response, context) => {
76
81
  const { manifestId } = request.params;
@@ -96,6 +101,7 @@ export const launchPwa = defineTool(() => ({
96
101
  .describe('Optional URL within the app to open instead of the default start URL.'),
97
102
  },
98
103
  blockedByDialog: false,
104
+ concurrency: 'exclusive',
99
105
  verifyFilesSchema: {},
100
106
  handler: async (request, response, context) => {
101
107
  const { manifestId, url } = request.params;
@@ -116,6 +122,7 @@ export const getOsAppState = defineTool(() => ({
116
122
  manifestId: manifestIdSchema,
117
123
  },
118
124
  blockedByDialog: false,
125
+ concurrency: 'exclusive',
119
126
  verifyFilesSchema: {},
120
127
  handler: async (request, response, context) => {
121
128
  const { manifestId } = request.params;
@@ -6,7 +6,7 @@
6
6
  import fs from 'node:fs/promises';
7
7
  import os from 'node:os';
8
8
  import path from 'node:path';
9
- import { zod } from '../third_party/index.js';
9
+ import { zod, } from '../third_party/index.js';
10
10
  import { ToolCategory } from './categories.js';
11
11
  import { definePageTool } from './ToolDefinition.js';
12
12
  async function generateTempFilePath() {
@@ -62,6 +62,7 @@ export const startScreencast = definePageTool((args) => ({
62
62
  : 'Output file path (.mp4). Uses mkdtemp to generate a unique path if not provided.'),
63
63
  },
64
64
  blockedByDialog: false,
65
+ concurrency: 'exclusive',
65
66
  verifyFilesSchema: {
66
67
  filePath: true,
67
68
  },
@@ -138,6 +139,7 @@ export const stopScreencast = definePageTool(() => ({
138
139
  },
139
140
  schema: {},
140
141
  blockedByDialog: false,
142
+ concurrency: 'exclusive',
141
143
  verifyFilesSchema: {},
142
144
  handler: async (request, response) => {
143
145
  const page = request.page;
@@ -55,9 +55,10 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
55
55
  var e = new Error(message);
56
56
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
57
  });
58
- import { zod } from '../third_party/index.js';
58
+ import { zod, } from '../third_party/index.js';
59
59
  import { ToolCategory } from './categories.js';
60
60
  import { definePageTool } from './ToolDefinition.js';
61
+ const MAX_CHROMIUM_SCREENSHOT_DIMENSION = 16384;
61
62
  async function getSourceBox(page, element, fullPage) {
62
63
  if (element) {
63
64
  const viewport = page.viewport();
@@ -190,6 +191,7 @@ export const screenshot = definePageTool((args) => {
190
191
  .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.'),
191
192
  },
192
193
  blockedByDialog: true,
194
+ concurrency: 'page',
193
195
  verifyFilesSchema: {
194
196
  filePath: true,
195
197
  },
@@ -217,12 +219,17 @@ export const screenshot = definePageTool((args) => {
217
219
  // The smaller scale factor wins so both bounds are respected while
218
220
  // preserving aspect ratio.
219
221
  let clip;
220
- if (screenshotMaxWidth !== undefined ||
221
- screenshotMaxHeight !== undefined) {
222
- const box = await getSourceBox(page, element, fullPage);
223
- if (box) {
224
- clip = computeDownscaleClip(box, screenshotMaxWidth, screenshotMaxHeight);
225
- }
222
+ const shouldInspectBox = fullPage ||
223
+ element !== undefined ||
224
+ screenshotMaxWidth !== undefined ||
225
+ screenshotMaxHeight !== undefined;
226
+ const box = shouldInspectBox
227
+ ? await getSourceBox(page, element, fullPage)
228
+ : undefined;
229
+ if (box &&
230
+ (screenshotMaxWidth !== undefined ||
231
+ screenshotMaxHeight !== undefined)) {
232
+ clip = computeDownscaleClip(box, screenshotMaxWidth, screenshotMaxHeight);
226
233
  }
227
234
  if (clip) {
228
235
  // page.screenshot with clip lets the CDP scale param downscale the
@@ -278,6 +285,15 @@ export const screenshot = definePageTool((args) => {
278
285
  data: Buffer.from(screenshot).toString('base64'),
279
286
  });
280
287
  }
288
+ if (box) {
289
+ const effectiveScale = clip?.scale ?? 1;
290
+ const effectiveWidth = box.width * box.devicePixelRatio * effectiveScale;
291
+ const effectiveHeight = box.height * box.devicePixelRatio * effectiveScale;
292
+ if (effectiveWidth > MAX_CHROMIUM_SCREENSHOT_DIMENSION ||
293
+ effectiveHeight > MAX_CHROMIUM_SCREENSHOT_DIMENSION) {
294
+ 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.`);
295
+ }
296
+ }
281
297
  }
282
298
  catch (e_1) {
283
299
  env_1.error = e_1;