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,512 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 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 { McpResponse } from './McpResponse.js';
59
+ import { SlimMcpResponse } from './SlimMcpResponse.js';
60
+ import { ClearcutLogger } from './telemetry/ClearcutLogger.js';
61
+ import { DisposableStack, ProtocolError, ProtocolErrorCode, zod, } from './third_party/index.js';
62
+ import { labels } from './tools/categories.js';
63
+ import { categoryToFlagName } from './config/category-options.js';
64
+ import { isAvailableInMode, isBrowserlessTool, isPageScopedTool, isSlimTool, } from './tools/ToolDefinition.js';
65
+ import { getErrorMessage, toError } from './utils/errorHandling.js';
66
+ import { logger } from './utils/logger.js';
67
+ import { raceWithSignal } from './utils/raceWithSignal.js';
68
+ import { fileURLToPath, pathToFileURL } from 'node:url';
69
+ import { isDeepStrictEqual } from 'node:util';
70
+ import { isLocalBrowserEndpoint } from './utils/url.js';
71
+ /**
72
+ * Upper bound on how long a tool call may wait to acquire the browser
73
+ * (connect/launch and McpContext initialization). A connect attempt on a
74
+ * half-open socket can hang without ever failing; this bound turns that into
75
+ * a clear error and abandons the attempt so the next call starts fresh.
76
+ *
77
+ * This does not bound the tool's own work. A slow but valid call (a long
78
+ * `wait_for` timeout, an `evaluate_script` awaiting a slow promise, a
79
+ * Lighthouse audit) must finish on its own terms without the browser being
80
+ * closed underneath it. A transport that dies mid-call is detected by the
81
+ * WebSocket keep-alive configured in BrowserManager#connect(), which rejects
82
+ * the in-flight CDP calls and fires `disconnected`.
83
+ */
84
+ export const TOOL_CALL_TIMEOUT_MS = 60_000;
85
+ class ToolCallTimeoutError extends Error {
86
+ }
87
+ function buildDisabledMessage(toolName, flag, categoryLabel) {
88
+ const reason = categoryLabel
89
+ ? `is in category ${categoryLabel} which`
90
+ : `requires ${flag.startsWith('--experimental') ? 'experimental feature' : 'flag'} ${flag} and`;
91
+ return `Tool ${toolName} ${reason} is currently disabled. Enable it by running chrome-devtools start ${flag}=true. For more information check the README.`;
92
+ }
93
+ function getDisabledReason(tool, serverArgs) {
94
+ if (!isAvailableInMode(tool, serverArgs)) {
95
+ return isSlimTool(tool)
96
+ ? `Tool ${tool.name} is only available with --slim.`
97
+ : `Tool ${tool.name} is not available with --slim.`;
98
+ }
99
+ const category = tool.annotations.category;
100
+ if (category) {
101
+ const flag = categoryToFlagName(category);
102
+ if (!serverArgs[flag]) {
103
+ return buildDisabledMessage(tool.name, `--${flag}`, labels[category]);
104
+ }
105
+ }
106
+ for (const condition of tool.annotations.conditions || []) {
107
+ if (!serverArgs[condition]) {
108
+ return buildDisabledMessage(tool.name, `--${condition}`);
109
+ }
110
+ }
111
+ return undefined;
112
+ }
113
+ async function validateAndResolvePathOrUrl(filePathOrUrl, context, allowUrl) {
114
+ if (filePathOrUrl.trim().length === 0) {
115
+ return undefined;
116
+ }
117
+ let url;
118
+ try {
119
+ url = new URL(filePathOrUrl);
120
+ }
121
+ catch {
122
+ // Not a URL; fall through and validate it as a regular file path.
123
+ }
124
+ if (url) {
125
+ if (url.protocol === 'file:') {
126
+ return pathToFileURL(await context.validatePath(fileURLToPath(url))).href;
127
+ }
128
+ if (['http:', 'https:', 'ws:', 'wss:'].includes(url.protocol)) {
129
+ // Only pass a remote URL through unchanged for parameters whose sink
130
+ // actually fetches the URL or hands it to the browser (allowUrl). For a
131
+ // filesystem-path parameter, a value that merely looks like an http/ws
132
+ // URL must still be rejected outright: `new URL()` accepts
133
+ // `http://x/../../etc/passwd`, and the downstream filesystem API (e.g.
134
+ // Puppeteer's uploadFile) path.resolve()s that non-absolute string into
135
+ // an absolute host path, which would bypass validatePath (workspace
136
+ // roots and the temp-dir fallback) if it fell through to it unchanged.
137
+ if (allowUrl) {
138
+ return filePathOrUrl;
139
+ }
140
+ throw new Error('This parameter expects a file path, not a URL.');
141
+ }
142
+ }
143
+ return await context.validatePath(filePathOrUrl);
144
+ }
145
+ function isLocalBrowser(browser) {
146
+ if (browser.process()) {
147
+ return true;
148
+ }
149
+ const wsEndpoint = browser.wsEndpoint();
150
+ if (wsEndpoint && isLocalBrowserEndpoint(wsEndpoint)) {
151
+ return true;
152
+ }
153
+ return false;
154
+ }
155
+ function shouldValidateFile(option, isLocal) {
156
+ if (option === true) {
157
+ return true;
158
+ }
159
+ if (typeof option === 'object' && option !== null) {
160
+ if (isLocal) {
161
+ return Boolean(option.local);
162
+ }
163
+ return Boolean(option.remote);
164
+ }
165
+ return false;
166
+ }
167
+ /**
168
+ * `isLocal` tells whether files are accessed on the machine the server runs on,
169
+ * which is always the case for browserless tools.
170
+ */
171
+ async function validateToolFiles(tool, params, context, isLocal) {
172
+ for (const [key, option] of Object.entries(tool.verifyFilesSchema)) {
173
+ if (shouldValidateFile(option, isLocal)) {
174
+ const allowUrl = option !== true && option.allowUrl === true;
175
+ const val = params[key];
176
+ if (typeof val === 'string') {
177
+ params[key] = await validateAndResolvePathOrUrl(val, context, allowUrl);
178
+ }
179
+ else if (Array.isArray(val)) {
180
+ const updated = [];
181
+ for (const item of val) {
182
+ if (typeof item === 'string') {
183
+ const resolved = await validateAndResolvePathOrUrl(item, context, allowUrl);
184
+ if (resolved !== undefined) {
185
+ updated.push(resolved);
186
+ }
187
+ }
188
+ else {
189
+ throw new Error('Unexpected non-string value as a file path or URL');
190
+ }
191
+ }
192
+ params[key] = updated;
193
+ }
194
+ }
195
+ }
196
+ }
197
+ function toInputJsonSchema(schema) {
198
+ return zod.toJSONSchema(schema, { io: 'input', unrepresentable: 'any' });
199
+ }
200
+ function formatValidationError(toolName, error) {
201
+ const details = error.issues
202
+ .map(issue => `${issue.path.length > 0 ? `${issue.path.join('.')}: ` : ''}${issue.message}`)
203
+ .join(', ');
204
+ return `Input validation error: Invalid arguments for tool ${toolName}: ${details}`;
205
+ }
206
+ function errorResult(text) {
207
+ return {
208
+ content: [{ type: 'text', text }],
209
+ isError: true,
210
+ };
211
+ }
212
+ /**
213
+ * The page id a page tool call targets, or `undefined` when the call targets
214
+ * the selected page. `args` can be the raw or the parsed arguments.
215
+ */
216
+ function routedPageId(tool, serverArgs, args) {
217
+ if (!serverArgs.pageIdRouting || isSlimTool(tool)) {
218
+ return undefined;
219
+ }
220
+ const { pageId } = args;
221
+ return typeof pageId === 'number' && Number.isInteger(pageId)
222
+ ? pageId
223
+ : undefined;
224
+ }
225
+ export class ToolHandler {
226
+ getContext;
227
+ abandonPendingBrowserAttemptOnTimeout;
228
+ #tool;
229
+ #config;
230
+ #registeredInputSchema;
231
+ #disabled = false;
232
+ #disabledReason;
233
+ constructor(tool, config, getContext, abandonPendingBrowserAttemptOnTimeout) {
234
+ this.getContext = getContext;
235
+ this.abandonPendingBrowserAttemptOnTimeout = abandonPendingBrowserAttemptOnTimeout;
236
+ this.#tool = tool;
237
+ this.#config = config;
238
+ this.#registeredInputSchema = zod.object(tool.schema).strict();
239
+ this.#updateStatus(tool);
240
+ }
241
+ get registeredInputSchema() {
242
+ return this.#registeredInputSchema;
243
+ }
244
+ /**
245
+ * Whether the tool is hidden from the client.
246
+ */
247
+ get disabled() {
248
+ return this.#disabled;
249
+ }
250
+ #updateStatus(tool) {
251
+ const serverArgs = this.#config.resolved;
252
+ this.#disabledReason = getDisabledReason(tool, serverArgs);
253
+ this.#disabled =
254
+ Boolean(this.#disabledReason) &&
255
+ (!isAvailableInMode(tool, serverArgs) || !serverArgs.viaCli);
256
+ }
257
+ /**
258
+ * Replaces the tool definition and re-evaluates its status against the
259
+ * current server config. Callers must pause the task runner, so calls that
260
+ * are already waiting run with the new state. Returns true if the tool
261
+ * listing visible to the client changed.
262
+ */
263
+ update(tool) {
264
+ const previousTool = this.#tool;
265
+ const previousDisabled = this.#disabled;
266
+ const previousInputSchema = this.#registeredInputSchema;
267
+ const nextInputSchema = zod.object(tool.schema).strict();
268
+ this.#tool = tool;
269
+ this.#registeredInputSchema = nextInputSchema;
270
+ this.#updateStatus(tool);
271
+ if (previousDisabled !== this.#disabled) {
272
+ return true;
273
+ }
274
+ if (this.#disabled) {
275
+ return false;
276
+ }
277
+ return (previousTool.description !== tool.description ||
278
+ !isDeepStrictEqual(previousTool.annotations, tool.annotations) ||
279
+ !isDeepStrictEqual(toInputJsonSchema(previousInputSchema), toInputJsonSchema(nextInputSchema)));
280
+ }
281
+ /**
282
+ * Races a promise against TOOL_CALL_TIMEOUT_MS and signal abort, calling
283
+ * onTimeout() only if the timer wins, never on abort.
284
+ * The loser of the race is left running — there is no way to
285
+ * cancel a pending connect/launch — but since nothing is left awaiting it,
286
+ * it cannot block subsequent tool calls.
287
+ */
288
+ async #raceWithTimeout(promise, onTimeout, signal) {
289
+ const timeoutError = new ToolCallTimeoutError(`Tool "${this.#tool.name}" timed out after ${TOOL_CALL_TIMEOUT_MS}ms waiting for the browser connection to be established. The connection attempt will be retried automatically on the next tool call.`);
290
+ let timer;
291
+ const timeout = new Promise((_, reject) => {
292
+ timer = setTimeout(() => reject(timeoutError), TOOL_CALL_TIMEOUT_MS);
293
+ timer.unref?.();
294
+ });
295
+ try {
296
+ return await raceWithSignal(Promise.race([promise, timeout]), signal);
297
+ }
298
+ catch (err) {
299
+ if (err === timeoutError) {
300
+ onTimeout();
301
+ }
302
+ throw err;
303
+ }
304
+ finally {
305
+ clearTimeout(timer);
306
+ }
307
+ }
308
+ #dataFormat(serverArgs) {
309
+ // --experimentalDataFormat takes precedence over the legacy
310
+ // --experimentalToonFormat.
311
+ return (serverArgs.experimentalDataFormat ??
312
+ (serverArgs.experimentalToonFormat ? 'toon' : 'default'));
313
+ }
314
+ /**
315
+ * Browserless tools never establish a browser connection, so they also never
316
+ * wait for one under TOOL_CALL_TIMEOUT_MS.
317
+ */
318
+ async #runBrowserlessTool(tool, params, response, context, signal) {
319
+ try {
320
+ await validateToolFiles(tool, params, context, true);
321
+ signal.throwIfAborted();
322
+ await tool.handler({ params }, response, context);
323
+ }
324
+ catch (err) {
325
+ signal.throwIfAborted();
326
+ response.setError(toError(err));
327
+ }
328
+ signal.throwIfAborted();
329
+ return await response.handle(context, this.#dataFormat(this.#config.resolved));
330
+ }
331
+ async #runBrowserTool(tool, params, response, context, signal, onTelemetryData) {
332
+ // ensureBrowser() has no cancellation mechanism, so this timeout only
333
+ // stops us from waiting — the attempt itself keeps running abandoned.
334
+ // abandonPendingBrowserAttemptOnTimeout() tells BrowserManager to
335
+ // discard that attempt if it succeeds later instead of handing it to a
336
+ // subsequent caller — see BrowserManager#abandonPendingAttempt()'s doc
337
+ // comment for the full mechanism.
338
+ const browser = await this.#raceWithTimeout(context.ensureBrowser(), () => this.abandonPendingBrowserAttemptOnTimeout(), signal);
339
+ logger?.(`${tool.name} browser: resolved`);
340
+ if (context.consumeReconnectNotice()) {
341
+ response.setReconnectNotice();
342
+ }
343
+ let page;
344
+ try {
345
+ await validateToolFiles(tool, params, context, isLocalBrowser(browser));
346
+ signal.throwIfAborted();
347
+ if (isPageScopedTool(tool)) {
348
+ const pageId = routedPageId(tool, this.#config.resolved, params);
349
+ page =
350
+ pageId !== undefined
351
+ ? context.getPageById(pageId)
352
+ : context.getSelectedMcpPage();
353
+ await page?.init({ emulateFocus: true });
354
+ signal.throwIfAborted();
355
+ response.setPage(page);
356
+ if (tool.blockedByDialog) {
357
+ page.throwIfDialogOpen();
358
+ }
359
+ await tool.handler({
360
+ params,
361
+ page,
362
+ }, response, context);
363
+ }
364
+ else {
365
+ await tool.handler({
366
+ params,
367
+ }, response, context);
368
+ }
369
+ }
370
+ catch (err) {
371
+ signal.throwIfAborted();
372
+ response.setError(toError(err));
373
+ }
374
+ signal.throwIfAborted();
375
+ const devToolsData = await context.getDevToolsData(page);
376
+ signal.throwIfAborted();
377
+ onTelemetryData(devToolsData, context.getSelectedMcpPageUrl(page));
378
+ return await response.handle(context, this.#dataFormat(this.#config.resolved));
379
+ }
380
+ /**
381
+ * The queue the call runs on. `'none'` tools run outside the runner.
382
+ * `'page'` tools run on the queue of the page named by `rawArgs.pageId`
383
+ * when page id routing applies; every other call runs on the context
384
+ * queue.
385
+ */
386
+ #queueFor(context, rawArgs) {
387
+ const tool = this.#tool;
388
+ switch (tool.concurrency) {
389
+ case 'none':
390
+ return undefined;
391
+ case 'page': {
392
+ const pageId = routedPageId(tool, this.#config.resolved, rawArgs);
393
+ return pageId !== undefined
394
+ ? context.pageTaskQueue(pageId)
395
+ : context.taskQueue;
396
+ }
397
+ default:
398
+ return context.taskQueue;
399
+ }
400
+ }
401
+ /**
402
+ * Cancellation stops waiting for a result, but running work keeps its queue
403
+ * until it settles, including response processing, to preserve serialization.
404
+ * Operations without cancellation support can keep the queue indefinitely.
405
+ */
406
+ async handle(rawArgs = {}, options) {
407
+ const env_1 = { stack: [], error: void 0, hasError: false };
408
+ try {
409
+ const signal = options?.signal ?? new AbortController().signal;
410
+ signal.throwIfAborted();
411
+ const context = await raceWithSignal(this.getContext(), signal);
412
+ let queueGuard;
413
+ try {
414
+ queueGuard = await this.#queueFor(context, rawArgs)?.scheduleTask(signal);
415
+ }
416
+ catch (err) {
417
+ signal.throwIfAborted();
418
+ // The queue was disposed while the call waited, e.g. the page closed.
419
+ return errorResult(getErrorMessage(err));
420
+ }
421
+ const guard = __addDisposableResource(env_1, new DisposableStack(), false);
422
+ guard.use(queueGuard);
423
+ signal.throwIfAborted();
424
+ if (options?.viaMcp && this.#disabled) {
425
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${this.#tool.name} disabled`);
426
+ }
427
+ if (this.#disabledReason) {
428
+ return errorResult(this.#disabledReason);
429
+ }
430
+ const tool = this.#tool;
431
+ const parseResult = this.#registeredInputSchema.safeParse(rawArgs);
432
+ if (!parseResult.success) {
433
+ return errorResult(formatValidationError(tool.name, parseResult.error));
434
+ }
435
+ const params = parseResult.data;
436
+ const startTime = Date.now();
437
+ let success = false;
438
+ let devToolsData;
439
+ let pageUrl;
440
+ try {
441
+ logger?.(`${tool.name} request: ${JSON.stringify(params, null, ' ')}`);
442
+ const response = isSlimTool(tool)
443
+ ? new SlimMcpResponse(this.#config)
444
+ : new McpResponse(this.#config);
445
+ // The execution owns the queue even when its caller stops waiting.
446
+ const execution = isBrowserlessTool(tool)
447
+ ? this.#runBrowserlessTool(tool, params, response, context, signal)
448
+ : this.#runBrowserTool(tool, params, response, context, signal, (data, url) => {
449
+ devToolsData = data;
450
+ pageUrl = url;
451
+ });
452
+ const executionGuard = guard.move();
453
+ const completion = execution.finally(() => executionGuard.dispose());
454
+ const { content, structuredContent } = await raceWithSignal(completion, signal);
455
+ const result = {
456
+ content,
457
+ };
458
+ if (response.error) {
459
+ result.isError = true;
460
+ }
461
+ success = true;
462
+ if (this.#config.resolved.experimentalStructuredContent) {
463
+ result.structuredContent = structuredContent;
464
+ }
465
+ return result;
466
+ }
467
+ catch (err) {
468
+ if (signal.aborted) {
469
+ logger?.(`${tool.name} cancelled:`, signal.reason);
470
+ }
471
+ signal.throwIfAborted();
472
+ logger?.(`${tool.name} error:`, err, err?.stack);
473
+ let errorText = err && typeof err === 'object' && 'message' in err
474
+ ? err.message
475
+ : String(err);
476
+ let cause = err && typeof err === 'object' && 'cause' in err
477
+ ? err.cause
478
+ : undefined;
479
+ const seenCauses = new Set([err]);
480
+ while (cause &&
481
+ typeof cause === 'object' &&
482
+ !seenCauses.has(cause) &&
483
+ 'message' in cause &&
484
+ typeof cause.message === 'string') {
485
+ seenCauses.add(cause);
486
+ errorText += `\nCause: ${cause.message}`;
487
+ cause = 'cause' in cause ? cause.cause : undefined;
488
+ }
489
+ return errorResult(errorText);
490
+ }
491
+ finally {
492
+ void ClearcutLogger.get()?.logToolInvocation({
493
+ toolName: tool.name,
494
+ params: rawArgs,
495
+ schema: tool.schema,
496
+ success,
497
+ latencyMs: Date.now() - startTime,
498
+ devToolsData,
499
+ pageUrl,
500
+ });
501
+ }
502
+ }
503
+ catch (e_1) {
504
+ env_1.error = e_1;
505
+ env_1.hasError = true;
506
+ }
507
+ finally {
508
+ __disposeResources(env_1);
509
+ }
510
+ }
511
+ }
512
+ //# sourceMappingURL=ToolHandler.js.map
@@ -6,11 +6,12 @@
6
6
  import '../utils/polyfill.js';
7
7
  import process from 'node:process';
8
8
  import { BrowserManager } from '../BrowserManager.js';
9
- import { McpServer, logDisclaimers } from '../index.js';
9
+ import { McpServer } from '../index.js';
10
10
  import { ClearcutLogger } from '../telemetry/ClearcutLogger.js';
11
11
  import { computeFlagUsage } from '../telemetry/flagUtils.js';
12
12
  import { StdioServerTransport } from '../third_party/index.js';
13
13
  import { checkForUpdates } from '../utils/check-for-updates.js';
14
+ import { logDisclaimers } from '../utils/disclaimers.js';
14
15
  import { logger, saveLogsToFile } from '../utils/logger.js';
15
16
  import { setupUnhandledRejectionHandler } from '../utils/errorHandling.js';
16
17
  import { VERSION } from '../version.js';
@@ -18,16 +19,17 @@ import { mcpOptions } from '../config/mcp-options.js';
18
19
  import { ConfigParser } from '../config/ConfigParser.js';
19
20
  await checkForUpdates('Run `npm install chrome-devtools-mcp@latest` to update.');
20
21
  const configParser = new ConfigParser(VERSION);
21
- export const args = configParser.parse();
22
+ const serverConfig = configParser.parseConfig();
23
+ const args = serverConfig.resolved;
22
24
  const logFile = args.logFile ? saveLogsToFile(args.logFile) : undefined;
23
25
  setupUnhandledRejectionHandler(() => {
24
26
  process.exit(1);
25
27
  });
26
28
  logger?.(`Starting Chrome DevTools MCP Server v${VERSION}`);
27
- const browserManager = new BrowserManager(args, {
29
+ const browserManager = new BrowserManager(serverConfig, {
28
30
  logFile,
29
31
  });
30
- const serverPromise = McpServer.from(args, {
32
+ const serverPromise = McpServer.from(serverConfig, {
31
33
  browserManager,
32
34
  });
33
35
  // Shutdown on stdin EOF (stdio MCP convention — the client closes the
@@ -7,13 +7,13 @@
7
7
  import process from 'node:process';
8
8
  import { startDaemon, stopDaemon, sendCommand, handleResponse, verifyDaemonVersion, } from '../daemon/client.js';
9
9
  import { isDaemonRunning, serializeArgs, assertValidSessionId, } from '../daemon/utils.js';
10
- import { logDisclaimers } from '../index.js';
11
- import { hideBin, yargs } from '../third_party/index.js';
10
+ import { logDisclaimers } from '../utils/disclaimers.js';
11
+ import { hideBin, yargs } from '../third_party/cli.js';
12
12
  import { checkForUpdates } from '../utils/check-for-updates.js';
13
13
  import { VERSION } from '../version.js';
14
14
  import { buildCommand, getCommandArgSpec, shieldLiteralArgs, } from '../config/cli-commands.js';
15
15
  import { commands } from '../config/cli-options.js';
16
- import { mcpOptions, getCliOptions } from '../config/mcp-options.js';
16
+ import { getCliOptions } from '../config/mcp-options.js';
17
17
  import { ConfigParser } from '../config/ConfigParser.js';
18
18
  process.title = 'chrome-devtools';
19
19
  await checkForUpdates('Run `npm install -g chrome-devtools-mcp@latest` and `chrome-devtools start` to update and restart the daemon.');
@@ -175,7 +175,7 @@ for (const [commandName, commandDef] of Object.entries(commands)) {
175
175
  ? verifyDaemonVersion(sessionId, VERSION)
176
176
  : Promise.resolve(undefined);
177
177
  if (!daemonRunning) {
178
- await start(serializeArgs(mcpOptions, argv), sessionId);
178
+ await start([], sessionId);
179
179
  }
180
180
  const commandArgs = {};
181
181
  for (const argName of Object.keys(args)) {
@@ -4,15 +4,18 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { FakeIssuesManager } from '../devtools/DevtoolsUtils.js';
7
- import { DevTools, FrameEvent } from '../third_party/index.js';
7
+ import { DevTools, FrameEvent, } from '../third_party/index.js';
8
8
  import { createIdGenerator, stableIdSymbol, } from '../utils/id.js';
9
9
  import { logger } from '../utils/logger.js';
10
+ import { DEFAULT_MAX_NAVIGATION_SAVED } from './constants.js';
10
11
  export class UncaughtError {
11
12
  details;
12
13
  targetId;
13
- constructor(details, targetId) {
14
+ session;
15
+ constructor(details, targetId, session) {
14
16
  this.details = details;
15
17
  this.targetId = targetId;
18
+ this.session = session;
16
19
  }
17
20
  }
18
21
  export class PageCollector {
@@ -20,15 +23,16 @@ export class PageCollector {
20
23
  #listeners;
21
24
  #pendingSameDocumentNavigation = false;
22
25
  #frameNavigatedWithinDocumentTarget;
23
- maxNavigationSaved = 3;
26
+ maxNavigationSaved;
24
27
  /**
25
28
  * This maps a Page to a list of navigations with a sub-list
26
29
  * of all collected resources.
27
30
  * The newer navigations come first.
28
31
  */
29
32
  storage = [[]];
30
- constructor(page, listeners, maxResourcesPerNavigation) {
33
+ constructor(page, listeners, { maxResourcesPerNavigation, maxNavigationSaved = DEFAULT_MAX_NAVIGATION_SAVED, } = {}) {
31
34
  this.pptrPage = page;
35
+ this.maxNavigationSaved = maxNavigationSaved;
32
36
  this.#attachFrameNavigatedWithinDocumentListener();
33
37
  const idGenerator = createIdGenerator();
34
38
  const listenerMap = listeners(value => {
@@ -129,8 +133,8 @@ export class PageCollector {
129
133
  export class ConsoleCollector extends PageCollector {
130
134
  static MAX_MESSAGES_PER_NAVIGATION = 10_000;
131
135
  #subscriber;
132
- constructor(page, listeners, maxMessagesPerNavigation = ConsoleCollector.MAX_MESSAGES_PER_NAVIGATION) {
133
- super(page, listeners, maxMessagesPerNavigation);
136
+ constructor(page, listeners, { maxResourcesPerNavigation = ConsoleCollector.MAX_MESSAGES_PER_NAVIGATION, maxNavigationSaved, } = {}) {
137
+ super(page, listeners, { maxResourcesPerNavigation, maxNavigationSaved });
134
138
  this.#subscriber = new PageEventSubscriber(this.pptrPage);
135
139
  this.#subscriber.subscribe();
136
140
  }
@@ -190,7 +194,7 @@ class PageEventSubscriber {
190
194
  this.#page.emit('devtoolsAggregatedIssue', event.data);
191
195
  };
192
196
  #onExceptionThrown = (event) => {
193
- this.#page.emit('uncaughtError', new UncaughtError(event.exceptionDetails, this.#targetId));
197
+ this.#page.emit('uncaughtError', new UncaughtError(event.exceptionDetails, this.#targetId, this.#session));
194
198
  };
195
199
  // On navigation, we reset issue aggregation.
196
200
  #onFrameNavigated = (frame) => {
@@ -259,30 +263,42 @@ class PageEventSubscriber {
259
263
  }
260
264
  export class NetworkCollector extends PageCollector {
261
265
  static MAX_REQUESTS_PER_NAVIGATION = 1_000;
262
- constructor(page, maxRequestsPerNavigation = NetworkCollector.MAX_REQUESTS_PER_NAVIGATION, listeners = collect => {
266
+ /** The navigation request that started the latest navigation, if any. */
267
+ #navigationRequest;
268
+ constructor(page, { maxResourcesPerNavigation = NetworkCollector.MAX_REQUESTS_PER_NAVIGATION, maxNavigationSaved, } = {}, listeners = collect => {
263
269
  return {
264
270
  request: req => {
271
+ // With the debugger `createTargetUniverse()` starts, initiator stacks
272
+ // carry up to 32 async parents, which no tool reads.
273
+ const stack = req.initiator()?.stack;
274
+ if (stack) {
275
+ delete stack.parent;
276
+ }
265
277
  collect(req);
266
278
  },
267
279
  };
268
280
  }) {
269
- super(page, listeners, maxRequestsPerNavigation);
281
+ super(page, listeners, { maxResourcesPerNavigation, maxNavigationSaved });
270
282
  }
271
283
  splitAfterNavigation() {
272
284
  const requests = this.storage[0];
285
+ // A navigation without a request, such as a back/forward cache restore or
286
+ // about:blank, must not claim the request of the previous navigation.
273
287
  const lastRequestIdx = requests.findLastIndex(request => {
274
- return request.frame() === this.pptrPage.mainFrame()
275
- ? request.isNavigationRequest()
276
- : false;
288
+ return (request !== this.#navigationRequest &&
289
+ request.frame() === this.pptrPage.mainFrame() &&
290
+ request.isNavigationRequest());
277
291
  });
278
292
  // Keep all requests since the last navigation request including that
279
293
  // navigation request itself.
280
294
  // Keep the reference
281
295
  if (lastRequestIdx !== -1) {
296
+ this.#navigationRequest = requests[lastRequestIdx];
282
297
  const fromCurrentNavigation = requests.splice(lastRequestIdx);
283
298
  this.storage.unshift(fromCurrentNavigation);
284
299
  }
285
300
  else {
301
+ this.#navigationRequest = undefined;
286
302
  this.storage.unshift([]);
287
303
  }
288
304
  this.storage.splice(this.maxNavigationSaved);