chrome-devtools-mcp 1.5.0 → 1.7.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 +41 -9
- package/build/src/HeapSnapshotManager.js +77 -28
- package/build/src/McpContext.js +233 -383
- package/build/src/McpPage.js +466 -41
- package/build/src/McpResponse.js +285 -331
- package/build/src/PageCollector.js +53 -122
- package/build/src/SlimMcpResponse.js +1 -1
- package/build/src/TextSnapshot.js +100 -21
- package/build/src/ToolHandler.js +31 -10
- package/build/src/WaitForHelper.js +140 -56
- package/build/src/bin/chrome-devtools-cli-options.js +63 -3
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +16 -7
- package/build/src/bin/chrome-devtools-mcp-main.js +3 -3
- package/build/src/bin/chrome-devtools.js +19 -3
- package/build/src/browser.js +1 -1
- package/build/src/daemon/client.js +55 -3
- package/build/src/daemon/daemon.js +17 -12
- package/build/src/daemon/utils.js +19 -4
- package/build/src/devtools/DevtoolsUtils.js +9 -65
- package/build/src/{issue-descriptions.js → devtools/issueDescriptions.js} +2 -2
- package/build/src/formatters/HeapSnapshotFormatter.js +48 -11
- package/build/src/formatters/IssueFormatter.js +2 -2
- package/build/src/index.js +13 -3
- package/build/src/telemetry/ClearcutLogger.js +4 -1
- package/build/src/telemetry/WatchdogClient.js +1 -1
- package/build/src/telemetry/metricsRegistry.js +2 -9
- package/build/src/telemetry/persistence.js +1 -1
- package/build/src/telemetry/transformation.js +50 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +1 -1
- package/build/src/telemetry/watchdog/main.js +1 -1
- package/build/src/third_party/THIRD_PARTY_NOTICES +230 -287
- package/build/src/third_party/bundled-packages.json +4 -6
- package/build/src/third_party/devtools-formatter-worker.js +60 -19
- package/build/src/third_party/devtools-heap-snapshot-worker.js +383 -182
- package/build/src/third_party/index.js +30171 -11328
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +2 -2
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +3 -3
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +2 -2
- package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +1 -1
- package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +2 -2
- package/build/src/third_party/issue-descriptions/LowTextContrast.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +3 -3
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +3 -3
- package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +1 -1
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +3 -3
- package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +3 -3
- package/build/src/third_party/issue-descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +1 -1
- package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +1 -1
- package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +2 -2
- package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +2 -2
- package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +3 -3
- package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +1 -1
- package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +1 -1
- package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +3 -3
- package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +2 -2
- package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +3 -3
- package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +4 -3
- package/build/src/third_party/issue-descriptions/cspEvalViolation.md +4 -4
- package/build/src/third_party/issue-descriptions/cspInlineViolation.md +2 -2
- package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +2 -2
- package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +4 -4
- package/build/src/third_party/issue-descriptions/cspURLViolation.md +4 -4
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -1
- package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +2 -2
- package/build/src/third_party/issue-descriptions/heavyAd.md +1 -1
- package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +3 -3
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +1 -1
- package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +3 -3
- package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +2 -2
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +2 -2
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +4 -4
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +4 -4
- package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +4 -4
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +4 -4
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +5 -5
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +3 -3
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +2 -2
- package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +4 -4
- package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +3 -3
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +2 -2
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +2 -2
- package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +1 -1
- package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +1 -1
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +2 -2
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +3 -3
- package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +2 -2
- package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +1 -1
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +3177 -6340
- package/build/src/tools/emulation.js +2 -2
- package/build/src/tools/extensions.js +1 -1
- package/build/src/tools/input.js +213 -112
- package/build/src/tools/lighthouse.js +1 -1
- package/build/src/tools/memory.js +49 -4
- package/build/src/tools/network.js +5 -5
- package/build/src/tools/pages.js +22 -89
- package/build/src/tools/performance.js +62 -41
- package/build/src/tools/screenshot.js +152 -77
- package/build/src/tools/script.js +95 -28
- package/build/src/tools/snapshot.js +2 -2
- package/build/src/tools/thirdPartyDeveloper.js +1 -1
- package/build/src/tools/webmcp.js +1 -1
- package/build/src/trace-processing/parse.js +1 -1
- package/build/src/{logger.js → utils/logger.js} +1 -1
- package/build/src/utils/polyfill.js +11 -0
- package/build/src/utils/url.js +43 -0
- package/build/src/version.js +1 -1
- package/package.json +23 -15
- package/skills/memory-leak-debugging/SKILL.md +23 -19
- package/skills/memory-leak-debugging/references/common-leaks.md +1 -1
- package/build/src/Mutex.js +0 -38
- package/build/src/devtools/DevToolsConnectionAdapter.js +0 -70
- package/build/src/polyfill.js +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeRead.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeSet.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteExcludeNavigationContextDowngrade.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeRead.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeSet.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnStrictLaxDowngradeStrict.md +0 -8
- package/build/src/third_party/issue-descriptions/arInsecureContext.md +0 -7
- package/build/src/third_party/issue-descriptions/arInvalidInfoHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
- package/build/src/third_party/issue-descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
- package/build/src/third_party/issue-descriptions/arNoRegisterOsSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterOsTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoWebOrOsSupport.md +0 -4
- package/build/src/third_party/issue-descriptions/arOsSourceIgnored.md +0 -18
- package/build/src/third_party/issue-descriptions/arOsTriggerIgnored.md +0 -19
- package/build/src/third_party/issue-descriptions/arPermissionPolicyDisabled.md +0 -8
- package/build/src/third_party/issue-descriptions/arSourceAndTriggerHeaders.md +0 -9
- package/build/src/third_party/issue-descriptions/arSourceIgnored.md +0 -13
- package/build/src/third_party/issue-descriptions/arTriggerIgnored.md +0 -12
- package/build/src/third_party/issue-descriptions/arUntrustworthyReportingOrigin.md +0 -10
- package/build/src/third_party/issue-descriptions/arWebAndOsHeaders.md +0 -11
- package/build/src/utils/types.js +0 -7
- package/skills/memory-leak-debugging/references/compare_snapshots.js +0 -109
- package/skills/memory-leak-debugging/references/memlab.md +0 -29
|
@@ -75,9 +75,9 @@ export const emulate = definePageTool({
|
|
|
75
75
|
},
|
|
76
76
|
blockedByDialog: true,
|
|
77
77
|
verifyFilesSchema: [],
|
|
78
|
-
handler: async (request, response
|
|
78
|
+
handler: async (request, response) => {
|
|
79
79
|
const page = request.page;
|
|
80
|
-
await
|
|
80
|
+
await page.emulate(request.params);
|
|
81
81
|
response.appendResponseLine('Emulation configured successfully');
|
|
82
82
|
},
|
|
83
83
|
});
|
package/build/src/tools/input.js
CHANGED
|
@@ -3,9 +3,61 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
7
|
+
if (value !== null && value !== void 0) {
|
|
8
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
9
|
+
var dispose, inner;
|
|
10
|
+
if (async) {
|
|
11
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
12
|
+
dispose = value[Symbol.asyncDispose];
|
|
13
|
+
}
|
|
14
|
+
if (dispose === void 0) {
|
|
15
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
16
|
+
dispose = value[Symbol.dispose];
|
|
17
|
+
if (async) inner = dispose;
|
|
18
|
+
}
|
|
19
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
20
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
21
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
22
|
+
}
|
|
23
|
+
else if (async) {
|
|
24
|
+
env.stack.push({ async: true });
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
29
|
+
return function (env) {
|
|
30
|
+
function fail(e) {
|
|
31
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
32
|
+
env.hasError = true;
|
|
33
|
+
}
|
|
34
|
+
var r, s = 0;
|
|
35
|
+
function next() {
|
|
36
|
+
while (r = env.stack.pop()) {
|
|
37
|
+
try {
|
|
38
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
39
|
+
if (r.dispose) {
|
|
40
|
+
var result = r.dispose.call(r.value);
|
|
41
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
42
|
+
}
|
|
43
|
+
else s |= 1;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
fail(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
50
|
+
if (env.hasError) throw env.error;
|
|
51
|
+
}
|
|
52
|
+
return next();
|
|
53
|
+
};
|
|
54
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
55
|
+
var e = new Error(message);
|
|
56
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
57
|
+
});
|
|
7
58
|
import { zod } from '../third_party/index.js';
|
|
8
59
|
import { parseKey } from '../utils/keyboard.js';
|
|
60
|
+
import { logger } from '../utils/logger.js';
|
|
9
61
|
import { ToolCategory } from './categories.js';
|
|
10
62
|
import { definePageTool } from './ToolDefinition.js';
|
|
11
63
|
const dblClickSchema = zod
|
|
@@ -27,41 +79,41 @@ function handleActionError(error, uid) {
|
|
|
27
79
|
});
|
|
28
80
|
}
|
|
29
81
|
async function selectNativeSelectOption(handle) {
|
|
30
|
-
const
|
|
31
|
-
if (!(node instanceof HTMLOptionElement)) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const select = node.closest('select');
|
|
35
|
-
if (!select || select.multiple || select.disabled || node.disabled) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const parentElement = node.parentElement;
|
|
39
|
-
if (parentElement instanceof HTMLOptGroupElement &&
|
|
40
|
-
parentElement.disabled) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return select;
|
|
44
|
-
});
|
|
82
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
45
83
|
try {
|
|
46
|
-
const
|
|
84
|
+
const selectHandle = __addDisposableResource(env_1, await handle.evaluateHandle(node => {
|
|
85
|
+
if (!(node instanceof HTMLOptionElement)) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
const select = node.closest('select');
|
|
89
|
+
if (!select || select.multiple || select.disabled || node.disabled) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const parentElement = node.parentElement;
|
|
93
|
+
if (parentElement instanceof HTMLOptGroupElement &&
|
|
94
|
+
parentElement.disabled) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return select;
|
|
98
|
+
}), false);
|
|
99
|
+
const select = __addDisposableResource(env_1, selectHandle.asElement(), false);
|
|
47
100
|
if (!select) {
|
|
48
101
|
return false;
|
|
49
102
|
}
|
|
50
|
-
const valueHandle = await handle.getProperty('value');
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
await select.asLocator().fill(value);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
void valueHandle.dispose();
|
|
103
|
+
const valueHandle = __addDisposableResource(env_1, await handle.getProperty('value'), false);
|
|
104
|
+
const value = await valueHandle.jsonValue();
|
|
105
|
+
if (typeof value !== 'string') {
|
|
106
|
+
return false;
|
|
60
107
|
}
|
|
108
|
+
await select.asLocator().fill(value);
|
|
61
109
|
return true;
|
|
62
110
|
}
|
|
111
|
+
catch (e_1) {
|
|
112
|
+
env_1.error = e_1;
|
|
113
|
+
env_1.hasError = true;
|
|
114
|
+
}
|
|
63
115
|
finally {
|
|
64
|
-
|
|
116
|
+
__disposeResources(env_1);
|
|
65
117
|
}
|
|
66
118
|
}
|
|
67
119
|
export const click = definePageTool({
|
|
@@ -81,33 +133,40 @@ export const click = definePageTool({
|
|
|
81
133
|
blockedByDialog: true,
|
|
82
134
|
verifyFilesSchema: [],
|
|
83
135
|
handler: async (request, response) => {
|
|
84
|
-
const
|
|
85
|
-
const handle = await request.page.getElementByUid(uid);
|
|
86
|
-
const aXNode = request.page.getAXNodeByUid(uid);
|
|
87
|
-
const shouldSelectNativeOption = !request.params.dblClick && aXNode?.role === 'option';
|
|
136
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
88
137
|
try {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
await
|
|
95
|
-
|
|
138
|
+
const uid = request.params.uid;
|
|
139
|
+
const handle = __addDisposableResource(env_2, await request.page.getElementByUid(uid), false);
|
|
140
|
+
const aXNode = request.page.getAXNodeByUid(uid);
|
|
141
|
+
const shouldSelectNativeOption = !request.params.dblClick && aXNode?.role === 'option';
|
|
142
|
+
try {
|
|
143
|
+
const result = await request.page.waitForEventsAfterAction(async () => {
|
|
144
|
+
if (shouldSelectNativeOption &&
|
|
145
|
+
(await selectNativeSelectOption(handle))) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
await handle.asLocator().click({
|
|
149
|
+
count: request.params.dblClick ? 2 : 1,
|
|
150
|
+
});
|
|
96
151
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
152
|
+
response.appendResponseLine(request.params.dblClick
|
|
153
|
+
? `Successfully double clicked on the element`
|
|
154
|
+
: `Successfully clicked on the element`);
|
|
155
|
+
response.attachWaitForResult(result);
|
|
156
|
+
if (request.params.includeSnapshot) {
|
|
157
|
+
response.includeSnapshot();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
handleActionError(error, uid);
|
|
104
162
|
}
|
|
105
163
|
}
|
|
106
|
-
catch (
|
|
107
|
-
|
|
164
|
+
catch (e_2) {
|
|
165
|
+
env_2.error = e_2;
|
|
166
|
+
env_2.hasError = true;
|
|
108
167
|
}
|
|
109
168
|
finally {
|
|
110
|
-
|
|
169
|
+
__disposeResources(env_2);
|
|
111
170
|
}
|
|
112
171
|
},
|
|
113
172
|
});
|
|
@@ -159,23 +218,30 @@ export const hover = definePageTool({
|
|
|
159
218
|
blockedByDialog: true,
|
|
160
219
|
verifyFilesSchema: [],
|
|
161
220
|
handler: async (request, response) => {
|
|
162
|
-
const
|
|
163
|
-
const handle = await request.page.getElementByUid(uid);
|
|
221
|
+
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
164
222
|
try {
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
response.
|
|
223
|
+
const uid = request.params.uid;
|
|
224
|
+
const handle = __addDisposableResource(env_3, await request.page.getElementByUid(uid), false);
|
|
225
|
+
try {
|
|
226
|
+
const result = await request.page.waitForEventsAfterAction(async () => {
|
|
227
|
+
await handle.asLocator().hover();
|
|
228
|
+
});
|
|
229
|
+
response.appendResponseLine(`Successfully hovered over the element`);
|
|
230
|
+
response.attachWaitForResult(result);
|
|
231
|
+
if (request.params.includeSnapshot) {
|
|
232
|
+
response.includeSnapshot();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
handleActionError(error, uid);
|
|
172
237
|
}
|
|
173
238
|
}
|
|
174
|
-
catch (
|
|
175
|
-
|
|
239
|
+
catch (e_3) {
|
|
240
|
+
env_3.error = e_3;
|
|
241
|
+
env_3.hasError = true;
|
|
176
242
|
}
|
|
177
243
|
finally {
|
|
178
|
-
|
|
244
|
+
__disposeResources(env_3);
|
|
179
245
|
}
|
|
180
246
|
},
|
|
181
247
|
});
|
|
@@ -187,26 +253,36 @@ async function selectOption(handle, aXNode, value) {
|
|
|
187
253
|
let optionFound = false;
|
|
188
254
|
for (const child of aXNode.children) {
|
|
189
255
|
if (child.role === 'option' && child.name === value && child.value) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
256
|
+
const env_4 = { stack: [], error: void 0, hasError: false };
|
|
257
|
+
try {
|
|
258
|
+
optionFound = true;
|
|
259
|
+
const childHandle = __addDisposableResource(env_4, await child.elementHandle(), false);
|
|
260
|
+
if (childHandle) {
|
|
261
|
+
const env_5 = { stack: [], error: void 0, hasError: false };
|
|
195
262
|
try {
|
|
263
|
+
const childValueHandle = __addDisposableResource(env_5, await childHandle.getProperty('value'), false);
|
|
196
264
|
const childValue = await childValueHandle.jsonValue();
|
|
197
265
|
if (childValue) {
|
|
198
266
|
await handle.asLocator().fill(childValue.toString());
|
|
199
267
|
}
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
catch (e_4) {
|
|
271
|
+
env_5.error = e_4;
|
|
272
|
+
env_5.hasError = true;
|
|
200
273
|
}
|
|
201
274
|
finally {
|
|
202
|
-
|
|
275
|
+
__disposeResources(env_5);
|
|
203
276
|
}
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
void childHandle.dispose();
|
|
208
277
|
}
|
|
209
278
|
}
|
|
279
|
+
catch (e_5) {
|
|
280
|
+
env_4.error = e_5;
|
|
281
|
+
env_4.hasError = true;
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
__disposeResources(env_4);
|
|
285
|
+
}
|
|
210
286
|
}
|
|
211
287
|
}
|
|
212
288
|
if (!optionFound) {
|
|
@@ -217,43 +293,50 @@ function hasOptionChildren(aXNode) {
|
|
|
217
293
|
return aXNode.children.some(child => child.role === 'option');
|
|
218
294
|
}
|
|
219
295
|
async function fillFormElement(uid, value, context, page) {
|
|
220
|
-
const
|
|
296
|
+
const env_6 = { stack: [], error: void 0, hasError: false };
|
|
221
297
|
try {
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
298
|
+
const handle = __addDisposableResource(env_6, await page.getElementByUid(uid), false);
|
|
299
|
+
try {
|
|
300
|
+
const aXNode = page.getAXNodeByUid(uid);
|
|
301
|
+
// We assume that combobox needs to be handled as select if it has
|
|
302
|
+
// role='combobox' and option children.
|
|
303
|
+
if (aXNode && aXNode.role === 'combobox' && hasOptionChildren(aXNode)) {
|
|
304
|
+
await selectOption(handle, aXNode, value);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
const isToggle = await handle.evaluate(el => {
|
|
308
|
+
if (el instanceof HTMLInputElement) {
|
|
309
|
+
return el.type === 'checkbox' || el.type === 'radio';
|
|
310
|
+
}
|
|
311
|
+
const role = el.getAttribute('role');
|
|
312
|
+
return role === 'checkbox' || role === 'radio' || role === 'switch';
|
|
313
|
+
});
|
|
314
|
+
if (isToggle) {
|
|
315
|
+
if (['true', 'false'].includes(value)) {
|
|
316
|
+
await handle.asLocator().fill(value === 'true');
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
throw new Error(`Checkboxes, radio boxes and toggles require "true" or "false" value, but ${value} was used`);
|
|
320
|
+
}
|
|
239
321
|
}
|
|
240
322
|
else {
|
|
241
|
-
|
|
323
|
+
// Increase timeout for longer input values.
|
|
324
|
+
const timeoutPerChar = 10; // ms
|
|
325
|
+
const fillTimeout = page.pptrPage.getDefaultTimeout() + value.length * timeoutPerChar;
|
|
326
|
+
await handle.asLocator().setTimeout(fillTimeout).fill(value);
|
|
242
327
|
}
|
|
243
328
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const fillTimeout = page.pptrPage.getDefaultTimeout() + value.length * timeoutPerChar;
|
|
248
|
-
await handle.asLocator().setTimeout(fillTimeout).fill(value);
|
|
249
|
-
}
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
handleActionError(error, uid);
|
|
250
332
|
}
|
|
251
333
|
}
|
|
252
|
-
catch (
|
|
253
|
-
|
|
334
|
+
catch (e_6) {
|
|
335
|
+
env_6.error = e_6;
|
|
336
|
+
env_6.hasError = true;
|
|
254
337
|
}
|
|
255
338
|
finally {
|
|
256
|
-
|
|
339
|
+
__disposeResources(env_6);
|
|
257
340
|
}
|
|
258
341
|
}
|
|
259
342
|
export const fill = definePageTool({
|
|
@@ -326,9 +409,10 @@ export const drag = definePageTool({
|
|
|
326
409
|
blockedByDialog: true,
|
|
327
410
|
verifyFilesSchema: [],
|
|
328
411
|
handler: async (request, response) => {
|
|
329
|
-
const
|
|
330
|
-
const toHandle = await request.page.getElementByUid(request.params.to_uid);
|
|
412
|
+
const env_7 = { stack: [], error: void 0, hasError: false };
|
|
331
413
|
try {
|
|
414
|
+
const fromHandle = __addDisposableResource(env_7, await request.page.getElementByUid(request.params.from_uid), false);
|
|
415
|
+
const toHandle = __addDisposableResource(env_7, await request.page.getElementByUid(request.params.to_uid), false);
|
|
332
416
|
const result = await request.page.waitForEventsAfterAction(async () => {
|
|
333
417
|
await fromHandle.drag(toHandle);
|
|
334
418
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
@@ -340,9 +424,12 @@ export const drag = definePageTool({
|
|
|
340
424
|
response.includeSnapshot();
|
|
341
425
|
}
|
|
342
426
|
}
|
|
427
|
+
catch (e_7) {
|
|
428
|
+
env_7.error = e_7;
|
|
429
|
+
env_7.hasError = true;
|
|
430
|
+
}
|
|
343
431
|
finally {
|
|
344
|
-
|
|
345
|
-
void toHandle.dispose();
|
|
432
|
+
__disposeResources(env_7);
|
|
346
433
|
}
|
|
347
434
|
},
|
|
348
435
|
});
|
|
@@ -399,10 +486,11 @@ export const uploadFile = definePageTool({
|
|
|
399
486
|
},
|
|
400
487
|
blockedByDialog: true,
|
|
401
488
|
verifyFilesSchema: ['filePath'],
|
|
402
|
-
handler: async (request, response
|
|
403
|
-
const {
|
|
404
|
-
const handle = (await request.page.getElementByUid(uid));
|
|
489
|
+
handler: async (request, response) => {
|
|
490
|
+
const env_8 = { stack: [], error: void 0, hasError: false };
|
|
405
491
|
try {
|
|
492
|
+
const { uid, filePath } = request.params;
|
|
493
|
+
const handle = __addDisposableResource(env_8, (await request.page.getElementByUid(uid)), false);
|
|
406
494
|
try {
|
|
407
495
|
await handle.uploadFile(filePath);
|
|
408
496
|
}
|
|
@@ -426,8 +514,12 @@ export const uploadFile = definePageTool({
|
|
|
426
514
|
}
|
|
427
515
|
response.appendResponseLine(`File uploaded from ${filePath}.`);
|
|
428
516
|
}
|
|
517
|
+
catch (e_8) {
|
|
518
|
+
env_8.error = e_8;
|
|
519
|
+
env_8.hasError = true;
|
|
520
|
+
}
|
|
429
521
|
finally {
|
|
430
|
-
|
|
522
|
+
__disposeResources(env_8);
|
|
431
523
|
}
|
|
432
524
|
},
|
|
433
525
|
});
|
|
@@ -451,12 +543,21 @@ export const pressKey = definePageTool({
|
|
|
451
543
|
const tokens = parseKey(request.params.key);
|
|
452
544
|
const [key, ...modifiers] = tokens;
|
|
453
545
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
454
|
-
|
|
455
|
-
|
|
546
|
+
const heldModifiers = [];
|
|
547
|
+
try {
|
|
548
|
+
for (const modifier of modifiers) {
|
|
549
|
+
await page.pptrPage.keyboard.down(modifier);
|
|
550
|
+
heldModifiers.push(modifier);
|
|
551
|
+
}
|
|
552
|
+
await page.pptrPage.keyboard.press(key);
|
|
456
553
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
554
|
+
finally {
|
|
555
|
+
// Release every modifier that was successfully pressed, even if a
|
|
556
|
+
// later key event throws. Otherwise a failed press leaves modifiers
|
|
557
|
+
// logically held down in the browser (see #2309).
|
|
558
|
+
for (const modifier of heldModifiers.toReversed()) {
|
|
559
|
+
await page.pptrPage.keyboard.up(modifier);
|
|
560
|
+
}
|
|
460
561
|
}
|
|
461
562
|
});
|
|
462
563
|
response.appendResponseLine(`Successfully pressed key: ${request.params.key}`);
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
8
|
import { definePageTool, defineTool } from './ToolDefinition.js';
|
|
9
|
+
const HEAP_SNAPSHOT_FILTERS = [
|
|
10
|
+
'objectsRetainedByDetachedDomNodes',
|
|
11
|
+
'objectsRetainedByConsole',
|
|
12
|
+
'objectsRetainedByEventHandlers',
|
|
13
|
+
'objectsRetainedByContexts',
|
|
14
|
+
'sharedNativeContext',
|
|
15
|
+
'noNativeContext',
|
|
16
|
+
'attributedToSpecificNativeContext',
|
|
17
|
+
];
|
|
9
18
|
export const takeHeapSnapshot = definePageTool({
|
|
10
19
|
name: 'take_heapsnapshot',
|
|
11
20
|
description: `Capture a heap snapshot of the currently selected page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.`,
|
|
@@ -31,7 +40,7 @@ export const takeHeapSnapshot = definePageTool({
|
|
|
31
40
|
});
|
|
32
41
|
export const getHeapSnapshotSummary = defineTool({
|
|
33
42
|
name: 'get_heapsnapshot_summary',
|
|
34
|
-
description: 'Loads a memory heapsnapshot and returns snapshot summary stats.',
|
|
43
|
+
description: 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes.',
|
|
35
44
|
annotations: {
|
|
36
45
|
category: ToolCategory.MEMORY,
|
|
37
46
|
readOnlyHint: true,
|
|
@@ -45,7 +54,8 @@ export const getHeapSnapshotSummary = defineTool({
|
|
|
45
54
|
handler: async (request, response, context) => {
|
|
46
55
|
const stats = await context.getHeapSnapshotStats(request.params.filePath);
|
|
47
56
|
const staticData = await context.getHeapSnapshotStaticData(request.params.filePath);
|
|
48
|
-
|
|
57
|
+
const nativeContextSizes = await context.getHeapSnapshotNativeContextSizes(request.params.filePath);
|
|
58
|
+
response.setHeapSnapshotStats(stats, staticData, nativeContextSizes);
|
|
49
59
|
},
|
|
50
60
|
});
|
|
51
61
|
export const getHeapSnapshotDetails = defineTool({
|
|
@@ -58,6 +68,14 @@ export const getHeapSnapshotDetails = defineTool({
|
|
|
58
68
|
},
|
|
59
69
|
schema: {
|
|
60
70
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
71
|
+
filterName: zod
|
|
72
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
73
|
+
.optional()
|
|
74
|
+
.describe('An optional filter to apply to the aggregates.'),
|
|
75
|
+
objectId: zod
|
|
76
|
+
.number()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
61
79
|
pageIdx: zod
|
|
62
80
|
.number()
|
|
63
81
|
.optional()
|
|
@@ -70,7 +88,7 @@ export const getHeapSnapshotDetails = defineTool({
|
|
|
70
88
|
blockedByDialog: false,
|
|
71
89
|
verifyFilesSchema: ['filePath'],
|
|
72
90
|
handler: async (request, response, context) => {
|
|
73
|
-
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath);
|
|
91
|
+
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath, request.params.filterName, request.params.objectId);
|
|
74
92
|
response.setHeapSnapshotAggregates(aggregates, {
|
|
75
93
|
pageIdx: request.params.pageIdx,
|
|
76
94
|
pageSize: request.params.pageSize,
|
|
@@ -88,13 +106,21 @@ export const getHeapSnapshotClassNodes = defineTool({
|
|
|
88
106
|
schema: {
|
|
89
107
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
90
108
|
id: zod.number().describe('The ID for the class, obtained from details.'),
|
|
109
|
+
filterName: zod
|
|
110
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('An optional filter to apply to the nodes.'),
|
|
113
|
+
objectId: zod
|
|
114
|
+
.number()
|
|
115
|
+
.optional()
|
|
116
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
91
117
|
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
92
118
|
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
93
119
|
},
|
|
94
120
|
blockedByDialog: false,
|
|
95
121
|
verifyFilesSchema: ['filePath'],
|
|
96
122
|
handler: async (request, response, context) => {
|
|
97
|
-
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id);
|
|
123
|
+
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id, request.params.filterName, request.params.objectId);
|
|
98
124
|
response.setHeapSnapshotNodes(nodes, {
|
|
99
125
|
pageIdx: request.params.pageIdx,
|
|
100
126
|
pageSize: request.params.pageSize,
|
|
@@ -280,4 +306,23 @@ export const getHeapSnapshotDuplicateStrings = defineTool({
|
|
|
280
306
|
});
|
|
281
307
|
},
|
|
282
308
|
});
|
|
309
|
+
export const getHeapSnapshotObjectDetails = defineTool({
|
|
310
|
+
name: 'get_heapsnapshot_object_details',
|
|
311
|
+
description: 'Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness.',
|
|
312
|
+
annotations: {
|
|
313
|
+
category: ToolCategory.MEMORY,
|
|
314
|
+
readOnlyHint: true,
|
|
315
|
+
conditions: ['memoryDebugging'],
|
|
316
|
+
},
|
|
317
|
+
blockedByDialog: false,
|
|
318
|
+
verifyFilesSchema: ['filePath'],
|
|
319
|
+
schema: {
|
|
320
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
321
|
+
nodeId: zod.number().describe('The node ID to get object details for.'),
|
|
322
|
+
},
|
|
323
|
+
handler: async (request, response, context) => {
|
|
324
|
+
const objectInfo = await context.getHeapSnapshotObjectDetails(request.params.filePath, request.params.nodeId);
|
|
325
|
+
response.setHeapSnapshotObjectDetails(objectInfo);
|
|
326
|
+
},
|
|
327
|
+
});
|
|
283
328
|
//# sourceMappingURL=memory.js.map
|
|
@@ -29,7 +29,7 @@ const FILTERABLE_RESOURCE_TYPES = [
|
|
|
29
29
|
];
|
|
30
30
|
export const listNetworkRequests = definePageTool({
|
|
31
31
|
name: 'list_network_requests',
|
|
32
|
-
description: `
|
|
32
|
+
description: `Lists the most recent requests for the currently selected page since the last navigation.`,
|
|
33
33
|
annotations: {
|
|
34
34
|
category: ToolCategory.NETWORK,
|
|
35
35
|
readOnlyHint: true,
|
|
@@ -59,11 +59,11 @@ export const listNetworkRequests = definePageTool({
|
|
|
59
59
|
},
|
|
60
60
|
blockedByDialog: false,
|
|
61
61
|
verifyFilesSchema: [],
|
|
62
|
-
handler: async (request, response
|
|
62
|
+
handler: async (request, response) => {
|
|
63
63
|
const data = await request.page.getDevToolsData();
|
|
64
64
|
response.attachDevToolsData(data);
|
|
65
65
|
const reqid = data?.cdpRequestId
|
|
66
|
-
?
|
|
66
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
67
67
|
: undefined;
|
|
68
68
|
response.setIncludeNetworkRequests(true, {
|
|
69
69
|
pageSize: request.params.pageSize,
|
|
@@ -97,7 +97,7 @@ export const getNetworkRequest = definePageTool({
|
|
|
97
97
|
},
|
|
98
98
|
blockedByDialog: true,
|
|
99
99
|
verifyFilesSchema: ['requestFilePath', 'responseFilePath'],
|
|
100
|
-
handler: async (request, response
|
|
100
|
+
handler: async (request, response) => {
|
|
101
101
|
if (request.params.reqid) {
|
|
102
102
|
response.attachNetworkRequest(request.params.reqid, {
|
|
103
103
|
requestFilePath: request.params.requestFilePath,
|
|
@@ -108,7 +108,7 @@ export const getNetworkRequest = definePageTool({
|
|
|
108
108
|
const data = await request.page.getDevToolsData();
|
|
109
109
|
response.attachDevToolsData(data);
|
|
110
110
|
const reqid = data?.cdpRequestId
|
|
111
|
-
?
|
|
111
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
112
112
|
: undefined;
|
|
113
113
|
if (reqid) {
|
|
114
114
|
response.attachNetworkRequest(reqid, {
|