@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +223 -2
- package/out/Default/gen/src/ArcBrowser.js +128 -0
- package/out/Default/gen/src/BrowserManager.js +562 -0
- package/out/Default/gen/src/LogpointManager.js +287 -0
- package/out/Default/gen/src/McpContext.js +1031 -0
- package/out/Default/gen/src/McpPage.js +1427 -0
- package/out/Default/gen/src/McpResponse.js +1350 -0
- package/out/Default/gen/src/McpWorker.js +66 -0
- package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
- package/out/Default/gen/src/SlimMcpResponse.js +23 -0
- package/out/Default/gen/src/TextSnapshot.js +336 -0
- package/out/Default/gen/src/ToolHandler.js +531 -0
- package/out/Default/gen/src/bin/check-latest-version.js +53 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
- package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
- package/out/Default/gen/src/collectors/PageCollector.js +325 -0
- package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigLocator.js +70 -0
- package/out/Default/gen/src/config/ConfigParser.js +163 -0
- package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
- package/out/Default/gen/src/config/ServerConfig.js +284 -0
- package/out/Default/gen/src/config/browser-options.js +135 -0
- package/out/Default/gen/src/config/category-options.js +84 -0
- package/out/Default/gen/src/config/cli-commands.js +208 -0
- package/out/Default/gen/src/config/cli-options.js +2090 -0
- package/out/Default/gen/src/config/mcp-options.js +371 -0
- package/out/Default/gen/src/config/puppeteer-options.js +69 -0
- package/out/Default/gen/src/config/tool-options.js +60 -0
- package/out/Default/gen/src/daemon/client.js +281 -0
- package/out/Default/gen/src/daemon/daemon.js +280 -0
- package/out/Default/gen/src/daemon/types.js +7 -0
- package/out/Default/gen/src/daemon/utils.js +173 -0
- package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
- package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
- package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
- package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
- package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
- package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
- package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
- package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
- package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/formatters/constants.js +8 -0
- package/out/Default/gen/src/index.js +434 -0
- package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
- package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
- package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
- package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
- package/out/Default/gen/src/telemetry/errors.js +18 -0
- package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
- package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
- package/out/Default/gen/src/telemetry/persistence.js +82 -0
- package/out/Default/gen/src/telemetry/transformation.js +229 -0
- package/out/Default/gen/src/telemetry/types.js +36 -0
- package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
- package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
- package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
- package/out/Default/gen/src/third_party/browser.js +808 -0
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +139 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
- package/out/Default/gen/src/third_party/index.js +128 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -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/out/Default/gen/src/tools/categories.js +37 -0
- package/out/Default/gen/src/tools/comments.js +230 -0
- package/out/Default/gen/src/tools/console.js +122 -0
- package/out/Default/gen/src/tools/css.js +54 -0
- package/out/Default/gen/src/tools/emulation.js +98 -0
- package/out/Default/gen/src/tools/extensions.js +108 -0
- package/out/Default/gen/src/tools/input.js +658 -0
- package/out/Default/gen/src/tools/lighthouse.js +279 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/memory.js +531 -0
- package/out/Default/gen/src/tools/network.js +325 -0
- package/out/Default/gen/src/tools/pages.js +420 -0
- package/out/Default/gen/src/tools/performance.js +258 -0
- package/out/Default/gen/src/tools/pwa.js +152 -0
- package/out/Default/gen/src/tools/screencast.js +160 -0
- package/out/Default/gen/src/tools/screenshot.js +315 -0
- package/out/Default/gen/src/tools/script.js +319 -0
- package/out/Default/gen/src/tools/slim/tools.js +110 -0
- package/out/Default/gen/src/tools/snapshot.js +88 -0
- package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/out/Default/gen/src/tools/tools.js +72 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/out/Default/gen/src/tools/webmcp.js +55 -0
- package/out/Default/gen/src/types.js +21 -0
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
- package/out/Default/gen/src/utils/bytes.js +95 -0
- package/out/Default/gen/src/utils/check-for-updates.js +81 -0
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/out/Default/gen/src/utils/errorHandling.js +23 -0
- package/out/Default/gen/src/utils/files.js +81 -0
- package/out/Default/gen/src/utils/id.js +16 -0
- package/out/Default/gen/src/utils/keyboard.js +307 -0
- package/out/Default/gen/src/utils/logger.js +145 -0
- package/out/Default/gen/src/utils/logpoint.js +44 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/pagination.js +50 -0
- package/out/Default/gen/src/utils/polyfill.js +11 -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 +43 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/out/Default/gen/src/utils/url.js +311 -0
- package/out/Default/gen/src/version.js +11 -0
- package/package.json +125 -4
- package/skills/a11y-debugging/SKILL.md +86 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/arc-compatibility/SKILL.md +174 -0
- package/skills/arc-compatibility/SOURCES.md +238 -0
- package/skills/arc-compatibility/references/compatibility.md +115 -0
- package/skills/arc-compatibility/references/output-contract.md +62 -0
- package/skills/arc-compatibility/references/workflows.md +108 -0
- package/skills/chrome-devtools/SKILL.md +80 -0
- package/skills/chrome-devtools-cli/SKILL.md +208 -0
- package/skills/chrome-devtools-cli/references/installation.md +24 -0
- package/skills/cookie-debugging/SKILL.md +152 -0
- package/skills/debug-optimize-lcp/SKILL.md +121 -0
- package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
- package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
- package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
- package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
- package/skills/inspect-in-devtools/SKILL.md +82 -0
- package/skills/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +107 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
* */
|
|
6
|
+
import { isUtf8 } from 'node:buffer';
|
|
7
|
+
import { DevTools, } from '../third_party/browser.js';
|
|
8
|
+
import { truncateText, truncateUrl } from '../utils/text.js';
|
|
9
|
+
const BODY_CONTEXT_SIZE_LIMIT = 10000;
|
|
10
|
+
/**
|
|
11
|
+
* How long to wait for a response body. Puppeteer reads a body only after the
|
|
12
|
+
* response finished loading, with no timeout of its own, and a response that
|
|
13
|
+
* never finishes (e.g. a `Cache-Control: no-store` response the page did not
|
|
14
|
+
* read) would otherwise hold the tool mutex forever.
|
|
15
|
+
*/
|
|
16
|
+
export const RESPONSE_BODY_TIMEOUT_MS = 5000;
|
|
17
|
+
class ResponseBodyTimeoutError extends Error {
|
|
18
|
+
timeout;
|
|
19
|
+
constructor(timeout) {
|
|
20
|
+
super(`Response body timed out after ${timeout} ms`);
|
|
21
|
+
this.timeout = timeout;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function responseBodyTimeoutMessage(error) {
|
|
25
|
+
return `<Response body not available: the response did not finish loading within ${error.timeout} ms>`;
|
|
26
|
+
}
|
|
27
|
+
export class NetworkFormatter {
|
|
28
|
+
#request;
|
|
29
|
+
#options;
|
|
30
|
+
#requestBody;
|
|
31
|
+
#responseBody;
|
|
32
|
+
#requestBodyFilePath;
|
|
33
|
+
#responseBodyFilePath;
|
|
34
|
+
constructor(request, options) {
|
|
35
|
+
this.#request = request;
|
|
36
|
+
this.#options = options;
|
|
37
|
+
}
|
|
38
|
+
static async from(request, options) {
|
|
39
|
+
const instance = new NetworkFormatter(request, options);
|
|
40
|
+
if (options.fetchData) {
|
|
41
|
+
await instance.#loadDetailedData();
|
|
42
|
+
}
|
|
43
|
+
return instance;
|
|
44
|
+
}
|
|
45
|
+
async #loadDetailedData() {
|
|
46
|
+
// Load Request Body
|
|
47
|
+
if (this.#request.hasPostData()) {
|
|
48
|
+
let data;
|
|
49
|
+
try {
|
|
50
|
+
data =
|
|
51
|
+
this.#request.postData() ?? (await this.#request.fetchPostData());
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Ignore parsing errors
|
|
55
|
+
}
|
|
56
|
+
const requestBodyNotAvailableMessage = '<Request body not available anymore>';
|
|
57
|
+
if (this.#options.requestFilePath) {
|
|
58
|
+
if (!this.#options.saveFile) {
|
|
59
|
+
throw new Error('Unable to save the request body to a file: no saveFile callback was configured.');
|
|
60
|
+
}
|
|
61
|
+
// postData() is UTF-8 decoded, so binary bodies lose bytes; content()
|
|
62
|
+
// returns the raw bytes.
|
|
63
|
+
let bytes;
|
|
64
|
+
try {
|
|
65
|
+
bytes = await this.#request.content();
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Fall back to the decoded string below.
|
|
69
|
+
}
|
|
70
|
+
const body = bytes?.length
|
|
71
|
+
? bytes
|
|
72
|
+
: data
|
|
73
|
+
? Buffer.from(data)
|
|
74
|
+
: undefined;
|
|
75
|
+
if (body) {
|
|
76
|
+
const result = await this.#options.saveFile(body, this.#options.requestFilePath, '.network-request');
|
|
77
|
+
this.#requestBodyFilePath = result.filename;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.#requestBody = requestBodyNotAvailableMessage;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (data) {
|
|
84
|
+
this.#requestBody = getSizeLimitedString(data, BODY_CONTEXT_SIZE_LIMIT);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.#requestBody = requestBodyNotAvailableMessage;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Load Response Body
|
|
91
|
+
const response = this.#request.response();
|
|
92
|
+
if (response) {
|
|
93
|
+
const responseBodyNotAvailableMessage = '<Response body not available anymore>';
|
|
94
|
+
if (this.#options.responseFilePath) {
|
|
95
|
+
let buffer;
|
|
96
|
+
try {
|
|
97
|
+
buffer = await this.#readResponseBody(response);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
this.#responseBody =
|
|
101
|
+
error instanceof ResponseBodyTimeoutError
|
|
102
|
+
? responseBodyTimeoutMessage(error)
|
|
103
|
+
: responseBodyNotAvailableMessage;
|
|
104
|
+
}
|
|
105
|
+
if (buffer) {
|
|
106
|
+
if (!this.#options.saveFile) {
|
|
107
|
+
throw new Error('Unable to save the response body to a file: no saveFile callback was configured.');
|
|
108
|
+
}
|
|
109
|
+
const result = await this.#options.saveFile(buffer, this.#options.responseFilePath, '.network-response');
|
|
110
|
+
this.#responseBodyFilePath = result.filename;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.#responseBody = await this.#getFormattedResponseBody(response, BODY_CONTEXT_SIZE_LIMIT);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
toString() {
|
|
119
|
+
return convertNetworkRequestConciseToString(this.toJSON());
|
|
120
|
+
}
|
|
121
|
+
toStringDetailed() {
|
|
122
|
+
return convertNetworkRequestDetailedToStringDetailed(this.toJSONDetailed());
|
|
123
|
+
}
|
|
124
|
+
toJSON() {
|
|
125
|
+
return {
|
|
126
|
+
requestId: this.#options.requestId,
|
|
127
|
+
method: this.#request.method(),
|
|
128
|
+
url: this.#request.url(),
|
|
129
|
+
status: this.#getStatusFromRequest(this.#request),
|
|
130
|
+
selectedInDevToolsUI: this.#options.selectedInDevToolsUI,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
#redactNetworkHeaders(headers) {
|
|
134
|
+
const headersList = Object.entries(headers).map(item => {
|
|
135
|
+
return { name: item[0], value: item[1] };
|
|
136
|
+
});
|
|
137
|
+
const redacted = DevTools.NetworkRequestFormatter.sanitizeHeaders(headersList);
|
|
138
|
+
return redacted.reduce((acc, item) => {
|
|
139
|
+
acc[item.name] = item.value;
|
|
140
|
+
return acc;
|
|
141
|
+
}, {});
|
|
142
|
+
}
|
|
143
|
+
toJSONDetailed() {
|
|
144
|
+
// Puppeteer shares one redirect chain array between all hops of a
|
|
145
|
+
// redirect, so earlier hops also list themselves and the hops after them.
|
|
146
|
+
// Keep only the requests that redirected to this one.
|
|
147
|
+
const fullChain = this.#request.redirectChain();
|
|
148
|
+
const ownIndex = fullChain.indexOf(this.#request);
|
|
149
|
+
const redirectChain = ownIndex === -1 ? fullChain : fullChain.slice(0, ownIndex);
|
|
150
|
+
const formattedRedirectChain = redirectChain.reverse().map(request => {
|
|
151
|
+
const id = this.#options.requestIdResolver
|
|
152
|
+
? this.#options.requestIdResolver(request)
|
|
153
|
+
: undefined;
|
|
154
|
+
const formatter = new NetworkFormatter(request, {
|
|
155
|
+
requestId: id,
|
|
156
|
+
saveFile: this.#options.saveFile,
|
|
157
|
+
redactNetworkHeaders: this.#options.redactNetworkHeaders,
|
|
158
|
+
});
|
|
159
|
+
return formatter.toJSON();
|
|
160
|
+
});
|
|
161
|
+
const responseHeaders = this.#request.response()?.headers();
|
|
162
|
+
return {
|
|
163
|
+
...this.toJSON(),
|
|
164
|
+
requestHeaders: this.#options.redactNetworkHeaders
|
|
165
|
+
? this.#redactNetworkHeaders(this.#request.headers())
|
|
166
|
+
: this.#request.headers(),
|
|
167
|
+
requestBody: this.#requestBody,
|
|
168
|
+
requestBodyFilePath: this.#requestBodyFilePath,
|
|
169
|
+
responseHeaders: this.#options.redactNetworkHeaders && responseHeaders
|
|
170
|
+
? this.#redactNetworkHeaders(responseHeaders)
|
|
171
|
+
: this.#request.response()?.headers(),
|
|
172
|
+
responseBody: this.#responseBody,
|
|
173
|
+
responseBodyFilePath: this.#responseBodyFilePath,
|
|
174
|
+
failure: this.#request.failure()?.errorText,
|
|
175
|
+
redirectChain: formattedRedirectChain.length
|
|
176
|
+
? formattedRedirectChain
|
|
177
|
+
: undefined,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
#getStatusFromRequest(request) {
|
|
181
|
+
const httpResponse = request.response();
|
|
182
|
+
const failure = request.failure();
|
|
183
|
+
let status;
|
|
184
|
+
if (httpResponse) {
|
|
185
|
+
status = httpResponse.status().toString();
|
|
186
|
+
}
|
|
187
|
+
else if (failure) {
|
|
188
|
+
status = failure.errorText;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
status = 'pending';
|
|
192
|
+
}
|
|
193
|
+
return status;
|
|
194
|
+
}
|
|
195
|
+
async #getFormattedResponseBody(httpResponse, sizeLimit = BODY_CONTEXT_SIZE_LIMIT) {
|
|
196
|
+
try {
|
|
197
|
+
const responseBuffer = await this.#readResponseBody(httpResponse);
|
|
198
|
+
if (isUtf8(responseBuffer)) {
|
|
199
|
+
const responseAsTest = responseBuffer.toString('utf-8');
|
|
200
|
+
if (responseAsTest.length === 0) {
|
|
201
|
+
return '<empty response>';
|
|
202
|
+
}
|
|
203
|
+
return getSizeLimitedString(responseAsTest, sizeLimit);
|
|
204
|
+
}
|
|
205
|
+
return '<binary data>';
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
if (error instanceof ResponseBodyTimeoutError) {
|
|
209
|
+
return responseBodyTimeoutMessage(error);
|
|
210
|
+
}
|
|
211
|
+
return '<not available anymore>';
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async #readResponseBody(httpResponse) {
|
|
215
|
+
const timeout = this.#options.responseBodyTimeout ?? RESPONSE_BODY_TIMEOUT_MS;
|
|
216
|
+
let timeoutId;
|
|
217
|
+
try {
|
|
218
|
+
return await Promise.race([
|
|
219
|
+
httpResponse.buffer(),
|
|
220
|
+
new Promise((_, reject) => {
|
|
221
|
+
timeoutId = setTimeout(() => {
|
|
222
|
+
reject(new ResponseBodyTimeoutError(timeout));
|
|
223
|
+
}, timeout);
|
|
224
|
+
}),
|
|
225
|
+
]);
|
|
226
|
+
}
|
|
227
|
+
finally {
|
|
228
|
+
clearTimeout(timeoutId);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function getSizeLimitedString(text, sizeLimit) {
|
|
233
|
+
return truncateText(text, sizeLimit, { ellipsis: '... <truncated>' });
|
|
234
|
+
}
|
|
235
|
+
function convertNetworkRequestConciseToString(data) {
|
|
236
|
+
// Long URLs (e.g., data: URLs) bloat the concise list output. The full URL
|
|
237
|
+
// remains available via the detailed view and the structured content.
|
|
238
|
+
const url = truncateUrl(data.url);
|
|
239
|
+
return `reqid=${data.requestId} ${data.method} ${url} [${data.status}]${data.selectedInDevToolsUI ? ` [selected in the DevTools Network panel]` : ''}`;
|
|
240
|
+
}
|
|
241
|
+
function formatHeaders(headers) {
|
|
242
|
+
const response = [];
|
|
243
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
244
|
+
response.push(`- ${name}:${value}`);
|
|
245
|
+
}
|
|
246
|
+
return response;
|
|
247
|
+
}
|
|
248
|
+
function convertNetworkRequestDetailedToStringDetailed(data) {
|
|
249
|
+
const response = [];
|
|
250
|
+
response.push(`## Request ${data.url}`);
|
|
251
|
+
response.push(`Status: ${data.status}`);
|
|
252
|
+
response.push(`### Request Headers`);
|
|
253
|
+
for (const line of formatHeaders(data.requestHeaders)) {
|
|
254
|
+
response.push(line);
|
|
255
|
+
}
|
|
256
|
+
if (data.requestBody) {
|
|
257
|
+
response.push(`### Request Body`);
|
|
258
|
+
response.push(data.requestBody);
|
|
259
|
+
}
|
|
260
|
+
else if (data.requestBodyFilePath) {
|
|
261
|
+
response.push(`### Request Body`);
|
|
262
|
+
response.push(`Saved to ${data.requestBodyFilePath}.`);
|
|
263
|
+
}
|
|
264
|
+
if (data.responseHeaders) {
|
|
265
|
+
response.push(`### Response Headers`);
|
|
266
|
+
for (const line of formatHeaders(data.responseHeaders)) {
|
|
267
|
+
response.push(line);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (data.responseBody) {
|
|
271
|
+
response.push(`### Response Body`);
|
|
272
|
+
response.push(data.responseBody);
|
|
273
|
+
}
|
|
274
|
+
else if (data.responseBodyFilePath) {
|
|
275
|
+
response.push(`### Response Body`);
|
|
276
|
+
response.push(`Saved to ${data.responseBodyFilePath}.`);
|
|
277
|
+
}
|
|
278
|
+
if (data.failure) {
|
|
279
|
+
response.push(`### Request failed with`);
|
|
280
|
+
response.push(data.failure);
|
|
281
|
+
}
|
|
282
|
+
const redirectChain = data.redirectChain;
|
|
283
|
+
if (redirectChain?.length) {
|
|
284
|
+
response.push(`### Redirect chain`);
|
|
285
|
+
let indent = 0;
|
|
286
|
+
// `redirectChain` is already ordered by toJSONDetailed(); don't reverse it
|
|
287
|
+
// again here or the text output contradicts structuredContent (the JSON).
|
|
288
|
+
for (const request of redirectChain) {
|
|
289
|
+
response.push(`${' '.repeat(indent)}${convertNetworkRequestConciseToString(request)}`);
|
|
290
|
+
indent++;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return response.join('\n');
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=NetworkFormatter.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
const MEASUREMENT_WARNING = 'Network mocks disable the page HTTP cache and intercept every request. ' +
|
|
7
|
+
'Replacement resources use altered delivery paths; these timings do not ' +
|
|
8
|
+
'represent normal production loading. Compare baseline and candidate using ' +
|
|
9
|
+
'the same mock mechanism, cache policy, and throttling.';
|
|
10
|
+
export class NetworkOverridesFormatter {
|
|
11
|
+
overrides;
|
|
12
|
+
constructor(overrides) {
|
|
13
|
+
this.overrides = overrides;
|
|
14
|
+
}
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
overrides: this.overrides,
|
|
18
|
+
...(this.overrides.length > 0 ? { warning: MEASUREMENT_WARNING } : {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
const { overrides, warning } = this.toJSON();
|
|
23
|
+
if (!warning) {
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
const lines = [warning];
|
|
27
|
+
for (const override of overrides) {
|
|
28
|
+
const source = override.kind === 'file'
|
|
29
|
+
? override.responseFilePath + ' (' + override.contentType + ')'
|
|
30
|
+
: override.kind === 'upstream'
|
|
31
|
+
? override.upstreamUrl
|
|
32
|
+
: 'original response';
|
|
33
|
+
const resourceType = override.resourceType
|
|
34
|
+
? ' [' + override.resourceType + ']'
|
|
35
|
+
: '';
|
|
36
|
+
lines.push(override.urlPattern + resourceType + ' -> ' + source);
|
|
37
|
+
if (override.abort) {
|
|
38
|
+
lines.push(' Requests are aborted; the response source is ignored.');
|
|
39
|
+
}
|
|
40
|
+
if (override.allowOrigin !== undefined) {
|
|
41
|
+
lines.push(' Access-Control-Allow-Origin: ' + override.allowOrigin);
|
|
42
|
+
}
|
|
43
|
+
const { hits, errors, navigations, lastError } = override.diagnostics;
|
|
44
|
+
lines.push(' Since configured: ' + hits + ' hits, ' + errors + ' errors.');
|
|
45
|
+
if (lastError) {
|
|
46
|
+
lines.push(' Last error: ' + lastError);
|
|
47
|
+
}
|
|
48
|
+
if (hits === 0) {
|
|
49
|
+
lines.push(navigations > 0
|
|
50
|
+
? ' Warning: no requests matched after navigation. Check the full-URL pattern, resource type, and service worker.'
|
|
51
|
+
: ' No matches yet. Navigate or reload to verify this rule.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return lines.join('\n');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=NetworkOverridesFormatter.js.map
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Plain-text port of devtools-frontend's RemoteObjectPreviewFormatter
|
|
8
|
+
* (front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts)
|
|
9
|
+
* at revision f7e7785de52d6f5955d6a9c5956c2fe2d520d091, the
|
|
10
|
+
* third_party/devtools-frontend revision this port was written against. Compare
|
|
11
|
+
* with that file when syncing. It formats the preview that CDP already attaches
|
|
12
|
+
* to console arguments, so nothing is evaluated in the page.
|
|
13
|
+
*
|
|
14
|
+
* Intentional differences from upstream:
|
|
15
|
+
* - Returns plain text instead of Lit templates, so there are no CSS classes,
|
|
16
|
+
* tooltips or localized strings ('empty' and 'empty × N' are English).
|
|
17
|
+
* - No nodeDescription markup: DOM nodes print their description as is instead
|
|
18
|
+
* of splitting it into tag, id and class spans (renderNodeTitle), and trusted
|
|
19
|
+
* types print their description instead of `ClassName "value"`.
|
|
20
|
+
* - 'date' and 'node' are added to the subtypes that print their description
|
|
21
|
+
* instead of a property preview.
|
|
22
|
+
* - The `includeNullOrUndefined` option is dropped; null and undefined
|
|
23
|
+
* properties are always listed.
|
|
24
|
+
* - Top-level strings print as their raw value (as the console does for string
|
|
25
|
+
* arguments), and unserializable primitives (NaN, -0, 1n) print from
|
|
26
|
+
* `unserializableValue`.
|
|
27
|
+
* - The 400-character description limit that upstream passes to
|
|
28
|
+
* trimEndWithMaxLength() inline is named MAX_DESCRIPTION_LENGTH.
|
|
29
|
+
*/
|
|
30
|
+
import { DevTools } from '../third_party/browser.js';
|
|
31
|
+
const { StringUtilities } = DevTools.Platform;
|
|
32
|
+
const MAX_DESCRIPTION_LENGTH = 400;
|
|
33
|
+
const PROMISE_STATE = '[[PromiseState]]';
|
|
34
|
+
const PROMISE_RESULT = '[[PromiseResult]]';
|
|
35
|
+
const GENERATOR_STATE = '[[GeneratorState]]';
|
|
36
|
+
const PRIMITIVE_VALUE = '[[PrimitiveValue]]';
|
|
37
|
+
const WEAK_REF_TARGET = '[[WeakRefTarget]]';
|
|
38
|
+
// Subtypes whose description is shown instead of a property preview.
|
|
39
|
+
const SUBTYPES_WITHOUT_VALUE_PREVIEW = new Set([
|
|
40
|
+
'arraybuffer',
|
|
41
|
+
'dataview',
|
|
42
|
+
'date',
|
|
43
|
+
'error',
|
|
44
|
+
'internal#entry',
|
|
45
|
+
'null',
|
|
46
|
+
'node',
|
|
47
|
+
'regexp',
|
|
48
|
+
'trustedtype',
|
|
49
|
+
'webassemblymemory',
|
|
50
|
+
]);
|
|
51
|
+
function sortValue(property) {
|
|
52
|
+
switch (property.name) {
|
|
53
|
+
case PROMISE_STATE:
|
|
54
|
+
return 1;
|
|
55
|
+
case PROMISE_RESULT:
|
|
56
|
+
return 2;
|
|
57
|
+
case GENERATOR_STATE:
|
|
58
|
+
case PRIMITIVE_VALUE:
|
|
59
|
+
case WEAK_REF_TARGET:
|
|
60
|
+
return 3;
|
|
61
|
+
}
|
|
62
|
+
if (property.type !== 'function' && !property.name.startsWith('#')) {
|
|
63
|
+
return 4;
|
|
64
|
+
}
|
|
65
|
+
return 5;
|
|
66
|
+
}
|
|
67
|
+
function formatName(name) {
|
|
68
|
+
return /^\s|\s$|^$|\n/.test(name) ? `"${name.replace(/\n/g, '↵')}"` : name;
|
|
69
|
+
}
|
|
70
|
+
function abbreviateClassName(description) {
|
|
71
|
+
const parts = description.split('.');
|
|
72
|
+
if (parts.length === 1 && parts[0] === 'Object') {
|
|
73
|
+
return '{…}';
|
|
74
|
+
}
|
|
75
|
+
return parts
|
|
76
|
+
.map((part, i) => i < parts.length - 1 ? StringUtilities.trimMiddle(part, 3) : part)
|
|
77
|
+
.join('.');
|
|
78
|
+
}
|
|
79
|
+
function formatPropertyValue(type, subtype, description = '') {
|
|
80
|
+
switch (type) {
|
|
81
|
+
case 'accessor':
|
|
82
|
+
return '(...)';
|
|
83
|
+
case 'function':
|
|
84
|
+
return 'ƒ';
|
|
85
|
+
case 'string':
|
|
86
|
+
return StringUtilities.formatAsJSLiteral(description);
|
|
87
|
+
case 'object':
|
|
88
|
+
return subtype ? description : abbreviateClassName(description);
|
|
89
|
+
default:
|
|
90
|
+
return description;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function arrayLength(preview) {
|
|
94
|
+
const match = preview.description?.match(/[[(](\d+)[\])]$/);
|
|
95
|
+
return match ? Number(match[1]) : 0;
|
|
96
|
+
}
|
|
97
|
+
function formatArrayItems(preview) {
|
|
98
|
+
const length = arrayLength(preview);
|
|
99
|
+
const toIndex = (name) => {
|
|
100
|
+
const index = Number(name) >>> 0;
|
|
101
|
+
return String(index) === name && index < length ? index : -1;
|
|
102
|
+
};
|
|
103
|
+
const indexed = preview.properties
|
|
104
|
+
.filter(p => toIndex(p.name) !== -1)
|
|
105
|
+
.sort((a, b) => toIndex(a.name) - toIndex(b.name));
|
|
106
|
+
const others = preview.properties
|
|
107
|
+
.filter(p => toIndex(p.name) === -1)
|
|
108
|
+
.sort((a, b) => sortValue(a) - sortValue(b));
|
|
109
|
+
// Gaps can be shown when all properties are guaranteed to be in the preview.
|
|
110
|
+
const canShowGaps = !preview.overflow;
|
|
111
|
+
const gap = (count) => count === 1 ? 'empty' : `empty × ${count}`;
|
|
112
|
+
const items = [];
|
|
113
|
+
let previous = -1;
|
|
114
|
+
for (const property of indexed) {
|
|
115
|
+
const index = toIndex(property.name);
|
|
116
|
+
const value = formatPropertyValue(property.type, property.subtype, property.value);
|
|
117
|
+
if (canShowGaps) {
|
|
118
|
+
if (index - previous > 1) {
|
|
119
|
+
items.push(gap(index - previous - 1));
|
|
120
|
+
}
|
|
121
|
+
items.push(value);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
items.push(index === items.length ? value : `${property.name}: ${value}`);
|
|
125
|
+
}
|
|
126
|
+
previous = index;
|
|
127
|
+
}
|
|
128
|
+
if (canShowGaps && length - previous > 1) {
|
|
129
|
+
items.push(gap(length - previous - 1));
|
|
130
|
+
}
|
|
131
|
+
for (const property of others) {
|
|
132
|
+
items.push(`${formatName(property.name)}: ${formatPropertyValue(property.type, property.subtype, property.value)}`);
|
|
133
|
+
}
|
|
134
|
+
return items;
|
|
135
|
+
}
|
|
136
|
+
function formatObjectItems(preview) {
|
|
137
|
+
const properties = preview.properties
|
|
138
|
+
.filter(p => p.type !== 'accessor')
|
|
139
|
+
.sort((a, b) => sortValue(a) - sortValue(b));
|
|
140
|
+
const items = [];
|
|
141
|
+
for (let i = 0; i < properties.length; i++) {
|
|
142
|
+
const property = properties[i];
|
|
143
|
+
const value = formatPropertyValue(property.type, property.subtype, property.value);
|
|
144
|
+
if (preview.subtype === 'promise' && property.name === PROMISE_STATE) {
|
|
145
|
+
const result = properties.at(i + 1);
|
|
146
|
+
if (result?.name === PROMISE_RESULT) {
|
|
147
|
+
i++;
|
|
148
|
+
}
|
|
149
|
+
items.push(property.value !== 'pending' && result?.name === PROMISE_RESULT
|
|
150
|
+
? `<${property.value}>: ${formatPropertyValue(result.type, result.subtype, result.value)}`
|
|
151
|
+
: `<${property.value}>`);
|
|
152
|
+
}
|
|
153
|
+
else if (preview.subtype === 'generator' &&
|
|
154
|
+
property.name === GENERATOR_STATE) {
|
|
155
|
+
items.push(`<${property.value}>`);
|
|
156
|
+
}
|
|
157
|
+
else if (property.name === PRIMITIVE_VALUE) {
|
|
158
|
+
items.push(value);
|
|
159
|
+
}
|
|
160
|
+
else if (property.name === WEAK_REF_TARGET) {
|
|
161
|
+
items.push(property.type === 'undefined' ? '<cleared>' : value);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
items.push(`${formatName(property.name)}: ${value}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return items;
|
|
168
|
+
}
|
|
169
|
+
function formatEntryItems(preview) {
|
|
170
|
+
return (preview.entries ?? []).map(({ key, value }) => {
|
|
171
|
+
const formattedValue = formatPropertyValue(value.type, value.subtype, value.description);
|
|
172
|
+
return key
|
|
173
|
+
? `${formatPropertyValue(key.type, key.subtype, key.description)} => ${formattedValue}`
|
|
174
|
+
: formattedValue;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Formats a `Runtime.ObjectPreview` the way the DevTools console previews it,
|
|
179
|
+
* for example `Map(1) {1 => 2}`, `(3) [1, 2, 3]` or `{a: 1, self: {…}}`.
|
|
180
|
+
*/
|
|
181
|
+
function formatObjectPreview(preview) {
|
|
182
|
+
const description = preview.description ?? '';
|
|
183
|
+
if (preview.type !== 'object' ||
|
|
184
|
+
(preview.subtype && SUBTYPES_WITHOUT_VALUE_PREVIEW.has(preview.subtype))) {
|
|
185
|
+
return formatPropertyValue(preview.type, preview.subtype, description);
|
|
186
|
+
}
|
|
187
|
+
const isArray = preview.subtype === 'array' || preview.subtype === 'typedarray';
|
|
188
|
+
let prefix = '';
|
|
189
|
+
if (isArray) {
|
|
190
|
+
const length = arrayLength(preview);
|
|
191
|
+
const lengthText = length > 1 ? `(${length})` : '';
|
|
192
|
+
const name = description.replace(/[[(]\d+[\])]$/, '');
|
|
193
|
+
prefix = name === 'Array' ? lengthText : `${name}${lengthText}`;
|
|
194
|
+
}
|
|
195
|
+
else if (description !== 'Object') {
|
|
196
|
+
prefix = description;
|
|
197
|
+
}
|
|
198
|
+
const items = preview.entries
|
|
199
|
+
? formatEntryItems(preview)
|
|
200
|
+
: isArray
|
|
201
|
+
? formatArrayItems(preview)
|
|
202
|
+
: formatObjectItems(preview);
|
|
203
|
+
if (preview.overflow) {
|
|
204
|
+
items.push('…');
|
|
205
|
+
}
|
|
206
|
+
const body = isArray ? `[${items.join(', ')}]` : `{${items.join(', ')}}`;
|
|
207
|
+
return prefix ? `${prefix} ${body}` : body;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Formats a console argument from the description and preview that CDP sends
|
|
211
|
+
* with it.
|
|
212
|
+
*/
|
|
213
|
+
export function formatRemoteObject(remoteObject) {
|
|
214
|
+
if (remoteObject.preview &&
|
|
215
|
+
remoteObject.type === 'object' &&
|
|
216
|
+
remoteObject.subtype !== 'node' &&
|
|
217
|
+
remoteObject.subtype !== 'trustedtype') {
|
|
218
|
+
return formatObjectPreview(remoteObject.preview);
|
|
219
|
+
}
|
|
220
|
+
if (remoteObject.type === 'string') {
|
|
221
|
+
return String(remoteObject.value ?? '');
|
|
222
|
+
}
|
|
223
|
+
if (remoteObject.unserializableValue !== undefined) {
|
|
224
|
+
return remoteObject.unserializableValue;
|
|
225
|
+
}
|
|
226
|
+
if (remoteObject.description !== undefined) {
|
|
227
|
+
return StringUtilities.trimEndWithMaxLength(remoteObject.description, MAX_DESCRIPTION_LENGTH);
|
|
228
|
+
}
|
|
229
|
+
return String(remoteObject.value);
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=RemoteObjectFormatter.js.map
|