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
@@ -58,10 +58,30 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
58
58
  import { DevToolsCommentBridge } from './devtools/DevToolsCommentBridge.js';
59
59
  import { createTargetUniverse, } from './devtools/DevtoolsUtils.js';
60
60
  import { ConsoleCollector, NetworkCollector, } from './collectors/PageCollector.js';
61
+ import { LogpointManager } from './LogpointManager.js';
61
62
  import { TextSnapshot } from './TextSnapshot.js';
62
- import { PredefinedNetworkConditions, DevTools, } from './third_party/index.js';
63
+ import { NetworkOverrideManager, } from './NetworkOverrideManager.js';
64
+ import { PredefinedNetworkConditions, DevTools, lighthouseNavigation, lighthouseSnapshot, } from './third_party/index.js';
65
+ import { getErrorMessage } from './utils/errorHandling.js';
63
66
  import { logger } from './utils/logger.js';
64
67
  import { getNetworkMultiplierFromString, WaitForHelper, } from './utils/WaitForHelper.js';
68
+ const WEBAUTHN_PROTOCOLS = {
69
+ ctap2: "ctap2" /* DevTools.Protocol.WebAuthn.AuthenticatorProtocol.Ctap2 */,
70
+ u2f: "u2f" /* DevTools.Protocol.WebAuthn.AuthenticatorProtocol.U2f */,
71
+ };
72
+ const WEBAUTHN_TRANSPORTS = {
73
+ internal: "internal" /* DevTools.Protocol.WebAuthn.AuthenticatorTransport.Internal */,
74
+ usb: "usb" /* DevTools.Protocol.WebAuthn.AuthenticatorTransport.Usb */,
75
+ nfc: "nfc" /* DevTools.Protocol.WebAuthn.AuthenticatorTransport.Nfc */,
76
+ ble: "ble" /* DevTools.Protocol.WebAuthn.AuthenticatorTransport.Ble */,
77
+ hybrid: "hybrid" /* DevTools.Protocol.WebAuthn.AuthenticatorTransport.Hybrid */,
78
+ };
79
+ const WEBAUTHN_CREATION_OPTIONS = [
80
+ 'protocol',
81
+ 'transport',
82
+ 'hasResidentKey',
83
+ 'hasUserVerification',
84
+ ];
65
85
  export function replaceHtmlElementsWithUids(schema) {
66
86
  if (typeof schema === 'boolean') {
67
87
  return;
@@ -115,6 +135,7 @@ function isDebuggingWebMcpTool(tool) {
115
135
  }
116
136
  const DEFAULT_TIMEOUT = 5_000;
117
137
  const NAVIGATION_TIMEOUT = 10_000;
138
+ const DEVTOOLS_UNIVERSE_TIMEOUT_MS = 5_000;
118
139
  /**
119
140
  * Chrome reports a URL-derived placeholder as the target title until the
120
141
  * document provides one. The placeholder omits the `http://` / `https://`
@@ -143,6 +164,7 @@ export class McpPage {
143
164
  id;
144
165
  #pptrPage;
145
166
  #initPromise;
167
+ #focusEmulationRequested = false;
146
168
  #disposed = false;
147
169
  #closed = false;
148
170
  // Snapshot
@@ -154,26 +176,28 @@ export class McpPage {
154
176
  // Metadata
155
177
  isolatedContextName;
156
178
  #devtoolsUniverse;
179
+ #webAuthnEnabled = false;
180
+ #webAuthnAuthenticator;
181
+ // Logpoints, created on first use.
182
+ #logpointManager;
157
183
  // Dialog
158
184
  #dialog;
159
185
  #dialogHandler;
160
186
  // Screencast
161
187
  #screenRecorder = null;
162
- eventBasedThirdPartyTools = [];
188
+ // Performance trace
189
+ #isRunningPerformanceTrace = false;
163
190
  #networkCollector;
164
191
  #consoleCollector;
165
- #hasNetworkBlockOrAllowlist;
166
192
  #locatorClass;
167
193
  #navigationTimeout;
168
- #sourceMaps;
194
+ #config;
169
195
  #commentBridge;
170
- #onNotification;
196
+ #networkOverrideManager;
171
197
  constructor(target, id, options) {
172
- this.#hasNetworkBlockOrAllowlist = options.hasNetworkBlockOrAllowlist;
198
+ this.#config = options.config;
173
199
  this.#locatorClass = options.locatorClass;
174
200
  this.#navigationTimeout = options.navigationTimeout ?? NAVIGATION_TIMEOUT;
175
- this.#sourceMaps = options.sourceMaps ?? true;
176
- this.#onNotification = options.onNotification;
177
201
  this.target = target;
178
202
  this.id = id;
179
203
  this.isolatedContextName = options.isolatedContextName;
@@ -181,6 +205,10 @@ export class McpPage {
181
205
  this.#dialog = dialog;
182
206
  };
183
207
  }
208
+ get #hasNetworkBlockOrAllowlist() {
209
+ return Boolean(this.#config.resolved.allowedUrlPattern ||
210
+ this.#config.resolved.blockedUrlPattern);
211
+ }
184
212
  get pptrPage() {
185
213
  if (!this.#pptrPage) {
186
214
  throw new Error(`McpPage (id=${this.id}) is not initialized. Call init() first.`);
@@ -242,20 +270,24 @@ export class McpPage {
242
270
  this.dispose();
243
271
  await page?.close({ runBeforeUnload: false });
244
272
  }
245
- async init() {
273
+ async init(options) {
246
274
  if (this.#disposed) {
247
275
  throw new Error(`McpPage (id=${this.id}) has already been disposed.`);
248
276
  }
249
- if (this.#initPromise) {
250
- return await this.#initPromise;
251
- }
252
- this.#initPromise = this.#doInit();
253
- try {
254
- await this.#initPromise;
277
+ if (!this.#initPromise) {
278
+ this.#initPromise = this.#doInit().catch(err => {
279
+ this.#initPromise = undefined;
280
+ throw err;
281
+ });
255
282
  }
256
- catch (err) {
257
- this.#initPromise = undefined;
258
- throw err;
283
+ await this.#initPromise;
284
+ // Discovery skips focus emulation, but a later page tool still needs it.
285
+ if (options?.emulateFocus !== false &&
286
+ !this.#disposed &&
287
+ !this.#focusEmulationRequested) {
288
+ // Prevent duplicate requests while pending and after success.
289
+ this.#focusEmulationRequested = true;
290
+ this.#initFocusEmulationNoThrow();
259
291
  }
260
292
  }
261
293
  async #doInit() {
@@ -268,8 +300,11 @@ export class McpPage {
268
300
  return;
269
301
  }
270
302
  this.#pptrPage = page;
303
+ this.#networkOverrideManager = new NetworkOverrideManager(page, this.#config);
271
304
  page.on('dialog', this.#dialogHandler);
272
- this.#networkCollector = new NetworkCollector(page);
305
+ this.#networkCollector = new NetworkCollector(page, {
306
+ maxNavigationSaved: this.#config.resolved.maxNavigationSaved,
307
+ });
273
308
  this.#consoleCollector = new ConsoleCollector(page, collect => {
274
309
  return {
275
310
  console: event => {
@@ -282,20 +317,19 @@ export class McpPage {
282
317
  collect(event);
283
318
  },
284
319
  };
285
- });
320
+ }, { maxNavigationSaved: this.#config.resolved.maxNavigationSaved });
286
321
  }
287
322
  this.updateTimeouts();
288
- await Promise.allSettled([
289
- this.#initDevToolsUniverseNoThrow(),
290
- this.#initFocusEmulationNoThrow(),
291
- ]);
323
+ await this.#initDevToolsUniverseNoThrow();
292
324
  if (this.#disposed) {
293
325
  this.dispose();
294
326
  }
295
327
  }
296
- async #initFocusEmulationNoThrow() {
297
- // We emulate a focused page for all pages to support multi-agent workflows.
328
+ #initFocusEmulationNoThrow() {
329
+ // Background pages need emulated focus for multi-agent workflows.
298
330
  void this.pptrPage.emulateFocusedPage(true).catch(error => {
331
+ // Allow the next page operation to retry a transient failure.
332
+ this.#focusEmulationRequested = false;
299
333
  logger?.('Error turning on focused page emulation', error);
300
334
  });
301
335
  }
@@ -306,17 +340,150 @@ export class McpPage {
306
340
  try {
307
341
  const session = await this.pptrPage.createCDPSession();
308
342
  this.#devtoolsUniverse = await createTargetUniverse(session, {
309
- sourceMaps: this.#sourceMaps,
343
+ sourceMaps: this.#config.resolved.sourceMaps,
310
344
  });
311
345
  }
312
346
  catch (e) {
313
347
  logger?.('Failed to initialize DevTools universe', e);
314
348
  }
315
349
  }
350
+ syncSourceMaps() {
351
+ if (!this.#devtoolsUniverse) {
352
+ return;
353
+ }
354
+ const sourceMaps = this.#config.resolved.sourceMaps;
355
+ this.#devtoolsUniverse.universe.settings
356
+ .resolve(DevTools.SDKSettings.jsSourceMapsEnabledSettingDescriptor)
357
+ .set(sourceMaps);
358
+ this.#devtoolsUniverse.universe.settings
359
+ .resolve(DevTools.SDKSettings.cssSourceMapsEnabledSettingDescriptor)
360
+ .set(sourceMaps);
361
+ }
316
362
  get devtoolsUniverse() {
317
363
  return this.#devtoolsUniverse;
318
364
  }
365
+ /**
366
+ * Makes the given logpoints the complete set of logpoints on the page, see
367
+ * {@link LogpointManager.setLogpoints}. The manager is created on first
368
+ * use, so an empty list on a page without logpoints is a no-op.
369
+ */
370
+ setLogpoints(logpoints) {
371
+ if (!this.#logpointManager) {
372
+ if (logpoints.length === 0) {
373
+ return Promise.resolve([]);
374
+ }
375
+ const devtoolsUniverse = this.devtoolsUniverse;
376
+ if (!devtoolsUniverse) {
377
+ throw new Error(`DevTools universe is not available for page ${this.id ?? '?'}.`);
378
+ }
379
+ this.#logpointManager = new LogpointManager(devtoolsUniverse);
380
+ }
381
+ return this.#logpointManager.setLogpoints(logpoints);
382
+ }
383
+ getWebAuthnAuthenticator() {
384
+ return (this.#webAuthnAuthenticator && {
385
+ ...this.#webAuthnAuthenticator.options,
386
+ });
387
+ }
388
+ async configureWebAuthn(config) {
389
+ const model = this.devtoolsUniverse?.target.model(DevTools.WebAuthnModel.WebAuthnModel);
390
+ if (!model) {
391
+ throw new Error(`WebAuthn is not available for page ${this.id}.`);
392
+ }
393
+ const options = config.enabled
394
+ ? this.#resolveWebAuthnOptions(config)
395
+ : undefined;
396
+ try {
397
+ return await this.#applyWebAuthnConfig(model, options);
398
+ }
399
+ catch (error) {
400
+ const orphan = this.#webAuthnAuthenticator;
401
+ this.#webAuthnEnabled = false;
402
+ this.#webAuthnAuthenticator = undefined;
403
+ if (orphan) {
404
+ try {
405
+ await model.removeAuthenticator(orphan.id);
406
+ }
407
+ catch {
408
+ // Already gone, e.g. another client disabled the environment.
409
+ }
410
+ }
411
+ throw new Error(`Failed to configure WebAuthn for page ${this.id}: ${getErrorMessage(error)}`, { cause: error });
412
+ }
413
+ }
414
+ #resolveWebAuthnOptions(config) {
415
+ const current = this.#webAuthnAuthenticator?.options;
416
+ const protocol = config.protocol ?? current?.protocol ?? 'ctap2';
417
+ const transport = config.transport ?? current?.transport ?? 'internal';
418
+ const isUserVerified = config.isUserVerified ?? current?.isUserVerified ?? true;
419
+ if (protocol === 'u2f') {
420
+ if (config.hasResidentKey || config.hasUserVerification) {
421
+ throw new Error(`protocol 'u2f' does not support hasResidentKey or hasUserVerification. Set them to false or omit them.`);
422
+ }
423
+ return {
424
+ protocol,
425
+ transport,
426
+ hasResidentKey: false,
427
+ hasUserVerification: false,
428
+ isUserVerified,
429
+ };
430
+ }
431
+ return {
432
+ protocol,
433
+ transport,
434
+ hasResidentKey: config.hasResidentKey ?? current?.hasResidentKey ?? true,
435
+ hasUserVerification: config.hasUserVerification ?? current?.hasUserVerification ?? true,
436
+ isUserVerified,
437
+ };
438
+ }
439
+ async #applyWebAuthnConfig(model, options) {
440
+ if (!options) {
441
+ this.#webAuthnAuthenticator = undefined;
442
+ this.#webAuthnEnabled = false;
443
+ await model.setVirtualAuthEnvEnabled(false);
444
+ return undefined;
445
+ }
446
+ if (!this.#webAuthnEnabled) {
447
+ await model.setVirtualAuthEnvEnabled(true, false);
448
+ this.#webAuthnEnabled = true;
449
+ }
450
+ const current = this.#webAuthnAuthenticator;
451
+ let authenticator = current;
452
+ if (!authenticator ||
453
+ WEBAUTHN_CREATION_OPTIONS.some(key => options[key] !== authenticator?.options[key])) {
454
+ if (authenticator) {
455
+ await model.removeAuthenticator(authenticator.id);
456
+ this.#webAuthnAuthenticator = undefined;
457
+ }
458
+ const id = await model.addAuthenticator({
459
+ ...options,
460
+ protocol: WEBAUTHN_PROTOCOLS[options.protocol],
461
+ transport: WEBAUTHN_TRANSPORTS[options.transport],
462
+ automaticPresenceSimulation: true,
463
+ });
464
+ authenticator = { id, options };
465
+ this.#webAuthnAuthenticator = authenticator;
466
+ }
467
+ else if (options.isUserVerified !== authenticator.options.isUserVerified) {
468
+ await model.setUserVerified(authenticator.id, options.isUserVerified);
469
+ authenticator.options.isUserVerified = options.isUserVerified;
470
+ }
471
+ const credentials = await model.getCredentials(authenticator.id);
472
+ return {
473
+ ...authenticator.options,
474
+ credentials: credentials.map(credential => ({
475
+ credentialId: credential.credentialId,
476
+ rpId: credential.rpId,
477
+ isResidentCredential: credential.isResidentCredential,
478
+ userName: credential.userName,
479
+ signCount: credential.signCount,
480
+ })),
481
+ };
482
+ }
319
483
  getDialog() {
484
+ if (this.#dialog?.handled) {
485
+ this.#dialog = undefined;
486
+ }
320
487
  return this.#dialog;
321
488
  }
322
489
  clearDialog() {
@@ -328,9 +495,16 @@ export class McpPage {
328
495
  setScreenRecorder(data) {
329
496
  this.#screenRecorder = data;
330
497
  }
498
+ isRunningPerformanceTrace() {
499
+ return this.#isRunningPerformanceTrace;
500
+ }
501
+ setIsRunningPerformanceTrace(x) {
502
+ this.#isRunningPerformanceTrace = x;
503
+ }
331
504
  throwIfDialogOpen() {
332
- if (this.#dialog && !this.#dialog.handled) {
333
- throw new Error(`A dialog is open (${this.#dialog.type()}: ${this.#dialog.message()}).`);
505
+ const dialog = this.getDialog();
506
+ if (dialog) {
507
+ throw new Error(`A dialog is open (${dialog.type()}: ${dialog.message()}).`);
334
508
  }
335
509
  }
336
510
  #getDebuggingWebMcpToolGroups() {
@@ -352,13 +526,7 @@ export class McpPage {
352
526
  },
353
527
  ];
354
528
  }
355
- getThirdPartyDeveloperTools() {
356
- return [
357
- ...this.#getDebuggingWebMcpToolGroups(),
358
- ...this.eventBasedThirdPartyTools,
359
- ];
360
- }
361
- async getToolGroups() {
529
+ async discoverThirdPartyDeveloperTools() {
362
530
  const env_1 = { stack: [], error: void 0, hasError: false };
363
531
  try {
364
532
  // Check if there is a `devtoolstooldiscovery` event listener
@@ -369,8 +537,7 @@ export class McpPage {
369
537
  objectId: windowHandle.remoteObject().objectId,
370
538
  });
371
539
  if (listeners.find(l => l.type === 'devtoolstooldiscovery') === undefined) {
372
- this.eventBasedThirdPartyTools = [];
373
- return this.getThirdPartyDeveloperTools();
540
+ return this.#getDebuggingWebMcpToolGroups();
374
541
  }
375
542
  const eventToolGroups = await this.pptrPage.evaluate(() => {
376
543
  if (window.__dtmcp) {
@@ -445,8 +612,7 @@ export class McpPage {
445
612
  replaceHtmlElementsWithUids(tool.inputSchema);
446
613
  }
447
614
  }
448
- this.eventBasedThirdPartyTools = eventToolGroups;
449
- return this.getThirdPartyDeveloperTools();
615
+ return [...this.#getDebuggingWebMcpToolGroups(), ...eventToolGroups];
450
616
  }
451
617
  catch (e_1) {
452
618
  env_1.error = e_1;
@@ -490,15 +656,17 @@ export class McpPage {
490
656
  get commentBridge() {
491
657
  return this.#commentBridge;
492
658
  }
659
+ disposeCommentBridge() {
660
+ this.#commentBridge?.dispose();
661
+ this.#commentBridge = undefined;
662
+ }
493
663
  /**
494
664
  * Returns the comment bridge attached to the DevTools page, or undefined if
495
665
  * the DevTools page does not support DevTools comments.
496
666
  */
497
667
  async ensureDevToolsCommentBridge(devtoolsPage) {
498
668
  if (!this.#commentBridge) {
499
- this.#commentBridge = new DevToolsCommentBridge({
500
- onNotification: this.#onNotification,
501
- });
669
+ this.#commentBridge = new DevToolsCommentBridge();
502
670
  }
503
671
  const attached = await this.#commentBridge.attach(devtoolsPage);
504
672
  return attached ? this.#commentBridge : undefined;
@@ -517,9 +685,20 @@ export class McpPage {
517
685
  return undefined;
518
686
  }
519
687
  }
688
+ /**
689
+ * Opens the DevTools window and waits until the DevTools frontend creates
690
+ * its universe, which also creates the CD4A bridge when it is enabled.
691
+ */
520
692
  async openDevTools() {
521
693
  const devtoolsPage = await this.pptrPage.openDevTools();
522
- await this.ensureDevToolsCommentBridge(devtoolsPage);
694
+ try {
695
+ await devtoolsPage.waitForFunction(() => Boolean(window.universe), {
696
+ timeout: DEVTOOLS_UNIVERSE_TIMEOUT_MS,
697
+ });
698
+ }
699
+ catch (e) {
700
+ logger?.(`DevTools might not have loaded completely within ${DEVTOOLS_UNIVERSE_TIMEOUT_MS / 1000} seconds`, e);
701
+ }
523
702
  return devtoolsPage;
524
703
  }
525
704
  getConsoleData(includePreservedMessages) {
@@ -568,18 +747,50 @@ export class McpPage {
568
747
  }
569
748
  dispose() {
570
749
  this.#disposed = true;
571
- this.#commentBridge?.dispose();
572
- this.#commentBridge = undefined;
750
+ this.#isRunningPerformanceTrace = false;
751
+ this.disposeCommentBridge();
752
+ if (this.#screenRecorder) {
753
+ const { recorder } = this.#screenRecorder;
754
+ this.#screenRecorder = null;
755
+ void recorder.stop().catch(e => {
756
+ logger?.('Failed to stop screencast recording on dispose', e);
757
+ });
758
+ }
573
759
  this.#pptrPage?.off('dialog', this.#dialogHandler);
760
+ void this.#networkOverrideManager?.dispose();
574
761
  this.#networkCollector?.dispose();
575
762
  this.#consoleCollector?.dispose();
763
+ this.#logpointManager?.dispose();
764
+ this.#logpointManager = undefined;
576
765
  const devtoolsUniverse = this.#devtoolsUniverse;
577
766
  this.#devtoolsUniverse = undefined;
767
+ this.#webAuthnAuthenticator = undefined;
578
768
  devtoolsUniverse?.universe.dispose();
579
769
  void devtoolsUniverse?.session.detach().catch(e => {
580
770
  logger?.('Failed to detach DevTools session', e);
581
771
  });
582
772
  }
773
+ async mockNetwork(input) {
774
+ const manager = await this.#getNetworkOverrideManagerForChanges();
775
+ return await manager.mock(input);
776
+ }
777
+ async #getNetworkOverrideManagerForChanges() {
778
+ if (this.#isRunningPerformanceTrace) {
779
+ throw new Error('Cannot change network mocks while a performance trace is running.');
780
+ }
781
+ await this.init();
782
+ if (!this.#networkOverrideManager) {
783
+ throw new Error(`McpPage (id=${this.id}) is not initialized.`);
784
+ }
785
+ return this.#networkOverrideManager;
786
+ }
787
+ listNetworkMocks(filter) {
788
+ return this.#networkOverrideManager?.list(filter) ?? [];
789
+ }
790
+ async removeNetworkMocks(filter) {
791
+ const manager = await this.#getNetworkOverrideManagerForChanges();
792
+ return await manager.remove(filter);
793
+ }
583
794
  async executeThirdPartyDeveloperTool(toolName, params, response) {
584
795
  const webmcpTool = this.pptrPage.webmcp
585
796
  .tools()
@@ -905,9 +1116,10 @@ export class McpPage {
905
1116
  logger?.('No DevTools page detected');
906
1117
  return {};
907
1118
  }
908
- await this.ensureDevToolsCommentBridge(devtoolsPage);
1119
+ if (this.#config.resolved.devtoolsComments) {
1120
+ await this.ensureDevToolsCommentBridge(devtoolsPage);
1121
+ }
909
1122
  const { cdpRequestId, cdpBackendNodeId } = await devtoolsPage.evaluate(async () => {
910
- window.universe?.cd4aBridge?.setAgentAttached(true);
911
1123
  // @ts-expect-error no types
912
1124
  const UI = await import('/bundled/ui/legacy/legacy.js');
913
1125
  // @ts-expect-error no types
@@ -928,6 +1140,19 @@ export class McpPage {
928
1140
  }
929
1141
  async restoreEmulation() {
930
1142
  const currentSetting = this.emulationSettings;
1143
+ const { viewport } = currentSetting;
1144
+ if (viewport) {
1145
+ // Lighthouse's CDP session replaces the device metrics override and
1146
+ // clears it on detach, and Chrome ignores an override identical to the
1147
+ // last one this session sent. A different width first makes the real
1148
+ // call take effect without a reload (`isMobile` and `hasTouch` stay the
1149
+ // same). This also runs after snapshot audits and fires a resize event,
1150
+ // so do not remove it as redundant.
1151
+ await this.pptrPage.setViewport({
1152
+ ...viewport,
1153
+ width: Math.max(1, viewport.width - 1),
1154
+ });
1155
+ }
931
1156
  await this.emulate(currentSetting);
932
1157
  }
933
1158
  async #emulateMediaFeatures(settings) {
@@ -991,7 +1216,7 @@ export class McpPage {
991
1216
  newSettings.cpuThrottlingRate = options.cpuThrottlingRate;
992
1217
  }
993
1218
  if (!options.geolocation) {
994
- await page.setGeolocation({ latitude: 0, longitude: 0 });
1219
+ await page.setGeolocation(null);
995
1220
  delete newSettings.geolocation;
996
1221
  }
997
1222
  else {
@@ -1051,11 +1276,34 @@ export class McpPage {
1051
1276
  delete newSettings.extraHttpHeaders;
1052
1277
  }
1053
1278
  }
1279
+ const previousViewport = this.emulationSettings.viewport;
1054
1280
  this.emulationSettings = Object.keys(newSettings).length ? newSettings : {};
1055
1281
  this.updateTimeouts();
1056
1282
  // This should happen after updating the page timeouts.
1057
1283
  // Setting the viewport can trigger a reload which we don't want to timeout.
1058
- await page.setViewport(newSettings.viewport ?? null);
1284
+ try {
1285
+ await page.setViewport(newSettings.viewport ?? null);
1286
+ }
1287
+ catch (error) {
1288
+ if (previousViewport) {
1289
+ newSettings.viewport = previousViewport;
1290
+ }
1291
+ else {
1292
+ delete newSettings.viewport;
1293
+ }
1294
+ this.emulationSettings = Object.keys(newSettings).length
1295
+ ? newSettings
1296
+ : {};
1297
+ throw error;
1298
+ }
1299
+ }
1300
+ async clearNetworkConditions() {
1301
+ if (!this.emulationSettings.networkConditions) {
1302
+ return;
1303
+ }
1304
+ await this.#pptrPage?.emulateNetworkConditions(null);
1305
+ delete this.emulationSettings.networkConditions;
1306
+ this.updateTimeouts();
1059
1307
  }
1060
1308
  updateTimeouts() {
1061
1309
  if (!this.#pptrPage) {
@@ -1071,23 +1319,84 @@ export class McpPage {
1071
1319
  const networkMultiplier = getNetworkMultiplierFromString(this.networkConditions);
1072
1320
  this.pptrPage.setDefaultNavigationTimeout(this.#navigationTimeout * networkMultiplier * cpuMultiplier);
1073
1321
  }
1074
- waitForTextOnPage(text, timeout) {
1075
- const frames = this.pptrPage.frames();
1076
- let locator = this.#locatorClass.race(frames.flatMap(frame => text.flatMap(value => [
1077
- frame.locator(`aria/${value}`),
1078
- frame.locator(`text/${value}`),
1079
- ])));
1322
+ waitForTextOnPage(text, options = {}) {
1323
+ const { timeout, visible } = options;
1324
+ const page = this.pptrPage;
1325
+ const initialFrames = page.frames();
1326
+ const observedFrames = new Set(initialFrames);
1327
+ const controller = new AbortController();
1328
+ const locatorForFrames = (frames) => this.#locatorClass.race(frames.flatMap(frame => text.flatMap(value => {
1329
+ const locators = [
1330
+ frame.locator(`aria/${value}`),
1331
+ frame.locator(`text/${value}`),
1332
+ ];
1333
+ return visible
1334
+ ? locators.map(locator => locator.setVisibility('visible'))
1335
+ : locators;
1336
+ })));
1337
+ let initialLocator = locatorForFrames(initialFrames);
1080
1338
  if (timeout) {
1081
- locator = locator.setTimeout(timeout);
1339
+ initialLocator = initialLocator.setTimeout(timeout);
1082
1340
  }
1083
- return locator.wait();
1341
+ return new Promise((resolve, reject) => {
1342
+ let settled = false;
1343
+ const cleanup = () => {
1344
+ if (settled) {
1345
+ return false;
1346
+ }
1347
+ settled = true;
1348
+ page.off('frameattached', onFrameAttached);
1349
+ controller.abort();
1350
+ return true;
1351
+ };
1352
+ const finish = (element) => {
1353
+ if (cleanup()) {
1354
+ resolve(element);
1355
+ }
1356
+ };
1357
+ const fail = (error) => {
1358
+ if (cleanup()) {
1359
+ reject(error);
1360
+ }
1361
+ };
1362
+ const onFrameAttached = (frame) => {
1363
+ if (observedFrames.has(frame)) {
1364
+ return;
1365
+ }
1366
+ observedFrames.add(frame);
1367
+ // The initial locator race does not include frames added later.
1368
+ // Watch each new frame until the initial race resolves or times out.
1369
+ // A timeout of 0 disables the frame timer; controller.abort() stops it.
1370
+ void locatorForFrames([frame])
1371
+ .setTimeout(0)
1372
+ .wait({ signal: controller.signal })
1373
+ .then(finish, error => {
1374
+ if (controller.signal.aborted) {
1375
+ return;
1376
+ }
1377
+ logger?.('Failed to wait for text in an attached frame', error);
1378
+ });
1379
+ };
1380
+ page.on('frameattached', onFrameAttached);
1381
+ void initialLocator.wait({ signal: controller.signal }).then(finish, fail);
1382
+ });
1383
+ }
1384
+ lighthouseNavigation(flags) {
1385
+ return lighthouseNavigation(this.pptrPage, this.pptrPage.url(), {
1386
+ flags,
1387
+ });
1388
+ }
1389
+ lighthouseSnapshot(flags) {
1390
+ return lighthouseSnapshot(this.pptrPage, {
1391
+ flags,
1392
+ });
1084
1393
  }
1085
1394
  /**
1086
1395
  * We need to ignore favicon request as they make our test flaky
1087
1396
  */
1088
1397
  async setUpNetworkCollectorForTesting() {
1089
1398
  this.networkCollector.dispose();
1090
- this.networkCollector = new NetworkCollector(this.pptrPage, undefined, collect => {
1399
+ this.networkCollector = new NetworkCollector(this.pptrPage, { maxNavigationSaved: this.#config.resolved.maxNavigationSaved }, collect => {
1091
1400
  return {
1092
1401
  request: req => {
1093
1402
  if (req.url().includes('favicon.ico')) {