chrome-devtools-mcp 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -22
- package/build/src/McpContext.js +121 -44
- package/build/src/McpPage.js +230 -14
- package/build/src/McpResponse.js +209 -283
- package/build/src/SlimMcpResponse.js +1 -1
- package/build/src/TextSnapshot.js +80 -19
- package/build/src/ToolHandler.js +80 -15
- package/build/src/bin/chrome-devtools-mcp-main.js +3 -3
- package/build/src/bin/chrome-devtools.js +47 -32
- package/build/src/browser.js +3 -1
- package/build/src/{PageCollector.js → collectors/PageCollector.js} +15 -10
- package/build/src/{ServiceWorkerCollector.js → collectors/ServiceWorkerCollector.js} +1 -1
- package/build/src/{bin/chrome-devtools-cli-options.js → config/cli-options.js} +414 -23
- package/build/src/{bin/chrome-devtools-mcp-cli-options.js → config/mcp-options.js} +74 -9
- package/build/src/daemon/client.js +33 -2
- package/build/src/daemon/daemon.js +17 -13
- package/build/src/daemon/utils.js +18 -3
- package/build/src/devtools/DevtoolsUtils.js +9 -16
- package/build/src/formatters/ConsoleFormatter.js +43 -10
- package/build/src/formatters/HeapSnapshotFormatter.js +58 -13
- package/build/src/formatters/IssueFormatter.js +1 -1
- package/build/src/formatters/NetworkFormatter.js +7 -7
- package/build/src/index.js +34 -5
- package/build/src/{HeapSnapshotManager.js → processors/HeapSnapshotManager.js} +82 -27
- package/build/src/{trace-processing/parse.js → processors/PerformanceTrace.js} +1 -1
- package/build/src/telemetry/ClearcutLogger.js +16 -1
- package/build/src/telemetry/flagUtils.js +4 -3
- package/build/src/telemetry/transformation.js +30 -0
- package/build/src/telemetry/types.js +4 -0
- package/build/src/third_party/THIRD_PARTY_NOTICES +235 -113
- package/build/src/third_party/bundled-packages.json +6 -7
- package/build/src/third_party/devtools-formatter-worker.js +60 -19
- package/build/src/third_party/devtools-heap-snapshot-worker.js +657 -224
- package/build/src/third_party/index.js +62484 -43814
- 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/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- 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/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- 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/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- 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/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- 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/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- 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 +1125 -1027
- package/build/src/tools/categories.js +3 -0
- package/build/src/tools/console.js +9 -3
- package/build/src/tools/emulation.js +2 -2
- package/build/src/tools/extensions.js +7 -5
- package/build/src/tools/input.js +222 -120
- package/build/src/tools/lighthouse.js +3 -1
- package/build/src/tools/memory.js +144 -17
- package/build/src/tools/network.js +6 -3
- package/build/src/tools/pages.js +13 -16
- package/build/src/tools/performance.js +57 -46
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +6 -4
- package/build/src/tools/screenshot.js +192 -84
- package/build/src/tools/script.js +118 -34
- package/build/src/tools/slim/tools.js +3 -3
- package/build/src/tools/snapshot.js +5 -3
- package/build/src/tools/thirdPartyDeveloper.js +2 -2
- package/build/src/tools/tools.js +2 -0
- package/build/src/tools/webmcp.js +2 -2
- package/build/src/utils/WaitForHelper.js +299 -0
- package/build/src/utils/bytes.js +105 -0
- package/build/src/utils/logger.js +25 -11
- package/build/src/utils/polyfill.js +6 -3
- package/build/src/utils/url.js +43 -0
- package/build/src/version.js +1 -1
- package/package.json +37 -25
- package/skills/a11y-debugging/SKILL.md +2 -0
- package/skills/chrome-devtools/SKILL.md +5 -4
- package/skills/chrome-devtools-cli/SKILL.md +109 -64
- package/skills/debug-optimize-lcp/SKILL.md +9 -9
- package/skills/memory-leak-debugging/SKILL.md +14 -18
- package/skills/memory-leak-debugging/references/common-leaks.md +1 -1
- package/skills/troubleshooting/SKILL.md +1 -0
- package/build/src/WaitForHelper.js +0 -200
- package/build/src/devtools/DevToolsConnectionAdapter.js +0 -70
- 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/Mutex.js +0 -38
- package/build/src/utils/string.js +0 -37
- package/skills/memory-leak-debugging/references/compare_snapshots.js +0 -109
- package/skills/memory-leak-debugging/references/memlab.md +0 -29
|
@@ -15,6 +15,7 @@ export var ToolCategory;
|
|
|
15
15
|
ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
|
|
16
16
|
ToolCategory["MEMORY"] = "memory";
|
|
17
17
|
ToolCategory["WEBMCP"] = "experimentalWebmcp";
|
|
18
|
+
ToolCategory["PWA"] = "pwa";
|
|
18
19
|
})(ToolCategory || (ToolCategory = {}));
|
|
19
20
|
export const labels = {
|
|
20
21
|
[ToolCategory.INPUT]: 'Input automation',
|
|
@@ -27,10 +28,12 @@ export const labels = {
|
|
|
27
28
|
[ToolCategory.THIRD_PARTY]: 'Third-party',
|
|
28
29
|
[ToolCategory.MEMORY]: 'Memory',
|
|
29
30
|
[ToolCategory.WEBMCP]: 'WebMCP',
|
|
31
|
+
[ToolCategory.PWA]: 'Progressive Web Apps',
|
|
30
32
|
};
|
|
31
33
|
export const OFF_BY_DEFAULT_CATEGORIES = [
|
|
32
34
|
ToolCategory.EXTENSIONS,
|
|
33
35
|
ToolCategory.THIRD_PARTY,
|
|
34
36
|
ToolCategory.WEBMCP,
|
|
37
|
+
ToolCategory.PWA,
|
|
35
38
|
];
|
|
36
39
|
//# sourceMappingURL=categories.js.map
|
|
@@ -32,7 +32,7 @@ const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
|
|
|
32
32
|
export const listConsoleMessages = definePageTool(cliArgs => {
|
|
33
33
|
return {
|
|
34
34
|
name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
|
|
35
|
-
description: `List all console messages for the
|
|
35
|
+
description: `List all console messages for the target page since the last navigation.${cliArgs?.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
|
|
36
36
|
annotations: {
|
|
37
37
|
category: ToolCategory.DEBUGGING,
|
|
38
38
|
readOnlyHint: true,
|
|
@@ -59,19 +59,25 @@ export const listConsoleMessages = definePageTool(cliArgs => {
|
|
|
59
59
|
.default(false)
|
|
60
60
|
.optional()
|
|
61
61
|
.describe('Set to true to return the preserved messages over the last 3 navigations.'),
|
|
62
|
+
includeStackTraces: zod
|
|
63
|
+
.boolean()
|
|
64
|
+
.default(false)
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('Set to true to include the stack trace for each message when available. Increases the response size.'),
|
|
62
67
|
serviceWorkerId: zod
|
|
63
68
|
.string()
|
|
64
69
|
.optional()
|
|
65
70
|
.describe('Filter messages to only return messages of the specified service worker.'),
|
|
66
71
|
},
|
|
67
72
|
blockedByDialog: false,
|
|
68
|
-
verifyFilesSchema:
|
|
73
|
+
verifyFilesSchema: {},
|
|
69
74
|
handler: async (request, response) => {
|
|
70
75
|
response.setIncludeConsoleData(true, {
|
|
71
76
|
pageSize: request.params.pageSize,
|
|
72
77
|
pageIdx: request.params.pageIdx,
|
|
73
78
|
types: request.params.types,
|
|
74
79
|
includePreservedMessages: request.params.includePreservedMessages,
|
|
80
|
+
includeStackTraces: request.params.includeStackTraces,
|
|
75
81
|
serviceWorkerId: request.params.serviceWorkerId,
|
|
76
82
|
});
|
|
77
83
|
},
|
|
@@ -90,7 +96,7 @@ export const getConsoleMessage = definePageTool({
|
|
|
90
96
|
.describe('The msgid of a console message on the page from the listed console messages'),
|
|
91
97
|
},
|
|
92
98
|
blockedByDialog: false,
|
|
93
|
-
verifyFilesSchema:
|
|
99
|
+
verifyFilesSchema: {},
|
|
94
100
|
handler: async (request, response) => {
|
|
95
101
|
response.attachConsoleMessage(request.params.msgid);
|
|
96
102
|
},
|
|
@@ -33,7 +33,7 @@ const throttlingOptions = [
|
|
|
33
33
|
];
|
|
34
34
|
export const emulate = definePageTool({
|
|
35
35
|
name: 'emulate',
|
|
36
|
-
description: `Emulates various features on the
|
|
36
|
+
description: `Emulates various features on the target page.`,
|
|
37
37
|
annotations: {
|
|
38
38
|
category: ToolCategory.EMULATION,
|
|
39
39
|
readOnlyHint: false,
|
|
@@ -74,7 +74,7 @@ export const emulate = definePageTool({
|
|
|
74
74
|
.describe('Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers.'),
|
|
75
75
|
},
|
|
76
76
|
blockedByDialog: true,
|
|
77
|
-
verifyFilesSchema:
|
|
77
|
+
verifyFilesSchema: {},
|
|
78
78
|
handler: async (request, response) => {
|
|
79
79
|
const page = request.page;
|
|
80
80
|
await page.emulate(request.params);
|
|
@@ -19,7 +19,9 @@ export const installExtension = defineTool({
|
|
|
19
19
|
.describe('Absolute path to the unpacked extension folder.'),
|
|
20
20
|
},
|
|
21
21
|
blockedByDialog: false,
|
|
22
|
-
verifyFilesSchema:
|
|
22
|
+
verifyFilesSchema: {
|
|
23
|
+
path: { local: true },
|
|
24
|
+
},
|
|
23
25
|
handler: async (request, response, context) => {
|
|
24
26
|
const { path } = request.params;
|
|
25
27
|
const id = await context.installExtension(path);
|
|
@@ -37,7 +39,7 @@ export const uninstallExtension = defineTool({
|
|
|
37
39
|
id: zod.string().describe('ID of the extension to uninstall.'),
|
|
38
40
|
},
|
|
39
41
|
blockedByDialog: false,
|
|
40
|
-
verifyFilesSchema:
|
|
42
|
+
verifyFilesSchema: {},
|
|
41
43
|
handler: async (request, response, context) => {
|
|
42
44
|
const { id } = request.params;
|
|
43
45
|
await context.uninstallExtension(id);
|
|
@@ -53,7 +55,7 @@ export const listExtensions = defineTool({
|
|
|
53
55
|
},
|
|
54
56
|
schema: {},
|
|
55
57
|
blockedByDialog: false,
|
|
56
|
-
verifyFilesSchema:
|
|
58
|
+
verifyFilesSchema: {},
|
|
57
59
|
handler: async (_request, response) => {
|
|
58
60
|
response.setListExtensions();
|
|
59
61
|
},
|
|
@@ -69,7 +71,7 @@ export const reloadExtension = defineTool({
|
|
|
69
71
|
id: zod.string().describe('ID of the extension to reload.'),
|
|
70
72
|
},
|
|
71
73
|
blockedByDialog: false,
|
|
72
|
-
verifyFilesSchema:
|
|
74
|
+
verifyFilesSchema: {},
|
|
73
75
|
handler: async (request, response, context) => {
|
|
74
76
|
const { id } = request.params;
|
|
75
77
|
const extension = await context.getExtension(id);
|
|
@@ -91,7 +93,7 @@ export const triggerExtensionAction = defineTool({
|
|
|
91
93
|
id: zod.string().describe('ID of the extension to trigger the action for.'),
|
|
92
94
|
},
|
|
93
95
|
blockedByDialog: false,
|
|
94
|
-
verifyFilesSchema:
|
|
96
|
+
verifyFilesSchema: {},
|
|
95
97
|
handler: async (request, response, context) => {
|
|
96
98
|
const { id } = request.params;
|
|
97
99
|
await context.triggerExtensionAction(id);
|
package/build/src/tools/input.js
CHANGED
|
@@ -3,6 +3,58 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
7
|
+
if (value !== null && value !== void 0) {
|
|
8
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
9
|
+
var dispose, inner;
|
|
10
|
+
if (async) {
|
|
11
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
12
|
+
dispose = value[Symbol.asyncDispose];
|
|
13
|
+
}
|
|
14
|
+
if (dispose === void 0) {
|
|
15
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
16
|
+
dispose = value[Symbol.dispose];
|
|
17
|
+
if (async) inner = dispose;
|
|
18
|
+
}
|
|
19
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
20
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
21
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
22
|
+
}
|
|
23
|
+
else if (async) {
|
|
24
|
+
env.stack.push({ async: true });
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
29
|
+
return function (env) {
|
|
30
|
+
function fail(e) {
|
|
31
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
32
|
+
env.hasError = true;
|
|
33
|
+
}
|
|
34
|
+
var r, s = 0;
|
|
35
|
+
function next() {
|
|
36
|
+
while (r = env.stack.pop()) {
|
|
37
|
+
try {
|
|
38
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
39
|
+
if (r.dispose) {
|
|
40
|
+
var result = r.dispose.call(r.value);
|
|
41
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
42
|
+
}
|
|
43
|
+
else s |= 1;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
fail(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
50
|
+
if (env.hasError) throw env.error;
|
|
51
|
+
}
|
|
52
|
+
return next();
|
|
53
|
+
};
|
|
54
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
55
|
+
var e = new Error(message);
|
|
56
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
57
|
+
});
|
|
6
58
|
import { zod } from '../third_party/index.js';
|
|
7
59
|
import { parseKey } from '../utils/keyboard.js';
|
|
8
60
|
import { logger } from '../utils/logger.js';
|
|
@@ -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({
|
|
@@ -79,35 +131,42 @@ export const click = definePageTool({
|
|
|
79
131
|
includeSnapshot: includeSnapshotSchema,
|
|
80
132
|
},
|
|
81
133
|
blockedByDialog: true,
|
|
82
|
-
verifyFilesSchema:
|
|
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
|
});
|
|
@@ -126,7 +185,7 @@ export const clickAt = definePageTool({
|
|
|
126
185
|
includeSnapshot: includeSnapshotSchema,
|
|
127
186
|
},
|
|
128
187
|
blockedByDialog: true,
|
|
129
|
-
verifyFilesSchema:
|
|
188
|
+
verifyFilesSchema: {},
|
|
130
189
|
handler: async (request, response) => {
|
|
131
190
|
const page = request.page;
|
|
132
191
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
@@ -157,25 +216,32 @@ export const hover = definePageTool({
|
|
|
157
216
|
includeSnapshot: includeSnapshotSchema,
|
|
158
217
|
},
|
|
159
218
|
blockedByDialog: true,
|
|
160
|
-
verifyFilesSchema:
|
|
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
|
-
if (childValue) {
|
|
198
|
-
await handle.asLocator().fill(childValue
|
|
265
|
+
if (typeof childValue === 'string') {
|
|
266
|
+
await handle.asLocator().fill(childValue);
|
|
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({
|
|
@@ -273,7 +356,7 @@ export const fill = definePageTool({
|
|
|
273
356
|
includeSnapshot: includeSnapshotSchema,
|
|
274
357
|
},
|
|
275
358
|
blockedByDialog: true,
|
|
276
|
-
verifyFilesSchema:
|
|
359
|
+
verifyFilesSchema: {},
|
|
277
360
|
handler: async (request, response, context) => {
|
|
278
361
|
const page = request.page;
|
|
279
362
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
@@ -298,7 +381,7 @@ export const typeText = definePageTool({
|
|
|
298
381
|
submitKey: submitKeySchema,
|
|
299
382
|
},
|
|
300
383
|
blockedByDialog: true,
|
|
301
|
-
verifyFilesSchema:
|
|
384
|
+
verifyFilesSchema: {},
|
|
302
385
|
handler: async (request, response) => {
|
|
303
386
|
const page = request.page;
|
|
304
387
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
@@ -324,11 +407,12 @@ export const drag = definePageTool({
|
|
|
324
407
|
includeSnapshot: includeSnapshotSchema,
|
|
325
408
|
},
|
|
326
409
|
blockedByDialog: true,
|
|
327
|
-
verifyFilesSchema:
|
|
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
|
});
|
|
@@ -367,7 +454,7 @@ export const fillForm = definePageTool({
|
|
|
367
454
|
includeSnapshot: includeSnapshotSchema,
|
|
368
455
|
},
|
|
369
456
|
blockedByDialog: true,
|
|
370
|
-
verifyFilesSchema:
|
|
457
|
+
verifyFilesSchema: {},
|
|
371
458
|
handler: async (request, response, context) => {
|
|
372
459
|
const page = request.page;
|
|
373
460
|
let lastResult = {};
|
|
@@ -394,17 +481,28 @@ export const uploadFile = definePageTool({
|
|
|
394
481
|
uid: zod
|
|
395
482
|
.string()
|
|
396
483
|
.describe('The uid of the file input element or an element that will open file chooser on the page from the page content snapshot'),
|
|
397
|
-
|
|
484
|
+
filePaths: zod
|
|
485
|
+
.array(zod.string())
|
|
486
|
+
.min(1)
|
|
487
|
+
.describe('One or more files paths to upload. File paths have to be local to the browser instance (not the MCP).'),
|
|
398
488
|
includeSnapshot: includeSnapshotSchema,
|
|
399
489
|
},
|
|
400
490
|
blockedByDialog: true,
|
|
401
|
-
|
|
491
|
+
// We do not validate file paths for remote browser instances
|
|
492
|
+
// because they are on the remote host and not accessed by the MCP server.
|
|
493
|
+
verifyFilesSchema: {
|
|
494
|
+
filePaths: {
|
|
495
|
+
local: true,
|
|
496
|
+
remote: false,
|
|
497
|
+
},
|
|
498
|
+
},
|
|
402
499
|
handler: async (request, response) => {
|
|
403
|
-
const {
|
|
404
|
-
const handle = (await request.page.getElementByUid(uid));
|
|
500
|
+
const env_8 = { stack: [], error: void 0, hasError: false };
|
|
405
501
|
try {
|
|
502
|
+
const { uid, filePaths } = request.params;
|
|
503
|
+
const handle = __addDisposableResource(env_8, (await request.page.getElementByUid(uid)), false);
|
|
406
504
|
try {
|
|
407
|
-
await handle.uploadFile(
|
|
505
|
+
await handle.uploadFile(...filePaths);
|
|
408
506
|
}
|
|
409
507
|
catch {
|
|
410
508
|
// Some sites use a proxy element to trigger file upload instead of
|
|
@@ -415,7 +513,7 @@ export const uploadFile = definePageTool({
|
|
|
415
513
|
request.page.pptrPage.waitForFileChooser({ timeout: 3000 }),
|
|
416
514
|
handle.asLocator().click(),
|
|
417
515
|
]);
|
|
418
|
-
await fileChooser.accept(
|
|
516
|
+
await fileChooser.accept(filePaths);
|
|
419
517
|
}
|
|
420
518
|
catch {
|
|
421
519
|
throw new Error(`Failed to upload file. The element could not accept the file directly, and clicking it did not trigger a file chooser.`);
|
|
@@ -424,10 +522,14 @@ export const uploadFile = definePageTool({
|
|
|
424
522
|
if (request.params.includeSnapshot) {
|
|
425
523
|
response.includeSnapshot();
|
|
426
524
|
}
|
|
427
|
-
response.appendResponseLine(`File uploaded from ${
|
|
525
|
+
response.appendResponseLine(`File uploaded from ${filePaths.join(', ')}.`);
|
|
526
|
+
}
|
|
527
|
+
catch (e_8) {
|
|
528
|
+
env_8.error = e_8;
|
|
529
|
+
env_8.hasError = true;
|
|
428
530
|
}
|
|
429
531
|
finally {
|
|
430
|
-
|
|
532
|
+
__disposeResources(env_8);
|
|
431
533
|
}
|
|
432
534
|
},
|
|
433
535
|
});
|
|
@@ -445,7 +547,7 @@ export const pressKey = definePageTool({
|
|
|
445
547
|
includeSnapshot: includeSnapshotSchema,
|
|
446
548
|
},
|
|
447
549
|
blockedByDialog: true,
|
|
448
|
-
verifyFilesSchema:
|
|
550
|
+
verifyFilesSchema: {},
|
|
449
551
|
handler: async (request, response) => {
|
|
450
552
|
const page = request.page;
|
|
451
553
|
const tokens = parseKey(request.params.key);
|
|
@@ -30,7 +30,9 @@ export const lighthouseAudit = definePageTool({
|
|
|
30
30
|
.describe('Directory for reports. If omitted, uses temporary files.'),
|
|
31
31
|
},
|
|
32
32
|
blockedByDialog: true,
|
|
33
|
-
verifyFilesSchema:
|
|
33
|
+
verifyFilesSchema: {
|
|
34
|
+
outputDirPath: true,
|
|
35
|
+
},
|
|
34
36
|
handler: async (request, response, context) => {
|
|
35
37
|
const page = request.page;
|
|
36
38
|
const categories = [
|