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