opera-devtools-mcp 0.2.3 → 0.3.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 +104 -7
- package/build/src/McpContext.js +365 -365
- package/build/src/McpPage.js +475 -48
- package/build/src/McpResponse.js +462 -288
- package/build/src/SlimMcpResponse.js +1 -1
- package/build/src/TextSnapshot.js +101 -22
- package/build/src/ToolHandler.js +142 -20
- package/build/src/bin/check-latest-version.js +27 -1
- package/build/src/bin/chrome-devtools-cli-options.js +573 -10
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +119 -32
- package/build/src/bin/chrome-devtools-mcp-main.js +50 -7
- package/build/src/bin/chrome-devtools-mcp.js +7 -4
- package/build/src/bin/chrome-devtools.js +57 -14
- package/build/src/bin/opera-devtools-cli-options.js +3 -829
- package/build/src/bin/opera-devtools-mcp-cli-options.js +3 -348
- package/build/src/bin/opera-devtools-mcp-main.js +3 -37
- package/build/src/bin/opera-devtools-mcp.js +4 -19
- package/build/src/bin/opera-devtools.js +4 -185
- package/build/src/browser.js +45 -5
- package/build/src/{PageCollector.js → collectors/PageCollector.js} +64 -133
- package/build/src/collectors/ServiceWorkerCollector.js +171 -0
- package/build/src/daemon/client.js +75 -17
- package/build/src/daemon/daemon.js +92 -30
- package/build/src/daemon/utils.js +24 -8
- package/build/src/{DevtoolsUtils.js → devtools/DevtoolsUtils.js} +94 -88
- package/build/src/devtools/McpHostBindingAdapter.js +165 -0
- package/build/src/{issue-descriptions.js → devtools/issueDescriptions.js} +8 -6
- package/build/src/formatters/ConsoleFormatter.js +44 -11
- package/build/src/formatters/HeapSnapshotFormatter.js +140 -9
- package/build/src/formatters/IssueFormatter.js +7 -7
- package/build/src/formatters/NetworkFormatter.js +10 -8
- package/build/src/index.js +101 -232
- package/build/src/opera/branding.js +34 -0
- package/build/src/opera/browserFlags.js +85 -0
- package/build/src/opera/browserLaunch.js +52 -0
- package/build/src/opera/policy.js +50 -0
- package/build/src/opera/serviceWorkerRetry.js +37 -0
- package/build/src/opera/toolHandlerHooks.js +39 -0
- package/build/src/{tools → opera/tools}/opera.js +9 -21
- package/build/src/processors/HeapSnapshotManager.js +258 -0
- package/build/src/{trace-processing/parse.js → processors/PerformanceTrace.js} +9 -9
- package/build/src/telemetry/ClearcutLogger.js +12 -119
- package/build/src/telemetry/WatchdogClient.js +5 -5
- package/build/src/telemetry/errors.js +1 -1
- package/build/src/telemetry/flagUtils.js +6 -6
- package/build/src/telemetry/{toolMetricsUtils.js → metricsRegistry.js} +4 -11
- package/build/src/telemetry/persistence.js +3 -3
- package/build/src/telemetry/transformation.js +184 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +11 -11
- package/build/src/telemetry/watchdog/main.js +6 -6
- package/build/src/third_party/THIRD_PARTY_NOTICES +3493 -0
- package/build/src/third_party/bundled-packages.json +9 -0
- package/build/src/third_party/devtools-formatter-worker.js +15340 -7
- package/build/src/third_party/devtools-heap-snapshot-worker.js +10337 -7
- package/build/src/third_party/index.js +179960 -26
- 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 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.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/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/genericBackUINavigationWouldSkipAd.md +4 -0
- 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/ToolDefinition.js +2 -2
- package/build/src/tools/categories.js +3 -0
- package/build/src/tools/console.js +13 -0
- package/build/src/tools/emulation.js +30 -3
- package/build/src/tools/extensions.js +8 -1
- package/build/src/tools/input.js +246 -128
- package/build/src/tools/lighthouse.js +14 -7
- package/build/src/tools/memory.js +289 -25
- package/build/src/tools/network.js +10 -7
- package/build/src/tools/pages.js +33 -92
- package/build/src/tools/performance.js +67 -52
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +35 -12
- package/build/src/tools/screenshot.js +234 -75
- package/build/src/tools/script.js +130 -45
- package/build/src/tools/slim/tools.js +3 -0
- package/build/src/tools/snapshot.js +7 -4
- package/build/src/tools/thirdPartyDeveloper.js +19 -9
- package/build/src/tools/tools.js +3 -1
- package/build/src/tools/webmcp.js +3 -1
- package/build/src/utils/WaitForHelper.js +299 -0
- package/build/src/utils/check-for-updates.js +8 -2
- package/build/src/utils/files.js +42 -3
- package/build/src/utils/logger.js +51 -0
- 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 +42 -33
- package/build/src/DevToolsConnectionAdapter.js +0 -70
- package/build/src/HeapSnapshotManager.js +0 -110
- package/build/src/Mutex.js +0 -38
- package/build/src/WaitForHelper.js +0 -195
- package/build/src/bin/cliDefinitions.js +0 -616
- package/build/src/logger.js +0 -37
- package/build/src/polyfill.js +0 -8
- package/build/src/telemetry/metricUtils.js +0 -15
- 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/string.js +0 -37
- package/build/src/utils/types.js +0 -7
|
@@ -1,353 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 2026 Opera Software AS.
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*
|
|
6
|
-
* Modified by Opera Software AS.
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
autoConnect: {
|
|
11
|
-
type: 'boolean',
|
|
12
|
-
description: 'If specified, automatically connects to a browser (Chrome 144+) running locally from the user data directory identified by the channel param (default channel is stable). Requires the remote debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging.',
|
|
13
|
-
conflicts: ['isolated', 'executablePath'],
|
|
14
|
-
default: false,
|
|
15
|
-
coerce: (value) => {
|
|
16
|
-
if (!value) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
browserUrl: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
description: 'Connect to a running, debuggable Chrome instance (e.g. `http://127.0.0.1:9222`). For more details see: https://github.com/operasoftware/opera-devtools-mcp#connecting-to-a-running-chrome-instance.',
|
|
25
|
-
alias: 'u',
|
|
26
|
-
conflicts: ['wsEndpoint'],
|
|
27
|
-
coerce: (url) => {
|
|
28
|
-
if (!url) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
new URL(url);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
throw new Error(`Provided browserUrl ${url} is not valid URL.`);
|
|
36
|
-
}
|
|
37
|
-
return url;
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
wsEndpoint: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'WebSocket endpoint to connect to a running Chrome instance (e.g., ws://127.0.0.1:9222/devtools/browser/<id>). Alternative to --browserUrl.',
|
|
43
|
-
alias: 'w',
|
|
44
|
-
conflicts: ['browserUrl'],
|
|
45
|
-
coerce: (url) => {
|
|
46
|
-
if (!url) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
const parsed = new URL(url);
|
|
51
|
-
if (parsed.protocol !== 'ws:' && parsed.protocol !== 'wss:') {
|
|
52
|
-
throw new Error(`Provided wsEndpoint ${url} must use ws:// or wss:// protocol.`);
|
|
53
|
-
}
|
|
54
|
-
return url;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (error.message.includes('ws://')) {
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
throw new Error(`Provided wsEndpoint ${url} is not valid URL.`);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
wsHeaders: {
|
|
65
|
-
type: 'string',
|
|
66
|
-
description: 'Custom headers for WebSocket connection in JSON format (e.g., \'{"Authorization":"Bearer token"}\'). Only works with --wsEndpoint.',
|
|
67
|
-
implies: 'wsEndpoint',
|
|
68
|
-
coerce: (val) => {
|
|
69
|
-
if (!val) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
const parsed = JSON.parse(val);
|
|
74
|
-
if (typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
75
|
-
throw new Error('Headers must be a JSON object');
|
|
76
|
-
}
|
|
77
|
-
return parsed;
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
throw new Error(`Invalid JSON for wsHeaders: ${error.message}`);
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
headless: {
|
|
85
|
-
type: 'boolean',
|
|
86
|
-
description: 'Whether to run in headless (no UI) mode.',
|
|
87
|
-
default: false,
|
|
88
|
-
},
|
|
89
|
-
executablePath: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Path to custom Chrome executable.',
|
|
92
|
-
conflicts: ['browserUrl', 'wsEndpoint'],
|
|
93
|
-
alias: 'e',
|
|
94
|
-
},
|
|
95
|
-
isolated: {
|
|
96
|
-
type: 'boolean',
|
|
97
|
-
description: 'If specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed. Defaults to false.',
|
|
98
|
-
},
|
|
99
|
-
userDataDir: {
|
|
100
|
-
type: 'string',
|
|
101
|
-
description: 'Path to the user data directory for Chrome. Default is $HOME/.cache/opera-devtools-mcp/chrome-profile$CHANNEL_SUFFIX_IF_NON_STABLE',
|
|
102
|
-
conflicts: ['browserUrl', 'wsEndpoint', 'isolated'],
|
|
103
|
-
},
|
|
104
|
-
channel: {
|
|
105
|
-
type: 'string',
|
|
106
|
-
description: 'Specify a different Chrome channel that should be used. The default is the stable channel version.',
|
|
107
|
-
choices: ['canary', 'dev', 'beta', 'stable'],
|
|
108
|
-
conflicts: ['browserUrl', 'wsEndpoint', 'executablePath'],
|
|
109
|
-
},
|
|
110
|
-
logFile: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
describe: 'Path to a file to write debug logs to. Set the env variable `DEBUG` to `*` to enable verbose logs. Useful for submitting bug reports.',
|
|
113
|
-
},
|
|
114
|
-
viewport: {
|
|
115
|
-
type: 'string',
|
|
116
|
-
describe: 'Initial viewport size for the Chrome instances started by the server. For example, `1280x720`. In headless mode, max size is 3840x2160px.',
|
|
117
|
-
coerce: (arg) => {
|
|
118
|
-
if (arg === undefined) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const [width, height] = arg.split('x').map(Number);
|
|
122
|
-
if (!width || !height || Number.isNaN(width) || Number.isNaN(height)) {
|
|
123
|
-
throw new Error('Invalid viewport. Expected format is `1280x720`.');
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
width,
|
|
127
|
-
height,
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
proxyServer: {
|
|
132
|
-
type: 'string',
|
|
133
|
-
description: `Proxy server configuration for Chrome passed as --proxy-server when launching the browser. See https://www.chromium.org/developers/design-documents/network-settings/ for details.`,
|
|
134
|
-
},
|
|
135
|
-
acceptInsecureCerts: {
|
|
136
|
-
type: 'boolean',
|
|
137
|
-
description: `If enabled, ignores errors relative to self-signed and expired certificates. Use with caution.`,
|
|
138
|
-
},
|
|
139
|
-
experimentalPageIdRouting: {
|
|
140
|
-
type: 'boolean',
|
|
141
|
-
describe: 'Whether to expose pageId on page-scoped tools and route requests by page ID.',
|
|
142
|
-
hidden: true,
|
|
143
|
-
},
|
|
144
|
-
experimentalDevtools: {
|
|
145
|
-
type: 'boolean',
|
|
146
|
-
describe: 'Whether to enable automation over DevTools targets',
|
|
147
|
-
hidden: true,
|
|
148
|
-
},
|
|
149
|
-
experimentalVision: {
|
|
150
|
-
type: 'boolean',
|
|
151
|
-
describe: 'Whether to enable coordinate-based tools such as click_at(x,y). Usually requires a computer-use model able to produce accurate coordinates by looking at screenshots.',
|
|
152
|
-
hidden: false,
|
|
153
|
-
},
|
|
154
|
-
experimentalMemory: {
|
|
155
|
-
type: 'boolean',
|
|
156
|
-
describe: 'Whether to enable experimental memory tools.',
|
|
157
|
-
hidden: true,
|
|
158
|
-
},
|
|
159
|
-
experimentalStructuredContent: {
|
|
160
|
-
type: 'boolean',
|
|
161
|
-
describe: 'Whether to output structured formatted content.',
|
|
162
|
-
hidden: true,
|
|
163
|
-
},
|
|
164
|
-
experimentalIncludeAllPages: {
|
|
165
|
-
type: 'boolean',
|
|
166
|
-
describe: 'Whether to include all kinds of pages such as webviews or background pages as pages.',
|
|
167
|
-
hidden: true,
|
|
168
|
-
},
|
|
169
|
-
experimentalNavigationAllowlist: {
|
|
170
|
-
type: 'boolean',
|
|
171
|
-
describe: 'Whether to enable navigation allowlist tool parameter.',
|
|
172
|
-
hidden: true,
|
|
173
|
-
},
|
|
174
|
-
experimentalInteropTools: {
|
|
175
|
-
type: 'boolean',
|
|
176
|
-
describe: 'Whether to enable interoperability tools',
|
|
177
|
-
hidden: true,
|
|
178
|
-
},
|
|
179
|
-
experimentalScreencast: {
|
|
180
|
-
type: 'boolean',
|
|
181
|
-
describe: 'Exposes experimental screencast tools (requires ffmpeg). Install ffmpeg https://www.ffmpeg.org/download.html and ensure it is available in the MCP server PATH.',
|
|
182
|
-
},
|
|
183
|
-
experimentalFfmpegPath: {
|
|
184
|
-
type: 'string',
|
|
185
|
-
describe: 'Path to ffmpeg executable for screencast recording.',
|
|
186
|
-
implies: 'experimentalScreencast',
|
|
187
|
-
},
|
|
188
|
-
categoryExperimentalWebmcp: {
|
|
189
|
-
type: 'boolean',
|
|
190
|
-
describe: 'Set to true to enable debugging WebMCP tools. Requires Chrome 149+ with the following flags: `--enable-features=WebMCPTesting,DevToolsWebMCPSupport`',
|
|
191
|
-
},
|
|
192
|
-
chromeArg: {
|
|
193
|
-
type: 'array',
|
|
194
|
-
describe: 'Additional arguments for Chrome. Only applies when Chrome is launched by opera-devtools-mcp.',
|
|
195
|
-
},
|
|
196
|
-
ignoreDefaultChromeArg: {
|
|
197
|
-
type: 'array',
|
|
198
|
-
describe: 'Explicitly disable default arguments for Chrome. Only applies when Chrome is launched by opera-devtools-mcp.',
|
|
199
|
-
},
|
|
200
|
-
categoryEmulation: {
|
|
201
|
-
type: 'boolean',
|
|
202
|
-
default: true,
|
|
203
|
-
describe: 'Set to false to exclude tools related to emulation.',
|
|
204
|
-
},
|
|
205
|
-
categoryPerformance: {
|
|
206
|
-
type: 'boolean',
|
|
207
|
-
default: true,
|
|
208
|
-
describe: 'Set to false to exclude tools related to performance.',
|
|
209
|
-
},
|
|
210
|
-
categoryNetwork: {
|
|
211
|
-
type: 'boolean',
|
|
212
|
-
default: true,
|
|
213
|
-
describe: 'Set to false to exclude tools related to network.',
|
|
214
|
-
},
|
|
215
|
-
categoryExtensions: {
|
|
216
|
-
type: 'boolean',
|
|
217
|
-
hidden: false,
|
|
218
|
-
default: false,
|
|
219
|
-
describe: 'Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.',
|
|
220
|
-
},
|
|
221
|
-
categoryExperimentalThirdParty: {
|
|
222
|
-
type: 'boolean',
|
|
223
|
-
default: false,
|
|
224
|
-
describe: 'Set to true to enable third-party developer tools exposed by the inspected page itself',
|
|
225
|
-
},
|
|
226
|
-
performanceCrux: {
|
|
227
|
-
type: 'boolean',
|
|
228
|
-
default: false,
|
|
229
|
-
describe: 'Set to true to enable sending URLs from performance traces to CrUX API to get field performance data.',
|
|
230
|
-
},
|
|
231
|
-
usageStatistics: {
|
|
232
|
-
type: 'boolean',
|
|
233
|
-
default: false,
|
|
234
|
-
describe: 'Set to true to opt-in to usage statistics collection. Google collects usage data to improve the tool, handled under the Google Privacy Policy (https://policies.google.com/privacy). This is independent from Chrome browser metrics. Disabled if `OPERA_DEVTOOLS_NO_USAGE_STATISTICS` or `CI` env variables are set.',
|
|
235
|
-
},
|
|
236
|
-
clearcutEndpoint: {
|
|
237
|
-
type: 'string',
|
|
238
|
-
hidden: true,
|
|
239
|
-
describe: 'Endpoint for Clearcut telemetry.',
|
|
240
|
-
},
|
|
241
|
-
clearcutForceFlushIntervalMs: {
|
|
242
|
-
type: 'number',
|
|
243
|
-
hidden: true,
|
|
244
|
-
describe: 'Force flush interval in milliseconds (for testing).',
|
|
245
|
-
},
|
|
246
|
-
clearcutIncludePidHeader: {
|
|
247
|
-
type: 'boolean',
|
|
248
|
-
hidden: true,
|
|
249
|
-
describe: 'Include watchdog PID in Clearcut request headers (for testing).',
|
|
250
|
-
},
|
|
251
|
-
slim: {
|
|
252
|
-
type: 'boolean',
|
|
253
|
-
describe: 'Exposes a "slim" set of 3 tools covering navigation, script execution and screenshots only. Useful for basic browser tasks.',
|
|
254
|
-
},
|
|
255
|
-
viaCli: {
|
|
256
|
-
type: 'boolean',
|
|
257
|
-
describe: 'Set by Chrome DevTools CLI if the MCP server is started via the CLI client (this arg exists for usage stats)',
|
|
258
|
-
hidden: true,
|
|
259
|
-
},
|
|
260
|
-
redactNetworkHeaders: {
|
|
261
|
-
type: 'boolean',
|
|
262
|
-
describe: 'If true, redacts some of the network headers considered senstive before returning to the client.',
|
|
263
|
-
default: false,
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
export function parseArguments(version, argv = process.argv, env = process.env) {
|
|
267
|
-
const yargsInstance = yargs(hideBin(argv))
|
|
268
|
-
.scriptName('npx opera-devtools-mcp@latest')
|
|
269
|
-
.options(cliOptions)
|
|
270
|
-
.check(args => {
|
|
271
|
-
// We can't set default in the options else
|
|
272
|
-
// Yargs will complain
|
|
273
|
-
if (!args.channel &&
|
|
274
|
-
!args.browserUrl &&
|
|
275
|
-
!args.wsEndpoint &&
|
|
276
|
-
!args.executablePath) {
|
|
277
|
-
args.channel = 'stable';
|
|
278
|
-
}
|
|
279
|
-
if (env['CI'] || env['OPERA_DEVTOOLS_NO_USAGE_STATISTICS']) {
|
|
280
|
-
console.error("turning off usage statistics. process.env['CI'] || process.env['OPERA_DEVTOOLS_NO_USAGE_STATISTICS'] is set.");
|
|
281
|
-
args.usageStatistics = false;
|
|
282
|
-
}
|
|
283
|
-
return true;
|
|
284
|
-
})
|
|
285
|
-
.example([
|
|
286
|
-
[
|
|
287
|
-
'$0 --browserUrl http://127.0.0.1:9222',
|
|
288
|
-
'Connect to an existing browser instance via HTTP',
|
|
289
|
-
],
|
|
290
|
-
[
|
|
291
|
-
'$0 --wsEndpoint ws://127.0.0.1:9222/devtools/browser/abc123',
|
|
292
|
-
'Connect to an existing browser instance via WebSocket',
|
|
293
|
-
],
|
|
294
|
-
[
|
|
295
|
-
`$0 --wsEndpoint ws://127.0.0.1:9222/devtools/browser/abc123 --wsHeaders '{"Authorization":"Bearer token"}'`,
|
|
296
|
-
'Connect via WebSocket with custom headers',
|
|
297
|
-
],
|
|
298
|
-
['$0 --channel beta', 'Use Chrome Beta installed on this system'],
|
|
299
|
-
['$0 --channel canary', 'Use Chrome Canary installed on this system'],
|
|
300
|
-
['$0 --channel dev', 'Use Chrome Dev installed on this system'],
|
|
301
|
-
['$0 --channel stable', 'Use stable Chrome installed on this system'],
|
|
302
|
-
['$0 --logFile /tmp/log.txt', 'Save logs to a file'],
|
|
303
|
-
['$0 --help', 'Print CLI options'],
|
|
304
|
-
[
|
|
305
|
-
'$0 --viewport 1280x720',
|
|
306
|
-
'Launch Chrome with the initial viewport size of 1280x720px',
|
|
307
|
-
],
|
|
308
|
-
[
|
|
309
|
-
`$0 --chrome-arg='--no-sandbox' --chrome-arg='--disable-setuid-sandbox'`,
|
|
310
|
-
'Launch Chrome without sandboxes. Use with caution.',
|
|
311
|
-
],
|
|
312
|
-
[
|
|
313
|
-
`$0 --ignore-default-chrome-arg='--disable-extensions'`,
|
|
314
|
-
'Disable the default arguments provided by Puppeteer. Use with caution.',
|
|
315
|
-
],
|
|
316
|
-
['$0 --no-category-emulation', 'Disable tools in the emulation category'],
|
|
317
|
-
[
|
|
318
|
-
'$0 --no-category-performance',
|
|
319
|
-
'Disable tools in the performance category',
|
|
320
|
-
],
|
|
321
|
-
['$0 --no-category-network', 'Disable tools in the network category'],
|
|
322
|
-
[
|
|
323
|
-
'$0 --user-data-dir=/tmp/user-data-dir',
|
|
324
|
-
'Use a custom user data directory',
|
|
325
|
-
],
|
|
326
|
-
[
|
|
327
|
-
'$0 --auto-connect',
|
|
328
|
-
'Connect to a stable Chrome instance (Chrome 144+) running instead of launching a new instance',
|
|
329
|
-
],
|
|
330
|
-
[
|
|
331
|
-
'$0 --auto-connect --channel=canary',
|
|
332
|
-
'Connect to a canary Chrome instance (Chrome 144+) running instead of launching a new instance',
|
|
333
|
-
],
|
|
334
|
-
[
|
|
335
|
-
'$0 --no-usage-statistics',
|
|
336
|
-
'Do not send usage statistics https://github.com/operasoftware/opera-devtools-mcp-mcp#usage-statistics.',
|
|
337
|
-
],
|
|
338
|
-
[
|
|
339
|
-
'$0 --no-performance-crux',
|
|
340
|
-
'Disable CrUX (field data) integration in performance tools.',
|
|
341
|
-
],
|
|
342
|
-
[
|
|
343
|
-
'$0 --slim',
|
|
344
|
-
'Only 3 tools: navigation, JavaScript execution and screenshot',
|
|
345
|
-
],
|
|
346
|
-
]);
|
|
347
|
-
return yargsInstance
|
|
348
|
-
.wrap(Math.min(120, yargsInstance.terminalWidth()))
|
|
349
|
-
.help()
|
|
350
|
-
.version(version)
|
|
351
|
-
.parseSync();
|
|
352
|
-
}
|
|
6
|
+
// Compatibility shim. Prefer importing the canonical path directly.
|
|
7
|
+
export * from './chrome-devtools-mcp-cli-options.js';
|
|
353
8
|
//# sourceMappingURL=opera-devtools-mcp-cli-options.js.map
|
|
@@ -1,42 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 2026 Opera Software AS.
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*
|
|
6
|
-
* Modified by Opera Software AS.
|
|
7
5
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { createMcpServer, logDisclaimers } from '../index.js';
|
|
11
|
-
import { logger, saveLogsToFile } from '../logger.js';
|
|
12
|
-
import { ClearcutLogger } from '../telemetry/ClearcutLogger.js';
|
|
13
|
-
import { computeFlagUsage } from '../telemetry/flagUtils.js';
|
|
14
|
-
import { StdioServerTransport } from '../third_party/index.js';
|
|
15
|
-
import { checkForUpdates } from '../utils/check-for-updates.js';
|
|
16
|
-
import { VERSION } from '../version.js';
|
|
17
|
-
import { cliOptions, parseArguments } from './opera-devtools-mcp-cli-options.js';
|
|
18
|
-
await checkForUpdates('Run `npm install opera-devtools-mcp@latest` to update.');
|
|
19
|
-
export const args = parseArguments(VERSION);
|
|
20
|
-
const logFile = args.logFile ? saveLogsToFile(args.logFile) : undefined;
|
|
21
|
-
// Always disable usage statistics and CrUX data collection.
|
|
22
|
-
if (args.usageStatistics || args.performanceCrux) {
|
|
23
|
-
console.error('Warning: usage statistics or CrUX were enabled via flags — forcing off.');
|
|
24
|
-
}
|
|
25
|
-
args.usageStatistics = false;
|
|
26
|
-
args.performanceCrux = false;
|
|
27
|
-
if (process.env['OPERA_DEVTOOLS_CRASH_ON_UNCAUGHT'] !== 'true') {
|
|
28
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
29
|
-
logger('Unhandled promise rejection', promise, reason);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
logger(`Starting Opera DevTools MCP Server v${VERSION}`);
|
|
33
|
-
const { server } = await createMcpServer(args, {
|
|
34
|
-
logFile,
|
|
35
|
-
});
|
|
36
|
-
const transport = new StdioServerTransport();
|
|
37
|
-
await server.connect(transport);
|
|
38
|
-
logger('Opera DevTools MCP Server connected');
|
|
39
|
-
logDisclaimers(args);
|
|
40
|
-
void ClearcutLogger.get()?.logDailyActiveIfNeeded();
|
|
41
|
-
void ClearcutLogger.get()?.logServerStart(computeFlagUsage(args, cliOptions));
|
|
6
|
+
// Compatibility shim. Importing this starts the MCP server, same as before.
|
|
7
|
+
export { args } from './chrome-devtools-mcp-main.js';
|
|
42
8
|
//# sourceMappingURL=opera-devtools-mcp-main.js.map
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright
|
|
4
|
+
* Copyright 2026 Opera Software AS.
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*
|
|
7
|
-
* Modified by Opera Software AS.
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (major === 20 && minor < 19) {
|
|
13
|
-
console.error(`ERROR: \`opera-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 20.19.0 LTS or a newer LTS.`);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
if (major === 22 && minor < 12) {
|
|
17
|
-
console.error(`ERROR: \`opera-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 22.12.0 LTS or a newer LTS.`);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
if (major < 20) {
|
|
21
|
-
console.error(`ERROR: \`opera-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 20.19.0 LTS or a newer LTS.`);
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
await import('./opera-devtools-mcp-main.js');
|
|
7
|
+
// Opera-named bin entry (see `package.json` `bin`). The implementation lives in
|
|
8
|
+
// the upstream-owned file and is branded via `src/opera/branding.ts`.
|
|
9
|
+
import './chrome-devtools-mcp.js';
|
|
25
10
|
//# sourceMappingURL=opera-devtools-mcp.js.map
|
|
@@ -1,191 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright 2026
|
|
4
|
+
* Copyright 2026 Opera Software AS.
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*
|
|
7
|
-
* Modified by Opera Software AS.
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import { isDaemonRunning, serializeArgs } from '../daemon/utils.js';
|
|
13
|
-
import { logDisclaimers } from '../index.js';
|
|
14
|
-
import { hideBin, yargs } from '../third_party/index.js';
|
|
15
|
-
import { checkForUpdates } from '../utils/check-for-updates.js';
|
|
16
|
-
import { VERSION } from '../version.js';
|
|
17
|
-
import { commands } from './opera-devtools-cli-options.js';
|
|
18
|
-
import { cliOptions, parseArguments } from './opera-devtools-mcp-cli-options.js';
|
|
19
|
-
await checkForUpdates('Run `npm install -g opera-devtools-mcp@latest` and `opera-devtools start` to update and restart the daemon.');
|
|
20
|
-
async function start(args, sessionId) {
|
|
21
|
-
const combinedArgs = [...args, ...defaultArgs];
|
|
22
|
-
await startDaemon(combinedArgs, sessionId);
|
|
23
|
-
logDisclaimers(parseArguments(VERSION, combinedArgs));
|
|
24
|
-
}
|
|
25
|
-
const defaultArgs = ['--viaCli', '--experimentalStructuredContent'];
|
|
26
|
-
const startCliOptions = {
|
|
27
|
-
...cliOptions,
|
|
28
|
-
};
|
|
29
|
-
// Missing CLI serialization.
|
|
30
|
-
delete startCliOptions.viewport;
|
|
31
|
-
// Change the defaults for the CLI.
|
|
32
|
-
delete startCliOptions.experimentalStructuredContent;
|
|
33
|
-
delete startCliOptions.experimentalInteropTools;
|
|
34
|
-
delete startCliOptions.experimentalPageIdRouting;
|
|
35
|
-
if (!('default' in cliOptions.headless)) {
|
|
36
|
-
throw new Error('headless cli option unexpectedly does not have a default');
|
|
37
|
-
}
|
|
38
|
-
if ('default' in cliOptions.isolated) {
|
|
39
|
-
throw new Error('isolated cli option unexpectedly has a default');
|
|
40
|
-
}
|
|
41
|
-
startCliOptions.headless.default = true;
|
|
42
|
-
startCliOptions.isolated.description =
|
|
43
|
-
'If specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed. Defaults to true unless userDataDir is provided.';
|
|
44
|
-
startCliOptions.categoryExtensions.default = true;
|
|
45
|
-
const y = yargs(hideBin(process.argv))
|
|
46
|
-
.scriptName('opera-devtools')
|
|
47
|
-
.showHelpOnFail(true)
|
|
48
|
-
.usage('opera-devtools <command> [...args] --flags')
|
|
49
|
-
.usage(`Run 'opera-devtools <command> --help' for help on the specific command.`)
|
|
50
|
-
.option('sessionId', {
|
|
51
|
-
type: 'string',
|
|
52
|
-
description: 'Session ID for daemon scoping',
|
|
53
|
-
default: '',
|
|
54
|
-
hidden: true,
|
|
55
|
-
})
|
|
56
|
-
.demandCommand()
|
|
57
|
-
.version(VERSION)
|
|
58
|
-
.strict()
|
|
59
|
-
.help(true)
|
|
60
|
-
.wrap(120);
|
|
61
|
-
y.command('start', 'Start or restart opera-devtools-mcp', y => y
|
|
62
|
-
.options(startCliOptions)
|
|
63
|
-
.example('$0 start --browserUrl http://localhost:9222', 'Start the server connecting to an existing browser')
|
|
64
|
-
.strict(), async (argv) => {
|
|
65
|
-
if (isDaemonRunning(argv.sessionId)) {
|
|
66
|
-
await stopDaemon(argv.sessionId);
|
|
67
|
-
}
|
|
68
|
-
// Defaults but we do not want to affect the yargs conflict resolution.
|
|
69
|
-
if (argv.isolated === undefined && argv.userDataDir === undefined) {
|
|
70
|
-
argv.isolated = true;
|
|
71
|
-
}
|
|
72
|
-
if (argv.headless === undefined) {
|
|
73
|
-
argv.headless = true;
|
|
74
|
-
}
|
|
75
|
-
const args = serializeArgs(cliOptions, argv);
|
|
76
|
-
await start(args, argv.sessionId);
|
|
77
|
-
process.exit(0);
|
|
78
|
-
}).strict(); // Re-enable strict validation for other commands; this is applied to the yargs instance itself
|
|
79
|
-
y.command('status', 'Checks if opera-devtools-mcp is running', y => y, async (argv) => {
|
|
80
|
-
if (isDaemonRunning(argv.sessionId)) {
|
|
81
|
-
console.log('opera-devtools-mcp daemon is running.');
|
|
82
|
-
const response = await sendCommand({
|
|
83
|
-
method: 'status',
|
|
84
|
-
}, argv.sessionId);
|
|
85
|
-
if (response.success) {
|
|
86
|
-
const data = JSON.parse(response.result);
|
|
87
|
-
console.log(`pid=${data.pid} socket=${data.socketPath} start-date=${data.startDate} version=${data.version}`);
|
|
88
|
-
console.log(`args=${JSON.stringify(data.args)}`);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
console.error('Error:', response.error);
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.log('opera-devtools-mcp daemon is not running.');
|
|
97
|
-
}
|
|
98
|
-
process.exit(0);
|
|
99
|
-
});
|
|
100
|
-
y.command('stop', 'Stop opera-devtools-mcp if any', y => y, async (argv) => {
|
|
101
|
-
const sessionId = argv.sessionId;
|
|
102
|
-
if (!isDaemonRunning(sessionId)) {
|
|
103
|
-
process.exit(0);
|
|
104
|
-
}
|
|
105
|
-
await stopDaemon(sessionId);
|
|
106
|
-
process.exit(0);
|
|
107
|
-
});
|
|
108
|
-
for (const [commandName, commandDef] of Object.entries(commands)) {
|
|
109
|
-
const args = commandDef.args;
|
|
110
|
-
const requiredArgNames = Object.keys(args).filter(name => args[name].required);
|
|
111
|
-
const optionalArgNames = Object.keys(args).filter(name => !args[name].required);
|
|
112
|
-
let commandStr = commandName;
|
|
113
|
-
for (const arg of requiredArgNames) {
|
|
114
|
-
commandStr += ` <${arg}>`;
|
|
115
|
-
}
|
|
116
|
-
for (const arg of optionalArgNames) {
|
|
117
|
-
commandStr += ` [--${arg}]`;
|
|
118
|
-
}
|
|
119
|
-
y.command(commandStr, commandDef.description, y => {
|
|
120
|
-
y.option('output-format', {
|
|
121
|
-
choices: ['md', 'json'],
|
|
122
|
-
default: 'md',
|
|
123
|
-
});
|
|
124
|
-
for (const [argName, opt] of Object.entries(args)) {
|
|
125
|
-
const type = opt.type === 'integer' || opt.type === 'number'
|
|
126
|
-
? 'number'
|
|
127
|
-
: opt.type === 'boolean'
|
|
128
|
-
? 'boolean'
|
|
129
|
-
: opt.type === 'array'
|
|
130
|
-
? 'array'
|
|
131
|
-
: 'string';
|
|
132
|
-
if (opt.required) {
|
|
133
|
-
const options = {
|
|
134
|
-
describe: opt.description,
|
|
135
|
-
type: type,
|
|
136
|
-
};
|
|
137
|
-
if (opt.default !== undefined) {
|
|
138
|
-
options.default = opt.default;
|
|
139
|
-
}
|
|
140
|
-
if (opt.enum) {
|
|
141
|
-
options.choices = opt.enum;
|
|
142
|
-
}
|
|
143
|
-
y.positional(argName, options);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
const options = {
|
|
147
|
-
describe: opt.description,
|
|
148
|
-
type: type,
|
|
149
|
-
};
|
|
150
|
-
if (opt.default !== undefined) {
|
|
151
|
-
options.default = opt.default;
|
|
152
|
-
}
|
|
153
|
-
if (opt.enum) {
|
|
154
|
-
options.choices = opt.enum;
|
|
155
|
-
}
|
|
156
|
-
y.option(argName, options);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}, async (argv) => {
|
|
160
|
-
const sessionId = argv.sessionId;
|
|
161
|
-
try {
|
|
162
|
-
if (!isDaemonRunning(sessionId)) {
|
|
163
|
-
await start([], sessionId);
|
|
164
|
-
}
|
|
165
|
-
const commandArgs = {};
|
|
166
|
-
for (const argName of Object.keys(args)) {
|
|
167
|
-
if (argName in argv) {
|
|
168
|
-
commandArgs[argName] = argv[argName];
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const response = await sendCommand({
|
|
172
|
-
method: 'invoke_tool',
|
|
173
|
-
tool: commandName,
|
|
174
|
-
args: commandArgs,
|
|
175
|
-
}, sessionId);
|
|
176
|
-
if (response.success) {
|
|
177
|
-
console.log(await handleResponse(JSON.parse(response.result), argv['output-format']));
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
console.error('Error:', response.error);
|
|
181
|
-
process.exit(1);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
console.error('Failed to execute command:', error);
|
|
186
|
-
process.exit(1);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
await y.parse();
|
|
7
|
+
// Opera-named bin entry (see `package.json` `bin`). The implementation lives in
|
|
8
|
+
// the upstream-owned file and is branded via `src/opera/branding.ts`.
|
|
9
|
+
import './chrome-devtools.js';
|
|
191
10
|
//# sourceMappingURL=opera-devtools.js.map
|