chrome-devtools-mcp 0.14.0 → 0.15.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.
@@ -40584,7 +40584,7 @@ function mergeUint8Arrays(items) {
40584
40584
  * Copyright 2025 Google Inc.
40585
40585
  * SPDX-License-Identifier: Apache-2.0
40586
40586
  */
40587
- const packageVersion = '24.36.0';
40587
+ const packageVersion = '24.36.1';
40588
40588
 
40589
40589
  /**
40590
40590
  * @license
@@ -53030,11 +53030,25 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53030
53030
  session.off('Target.attachedToTarget', listener);
53031
53031
  this.#attachedToTargetListenersBySession.delete(session);
53032
53032
  }
53033
- if (this.#detachedFromTargetListenersBySession.has(session)) {
53034
- session.off('Target.detachedFromTarget', this.#detachedFromTargetListenersBySession.get(session));
53033
+ const detachedListener = this.#detachedFromTargetListenersBySession.get(session);
53034
+ if (detachedListener) {
53035
+ session.off('Target.detachedFromTarget', detachedListener);
53035
53036
  this.#detachedFromTargetListenersBySession.delete(session);
53036
53037
  }
53037
53038
  }
53039
+ #silentDetach = async (session, parentSession) => {
53040
+ await session.send('Runtime.runIfWaitingForDebugger').catch(debugError);
53041
+ await parentSession
53042
+ .send('Target.detachFromTarget', {
53043
+ sessionId: session.id(),
53044
+ })
53045
+ .catch(debugError);
53046
+ };
53047
+ #getParentTarget = (parentSession) => {
53048
+ return parentSession instanceof CdpCDPSession
53049
+ ? parentSession.target()
53050
+ : null;
53051
+ };
53038
53052
  #onSessionDetached = (session) => {
53039
53053
  this.#removeAttachmentListeners(session);
53040
53054
  };
@@ -53054,8 +53068,7 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53054
53068
  const targetInfo = this.#discoveredTargetsByTargetId.get(event.targetId);
53055
53069
  this.#discoveredTargetsByTargetId.delete(event.targetId);
53056
53070
  this.#finishInitializationIfReady(event.targetId);
53057
- if (targetInfo?.type === 'service_worker' &&
53058
- this.#attachedTargetsByTargetId.has(event.targetId)) {
53071
+ if (targetInfo?.type === 'service_worker') {
53059
53072
  const target = this.#attachedTargetsByTargetId.get(event.targetId);
53060
53073
  if (target) {
53061
53074
  this.emit("targetGone" , target);
@@ -53066,7 +53079,6 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53066
53079
  #onTargetInfoChanged = (event) => {
53067
53080
  this.#discoveredTargetsByTargetId.set(event.targetInfo.targetId, event.targetInfo);
53068
53081
  if (this.#ignoredTargets.has(event.targetInfo.targetId) ||
53069
- !this.#attachedTargetsByTargetId.has(event.targetInfo.targetId) ||
53070
53082
  !event.targetInfo.attached) {
53071
53083
  return;
53072
53084
  }
@@ -53077,7 +53089,7 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53077
53089
  const previousURL = target.url();
53078
53090
  const wasInitialized = target._initializedDeferred.value() === InitializationStatus.SUCCESS;
53079
53091
  if (isPageTargetBecomingPrimary(target, event.targetInfo)) {
53080
- const session = target?._session();
53092
+ const session = target._session();
53081
53093
  assert(session, 'Target that is being activated is missing a CDPSession.');
53082
53094
  session.parentSession()?.emit(CDPSessionEvent.Swapped, session);
53083
53095
  }
@@ -53096,19 +53108,11 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53096
53108
  if (!session) {
53097
53109
  throw new Error(`Session ${event.sessionId} was not created.`);
53098
53110
  }
53099
- const silentDetach = async () => {
53100
- await session.send('Runtime.runIfWaitingForDebugger').catch(debugError);
53101
- await parentSession
53102
- .send('Target.detachFromTarget', {
53103
- sessionId: session.id(),
53104
- })
53105
- .catch(debugError);
53106
- };
53107
53111
  if (!this.#connection.isAutoAttached(targetInfo.targetId)) {
53108
53112
  return;
53109
53113
  }
53110
53114
  if (targetInfo.type === 'service_worker') {
53111
- await silentDetach();
53115
+ await this.#silentDetach(session, parentSession);
53112
53116
  if (this.#attachedTargetsByTargetId.has(targetInfo.targetId)) {
53113
53117
  return;
53114
53118
  }
@@ -53118,17 +53122,18 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53118
53122
  this.emit("targetAvailable" , target);
53119
53123
  return;
53120
53124
  }
53121
- const isExistingTarget = this.#attachedTargetsByTargetId.has(targetInfo.targetId);
53122
- const target = isExistingTarget
53123
- ? this.#attachedTargetsByTargetId.get(targetInfo.targetId)
53124
- : this.#targetFactory(targetInfo, session, parentSession instanceof CdpCDPSession ? parentSession : undefined);
53125
- const parentTarget = parentSession instanceof CdpCDPSession ? parentSession.target() : null;
53125
+ let target = this.#attachedTargetsByTargetId.get(targetInfo.targetId);
53126
+ const isExistingTarget = target !== undefined;
53127
+ if (!target) {
53128
+ target = this.#targetFactory(targetInfo, session, parentSession instanceof CdpCDPSession ? parentSession : undefined);
53129
+ }
53130
+ const parentTarget = this.#getParentTarget(parentSession);
53126
53131
  if (this.#targetFilterCallback && !this.#targetFilterCallback(target)) {
53127
53132
  this.#ignoredTargets.add(targetInfo.targetId);
53128
53133
  if (parentTarget?.type() === 'tab') {
53129
53134
  this.#finishInitializationIfReady(parentTarget._targetId);
53130
53135
  }
53131
- await silentDetach();
53136
+ await this.#silentDetach(session, parentSession);
53132
53137
  return;
53133
53138
  }
53134
53139
  if (this.#waitForInitiallyDiscoveredTargets &&
@@ -53139,7 +53144,7 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53139
53144
  this.#setupAttachmentListeners(session);
53140
53145
  if (isExistingTarget) {
53141
53146
  session.setTarget(target);
53142
- this.#attachedTargetsBySessionId.set(session.id(), this.#attachedTargetsByTargetId.get(targetInfo.targetId));
53147
+ this.#attachedTargetsBySessionId.set(session.id(), target);
53143
53148
  }
53144
53149
  else {
53145
53150
  target._initialize();
@@ -53181,7 +53186,7 @@ let TargetManager$1 = class TargetManager extends EventEmitter {
53181
53186
  if (!target) {
53182
53187
  return;
53183
53188
  }
53184
- if (parentSession instanceof CDPSession) {
53189
+ if (parentSession instanceof CdpCDPSession) {
53185
53190
  parentSession.target()._removeChildTarget(target);
53186
53191
  }
53187
53192
  this.#attachedTargetsByTargetId.delete(target._targetId);
@@ -84480,7 +84485,7 @@ function getLocalAppDataWin() {
84480
84485
  function getConfigHomeLinux() {
84481
84486
  return (process.env['CHROME_CONFIG_HOME'] ||
84482
84487
  process.env['XDG_CONFIG_HOME'] ||
84483
- path$1.join(os.homedir(), 'config'));
84488
+ path$1.join(os.homedir(), '.config'));
84484
84489
  }
84485
84490
  function getBaseUserDataDirPathMac() {
84486
84491
  return path$1.join(os.homedir(), 'Library', 'Application Support', 'Google');
@@ -100178,6 +100183,12 @@ class InspectorFrontendHostStub {
100178
100183
  }
100179
100184
  this.recordedPerformanceHistograms.push({ histogramName, duration });
100180
100185
  }
100186
+ recordPerformanceHistogramMedium(histogramName, duration) {
100187
+ if (this.recordedPerformanceHistograms.length >= MAX_RECORDED_HISTOGRAMS_SIZE) {
100188
+ this.recordedPerformanceHistograms.shift();
100189
+ }
100190
+ this.recordedPerformanceHistograms.push({ histogramName, duration });
100191
+ }
100181
100192
  recordUserMetricsAction(_umaName) {
100182
100193
  }
100183
100194
  recordNewBadgeUsage(_featureName) {
@@ -100398,6 +100409,8 @@ class InspectorFrontendHostStub {
100398
100409
  }
100399
100410
  recordFunctionCall(_event) {
100400
100411
  }
100412
+ setChromeFlag(_flagName, _value) {
100413
+ }
100401
100414
  }
100402
100415
 
100403
100416
  // Copyright 2009 The Chromium Authors
@@ -100584,6 +100597,8 @@ class McpHostBindings {
100584
100597
  }
100585
100598
  recordPerformanceHistogram() {
100586
100599
  }
100600
+ recordPerformanceHistogramMedium() {
100601
+ }
100587
100602
  recordUserMetricsAction() {
100588
100603
  }
100589
100604
  recordNewBadgeUsage() {
@@ -100671,6 +100686,8 @@ class McpHostBindings {
100671
100686
  }
100672
100687
  recordFunctionCall() {
100673
100688
  }
100689
+ setChromeFlag() {
100690
+ }
100674
100691
  }
100675
100692
 
100676
100693
  // Copyright 2025 The Chromium Authors
@@ -100918,7 +100935,7 @@ function registerCommands(inspectorBackend) {
100918
100935
  inspectorBackend.registerCommand("CSS.forceStartingStyle", [{ "name": "nodeId", "type": "number", "optional": false, "description": "The element id for which to force the starting-style state.", "typeRef": "DOM.NodeId" }, { "name": "forced", "type": "boolean", "optional": false, "description": "Boolean indicating if this is on or off.", "typeRef": null }], [], "Ensures that the given node is in its starting-style state.");
100919
100936
  inspectorBackend.registerCommand("CSS.getBackgroundColors", [{ "name": "nodeId", "type": "number", "optional": false, "description": "Id of the node to get background colors for.", "typeRef": "DOM.NodeId" }], ["backgroundColors", "computedFontSize", "computedFontWeight"], "");
100920
100937
  inspectorBackend.registerCommand("CSS.getComputedStyleForNode", [{ "name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId" }], ["computedStyle", "extraFields"], "Returns the computed style for a DOM node identified by `nodeId`.");
100921
- inspectorBackend.registerCommand("CSS.resolveValues", [{ "name": "values", "type": "array", "optional": false, "description": "Cascade-dependent keywords (revert/revert-layer) do not work.", "typeRef": "string" }, { "name": "nodeId", "type": "number", "optional": false, "description": "Id of the node in whose context the expression is evaluated", "typeRef": "DOM.NodeId" }, { "name": "propertyName", "type": "string", "optional": true, "description": "Only longhands and custom property names are accepted.", "typeRef": null }, { "name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after.", "typeRef": "DOM.PseudoType" }, { "name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element custom ident.", "typeRef": null }], ["results"], "Resolve the specified values in the context of the provided element. For example, a value of '1em' is evaluated according to the computed 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved to '3px'. If the `propertyName` was specified the `values` are resolved as if they were property's declaration. If a value cannot be parsed according to the provided property syntax, the value is parsed using combined syntax as if null `propertyName` was provided. If the value cannot be resolved even then, return the provided value without any changes.");
100938
+ inspectorBackend.registerCommand("CSS.resolveValues", [{ "name": "values", "type": "array", "optional": false, "description": "Cascade-dependent keywords (revert/revert-layer) do not work.", "typeRef": "string" }, { "name": "nodeId", "type": "number", "optional": false, "description": "Id of the node in whose context the expression is evaluated", "typeRef": "DOM.NodeId" }, { "name": "propertyName", "type": "string", "optional": true, "description": "Only longhands and custom property names are accepted.", "typeRef": null }, { "name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after.", "typeRef": "DOM.PseudoType" }, { "name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element custom ident.", "typeRef": null }], ["results"], "Resolve the specified values in the context of the provided element. For example, a value of '1em' is evaluated according to the computed 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved to '3px'. If the `propertyName` was specified the `values` are resolved as if they were property's declaration. If a value cannot be parsed according to the provided property syntax, the value is parsed using combined syntax as if null `propertyName` was provided. If the value cannot be resolved even then, return the provided value without any changes. Note: this function currently does not resolve CSS random() function, it returns unmodified random() function parts.`");
100922
100939
  inspectorBackend.registerCommand("CSS.getLonghandProperties", [{ "name": "shorthandName", "type": "string", "optional": false, "description": "", "typeRef": null }, { "name": "value", "type": "string", "optional": false, "description": "", "typeRef": null }], ["longhandProperties"], "");
100923
100940
  inspectorBackend.registerCommand("CSS.getInlineStylesForNode", [{ "name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId" }], ["inlineStyle", "attributesStyle"], "Returns the styles defined inline (explicitly in the \"style\" attribute and implicitly, using DOM attributes) for a DOM node identified by `nodeId`.");
100924
100941
  inspectorBackend.registerCommand("CSS.getAnimatedStylesForNode", [{ "name": "nodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.NodeId" }], ["animationStyles", "transitionsStyle", "inherited"], "Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.");
@@ -101391,7 +101408,7 @@ function registerCommands(inspectorBackend) {
101391
101408
  inspectorBackend.registerEnum("Network.RequestReferrerPolicy", { UnsafeUrl: "unsafe-url", NoReferrerWhenDowngrade: "no-referrer-when-downgrade", NoReferrer: "no-referrer", Origin: "origin", OriginWhenCrossOrigin: "origin-when-cross-origin", SameOrigin: "same-origin", StrictOrigin: "strict-origin", StrictOriginWhenCrossOrigin: "strict-origin-when-cross-origin" });
101392
101409
  inspectorBackend.registerEnum("Network.CertificateTransparencyCompliance", { Unknown: "unknown", NotCompliant: "not-compliant", Compliant: "compliant" });
101393
101410
  inspectorBackend.registerEnum("Network.BlockedReason", { Other: "other", Csp: "csp", MixedContent: "mixed-content", Origin: "origin", Inspector: "inspector", Integrity: "integrity", SubresourceFilter: "subresource-filter", ContentType: "content-type", CoepFrameResourceNeedsCoepHeader: "coep-frame-resource-needs-coep-header", CoopSandboxedIframeCannotNavigateToCoopPage: "coop-sandboxed-iframe-cannot-navigate-to-coop-page", CorpNotSameOrigin: "corp-not-same-origin", CorpNotSameOriginAfterDefaultedToSameOriginByCoep: "corp-not-same-origin-after-defaulted-to-same-origin-by-coep", CorpNotSameOriginAfterDefaultedToSameOriginByDip: "corp-not-same-origin-after-defaulted-to-same-origin-by-dip", CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip: "corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip", CorpNotSameSite: "corp-not-same-site", SriMessageSignatureMismatch: "sri-message-signature-mismatch" });
101394
- inspectorBackend.registerEnum("Network.CorsError", { DisallowedByMode: "DisallowedByMode", InvalidResponse: "InvalidResponse", WildcardOriginNotAllowed: "WildcardOriginNotAllowed", MissingAllowOriginHeader: "MissingAllowOriginHeader", MultipleAllowOriginValues: "MultipleAllowOriginValues", InvalidAllowOriginValue: "InvalidAllowOriginValue", AllowOriginMismatch: "AllowOriginMismatch", InvalidAllowCredentials: "InvalidAllowCredentials", CorsDisabledScheme: "CorsDisabledScheme", PreflightInvalidStatus: "PreflightInvalidStatus", PreflightDisallowedRedirect: "PreflightDisallowedRedirect", PreflightWildcardOriginNotAllowed: "PreflightWildcardOriginNotAllowed", PreflightMissingAllowOriginHeader: "PreflightMissingAllowOriginHeader", PreflightMultipleAllowOriginValues: "PreflightMultipleAllowOriginValues", PreflightInvalidAllowOriginValue: "PreflightInvalidAllowOriginValue", PreflightAllowOriginMismatch: "PreflightAllowOriginMismatch", PreflightInvalidAllowCredentials: "PreflightInvalidAllowCredentials", PreflightMissingAllowExternal: "PreflightMissingAllowExternal", PreflightInvalidAllowExternal: "PreflightInvalidAllowExternal", PreflightMissingAllowPrivateNetwork: "PreflightMissingAllowPrivateNetwork", PreflightInvalidAllowPrivateNetwork: "PreflightInvalidAllowPrivateNetwork", InvalidAllowMethodsPreflightResponse: "InvalidAllowMethodsPreflightResponse", InvalidAllowHeadersPreflightResponse: "InvalidAllowHeadersPreflightResponse", MethodDisallowedByPreflightResponse: "MethodDisallowedByPreflightResponse", HeaderDisallowedByPreflightResponse: "HeaderDisallowedByPreflightResponse", RedirectContainsCredentials: "RedirectContainsCredentials", InsecurePrivateNetwork: "InsecurePrivateNetwork", InvalidPrivateNetworkAccess: "InvalidPrivateNetworkAccess", UnexpectedPrivateNetworkAccess: "UnexpectedPrivateNetworkAccess", NoCorsRedirectModeNotFollow: "NoCorsRedirectModeNotFollow", PreflightMissingPrivateNetworkAccessId: "PreflightMissingPrivateNetworkAccessId", PreflightMissingPrivateNetworkAccessName: "PreflightMissingPrivateNetworkAccessName", PrivateNetworkAccessPermissionUnavailable: "PrivateNetworkAccessPermissionUnavailable", PrivateNetworkAccessPermissionDenied: "PrivateNetworkAccessPermissionDenied", LocalNetworkAccessPermissionDenied: "LocalNetworkAccessPermissionDenied" });
101411
+ inspectorBackend.registerEnum("Network.CorsError", { DisallowedByMode: "DisallowedByMode", InvalidResponse: "InvalidResponse", WildcardOriginNotAllowed: "WildcardOriginNotAllowed", MissingAllowOriginHeader: "MissingAllowOriginHeader", MultipleAllowOriginValues: "MultipleAllowOriginValues", InvalidAllowOriginValue: "InvalidAllowOriginValue", AllowOriginMismatch: "AllowOriginMismatch", InvalidAllowCredentials: "InvalidAllowCredentials", CorsDisabledScheme: "CorsDisabledScheme", PreflightInvalidStatus: "PreflightInvalidStatus", PreflightDisallowedRedirect: "PreflightDisallowedRedirect", PreflightWildcardOriginNotAllowed: "PreflightWildcardOriginNotAllowed", PreflightMissingAllowOriginHeader: "PreflightMissingAllowOriginHeader", PreflightMultipleAllowOriginValues: "PreflightMultipleAllowOriginValues", PreflightInvalidAllowOriginValue: "PreflightInvalidAllowOriginValue", PreflightAllowOriginMismatch: "PreflightAllowOriginMismatch", PreflightInvalidAllowCredentials: "PreflightInvalidAllowCredentials", PreflightMissingAllowExternal: "PreflightMissingAllowExternal", PreflightInvalidAllowExternal: "PreflightInvalidAllowExternal", InvalidAllowMethodsPreflightResponse: "InvalidAllowMethodsPreflightResponse", InvalidAllowHeadersPreflightResponse: "InvalidAllowHeadersPreflightResponse", MethodDisallowedByPreflightResponse: "MethodDisallowedByPreflightResponse", HeaderDisallowedByPreflightResponse: "HeaderDisallowedByPreflightResponse", RedirectContainsCredentials: "RedirectContainsCredentials", InsecurePrivateNetwork: "InsecurePrivateNetwork", InvalidPrivateNetworkAccess: "InvalidPrivateNetworkAccess", NoCorsRedirectModeNotFollow: "NoCorsRedirectModeNotFollow", LocalNetworkAccessPermissionDenied: "LocalNetworkAccessPermissionDenied" });
101395
101412
  inspectorBackend.registerEnum("Network.ServiceWorkerResponseSource", { CacheStorage: "cache-storage", HttpCache: "http-cache", FallbackCode: "fallback-code", Network: "network" });
101396
101413
  inspectorBackend.registerEnum("Network.TrustTokenParamsRefreshPolicy", { UseCached: "UseCached", Refresh: "Refresh" });
101397
101414
  inspectorBackend.registerEnum("Network.TrustTokenOperationType", { Issuance: "Issuance", Redemption: "Redemption", Signing: "Signing" });
@@ -101413,6 +101430,7 @@ function registerCommands(inspectorBackend) {
101413
101430
  inspectorBackend.registerEnum("Network.CrossOriginEmbedderPolicyValue", { None: "None", Credentialless: "Credentialless", RequireCorp: "RequireCorp" });
101414
101431
  inspectorBackend.registerEnum("Network.ContentSecurityPolicySource", { HTTP: "HTTP", Meta: "Meta" });
101415
101432
  inspectorBackend.registerEnum("Network.ReportStatus", { Queued: "Queued", Pending: "Pending", MarkedForRemoval: "MarkedForRemoval", Success: "Success" });
101433
+ inspectorBackend.registerEnum("Network.DeviceBoundSessionWithUsageUsage", { NotInScope: "NotInScope", InScopeRefreshNotYetNeeded: "InScopeRefreshNotYetNeeded", InScopeRefreshNotAllowed: "InScopeRefreshNotAllowed", ProactiveRefreshNotPossible: "ProactiveRefreshNotPossible", ProactiveRefreshAttempted: "ProactiveRefreshAttempted", Deferred: "Deferred" });
101416
101434
  inspectorBackend.registerEnum("Network.DeviceBoundSessionUrlRuleRuleType", { Exclude: "Exclude", Include: "Include" });
101417
101435
  inspectorBackend.registerEnum("Network.DeviceBoundSessionFetchResult", { Success: "Success", KeyError: "KeyError", SigningError: "SigningError", ServerRequestedTermination: "ServerRequestedTermination", InvalidSessionId: "InvalidSessionId", InvalidChallenge: "InvalidChallenge", TooManyChallenges: "TooManyChallenges", InvalidFetcherUrl: "InvalidFetcherUrl", InvalidRefreshUrl: "InvalidRefreshUrl", TransientHttpError: "TransientHttpError", ScopeOriginSameSiteMismatch: "ScopeOriginSameSiteMismatch", RefreshUrlSameSiteMismatch: "RefreshUrlSameSiteMismatch", MismatchedSessionId: "MismatchedSessionId", MissingScope: "MissingScope", NoCredentials: "NoCredentials", SubdomainRegistrationWellKnownUnavailable: "SubdomainRegistrationWellKnownUnavailable", SubdomainRegistrationUnauthorized: "SubdomainRegistrationUnauthorized", SubdomainRegistrationWellKnownMalformed: "SubdomainRegistrationWellKnownMalformed", SessionProviderWellKnownUnavailable: "SessionProviderWellKnownUnavailable", RelyingPartyWellKnownUnavailable: "RelyingPartyWellKnownUnavailable", FederatedKeyThumbprintMismatch: "FederatedKeyThumbprintMismatch", InvalidFederatedSessionUrl: "InvalidFederatedSessionUrl", InvalidFederatedKey: "InvalidFederatedKey", TooManyRelyingOriginLabels: "TooManyRelyingOriginLabels", BoundCookieSetForbidden: "BoundCookieSetForbidden", NetError: "NetError", ProxyError: "ProxyError", EmptySessionConfig: "EmptySessionConfig", InvalidCredentialsConfig: "InvalidCredentialsConfig", InvalidCredentialsType: "InvalidCredentialsType", InvalidCredentialsEmptyName: "InvalidCredentialsEmptyName", InvalidCredentialsCookie: "InvalidCredentialsCookie", PersistentHttpError: "PersistentHttpError", RegistrationAttemptedChallenge: "RegistrationAttemptedChallenge", InvalidScopeOrigin: "InvalidScopeOrigin", ScopeOriginContainsPath: "ScopeOriginContainsPath", RefreshInitiatorNotString: "RefreshInitiatorNotString", RefreshInitiatorInvalidHostPattern: "RefreshInitiatorInvalidHostPattern", InvalidScopeSpecification: "InvalidScopeSpecification", MissingScopeSpecificationType: "MissingScopeSpecificationType", EmptyScopeSpecificationDomain: "EmptyScopeSpecificationDomain", EmptyScopeSpecificationPath: "EmptyScopeSpecificationPath", InvalidScopeSpecificationType: "InvalidScopeSpecificationType", InvalidScopeIncludeSite: "InvalidScopeIncludeSite", MissingScopeIncludeSite: "MissingScopeIncludeSite", FederatedNotAuthorizedByProvider: "FederatedNotAuthorizedByProvider", FederatedNotAuthorizedByRelyingParty: "FederatedNotAuthorizedByRelyingParty", SessionProviderWellKnownMalformed: "SessionProviderWellKnownMalformed", SessionProviderWellKnownHasProviderOrigin: "SessionProviderWellKnownHasProviderOrigin", RelyingPartyWellKnownMalformed: "RelyingPartyWellKnownMalformed", RelyingPartyWellKnownHasRelyingOrigins: "RelyingPartyWellKnownHasRelyingOrigins", InvalidFederatedSessionProviderSessionMissing: "InvalidFederatedSessionProviderSessionMissing", InvalidFederatedSessionWrongProviderOrigin: "InvalidFederatedSessionWrongProviderOrigin", InvalidCredentialsCookieCreationTime: "InvalidCredentialsCookieCreationTime", InvalidCredentialsCookieName: "InvalidCredentialsCookieName", InvalidCredentialsCookieParsing: "InvalidCredentialsCookieParsing", InvalidCredentialsCookieUnpermittedAttribute: "InvalidCredentialsCookieUnpermittedAttribute", InvalidCredentialsCookieInvalidDomain: "InvalidCredentialsCookieInvalidDomain", InvalidCredentialsCookiePrefix: "InvalidCredentialsCookiePrefix", InvalidScopeRulePath: "InvalidScopeRulePath", InvalidScopeRuleHostPattern: "InvalidScopeRuleHostPattern", ScopeRuleOriginScopedHostPatternMismatch: "ScopeRuleOriginScopedHostPatternMismatch", ScopeRuleSiteScopedHostPatternMismatch: "ScopeRuleSiteScopedHostPatternMismatch", SigningQuotaExceeded: "SigningQuotaExceeded", InvalidConfigJson: "InvalidConfigJson", InvalidFederatedSessionProviderFailedToRestoreKey: "InvalidFederatedSessionProviderFailedToRestoreKey", FailedToUnwrapKey: "FailedToUnwrapKey", SessionDeletedDuringRefresh: "SessionDeletedDuringRefresh" });
101418
101436
  inspectorBackend.registerEnum("Network.RefreshEventDetailsRefreshResult", { Refreshed: "Refreshed", InitializedService: "InitializedService", Unreachable: "Unreachable", ServerError: "ServerError", RefreshQuotaExceeded: "RefreshQuotaExceeded", FatalError: "FatalError", SigningQuotaExceeded: "SigningQuotaExceeded" });
@@ -101452,7 +101470,7 @@ function registerCommands(inspectorBackend) {
101452
101470
  inspectorBackend.registerEvent("Network.directUDPSocketClosed", ["identifier", "timestamp"]);
101453
101471
  inspectorBackend.registerEvent("Network.directUDPSocketChunkSent", ["identifier", "message", "timestamp"]);
101454
101472
  inspectorBackend.registerEvent("Network.directUDPSocketChunkReceived", ["identifier", "message", "timestamp"]);
101455
- inspectorBackend.registerEvent("Network.requestWillBeSentExtraInfo", ["requestId", "associatedCookies", "headers", "connectTiming", "clientSecurityState", "siteHasCookieInOtherPartition", "appliedNetworkConditionsId"]);
101473
+ inspectorBackend.registerEvent("Network.requestWillBeSentExtraInfo", ["requestId", "associatedCookies", "headers", "connectTiming", "deviceBoundSessionUsages", "clientSecurityState", "siteHasCookieInOtherPartition", "appliedNetworkConditionsId"]);
101456
101474
  inspectorBackend.registerEvent("Network.responseReceivedExtraInfo", ["requestId", "blockedCookies", "headers", "resourceIPAddressSpace", "statusCode", "headersText", "cookiePartitionKey", "cookiePartitionKeyOpaque", "exemptedCookies"]);
101457
101475
  inspectorBackend.registerEvent("Network.responseReceivedEarlyHints", ["requestId", "headers"]);
101458
101476
  inspectorBackend.registerEnum("Network.TrustTokenOperationDoneEventStatus", { Ok: "Ok", InvalidArgument: "InvalidArgument", MissingIssuerKeys: "MissingIssuerKeys", FailedPrecondition: "FailedPrecondition", ResourceExhausted: "ResourceExhausted", AlreadyExists: "AlreadyExists", ResourceLimited: "ResourceLimited", Unauthorized: "Unauthorized", BadResponse: "BadResponse", InternalError: "InternalError", UnknownError: "UnknownError", FulfilledLocally: "FulfilledLocally", SiteIssuerLimit: "SiteIssuerLimit" });
@@ -101544,6 +101562,7 @@ function registerCommands(inspectorBackend) {
101544
101562
  inspectorBackend.registerType("Network.ReportingApiReport", [{ "name": "id", "type": "string", "optional": false, "description": "", "typeRef": "Network.ReportId" }, { "name": "initiatorUrl", "type": "string", "optional": false, "description": "The URL of the document that triggered the report.", "typeRef": null }, { "name": "destination", "type": "string", "optional": false, "description": "The name of the endpoint group that should be used to deliver the report.", "typeRef": null }, { "name": "type", "type": "string", "optional": false, "description": "The type of the report (specifies the set of data that is contained in the report body).", "typeRef": null }, { "name": "timestamp", "type": "number", "optional": false, "description": "When the report was generated.", "typeRef": "Network.TimeSinceEpoch" }, { "name": "depth", "type": "number", "optional": false, "description": "How many uploads deep the related request was.", "typeRef": null }, { "name": "completedAttempts", "type": "number", "optional": false, "description": "The number of delivery attempts made so far, not including an active attempt.", "typeRef": null }, { "name": "body", "type": "object", "optional": false, "description": "", "typeRef": null }, { "name": "status", "type": "string", "optional": false, "description": "", "typeRef": "Network.ReportStatus" }]);
101545
101563
  inspectorBackend.registerType("Network.ReportingApiEndpoint", [{ "name": "url", "type": "string", "optional": false, "description": "The URL of the endpoint to which reports may be delivered.", "typeRef": null }, { "name": "groupName", "type": "string", "optional": false, "description": "Name of the endpoint group.", "typeRef": null }]);
101546
101564
  inspectorBackend.registerType("Network.DeviceBoundSessionKey", [{ "name": "site", "type": "string", "optional": false, "description": "The site the session is set up for.", "typeRef": null }, { "name": "id", "type": "string", "optional": false, "description": "The id of the session.", "typeRef": null }]);
101565
+ inspectorBackend.registerType("Network.DeviceBoundSessionWithUsage", [{ "name": "sessionKey", "type": "object", "optional": false, "description": "The key for the session.", "typeRef": "Network.DeviceBoundSessionKey" }, { "name": "usage", "type": "string", "optional": false, "description": "How the session was used (or not used).", "typeRef": null }]);
101547
101566
  inspectorBackend.registerType("Network.DeviceBoundSessionCookieCraving", [{ "name": "name", "type": "string", "optional": false, "description": "The name of the craving.", "typeRef": null }, { "name": "domain", "type": "string", "optional": false, "description": "The domain of the craving.", "typeRef": null }, { "name": "path", "type": "string", "optional": false, "description": "The path of the craving.", "typeRef": null }, { "name": "secure", "type": "boolean", "optional": false, "description": "The `Secure` attribute of the craving attributes.", "typeRef": null }, { "name": "httpOnly", "type": "boolean", "optional": false, "description": "The `HttpOnly` attribute of the craving attributes.", "typeRef": null }, { "name": "sameSite", "type": "string", "optional": true, "description": "The `SameSite` attribute of the craving attributes.", "typeRef": "Network.CookieSameSite" }]);
101548
101567
  inspectorBackend.registerType("Network.DeviceBoundSessionUrlRule", [{ "name": "ruleType", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`.", "typeRef": null }, { "name": "hostPattern", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`.", "typeRef": null }, { "name": "pathPrefix", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`.", "typeRef": null }]);
101549
101568
  inspectorBackend.registerType("Network.DeviceBoundSessionInclusionRules", [{ "name": "origin", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`.", "typeRef": null }, { "name": "includeSite", "type": "boolean", "optional": false, "description": "Whether the whole site is included. See comments on `net::device_bound_sessions::SessionInclusionRules::include_site_` for more details; this boolean is true if that value is populated.", "typeRef": null }, { "name": "urlRules", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`.", "typeRef": "Network.DeviceBoundSessionUrlRule" }]);
@@ -101969,7 +101988,7 @@ function registerCommands(inspectorBackend) {
101969
101988
  inspectorBackend.registerCommand("Target.exposeDevToolsProtocol", [{ "name": "targetId", "type": "string", "optional": false, "description": "", "typeRef": "Target.TargetID" }, { "name": "bindingName", "type": "string", "optional": true, "description": "Binding name, 'cdp' if not specified.", "typeRef": null }, { "name": "inheritPermissions", "type": "boolean", "optional": true, "description": "If true, inherits the current root session's permissions (default: false).", "typeRef": null }], [], "Inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as `window[bindingName]`. The object has the following API: - `binding.send(json)` - a method to send messages over the remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.");
101970
101989
  inspectorBackend.registerCommand("Target.createBrowserContext", [{ "name": "disposeOnDetach", "type": "boolean", "optional": true, "description": "If specified, disposes this context when debugging session disconnects.", "typeRef": null }, { "name": "proxyServer", "type": "string", "optional": true, "description": "Proxy server, similar to the one passed to --proxy-server", "typeRef": null }, { "name": "proxyBypassList", "type": "string", "optional": true, "description": "Proxy bypass list, similar to the one passed to --proxy-bypass-list", "typeRef": null }, { "name": "originsWithUniversalNetworkAccess", "type": "array", "optional": true, "description": "An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored.", "typeRef": "string" }], ["browserContextId"], "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.");
101971
101990
  inspectorBackend.registerCommand("Target.getBrowserContexts", [], ["browserContextIds", "defaultBrowserContextId"], "Returns all browser contexts created with `Target.createBrowserContext` method.");
101972
- inspectorBackend.registerCommand("Target.createTarget", [{ "name": "url", "type": "string", "optional": false, "description": "The initial URL the page will be navigated to. An empty string indicates about:blank.", "typeRef": null }, { "name": "left", "type": "number", "optional": true, "description": "Frame left origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "top", "type": "number", "optional": true, "description": "Frame top origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "width", "type": "number", "optional": true, "description": "Frame width in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "height", "type": "number", "optional": true, "description": "Frame height in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "windowState", "type": "string", "optional": true, "description": "Frame window state (requires newWindow to be true or headless shell). Default is normal.", "typeRef": "Target.WindowState" }, { "name": "browserContextId", "type": "string", "optional": true, "description": "The browser context to create the page in.", "typeRef": "Browser.BrowserContextID" }, { "name": "enableBeginFrameControl", "type": "boolean", "optional": true, "description": "Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default).", "typeRef": null }, { "name": "newWindow", "type": "boolean", "optional": true, "description": "Whether to create a new Window or Tab (false by default, not supported by headless shell).", "typeRef": null }, { "name": "background", "type": "boolean", "optional": true, "description": "Whether to create the target in background or foreground (false by default, not supported by headless shell).", "typeRef": null }, { "name": "forTab", "type": "boolean", "optional": true, "description": "Whether to create the target of type \\\"tab\\\".", "typeRef": null }, { "name": "hidden", "type": "boolean", "optional": true, "description": "Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or `background: false`. The life-time of the tab is limited to the life-time of the session.", "typeRef": null }], ["targetId"], "Creates a new page.");
101991
+ inspectorBackend.registerCommand("Target.createTarget", [{ "name": "url", "type": "string", "optional": false, "description": "The initial URL the page will be navigated to. An empty string indicates about:blank.", "typeRef": null }, { "name": "left", "type": "number", "optional": true, "description": "Frame left origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "top", "type": "number", "optional": true, "description": "Frame top origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "width", "type": "number", "optional": true, "description": "Frame width in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "height", "type": "number", "optional": true, "description": "Frame height in DIP (requires newWindow to be true or headless shell).", "typeRef": null }, { "name": "windowState", "type": "string", "optional": true, "description": "Frame window state (requires newWindow to be true or headless shell). Default is normal.", "typeRef": "Target.WindowState" }, { "name": "browserContextId", "type": "string", "optional": true, "description": "The browser context to create the page in.", "typeRef": "Browser.BrowserContextID" }, { "name": "enableBeginFrameControl", "type": "boolean", "optional": true, "description": "Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default).", "typeRef": null }, { "name": "newWindow", "type": "boolean", "optional": true, "description": "Whether to create a new Window or Tab (false by default, not supported by headless shell).", "typeRef": null }, { "name": "background", "type": "boolean", "optional": true, "description": "Whether to create the target in background or foreground (false by default, not supported by headless shell).", "typeRef": null }, { "name": "forTab", "type": "boolean", "optional": true, "description": "Whether to create the target of type \\\"tab\\\".", "typeRef": null }, { "name": "hidden", "type": "boolean", "optional": true, "description": "Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or `background: false`. The life-time of the tab is limited to the life-time of the session.", "typeRef": null }, { "name": "focus", "type": "boolean", "optional": true, "description": "If specified, the option is used to determine if the new target should be focused or not. By default, the focus behavior depends on the value of the background field. For example, background=false and focus=false will result in the target tab being opened but the browser window remain unchanged (if it was in the background, it will remain in the background) and background=false with focus=undefined will result in the window being focused. Using background: true and focus: true is not supported and will result in an error.", "typeRef": null }], ["targetId"], "Creates a new page.");
101973
101992
  inspectorBackend.registerCommand("Target.detachFromTarget", [{ "name": "sessionId", "type": "string", "optional": true, "description": "Session to detach.", "typeRef": "Target.SessionID" }, { "name": "targetId", "type": "string", "optional": true, "description": "Deprecated.", "typeRef": "Target.TargetID" }], [], "Detaches session with given id.");
101974
101993
  inspectorBackend.registerCommand("Target.disposeBrowserContext", [{ "name": "browserContextId", "type": "string", "optional": false, "description": "", "typeRef": "Browser.BrowserContextID" }], [], "Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.");
101975
101994
  inspectorBackend.registerCommand("Target.getTargetInfo", [{ "name": "targetId", "type": "string", "optional": true, "description": "", "typeRef": "Target.TargetID" }], ["targetInfo"], "Returns information about a target.");
@@ -104574,9 +104593,18 @@ class UserMetrics {
104574
104593
  consoleInsightTeaserGenerated(timeInMilliseconds) {
104575
104594
  InspectorFrontendHostInstance.recordPerformanceHistogram('DevTools.Insights.TeaserGenerationTime', timeInMilliseconds);
104576
104595
  }
104596
+ consoleInsightTeaserGeneratedMedium(timeInMilliseconds) {
104597
+ InspectorFrontendHostInstance.recordPerformanceHistogramMedium('DevTools.Insights.TeaserGenerationTimeMedium', timeInMilliseconds);
104598
+ }
104577
104599
  consoleInsightTeaserFirstChunkGenerated(timeInMilliseconds) {
104578
104600
  InspectorFrontendHostInstance.recordPerformanceHistogram('DevTools.Insights.TeaserFirstChunkGenerationTime', timeInMilliseconds);
104579
104601
  }
104602
+ consoleInsightTeaserFirstChunkGeneratedMedium(timeInMilliseconds) {
104603
+ InspectorFrontendHostInstance.recordPerformanceHistogramMedium('DevTools.Insights.TeaserFirstChunkGenerationTimeMedium', timeInMilliseconds);
104604
+ }
104605
+ consoleInsightTeaserChunkToEndMedium(timeInMilliseconds) {
104606
+ InspectorFrontendHostInstance.recordPerformanceHistogramMedium('DevTools.Insights.TeaserChunkToEndMedium', timeInMilliseconds);
104607
+ }
104580
104608
  consoleInsightTeaserAbortedAfterFirstCharacter(timeInMilliseconds) {
104581
104609
  InspectorFrontendHostInstance.recordPerformanceHistogram('DevTools.Insights.TeaserAfterFirstCharacterAbortionTime', timeInMilliseconds);
104582
104610
  }
@@ -106093,6 +106121,7 @@ const generatedProperties = [
106093
106121
  "view-transition-class",
106094
106122
  "view-transition-group",
106095
106123
  "view-transition-name",
106124
+ "view-transition-scope",
106096
106125
  "visibility",
106097
106126
  "white-space-collapse",
106098
106127
  "widows",
@@ -107163,8 +107192,7 @@ const generatedProperties = [
107163
107192
  "style",
107164
107193
  "paint",
107165
107194
  "inline-size",
107166
- "block-size",
107167
- "view-transition"
107195
+ "block-size"
107168
107196
  ],
107169
107197
  "name": "contain"
107170
107198
  },
@@ -110122,6 +110150,14 @@ const generatedProperties = [
110122
110150
  ],
110123
110151
  "name": "view-transition-name"
110124
110152
  },
110153
+ {
110154
+ "inherited": false,
110155
+ "keywords": [
110156
+ "none",
110157
+ "auto"
110158
+ ],
110159
+ "name": "view-transition-scope"
110160
+ },
110125
110161
  {
110126
110162
  "inherited": true,
110127
110163
  "keywords": [
@@ -110875,8 +110911,7 @@ const generatedPropertyValues = {
110875
110911
  "style",
110876
110912
  "paint",
110877
110913
  "inline-size",
110878
- "block-size",
110879
- "view-transition"
110914
+ "block-size"
110880
110915
  ]
110881
110916
  },
110882
110917
  "contain-intrinsic-height": {
@@ -112472,6 +112507,12 @@ const generatedPropertyValues = {
112472
112507
  "auto"
112473
112508
  ]
112474
112509
  },
112510
+ "view-transition-scope": {
112511
+ "values": [
112512
+ "none",
112513
+ "auto"
112514
+ ]
112515
+ },
112475
112516
  "visibility": {
112476
112517
  "values": [
112477
112518
  "visible",
@@ -133827,10 +133868,6 @@ class AnimationModel extends SDKModel {
133827
133868
  this.playbackRate = playbackRate;
133828
133869
  void this.agent.invoke_setPlaybackRate({ playbackRate });
133829
133870
  }
133830
- async releaseAllAnimations() {
133831
- const animationIds = [...this.animationGroups.values()].flatMap(animationGroup => animationGroup.animations().map(animation => animation.id()));
133832
- await this.agent.invoke_releaseAnimations({ animations: animationIds });
133833
- }
133834
133871
  releaseAnimations(animations) {
133835
133872
  void this.agent.invoke_releaseAnimations({ animations });
133836
133873
  }
@@ -137826,9 +137863,39 @@ class DebuggableFrameImpl {
137826
137863
  }
137827
137864
 
137828
137865
  // Copyright 2025 The Chromium Authors
137866
+ class DebuggableFrameFlavor {
137867
+ static #last;
137868
+ url;
137869
+ uiSourceCode;
137870
+ name;
137871
+ line;
137872
+ column;
137873
+ missingDebugInfo;
137874
+ sdkFrame;
137875
+ constructor(frame) {
137876
+ this.url = frame.url;
137877
+ this.uiSourceCode = frame.uiSourceCode;
137878
+ this.name = frame.name;
137879
+ this.line = frame.line;
137880
+ this.column = frame.column;
137881
+ this.missingDebugInfo = frame.missingDebugInfo;
137882
+ this.sdkFrame = frame.sdkFrame;
137883
+ }
137884
+ static for(frame) {
137885
+ function equals(a, b) {
137886
+ return a.url === b.url && a.uiSourceCode === b.uiSourceCode && a.name === b.name && a.line === b.line &&
137887
+ a.column === b.column && a.sdkFrame === b.sdkFrame;
137888
+ }
137889
+ if (!DebuggableFrameFlavor.#last || !equals(DebuggableFrameFlavor.#last, frame)) {
137890
+ DebuggableFrameFlavor.#last = new DebuggableFrameFlavor(frame);
137891
+ }
137892
+ return DebuggableFrameFlavor.#last;
137893
+ }
137894
+ }
137829
137895
 
137830
137896
  var StackTrace = /*#__PURE__*/Object.freeze({
137831
- __proto__: null
137897
+ __proto__: null,
137898
+ DebuggableFrameFlavor: DebuggableFrameFlavor
137832
137899
  });
137833
137900
 
137834
137901
  // Copyright 2025 The Chromium Authors
@@ -163878,11 +163945,6 @@ class NetworkLog extends ObjectWrapper {
163878
163945
  if (!this.#requestsSet.has(request)) {
163879
163946
  return;
163880
163947
  }
163881
- if (request.isPreflightRequest() &&
163882
- request.corsErrorStatus()?.corsError === "UnexpectedPrivateNetworkAccess" ) {
163883
- this.removeRequest(request);
163884
- return;
163885
- }
163886
163948
  this.dispatchEventToListeners(Events.RequestUpdated, { request });
163887
163949
  }
163888
163950
  onRequestRedirect(event) {
@@ -169590,19 +169652,6 @@ function getIssueCode$1(details) {
169590
169652
  return "CorsIssue::NoCorsRedirectModeNotFollow" ;
169591
169653
  case "InvalidPrivateNetworkAccess" :
169592
169654
  return "CorsIssue::InvalidPrivateNetworkAccess" ;
169593
- case "UnexpectedPrivateNetworkAccess" :
169594
- return "CorsIssue::UnexpectedPrivateNetworkAccess" ;
169595
- case "PreflightMissingAllowPrivateNetwork" :
169596
- case "PreflightInvalidAllowPrivateNetwork" :
169597
- return "CorsIssue::PreflightAllowPrivateNetworkError" ;
169598
- case "PreflightMissingPrivateNetworkAccessId" :
169599
- return "CorsIssue::PreflightMissingPrivateNetworkAccessId" ;
169600
- case "PreflightMissingPrivateNetworkAccessName" :
169601
- return "CorsIssue::PreflightMissingPrivateNetworkAccessName" ;
169602
- case "PrivateNetworkAccessPermissionUnavailable" :
169603
- return "CorsIssue::PrivateNetworkAccessPermissionUnavailable" ;
169604
- case "PrivateNetworkAccessPermissionDenied" :
169605
- return "CorsIssue::PrivateNetworkAccessPermissionDenied" ;
169606
169655
  case "LocalNetworkAccessPermissionDenied" :
169607
169656
  return "CorsIssue::LocalNetworkAccessPermissionDenied" ;
169608
169657
  }
@@ -169624,14 +169673,6 @@ class CorsIssue extends Issue {
169624
169673
  linkTitle: i18nString$7(UIStrings$g.corsPrivateNetworkAccess),
169625
169674
  }],
169626
169675
  };
169627
- case "CorsIssue::PreflightAllowPrivateNetworkError" :
169628
- return {
169629
- file: 'corsPreflightAllowPrivateNetworkError.md',
169630
- links: [{
169631
- link: 'https://developer.chrome.com/blog/private-network-access-update',
169632
- linkTitle: i18nString$7(UIStrings$g.corsPrivateNetworkAccess),
169633
- }],
169634
- };
169635
169676
  case "CorsIssue::InvalidHeaders" :
169636
169677
  return {
169637
169678
  file: 'corsInvalidHeaderValues.md',
@@ -169720,15 +169761,6 @@ class CorsIssue extends Issue {
169720
169761
  linkTitle: i18nString$7(UIStrings$g.CORS),
169721
169762
  }],
169722
169763
  };
169723
- case "CorsIssue::PreflightMissingPrivateNetworkAccessId" :
169724
- case "CorsIssue::PreflightMissingPrivateNetworkAccessName" :
169725
- return {
169726
- file: 'corsPrivateNetworkPermissionDenied.md',
169727
- links: [{
169728
- link: 'https://developer.chrome.com/blog/private-network-access-update',
169729
- linkTitle: i18nString$7(UIStrings$g.corsPrivateNetworkAccess),
169730
- }],
169731
- };
169732
169764
  case "CorsIssue::LocalNetworkAccessPermissionDenied" :
169733
169765
  return {
169734
169766
  file: 'corsLocalNetworkAccessPermissionDenied.md',
@@ -169740,9 +169772,6 @@ class CorsIssue extends Issue {
169740
169772
  case "CorsIssue::PreflightMissingAllowExternal" :
169741
169773
  case "CorsIssue::PreflightInvalidAllowExternal" :
169742
169774
  case "CorsIssue::InvalidPrivateNetworkAccess" :
169743
- case "CorsIssue::UnexpectedPrivateNetworkAccess" :
169744
- case "CorsIssue::PrivateNetworkAccessPermissionUnavailable" :
169745
- case "CorsIssue::PrivateNetworkAccessPermissionDenied" :
169746
169775
  return null;
169747
169776
  }
169748
169777
  }
@@ -169751,9 +169780,7 @@ class CorsIssue extends Issue {
169751
169780
  }
169752
169781
  getKind() {
169753
169782
  if (this.details().isWarning &&
169754
- (this.details().corsErrorStatus.corsError === "InsecurePrivateNetwork" ||
169755
- this.details().corsErrorStatus.corsError === "PreflightMissingAllowPrivateNetwork" ||
169756
- this.details().corsErrorStatus.corsError === "PreflightInvalidAllowPrivateNetwork" )) {
169783
+ this.details().corsErrorStatus.corsError === "InsecurePrivateNetwork" ) {
169757
169784
  return "BreakingChange" ;
169758
169785
  }
169759
169786
  return "PageError" ;
@@ -51,6 +51,10 @@ export const emulate = defineTool({
51
51
  .nullable()
52
52
  .optional()
53
53
  .describe('User agent to emulate. Set to null to clear the user agent override.'),
54
+ colorScheme: zod
55
+ .enum(['dark', 'light', 'auto'])
56
+ .optional()
57
+ .describe('Emulate the dark or the light mode. Set to "auto" to reset to the default.'),
54
58
  viewport: zod
55
59
  .object({
56
60
  width: zod.number().int().min(0).describe('Page width in pixels.'),
@@ -128,6 +132,23 @@ export const emulate = defineTool({
128
132
  context.setUserAgent(userAgent);
129
133
  }
130
134
  }
135
+ if (request.params.colorScheme) {
136
+ if (request.params.colorScheme === 'auto') {
137
+ await page.emulateMediaFeatures([
138
+ { name: 'prefers-color-scheme', value: '' },
139
+ ]);
140
+ context.setColorScheme(null);
141
+ }
142
+ else {
143
+ await page.emulateMediaFeatures([
144
+ {
145
+ name: 'prefers-color-scheme',
146
+ value: request.params.colorScheme,
147
+ },
148
+ ]);
149
+ context.setColorScheme(request.params.colorScheme);
150
+ }
151
+ }
131
152
  if (viewport !== undefined) {
132
153
  if (viewport === null) {
133
154
  await page.setViewport(null);
@@ -117,6 +117,10 @@ export const navigatePage = defineTool({
117
117
  .enum(['accept', 'decline'])
118
118
  .optional()
119
119
  .describe('Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.'),
120
+ initScript: zod
121
+ .string()
122
+ .optional()
123
+ .describe('A JavaScript script to be executed on each new document before any other scripts for the next navigation.'),
120
124
  ...timeoutSchema,
121
125
  },
122
126
  handler: async (request, response, context) => {
@@ -145,6 +149,11 @@ export const navigatePage = defineTool({
145
149
  context.clearDialog();
146
150
  }
147
151
  };
152
+ let initScriptId;
153
+ if (request.params.initScript) {
154
+ const { identifier } = await page.evaluateOnNewDocument(request.params.initScript);
155
+ initScriptId = identifier;
156
+ }
148
157
  page.on('dialog', dialogHandler);
149
158
  try {
150
159
  await context.waitForEventsAfterAction(async () => {
@@ -196,6 +205,13 @@ export const navigatePage = defineTool({
196
205
  }
197
206
  finally {
198
207
  page.off('dialog', dialogHandler);
208
+ if (initScriptId) {
209
+ await page
210
+ .removeScriptToEvaluateOnNewDocument(initScriptId)
211
+ .catch(error => {
212
+ logger(`Failed to remove init script`, error);
213
+ });
214
+ }
199
215
  }
200
216
  response.setIncludePages(true);
201
217
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrome-devtools-mcp",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "MCP server for Chrome DevTools",
5
5
  "type": "module",
6
6
  "bin": "./build/src/index.js",
@@ -54,7 +54,7 @@
54
54
  "@types/yargs": "^17.0.33",
55
55
  "@typescript-eslint/eslint-plugin": "^8.43.0",
56
56
  "@typescript-eslint/parser": "^8.43.0",
57
- "chrome-devtools-frontend": "1.0.1573331",
57
+ "chrome-devtools-frontend": "1.0.1575174",
58
58
  "core-js": "3.48.0",
59
59
  "debug": "4.4.3",
60
60
  "eslint": "^9.35.0",
@@ -62,8 +62,8 @@
62
62
  "eslint-plugin-import": "^2.32.0",
63
63
  "globals": "^17.0.0",
64
64
  "prettier": "^3.6.2",
65
- "puppeteer": "24.36.0",
66
- "rollup": "4.56.0",
65
+ "puppeteer": "24.36.1",
66
+ "rollup": "4.57.0",
67
67
  "rollup-plugin-cleanup": "^3.2.1",
68
68
  "rollup-plugin-license": "^3.6.0",
69
69
  "sinon": "^21.0.0",