@mcp-b/chrome-devtools-mcp 2.0.2 → 2.0.5

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.
Files changed (149) hide show
  1. package/README.md +120 -10
  2. package/build/src/McpContext.js +69 -5
  3. package/build/src/browser.js +157 -51
  4. package/build/src/cli.js +11 -5
  5. package/build/src/formatters/IssueFormatter.js +190 -0
  6. package/build/src/main.js +83 -2
  7. package/build/src/telemetry/clearcut-logger.js +102 -0
  8. package/build/src/telemetry/flag-utils.js +45 -0
  9. package/build/src/telemetry/metric-utils.js +14 -0
  10. package/build/src/telemetry/persistence.js +53 -0
  11. package/build/src/telemetry/types.js +33 -0
  12. package/build/src/telemetry/watchdog/clearcut-sender.js +201 -0
  13. package/build/src/telemetry/watchdog/main.js +127 -0
  14. package/build/src/telemetry/watchdog-client.js +60 -0
  15. package/build/src/third_party/devtools-formatter-worker.js +7 -0
  16. package/build/src/third_party/index.js +1 -1
  17. package/build/src/tools/browser.js +92 -0
  18. package/build/src/tools/extension.js +31 -0
  19. package/build/src/tools/extensions.js +79 -0
  20. package/build/src/tools/input.js +6 -1
  21. package/build/src/tools/pages.js +7 -1
  22. package/build/src/tools/script.js +31 -4
  23. package/build/src/tools/tools.js +4 -0
  24. package/build/src/transports/CDPClientTransport.js +184 -0
  25. package/build/src/transports/WebMCPBridgeScript.js +11 -2
  26. package/build/src/utils/ExtensionRegistry.js +35 -0
  27. package/build/src/utils/string.js +36 -0
  28. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Base64.js +20 -2
  29. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Debouncer.js +8 -1
  30. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Gzip.js +11 -0
  31. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Object.js +6 -1
  32. package/build/vendor/chrome-devtools-frontend/front_end/core/common/ParsedURL.js +3 -0
  33. package/build/vendor/chrome-devtools-frontend/front_end/core/common/ResourceType.js +6 -0
  34. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Revealer.js +0 -5
  35. package/build/vendor/chrome-devtools-frontend/front_end/core/common/Settings.js +18 -8
  36. package/build/vendor/chrome-devtools-frontend/front_end/core/host/AidaClient.js +24 -0
  37. package/build/vendor/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostStub.js +11 -3
  38. package/build/vendor/chrome-devtools-frontend/front_end/core/host/ResourceLoader.js +1 -1
  39. package/build/vendor/chrome-devtools-frontend/front_end/core/host/UserMetrics.js +27 -20
  40. package/build/vendor/chrome-devtools-frontend/front_end/core/i18n/collect-ui-strings.js +7 -8
  41. package/build/vendor/chrome-devtools-frontend/front_end/core/i18n/generate-locales-js.js +4 -5
  42. package/build/vendor/chrome-devtools-frontend/front_end/core/platform/ArrayUtilities.js +10 -0
  43. package/build/vendor/chrome-devtools-frontend/front_end/core/platform/StringUtilities.js +63 -12
  44. package/build/vendor/chrome-devtools-frontend/front_end/core/protocol_client/CDPConnection.js +1 -0
  45. package/build/vendor/chrome-devtools-frontend/front_end/core/protocol_client/InspectorBackend.js +4 -1
  46. package/build/vendor/chrome-devtools-frontend/front_end/core/root/ExperimentNames.js +30 -0
  47. package/build/vendor/chrome-devtools-frontend/front_end/core/root/root.js +2 -1
  48. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/AnimationModel.js +0 -4
  49. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CSSMatchedStyles.js +69 -9
  50. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CSSMetadata.js +6 -6
  51. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CSSModel.js +28 -13
  52. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CSSProperty.js +1 -1
  53. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParserMatchers.js +6 -0
  54. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/ConsoleModel.js +0 -2
  55. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/CookieModel.js +1 -1
  56. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/DOMModel.js +170 -13
  57. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/DebuggerModel.js +5 -39
  58. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/HeapProfilerModel.js +8 -1
  59. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/NetworkManager.js +20 -5
  60. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/NetworkRequest.js +12 -21
  61. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/OverlayModel.js +19 -6
  62. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/RehydratingConnection.js +5 -1
  63. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/ResourceTreeModel.js +8 -5
  64. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/SourceMap.js +15 -10
  65. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/SourceMapManager.js +1 -1
  66. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/SourceMapScopesInfo.js +13 -27
  67. package/build/vendor/chrome-devtools-frontend/front_end/core/sdk/Target.js +3 -1
  68. package/build/vendor/chrome-devtools-frontend/front_end/generated/ARIAProperties.js +1 -7
  69. package/build/vendor/chrome-devtools-frontend/front_end/generated/Deprecation.js +1 -16
  70. package/build/vendor/chrome-devtools-frontend/front_end/generated/InspectorBackendCommands.js +82 -22
  71. package/build/vendor/chrome-devtools-frontend/front_end/generated/SupportedCSSProperties.js +265 -123
  72. package/build/vendor/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.js +2 -1
  73. package/build/vendor/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js +10 -16
  74. package/build/vendor/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js +97 -26
  75. package/build/vendor/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AICallTree.js +35 -0
  76. package/build/vendor/chrome-devtools-frontend/front_end/models/annotations/AnnotationRepository.js +163 -0
  77. package/build/vendor/chrome-devtools-frontend/front_end/models/annotations/AnnotationType.js +10 -0
  78. package/build/vendor/chrome-devtools-frontend/front_end/models/annotations/annotations.js +5 -0
  79. package/build/vendor/chrome-devtools-frontend/front_end/models/bindings/CompilerScriptMapping.js +5 -3
  80. package/build/vendor/chrome-devtools-frontend/front_end/models/bindings/DebuggerLanguagePlugins.js +29 -58
  81. package/build/vendor/chrome-devtools-frontend/front_end/models/bindings/DebuggerWorkspaceBinding.js +7 -45
  82. package/build/vendor/chrome-devtools-frontend/front_end/models/emulation/DeviceModeModel.js +1 -1
  83. package/build/vendor/chrome-devtools-frontend/front_end/models/emulation/EmulatedDevices.js +14 -0
  84. package/build/vendor/chrome-devtools-frontend/front_end/models/formatter/FormatterWorkerPool.js +8 -5
  85. package/build/vendor/chrome-devtools-frontend/front_end/models/greendev/Prototypes.js +33 -0
  86. package/build/vendor/chrome-devtools-frontend/front_end/models/greendev/greendev.js +4 -0
  87. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/ContrastCheckTrigger.js +2 -2
  88. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/CookieIssue.js +0 -21
  89. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/CorsIssue.js +1 -38
  90. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/IssueAggregator.js +8 -0
  91. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/IssuesManager.js +6 -12
  92. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/PermissionElementIssue.js +243 -0
  93. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
  94. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
  95. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
  96. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
  97. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
  98. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
  99. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
  100. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
  101. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
  102. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
  103. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
  104. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
  105. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
  106. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
  107. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
  108. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
  109. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
  110. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
  111. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
  112. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
  113. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
  114. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
  115. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
  116. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/issues_manager.js +2 -1
  117. package/build/vendor/chrome-devtools-frontend/front_end/models/logs/NetworkLog.js +0 -8
  118. package/build/vendor/chrome-devtools-frontend/front_end/models/source_map_scopes/NamesResolver.js +4 -8
  119. package/build/vendor/chrome-devtools-frontend/front_end/models/stack_trace/StackTrace.js +30 -1
  120. package/build/vendor/chrome-devtools-frontend/front_end/models/stack_trace/StackTraceImpl.js +70 -1
  121. package/build/vendor/chrome-devtools-frontend/front_end/models/stack_trace/StackTraceModel.js +82 -30
  122. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/EventsSerializer.js +10 -2
  123. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/LanternComputationData.js +2 -2
  124. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/ModelImpl.js +0 -3
  125. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/Processor.js +18 -19
  126. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/Styles.js +12 -4
  127. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/extras/Initiators.js +46 -0
  128. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/extras/TraceTree.js +4 -3
  129. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/extras/extras.js +1 -0
  130. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/handlers/LargestImagePaintHandler.js +2 -2
  131. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/handlers/LayoutShiftsHandler.js +1 -1
  132. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/handlers/MetaHandler.js +6 -0
  133. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/handlers/NetworkRequestsHandler.js +10 -1
  134. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/handlers/PageLoadMetricsHandler.js +44 -27
  135. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/helpers/Timing.js +9 -2
  136. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/insights/Common.js +1 -6
  137. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/insights/LCPBreakdown.js +2 -2
  138. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/insights/LCPDiscovery.js +2 -4
  139. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/insights/NetworkDependencyTree.js +3 -2
  140. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/insights/RenderBlocking.js +1 -1
  141. package/build/vendor/chrome-devtools-frontend/front_end/models/trace/types/TraceEvents.js +33 -11
  142. package/build/vendor/chrome-devtools-frontend/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +51 -18
  143. package/build/vendor/chrome-devtools-frontend/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  144. package/build/vendor/chrome-devtools-frontend/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +4 -0
  145. package/build/vendor/chrome-devtools-frontend/mcp/HostBindings.js +4 -0
  146. package/build/vendor/chrome-devtools-frontend/mcp/mcp.js +4 -0
  147. package/package.json +28 -21
  148. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/SameSiteInvalidSameParty.md +0 -8
  149. package/build/vendor/chrome-devtools-frontend/front_end/models/issues_manager/descriptions/SameSiteSamePartyCrossPartyContextSet.md +0 -10
@@ -2,7 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
  import * as Common from '../../core/common/common.js';
5
- import * as Root from '../../core/root/root.js';
6
5
  import * as SDK from '../../core/sdk/sdk.js';
7
6
  import { AttributionReportingIssue } from './AttributionReportingIssue.js';
8
7
  import { BounceTrackingIssue } from './BounceTrackingIssue.js';
@@ -20,6 +19,7 @@ import { HeavyAdIssue } from './HeavyAdIssue.js';
20
19
  import { LowTextContrastIssue } from './LowTextContrastIssue.js';
21
20
  import { MixedContentIssue } from './MixedContentIssue.js';
22
21
  import { PartitioningBlobURLIssue } from './PartitioningBlobURLIssue.js';
22
+ import { PermissionElementIssue } from './PermissionElementIssue.js';
23
23
  import { PropertyRuleIssue } from './PropertyRuleIssue.js';
24
24
  import { QuirksModeIssue } from './QuirksModeIssue.js';
25
25
  import { SharedArrayBufferIssue } from './SharedArrayBufferIssue.js';
@@ -130,6 +130,10 @@ const issueCodeHandlers = new Map([
130
130
  "UnencodedDigestIssue" /* Protocol.Audits.InspectorIssueCode.UnencodedDigestIssue */,
131
131
  UnencodedDigestIssue.fromInspectorIssue,
132
132
  ],
133
+ [
134
+ "PermissionElementIssue" /* Protocol.Audits.InspectorIssueCode.PermissionElementIssue */,
135
+ PermissionElementIssue.fromInspectorIssue,
136
+ ],
133
137
  ]);
134
138
  /**
135
139
  * Each issue reported by the backend can result in multiple `Issue` instances.
@@ -172,7 +176,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper {
172
176
  #thirdPartyCookiePhaseoutIssueCount = new Map();
173
177
  #issuesById = new Map();
174
178
  #issuesByOutermostTarget = new Map();
175
- #thirdPartyCookiePhaseoutIssueMessageSent = false;
176
179
  constructor(showThirdPartyIssuesSetting, hideIssueSetting) {
177
180
  super();
178
181
  this.showThirdPartyIssuesSetting = showThirdPartyIssuesSetting;
@@ -255,7 +258,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper {
255
258
  }
256
259
  #onIssueAddedEvent(event) {
257
260
  const { issuesModel, inspectorIssue } = event.data;
258
- const isPrivacyUiEnabled = Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled;
259
261
  const issues = createIssuesFromProtocolIssue(issuesModel, inspectorIssue);
260
262
  for (const issue of issues) {
261
263
  this.addIssue(issuesModel, issue);
@@ -263,14 +265,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper {
263
265
  if (!message) {
264
266
  continue;
265
267
  }
266
- // Only show one message for third-party cookie phaseout issues if the new privacy ui is enabled
267
- const is3rdPartyCookiePhaseoutIssue = CookieIssue.getSubCategory(issue.code()) === "ThirdPartyPhaseoutCookie" /* CookieIssueSubCategory.THIRD_PARTY_PHASEOUT_COOKIE */;
268
- if (!is3rdPartyCookiePhaseoutIssue || !isPrivacyUiEnabled || !this.#thirdPartyCookiePhaseoutIssueMessageSent) {
269
- issuesModel.target().model(SDK.ConsoleModel.ConsoleModel)?.addMessage(message);
270
- }
271
- if (is3rdPartyCookiePhaseoutIssue && isPrivacyUiEnabled) {
272
- this.#thirdPartyCookiePhaseoutIssueMessageSent = true;
273
- }
268
+ issuesModel.target().model(SDK.ConsoleModel.ConsoleModel)?.addMessage(message);
274
269
  }
275
270
  }
276
271
  addIssue(issuesModel, issue) {
@@ -379,7 +374,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper {
379
374
  this.#issuesById.clear();
380
375
  this.#hiddenIssueCount.clear();
381
376
  this.#thirdPartyCookiePhaseoutIssueCount.clear();
382
- this.#thirdPartyCookiePhaseoutIssueMessageSent = false;
383
377
  const values = this.hideIssueSetting?.get();
384
378
  for (const [key, issue] of this.#allIssues) {
385
379
  if (this.#issueFilter(issue)) {
@@ -0,0 +1,243 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ import { Issue } from './Issue.js';
5
+ export class PermissionElementIssue extends Issue {
6
+ #issueDetails;
7
+ constructor(issueDetails, issuesModel) {
8
+ const issueCode = [
9
+ "PermissionElementIssue" /* Protocol.Audits.InspectorIssueCode.PermissionElementIssue */,
10
+ issueDetails.issueType,
11
+ ].join('::');
12
+ super(issueCode, issueDetails, issuesModel);
13
+ this.#issueDetails = issueDetails;
14
+ }
15
+ getCategory() {
16
+ return "PermissionElement" /* IssueCategory.PERMISSION_ELEMENT */;
17
+ }
18
+ getDescription() {
19
+ const issueType = this.#issueDetails.issueType;
20
+ switch (issueType) {
21
+ case "InvalidType" /* Protocol.Audits.PermissionElementIssueType.InvalidType */:
22
+ return {
23
+ file: 'permissionElementInvalidType.md',
24
+ substitutions: new Map([
25
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
26
+ ]),
27
+ links: [],
28
+ };
29
+ case "FencedFrameDisallowed" /* Protocol.Audits.PermissionElementIssueType.FencedFrameDisallowed */:
30
+ return {
31
+ file: 'permissionElementFencedFrameDisallowed.md',
32
+ substitutions: new Map([
33
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
34
+ ]),
35
+ links: [],
36
+ };
37
+ case "CspFrameAncestorsMissing" /* Protocol.Audits.PermissionElementIssueType.CspFrameAncestorsMissing */:
38
+ return {
39
+ file: 'permissionElementCspFrameAncestorsMissing.md',
40
+ substitutions: new Map([
41
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
42
+ ]),
43
+ links: [],
44
+ };
45
+ case "PermissionsPolicyBlocked" /* Protocol.Audits.PermissionElementIssueType.PermissionsPolicyBlocked */:
46
+ return {
47
+ file: 'permissionElementPermissionsPolicyBlocked.md',
48
+ substitutions: new Map([
49
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
50
+ ['PLACEHOLDER_PermissionName', this.#issueDetails.permissionName || ''],
51
+ ]),
52
+ links: [],
53
+ };
54
+ case "PaddingRightUnsupported" /* Protocol.Audits.PermissionElementIssueType.PaddingRightUnsupported */:
55
+ return {
56
+ file: 'permissionElementPaddingRightUnsupported.md',
57
+ substitutions: new Map([
58
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
59
+ ]),
60
+ links: [],
61
+ };
62
+ case "PaddingBottomUnsupported" /* Protocol.Audits.PermissionElementIssueType.PaddingBottomUnsupported */:
63
+ return {
64
+ file: 'permissionElementPaddingBottomUnsupported.md',
65
+ substitutions: new Map([
66
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
67
+ ]),
68
+ links: [],
69
+ };
70
+ case "InsetBoxShadowUnsupported" /* Protocol.Audits.PermissionElementIssueType.InsetBoxShadowUnsupported */:
71
+ return {
72
+ file: 'permissionElementInsetBoxShadowUnsupported.md',
73
+ substitutions: new Map([
74
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
75
+ ]),
76
+ links: [],
77
+ };
78
+ case "RequestInProgress" /* Protocol.Audits.PermissionElementIssueType.RequestInProgress */:
79
+ return {
80
+ file: 'permissionElementRequestInProgress.md',
81
+ substitutions: new Map([
82
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
83
+ ]),
84
+ links: [],
85
+ };
86
+ case "UntrustedEvent" /* Protocol.Audits.PermissionElementIssueType.UntrustedEvent */:
87
+ return {
88
+ file: 'permissionElementUntrustedEvent.md',
89
+ substitutions: new Map([
90
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
91
+ ]),
92
+ links: [],
93
+ };
94
+ case "RegistrationFailed" /* Protocol.Audits.PermissionElementIssueType.RegistrationFailed */:
95
+ return {
96
+ file: 'permissionElementRegistrationFailed.md',
97
+ substitutions: new Map([
98
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
99
+ ]),
100
+ links: [],
101
+ };
102
+ case "TypeNotSupported" /* Protocol.Audits.PermissionElementIssueType.TypeNotSupported */:
103
+ return {
104
+ file: 'permissionElementTypeNotSupported.md',
105
+ substitutions: new Map([
106
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
107
+ ]),
108
+ links: [],
109
+ };
110
+ case "InvalidTypeActivation" /* Protocol.Audits.PermissionElementIssueType.InvalidTypeActivation */:
111
+ return {
112
+ file: 'permissionElementInvalidTypeActivation.md',
113
+ substitutions: new Map([
114
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
115
+ ]),
116
+ links: [],
117
+ };
118
+ case "SecurityChecksFailed" /* Protocol.Audits.PermissionElementIssueType.SecurityChecksFailed */:
119
+ return {
120
+ file: 'permissionElementSecurityChecksFailed.md',
121
+ substitutions: new Map([
122
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
123
+ ]),
124
+ links: [],
125
+ };
126
+ case "ActivationDisabled" /* Protocol.Audits.PermissionElementIssueType.ActivationDisabled */: {
127
+ if (this.#issueDetails.occluderNodeInfo && this.#issueDetails.occluderParentNodeInfo) {
128
+ return {
129
+ file: 'permissionElementActivationDisabledWithOccluderParent.md',
130
+ substitutions: new Map([
131
+ ['PLACEHOLDER_DisableReason', this.#issueDetails.disableReason || ''],
132
+ ['PLACEHOLDER_OccluderInfo', this.#issueDetails.occluderNodeInfo || ''],
133
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
134
+ ['PLACEHOLDER_OccluderParentInfo', this.#issueDetails.occluderParentNodeInfo || ''],
135
+ ]),
136
+ links: [],
137
+ };
138
+ }
139
+ if (this.#issueDetails.occluderNodeInfo) {
140
+ return {
141
+ file: 'permissionElementActivationDisabledWithOccluder.md',
142
+ substitutions: new Map([
143
+ ['PLACEHOLDER_DisableReason', this.#issueDetails.disableReason || ''],
144
+ ['PLACEHOLDER_OccluderInfo', this.#issueDetails.occluderNodeInfo || ''],
145
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
146
+ ]),
147
+ links: [],
148
+ };
149
+ }
150
+ return {
151
+ file: 'permissionElementActivationDisabled.md',
152
+ substitutions: new Map([
153
+ ['PLACEHOLDER_DisableReason', this.#issueDetails.disableReason || ''],
154
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
155
+ ]),
156
+ links: [],
157
+ };
158
+ }
159
+ case "GeolocationDeprecated" /* Protocol.Audits.PermissionElementIssueType.GeolocationDeprecated */:
160
+ return {
161
+ file: 'permissionElementGeolocationDeprecated.md',
162
+ links: [],
163
+ };
164
+ case "InvalidDisplayStyle" /* Protocol.Audits.PermissionElementIssueType.InvalidDisplayStyle */:
165
+ return {
166
+ file: 'permissionElementInvalidDisplayStyle.md',
167
+ substitutions: new Map([
168
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
169
+ ]),
170
+ links: [],
171
+ };
172
+ case "NonOpaqueColor" /* Protocol.Audits.PermissionElementIssueType.NonOpaqueColor */:
173
+ return {
174
+ file: 'permissionElementNonOpaqueColor.md',
175
+ substitutions: new Map([
176
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
177
+ ]),
178
+ links: [],
179
+ };
180
+ case "LowContrast" /* Protocol.Audits.PermissionElementIssueType.LowContrast */:
181
+ return {
182
+ file: 'permissionElementLowContrast.md',
183
+ substitutions: new Map([
184
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
185
+ ]),
186
+ links: [],
187
+ };
188
+ case "FontSizeTooSmall" /* Protocol.Audits.PermissionElementIssueType.FontSizeTooSmall */:
189
+ return {
190
+ file: 'permissionElementFontSizeTooSmall.md',
191
+ substitutions: new Map([
192
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
193
+ ]),
194
+ links: [],
195
+ };
196
+ case "FontSizeTooLarge" /* Protocol.Audits.PermissionElementIssueType.FontSizeTooLarge */:
197
+ return {
198
+ file: 'permissionElementFontSizeTooLarge.md',
199
+ substitutions: new Map([
200
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
201
+ ]),
202
+ links: [],
203
+ };
204
+ case "InvalidSizeValue" /* Protocol.Audits.PermissionElementIssueType.InvalidSizeValue */:
205
+ return {
206
+ file: 'permissionElementInvalidSizeValue.md',
207
+ substitutions: new Map([
208
+ ['PLACEHOLDER_Type', this.#issueDetails.type || ''],
209
+ ]),
210
+ links: [],
211
+ };
212
+ default:
213
+ console.warn('Unknown PermissionElementIssueType:', issueType);
214
+ return null;
215
+ }
216
+ }
217
+ elements() {
218
+ if (this.#issueDetails.nodeId) {
219
+ const target = this.model()?.target();
220
+ const result = [{
221
+ backendNodeId: this.#issueDetails.nodeId,
222
+ nodeName: this.#issueDetails.type || 'Affected element',
223
+ target: target || null,
224
+ }];
225
+ return result;
226
+ }
227
+ return [];
228
+ }
229
+ getKind() {
230
+ return this.#issueDetails.isWarning ? "Improvement" /* IssueKind.IMPROVEMENT */ : "PageError" /* IssueKind.PAGE_ERROR */;
231
+ }
232
+ primaryKey() {
233
+ return `${"PermissionElementIssue" /* Protocol.Audits.InspectorIssueCode.PermissionElementIssue */}-${JSON.stringify(this.#issueDetails)}`;
234
+ }
235
+ static fromInspectorIssue(issuesModel, inspectorIssue) {
236
+ const permissionElementIssueDetails = inspectorIssue.details.permissionElementIssueDetails;
237
+ if (!permissionElementIssueDetails) {
238
+ console.warn('Permission element issue without details received.');
239
+ return [];
240
+ }
241
+ return [new PermissionElementIssue(permissionElementIssueDetails, issuesModel)];
242
+ }
243
+ }
@@ -0,0 +1,7 @@
1
+ # Activation disabled
2
+
3
+ The "{PLACEHOLDER_Type}" element could not be activated for the following reason: {PLACEHOLDER_DisableReason}.
4
+
5
+ To resolve this issue, ensure that the element follows all styling restrictions and is fully visible to the user.
6
+
7
+ You can use the command line flag `--runtime-enabled-features=BypassPepcSecurityForTesting` to bypass this behavior for testing purposes.
@@ -0,0 +1,9 @@
1
+ # Activation disabled
2
+
3
+ The "{PLACEHOLDER_Type}" element could not be activated for the following reason: {PLACEHOLDER_DisableReason}.
4
+
5
+ The element is occluded by: "{PLACEHOLDER_OccluderInfo}"
6
+
7
+ To resolve this issue, ensure that the element follows all styling restrictions and is fully visible to the user.
8
+
9
+ You can use the command line flag `--runtime-enabled-features=BypassPepcSecurityForTesting` to bypass this behavior for testing purposes.
@@ -0,0 +1,9 @@
1
+ # Activation disabled
2
+
3
+ The "{PLACEHOLDER_Type}" element could not be activated for the following reason: {PLACEHOLDER_DisableReason}.
4
+
5
+ The element is occluded by: "{PLACEHOLDER_OccluderInfo}" (parent element: "{PLACEHOLDER_OccluderParentInfo}")
6
+
7
+ To resolve this issue, ensure that the element follows all styling restrictions and is fully visible to the user.
8
+
9
+ You can use the command line flag `--runtime-enabled-features=BypassPepcSecurityForTesting` to bypass this behavior for testing purposes.
@@ -0,0 +1,5 @@
1
+ # CSP `frame-ancestors` missing
2
+
3
+ The "{PLACEHOLDER_Type}" element is used in a cross-origin iframe, but the required `frame-ancestors` Content Security Policy directive is missing.
4
+
5
+ To resolve this issue, add a `frame-ancestors` Content Security Policy directive to the iframe.
@@ -0,0 +1,5 @@
1
+ # Fenced frame disallowed
2
+
3
+ The "{PLACEHOLDER_Type}" element is not allowed in a fenced frame.
4
+
5
+ To resolve this issue, ensure the element is not used in a fenced frame.
@@ -0,0 +1,5 @@
1
+ # Font size too large
2
+
3
+ The "{PLACEHOLDER_Type}" element's font size is too large.
4
+
5
+ To resolve this issue, ensure that the element's font is at most 'xx-large'.
@@ -0,0 +1,5 @@
1
+ # Font size too small
2
+
3
+ The "{PLACEHOLDER_Type}" element's font size is too small.
4
+
5
+ To resolve this issue, ensure that the element's font is at least 'small'.
@@ -0,0 +1,5 @@
1
+ # Geolocation deprecated
2
+
3
+ Using `<permission type="geolocation">` is deprecated.
4
+
5
+ To resolve this issue, use the `<geolocation>` element instead.
@@ -0,0 +1,5 @@
1
+ # Unsupported inset box shadow
2
+
3
+ The "{PLACEHOLDER_Type}" element does not support `inset` box shadows.
4
+
5
+ To resolve this issue, remove the `inset` keyword from the relevant stylesheet.
@@ -0,0 +1,5 @@
1
+ # Invalid display style
2
+
3
+ The "{PLACEHOLDER_Type}" element has an invalid display style. Values that result in an unsupported layout are not allowed.
4
+
5
+ To resolve this issue, consider using 'inline-block', 'block', or 'flex' instead.
@@ -0,0 +1,5 @@
1
+ # Invalid size value
2
+
3
+ Content, intrinsic, or stretch sizes are not supported as values for the min/max width and height of the "{PLACEHOLDER_Type}" element.
4
+
5
+ To resolve this issue, use absolute or relative lengths for the element's width and height.
@@ -0,0 +1,5 @@
1
+ # Invalid type attribute
2
+
3
+ The "{PLACEHOLDER_Type}" type is not supported.
4
+
5
+ To resolve this issue, ensure the element's type is one of the supported values: "camera", "microphone", "geolocation", "camera microphone".
@@ -0,0 +1,5 @@
1
+ # Invalid type activation
2
+
3
+ An element with the "{PLACEHOLDER_Type}" type was attempted to be activated. However this type is not supported.
4
+
5
+ To resolve this issue, ensure the element's type is one of the supported values: "camera", "microphone", "geolocation", "camera microphone".
@@ -0,0 +1,5 @@
1
+ # Low contrast
2
+
3
+ The contrast between the text color and background color of the "{PLACEHOLDER_Type}" element is too low.
4
+
5
+ To resolve this issue, ensure that your text/background colors have more contrast between them.
@@ -0,0 +1,5 @@
1
+ # Non-opaque color
2
+
3
+ The text color or background color of the "{PLACEHOLDER_Type}" element is non-opaque.
4
+
5
+ To resolve this issue, ensure the element's text and background colors have their alpha channel value at 100%.
@@ -0,0 +1,6 @@
1
+ # Unsupported bottom padding
2
+
3
+ The "{PLACEHOLDER_Type}" element does not support `padding-bottom`.
4
+ `padding-bottom` is always set to be identical to `padding-top`.
5
+
6
+ To resolve this issue, ensure the element's `padding-bottom` is unset or identical to `padding-top`.
@@ -0,0 +1,6 @@
1
+ # Unsupported right padding
2
+
3
+ The "{PLACEHOLDER_Type}" element does not support `padding-right`.
4
+ `padding-right` is always set to be identical to `padding-left`.
5
+
6
+ To resolve this issue, ensure the element's `padding-right` is unset or identical to `padding-left`.
@@ -0,0 +1,5 @@
1
+ # Permissions policy blocked
2
+
3
+ The "{PLACEHOLDER_Type}" element is blocked by the "{PLACEHOLDER_PermissionName}" permission policy.
4
+
5
+ To resolve this issue, ensure the frame which contains the element is loaded with the appropriate permission policy by its embedder.
@@ -0,0 +1,5 @@
1
+ # Quota exceeded
2
+
3
+ The "{PLACEHOLDER_Type}" element has surpassed the maximum instances quota per page.
4
+
5
+ To resolve this issue, ensure that you have no more than 3 elements of the same type per page.
@@ -0,0 +1,5 @@
1
+ # Request in progress
2
+
3
+ A permission request on the "{PLACEHOLDER_Type}" element was prevented because a previous request is still in progress.
4
+
5
+ To resolve this issue, ensure that the site does not allow users to interact with the element behind the current content scrim (for example by moving the element to a document in a new window, which is not covered by the scrim).
@@ -0,0 +1,5 @@
1
+ # Activation disabled (quota)
2
+
3
+ The "{PLACEHOLDER_Type}" element could not be activated because the page's quota has been exceeded.
4
+
5
+ To resolve this issue, ensure that you have no more than 3 elements of the same type per page.
@@ -0,0 +1,5 @@
1
+ # Permission not supported
2
+
3
+ The permission type "{PLACEHOLDER_Type}" is not supported by this browser and therefore the element will not be functional.
4
+
5
+ To resolve this issue, ensure the element's type is one of the supported values: "camera", "microphone", "geolocation", "camera microphone".
@@ -0,0 +1,7 @@
1
+ # Untrusted event
2
+
3
+ The "{PLACEHOLDER_Type}" element can only be activated by actual user clicks, not simulated ones.
4
+
5
+ To resolve this issue, do not use frameworks which simulate click events, (e.g. via `click()`) and do not prevent the `DOMActivate` event.
6
+
7
+ You can use the command line flag `--runtime-enabled-features=BypassPepcSecurityForTesting` to bypass this behavior for testing purposes.
@@ -23,6 +23,7 @@ import * as LowTextContrastIssue from './LowTextContrastIssue.js';
23
23
  import * as MarkdownIssueDescription from './MarkdownIssueDescription.js';
24
24
  import * as MixedContentIssue from './MixedContentIssue.js';
25
25
  import * as PartitioningBlobURLIssue from './PartitioningBlobURLIssue.js';
26
+ import * as PermissionElementIssue from './PermissionElementIssue.js';
26
27
  import * as PropertyRuleIssue from './PropertyRuleIssue.js';
27
28
  import * as QuirksModeIssue from './QuirksModeIssue.js';
28
29
  import * as RelatedIssue from './RelatedIssue.js';
@@ -32,4 +33,4 @@ import * as SourceFrameIssuesManager from './SourceFrameIssuesManager.js';
32
33
  import * as SRIMessageSignatureIssue from './SRIMessageSignatureIssue.js';
33
34
  import * as StylesheetLoadingIssue from './StylesheetLoadingIssue.js';
34
35
  import * as UnencodedDigestIssue from './UnencodedDigestIssue.js';
35
- export { AttributionReportingIssue, CheckFormsIssuesTrigger, ClientHintIssue, ContentSecurityPolicyIssue, ContrastCheckTrigger, CookieDeprecationMetadataIssue, CookieIssue, CorsIssue, CrossOriginEmbedderPolicyIssue, DeprecationIssue, ElementAccessibilityIssue, FederatedAuthUserInfoRequestIssue, GenericIssue, HeavyAdIssue, Issue, IssueAggregator, IssueResolver, IssuesManager, LowTextContrastIssue, MarkdownIssueDescription, MixedContentIssue, PartitioningBlobURLIssue, PropertyRuleIssue, QuirksModeIssue, RelatedIssue, SharedArrayBufferIssue, SharedDictionaryIssue, SourceFrameIssuesManager, SRIMessageSignatureIssue, StylesheetLoadingIssue, UnencodedDigestIssue, };
36
+ export { AttributionReportingIssue, CheckFormsIssuesTrigger, ClientHintIssue, ContentSecurityPolicyIssue, ContrastCheckTrigger, CookieDeprecationMetadataIssue, CookieIssue, CorsIssue, CrossOriginEmbedderPolicyIssue, DeprecationIssue, ElementAccessibilityIssue, FederatedAuthUserInfoRequestIssue, GenericIssue, HeavyAdIssue, Issue, IssueAggregator, IssueResolver, IssuesManager, LowTextContrastIssue, MarkdownIssueDescription, MixedContentIssue, PartitioningBlobURLIssue, PermissionElementIssue, PropertyRuleIssue, QuirksModeIssue, RelatedIssue, SharedArrayBufferIssue, SharedDictionaryIssue, SourceFrameIssuesManager, SRIMessageSignatureIssue, StylesheetLoadingIssue, UnencodedDigestIssue, };
@@ -407,14 +407,6 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper {
407
407
  if (!this.#requestsSet.has(request)) {
408
408
  return;
409
409
  }
410
- // This is only triggered in an edge case in which Chrome reports 2 preflight requests. The
411
- // first preflight gets aborted and should not be shown in DevTools.
412
- // (see https://crbug.com/1290390 for details)
413
- if (request.isPreflightRequest() &&
414
- request.corsErrorStatus()?.corsError === "UnexpectedPrivateNetworkAccess" /* Protocol.Network.CorsError.UnexpectedPrivateNetworkAccess */) {
415
- this.removeRequest(request);
416
- return;
417
- }
418
410
  this.dispatchEventToListeners(Events.RequestUpdated, { request });
419
411
  }
420
412
  onRequestRedirect(event) {
@@ -2,7 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
  import * as Common from '../../core/common/common.js';
5
- import * as Root from '../../core/root/root.js';
6
5
  import * as SDK from '../../core/sdk/sdk.js';
7
6
  import * as Bindings from '../bindings/bindings.js';
8
7
  import * as Formatter from '../formatter/formatter.js';
@@ -297,16 +296,13 @@ const resolveScope = async (script, scopeChain) => {
297
296
  };
298
297
  export const resolveScopeChain = async function (callFrame) {
299
298
  const { pluginManager } = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance();
300
- let scopeChain = await pluginManager.resolveScopeChain(callFrame);
301
- if (scopeChain) {
302
- return scopeChain;
303
- }
304
- scopeChain = Root.Runtime.experiments.isEnabled("use-source-map-scopes" /* Root.Runtime.ExperimentName.USE_SOURCE_MAP_SCOPES */) ?
305
- callFrame.script.sourceMap()?.resolveScopeChain(callFrame) :
306
- null;
299
+ const scopeChain = await pluginManager.resolveScopeChain(callFrame);
307
300
  if (scopeChain) {
308
301
  return scopeChain;
309
302
  }
303
+ // TODO(crbug.com/465968290): Re-enable creating the scope chain from the source map once:
304
+ // 1) We have a flag indicating whether the source map contained variable/binding information.
305
+ // 2) We have a chrome feature flag.
310
306
  if (callFrame.script.isWasm()) {
311
307
  return callFrame.scopeChain();
312
308
  }
@@ -1,4 +1,33 @@
1
1
  // Copyright 2025 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- export {};
4
+ /**
5
+ * A small wrapper around a DebuggableFrame usable as a UI.Context flavor.
6
+ * This is necessary as DebuggableFrame are just interfaces and the impl classes are hidden.
7
+ *
8
+ * Moreover, re-translation creates a new DebuggableFrame instance even though the
9
+ * translation result stays the same, in which case we don't need a new instance for the flavor.
10
+ */
11
+ export class DebuggableFrameFlavor {
12
+ static #last;
13
+ frame;
14
+ /** Use the static {@link for}. Only public to satisfy the `setFlavor` Ctor type */
15
+ constructor(frame) {
16
+ this.frame = frame;
17
+ }
18
+ get sdkFrame() {
19
+ return this.frame.sdkFrame;
20
+ }
21
+ /** @returns the same instance of DebuggableFrameFlavor for repeated calls with the same (i.e. deep equal) DebuggableFrame */
22
+ static for(frame) {
23
+ function equals(a, b) {
24
+ return a.url === b.url && a.uiSourceCode === b.uiSourceCode && a.name === b.name && a.line === b.line &&
25
+ a.column === b.column && a.sdkFrame === b.sdkFrame &&
26
+ JSON.stringify(a.missingDebugInfo) === JSON.stringify(b.missingDebugInfo);
27
+ }
28
+ if (!DebuggableFrameFlavor.#last || !equals(DebuggableFrameFlavor.#last.frame, frame)) {
29
+ DebuggableFrameFlavor.#last = new DebuggableFrameFlavor(frame);
30
+ }
31
+ return DebuggableFrameFlavor.#last;
32
+ }
33
+ }