chrome-devtools-frontend 1.0.1709383 → 1.0.1713292

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 (165) hide show
  1. package/.agents/skills/code-review/SKILL.md +16 -12
  2. package/AUTHORS +2 -0
  3. package/DIR_METADATA +36 -0
  4. package/front_end/core/common/ParsedURL.ts +20 -19
  5. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -2
  6. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
  7. package/front_end/core/sdk/DOMModel.ts +6 -4
  8. package/front_end/core/sdk/NetworkRequest.ts +11 -11
  9. package/front_end/core/sdk/PageFunctions.ts +1 -1
  10. package/front_end/core/sdk/ResourceTreeModel.ts +17 -1
  11. package/front_end/core/sdk/SourceMap.ts +6 -0
  12. package/front_end/core/sdk/SourceMapScopesInfo.ts +25 -0
  13. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +7 -7
  14. package/front_end/generated/InspectorBackendCommands.ts +2 -1
  15. package/front_end/generated/protocol-mapping.d.ts +7 -0
  16. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  17. package/front_end/generated/protocol.ts +18 -0
  18. package/front_end/models/ai_assistance/agents/AiAgent.ts +7 -4
  19. package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -0
  20. package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +6 -1
  21. package/front_end/models/ai_assistance/contexts/LighthouseContext.ts +3 -2
  22. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +11 -0
  23. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +47 -19
  24. package/front_end/models/ai_assistance/skills/accessibility.md +1 -0
  25. package/front_end/models/ai_assistance/skills/lighthouse.md +1 -0
  26. package/front_end/models/ai_assistance/skills/styling.md +1 -0
  27. package/front_end/models/ai_assistance/tools/ListSources.ts +11 -5
  28. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -1
  29. package/front_end/models/bindings/SourceMapStepping.ts +103 -4
  30. package/front_end/models/bindings/StylesSourceMapping.ts +3 -0
  31. package/front_end/models/emulation/DeviceModeModel.ts +9 -4
  32. package/front_end/models/har/HARFormat.ts +2 -7
  33. package/front_end/models/issues_manager/Issue.ts +1 -1
  34. package/front_end/models/javascript_metadata/NativeFunctions.ts +66 -54
  35. package/front_end/models/persistence/Automapping.ts +8 -3
  36. package/front_end/models/trace/Processor.ts +9 -3
  37. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  38. package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
  39. package/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +1 -1
  40. package/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +1 -1
  41. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingListView.ts +40 -8
  42. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +108 -2
  43. package/front_end/panels/accessibility/AccessibilityNodeView.ts +2 -2
  44. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
  45. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
  46. package/front_end/panels/ai_assistance/components/OptInChangeDialog.ts +1 -1
  47. package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +1 -1
  48. package/front_end/panels/application/CookieItemsView.ts +10 -10
  49. package/front_end/panels/application/DOMStorageItemsView.ts +7 -8
  50. package/front_end/panels/application/ExtensionStorageItemsView.ts +4 -5
  51. package/front_end/panels/application/IndexedDBViews.ts +29 -31
  52. package/front_end/panels/application/KeyValueStorageItemsView.ts +5 -5
  53. package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +6 -6
  54. package/front_end/panels/application/ServiceWorkerCacheViews.ts +17 -17
  55. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +3 -2
  56. package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -10
  57. package/front_end/panels/application/StorageItemsToolbar.ts +6 -6
  58. package/front_end/panels/application/StorageView.ts +36 -34
  59. package/front_end/panels/application/TrustTokensTreeElement.ts +1 -2
  60. package/front_end/panels/application/WebMCPView.ts +6 -2
  61. package/front_end/panels/application/components/AdsView.ts +28 -29
  62. package/front_end/panels/application/components/BackForwardCacheStrings.ts +188 -204
  63. package/front_end/panels/application/components/BackForwardCacheView.ts +33 -45
  64. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +10 -12
  65. package/front_end/panels/application/components/CrashReportContextGrid.ts +4 -4
  66. package/front_end/panels/application/components/EndpointsGrid.ts +3 -5
  67. package/front_end/panels/application/components/PermissionsPolicySection.ts +12 -15
  68. package/front_end/panels/application/components/ProtocolHandlersView.ts +9 -9
  69. package/front_end/panels/application/components/ReportsGrid.ts +7 -12
  70. package/front_end/panels/application/components/StorageMetadataView.ts +22 -24
  71. package/front_end/panels/application/components/TrustTokensView.ts +8 -10
  72. package/front_end/panels/application/preloading/components/PreloadingString.ts +28 -29
  73. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  74. package/front_end/panels/comments/CommentsPane.ts +14 -7
  75. package/front_end/panels/comments/commentsPane.css +6 -20
  76. package/front_end/panels/common/CPUThrottlingOption.ts +1 -1
  77. package/front_end/panels/common/CommentThreadWidget.ts +0 -17
  78. package/front_end/panels/common/CommentsOverlayWidget.ts +0 -4
  79. package/front_end/panels/common/ExtensionServer.ts +52 -50
  80. package/front_end/panels/common/commentThreadWidget.css +0 -4
  81. package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
  82. package/front_end/panels/console/ConsoleViewMessage.ts +1 -0
  83. package/front_end/panels/console/ConsoleViewport.ts +35 -4
  84. package/front_end/panels/coverage/CoverageListView.ts +2 -2
  85. package/front_end/panels/coverage/CoverageView.ts +2 -2
  86. package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
  87. package/front_end/panels/elements/DOMPath.ts +7 -1
  88. package/front_end/panels/elements/DOMTreeWidget.ts +19 -22
  89. package/front_end/panels/elements/ElementsPanel.ts +3 -3
  90. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -2
  91. package/front_end/panels/elements/StylePropertyUtils.ts +11 -3
  92. package/front_end/panels/elements/components/CSSVariableValueView.ts +1 -1
  93. package/front_end/panels/elements/elements-meta.ts +3 -3
  94. package/front_end/panels/emulation/DeviceModeView.ts +1 -1
  95. package/front_end/panels/explain/components/ConsoleInsight.ts +1 -1
  96. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +2 -3
  97. package/front_end/panels/layer_viewer/Layers3DView.ts +7 -8
  98. package/front_end/panels/layer_viewer/layer_viewer-meta.ts +1 -5
  99. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +1 -1
  100. package/front_end/panels/network/FetchHeaderCommenting.ts +1 -1
  101. package/front_end/panels/network/NetworkDataGridNode.ts +5 -2
  102. package/front_end/panels/network/NetworkLogView.ts +8 -13
  103. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
  104. package/front_end/panels/network/RequestCookiesView.ts +1 -1
  105. package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +3 -3
  106. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  107. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  108. package/front_end/panels/recorder/RecordingView.ts +1 -1
  109. package/front_end/panels/security/SecurityPanel.ts +27 -20
  110. package/front_end/panels/sensors/LocationsSettingsTab.ts +4 -9
  111. package/front_end/panels/sensors/SensorsView.ts +2 -2
  112. package/front_end/panels/sensors/sensors-meta.ts +0 -83
  113. package/front_end/panels/settings/AISettingsTab.ts +5 -5
  114. package/front_end/panels/settings/BackendLinkingSettingsTab.ts +1 -1
  115. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +4 -4
  116. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
  117. package/front_end/panels/sources/DebuggerPlugin.ts +3 -3
  118. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +4 -1
  119. package/front_end/panels/sources/NavigatorView.ts +9 -6
  120. package/front_end/panels/sources/PersistenceActions.ts +1 -1
  121. package/front_end/panels/sources/SourcesPanel.ts +26 -9
  122. package/front_end/panels/sources/SourcesSearchScope.ts +4 -1
  123. package/front_end/panels/sources/SourcesView.ts +79 -86
  124. package/front_end/panels/sources/UISourceCodeFrame.ts +69 -64
  125. package/front_end/panels/sources/sources-meta.ts +26 -63
  126. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -1
  127. package/front_end/panels/timeline/CountersGraph.ts +32 -13
  128. package/front_end/panels/timeline/ModificationsManager.ts +3 -1
  129. package/front_end/panels/timeline/ThreadAppender.ts +4 -1
  130. package/front_end/panels/timeline/TimelineController.ts +9 -2
  131. package/front_end/panels/timeline/TimelineDetailsView.ts +4 -1
  132. package/front_end/panels/timeline/TimelineEventOverview.ts +3 -5
  133. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -4
  134. package/front_end/panels/timeline/TimelinePanel.ts +39 -21
  135. package/front_end/panels/timeline/TimelineTreeView.ts +0 -6
  136. package/front_end/panels/timeline/TimelineUIUtils.ts +6 -4
  137. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +3 -1
  138. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +3 -1
  139. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  140. package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +147 -97
  141. package/front_end/panels/timeline/timeline-meta.ts +33 -105
  142. package/front_end/third_party/chromium/README.chromium +1 -1
  143. package/front_end/ui/components/lists/list.css +1 -2
  144. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +9 -5
  145. package/front_end/ui/components/text_editor/AiCodeCompletionDisclaimer.ts +3 -3
  146. package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +1 -1
  147. package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +3 -3
  148. package/front_end/ui/components/text_editor/AiCodeGenerationUpgradeDialog.ts +1 -1
  149. package/front_end/ui/components/text_editor/TextEditor.ts +18 -6
  150. package/front_end/ui/components/text_editor/config.ts +3 -3
  151. package/front_end/ui/legacy/TabbedPane.ts +17 -1
  152. package/front_end/ui/legacy/TextPrompt.ts +80 -19
  153. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -0
  154. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -1
  155. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +2 -5
  156. package/front_end/ui/legacy/components/source_frame/ImageView.ts +11 -4
  157. package/front_end/ui/legacy/components/utils/Linkifier.ts +29 -17
  158. package/front_end/ui/legacy/listWidget.css +1 -6
  159. package/front_end/ui/settings/EmulationSettings.ts +91 -0
  160. package/front_end/ui/settings/LayerViewerSettings.ts +14 -0
  161. package/front_end/ui/settings/SourcesSettings.ts +58 -0
  162. package/front_end/ui/settings/TimelineSettings.ts +131 -0
  163. package/front_end/ui/settings/settings.ts +4 -0
  164. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  165. package/package.json +1 -1
@@ -10,17 +10,21 @@ Use it for self-review before upload and for reviewing other people's CLs.
10
10
 
11
11
  ## 1. Gather context
12
12
 
13
- - **Local change:** `git diff origin/main...HEAD` (or `git show HEAD` for a
14
- single-commit branch). To learn about the branch and upload workflow, see the
15
- `devtools-version-control` skill.
16
- - **Gerrit CL:** strip the leading `)]}'` line from each response to get JSON:
17
- - Diff: `git cl diff` (for the current branch), or fetch the patch set.
18
- - Inline comments:
19
- `curl -s https://chromium-review.googlesource.com/changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/comments | tail -n +2`
20
- - Messages:
21
- `.../changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/messages`
22
- - Read the CL description first. Then check that the diff does what the
23
- description says, and nothing else.
13
+ - **Automated Review Agent (diff already in prompt):** Do not run shell
14
+ commands. Use `read_file` to inspect enclosing classes/functions/tests and
15
+ `search_files` to verify callers or conventions across the repository.
16
+ - **Local CLI / Interactive session (no diff in prompt):**
17
+ - **Local change:** `git diff origin/main...HEAD` (or `git show HEAD` for a
18
+ single-commit branch). To learn about the branch and upload workflow, see the
19
+ `devtools-version-control` skill.
20
+ - **Gerrit CL:** strip the leading `)]}'` line from each response to get JSON:
21
+ - Diff: `git cl diff` (for the current branch), or fetch the patch set.
22
+ - Inline comments:
23
+ `curl -s https://chromium-review.googlesource.com/changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/comments | tail -n +2`
24
+ - Messages:
25
+ `.../changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/messages`
26
+ - Read the CL description first. Then check that the diff does what the
27
+ description says, and nothing else.
24
28
 
25
29
  ## 2. Consult the specialized skills
26
30
 
@@ -29,7 +33,7 @@ Load the skill that matches what the diff touches, and apply its rules:
29
33
  | If the diff touches… | Use skill |
30
34
  | :--- | :--- |
31
35
  | Any `import` statement, or a new cross-module dependency | `devtools-imports` |
32
- | `UI.Widget`, lit-html views, components, CSS | `devtools-ui-widgets` |
36
+ | `UI.Widget`, lit-html views, components, CSS | `ui-widgets` |
33
37
  | Migration of legacy imperative DOM to widgets or Lit | `ui-eng-vision-orchestrator` (and its sub-skills) |
34
38
  | New or changed tests: choosing unit, API, or E2E | `devtools-testing-guidance` |
35
39
  | Tests that use `describeWithEnvironment` or `describeWithMockConnection`, or foundation modules | `foundation-test-migration` |
package/AUTHORS CHANGED
@@ -60,6 +60,7 @@ Jan Keitel <jan.keitel@gmail.com>
60
60
  Jeffrey Chen <jeffreyca16@gmail.com>
61
61
  Jerome Vouillon <jerome.vouillon@gmail.com>
62
62
  Jesper van den Ende <jespertheend@gmail.com>
63
+ Jihyeon Lee <wlgus7464@gmail.com>
63
64
  Jithil p Ponnan <jithil.p@gmail.com>
64
65
  Joseph P <thepigrammer@gmail.com>
65
66
  Juba Borgohain <chromiumjuba@gmail.com>
@@ -107,6 +108,7 @@ Sergio Avalos <sergio.avalos@gmail.com>
107
108
  Shelley Vohr <shelley.vohr@gmail.com>
108
109
  Simon Siefke <simon.siefke@gmail.com>
109
110
  Stephen Tsoi-A-Sue <stsoiasue@gmail.com>
111
+ Steve Harrison <steve@steveharrison.dev>
110
112
  Sunnylost <sunnylost@gmail.com>
111
113
  Suyoung Jung <tdhitbtd@gmail.com>
112
114
  TaegeonKim <aksen5240@gmail.com>
package/DIR_METADATA CHANGED
@@ -2,3 +2,39 @@ team_email: "devtools-dev@chromium.org"
2
2
  buganizer_public: {
3
3
  component_id: 1457055
4
4
  }
5
+ agentic_review: {
6
+ capability_groups: {
7
+ name: "core-review"
8
+ review_capability_skills: [".agents/skills/code-review/SKILL.md"]
9
+ }
10
+ capability_groups: {
11
+ name: "typescript-and-models"
12
+ path_expression: ["front_end/.*\\.ts", ".*BUILD\\.gn", ".*\\.gni"]
13
+ path_expression_exclusion: [".*\\.test\\.ts"]
14
+ review_capability_skills: [
15
+ ".agents/skills/devtools-imports/SKILL.md",
16
+ ".agents/skills/devtools-model-management/SKILL.md",
17
+ ".agents/skills/devtools-setting-migration/SKILL.md",
18
+ ".agents/skills/devtools-unicode-escaping/SKILL.md",
19
+ ".agents/skills/devtools-ux-writing-refactor/SKILL.md"
20
+ ]
21
+ }
22
+ capability_groups: {
23
+ name: "ui-and-widgets"
24
+ path_expression: ["front_end/(panels|ui)/.*\\.(ts|css)"]
25
+ path_expression_exclusion: [".*\\.test\\.ts"]
26
+ review_capability_skills: [
27
+ ".agents/skills/ui-widgets/SKILL.md",
28
+ ".agents/skills/ui-eng-vision-orchestrator/SKILL.md"
29
+ ]
30
+ }
31
+ capability_groups: {
32
+ name: "tests"
33
+ path_expression: [".*\\.test\\.ts", "test/.*\\.ts"]
34
+ review_capability_skills: [
35
+ ".agents/skills/devtools-testing-guidance/SKILL.md",
36
+ ".agents/skills/foundation-test-migration/SKILL.md",
37
+ ".agents/skills/fix-tests/SKILL.md"
38
+ ]
39
+ }
40
+ }
@@ -57,26 +57,34 @@ const WEB_SAFE_SCHEMES = new Set([
57
57
  'data:',
58
58
  ]);
59
59
 
60
- /**
61
- * Returns true if the URL uses an unprivileged web-safe scheme (or is a `blob:` URL wrapping one).
62
- */
63
- export function hasWebSafeScheme(url: Platform.DevToolsPath.UrlString|URL|string): boolean {
60
+ function parseUnwrappedURL(url: Platform.DevToolsPath.UrlString|URL|string): URL|null {
64
61
  try {
65
- const parsed = new URL(url);
66
- if (parsed.protocol === 'blob:') {
67
- return hasWebSafeScheme(parsed.pathname);
62
+ let parsed = new URL(url);
63
+ // Iteratively unwrap nested `blob:` and `filesystem:` URLs (e.g. `blob:filesystem:https://...`)
64
+ // to inspect the underlying origin's protocol.
65
+ while (parsed.protocol === 'blob:' || parsed.protocol === 'filesystem:') {
66
+ parsed = new URL(parsed.href.slice(parsed.protocol.length));
68
67
  }
69
- return WEB_SAFE_SCHEMES.has(parsed.protocol);
68
+ return parsed;
70
69
  } catch {
71
- return false;
70
+ return null;
72
71
  }
73
72
  }
74
73
 
74
+ /**
75
+ * Returns true if the URL uses an unprivileged web-safe scheme (or is a `blob:`/`filesystem:` URL wrapping one).
76
+ */
77
+ export function hasWebSafeScheme(url: Platform.DevToolsPath.UrlString|URL|string): boolean {
78
+ const parsed = parseUnwrappedURL(url);
79
+ return parsed !== null && WEB_SAFE_SCHEMES.has(parsed.protocol);
80
+ }
81
+
75
82
  /**
76
83
  * Privileged browser and local schemes that must not be opened via external/new-tab links by default.
77
84
  */
78
85
  const PRIVILEGED_SCHEMES = new Set([
79
86
  'chrome:',
87
+ 'chrome-error:',
80
88
  'chrome-extension:',
81
89
  'chrome-search:',
82
90
  'chrome-untrusted:',
@@ -86,18 +94,11 @@ const PRIVILEGED_SCHEMES = new Set([
86
94
  ]);
87
95
 
88
96
  /**
89
- * Returns true if the URL uses a privileged scheme (or is a `blob:` URL wrapping one).
97
+ * Returns true if the URL uses a privileged scheme (or is a `blob:`/`filesystem:` URL wrapping one).
90
98
  */
91
99
  export function isPrivilegedScheme(url: Platform.DevToolsPath.UrlString|URL|string): boolean {
92
- try {
93
- const parsed = new URL(url);
94
- if (parsed.protocol === 'blob:') {
95
- return isPrivilegedScheme(parsed.pathname);
96
- }
97
- return PRIVILEGED_SCHEMES.has(parsed.protocol);
98
- } catch {
99
- return false;
100
- }
100
+ const parsed = parseUnwrappedURL(url);
101
+ return parsed !== null && PRIVILEGED_SCHEMES.has(parsed.protocol);
101
102
  }
102
103
 
103
104
  /**
@@ -19,11 +19,11 @@ const UIStrings = {
19
19
  /**
20
20
  * @description Error message for when a CSS file can't be loaded.
21
21
  */
22
- couldNotFindTheOriginalStyle: 'Could not find the original style sheet',
22
+ couldNotFindTheOriginalStyle: 'Couldn’t find the original style sheet',
23
23
  /**
24
24
  * @description Error message to display when a source CSS file could not be retrieved.
25
25
  */
26
- couldNotRetrieveSourceStyles: 'Could not retrieve source styles',
26
+ couldNotRetrieveSourceStyles: 'Couldn’t retrieve source styles',
27
27
  } as const;
28
28
  const str_ = i18n.i18n.registerUIStrings('core/sdk/CSSStyleSheetHeader.ts', UIStrings);
29
29
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -15,7 +15,7 @@ const UIStrings = {
15
15
  * @example {https://example.com/sourcemap.map} PH1
16
16
  * @example {An error occurred} PH2
17
17
  */
18
- couldNotLoadContentForSS: 'Could not load content for {PH1} ({PH2})',
18
+ couldNotLoadContentForSS: 'Couldn’t load content for {PH1} ({PH2})',
19
19
  } as const;
20
20
 
21
21
  const str_ = i18n.i18n.registerUIStrings('core/sdk/CompilerSourceMappingContentProvider.ts', UIStrings);
@@ -1100,8 +1100,9 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
1100
1100
  */
1101
1101
  async toggleHideElement(): Promise<void> {
1102
1102
  let pseudoElementName = this.pseudoType() ? this.nodeName() : null;
1103
- if (pseudoElementName && this.pseudoIdentifier()) {
1104
- pseudoElementName += `(${this.pseudoIdentifier()})`;
1103
+ const pseudoIdentifier = this.pseudoIdentifier();
1104
+ if (pseudoElementName && pseudoIdentifier) {
1105
+ pseudoElementName += `(${cssEscape(pseudoIdentifier)})`;
1105
1106
  }
1106
1107
 
1107
1108
  let effectiveNode: DOMNode|null = this;
@@ -1358,8 +1359,9 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
1358
1359
  const classList = classes.trim().split(/\s+/g);
1359
1360
  return (lowerCaseName === 'div' ? '' : lowerCaseName) + '.' + classList.map(cls => cssEscape(cls)).join('.');
1360
1361
  }
1361
- if (this.pseudoIdentifier()) {
1362
- return `${lowerCaseName}(${this.pseudoIdentifier()})`;
1362
+ const pseudoIdentifier = this.pseudoIdentifier();
1363
+ if (pseudoIdentifier) {
1364
+ return `${lowerCaseName}(${cssEscape(pseudoIdentifier)})`;
1363
1365
  }
1364
1366
  return lowerCaseName;
1365
1367
  }
@@ -30,11 +30,11 @@ const UIStrings = {
30
30
  /**
31
31
  * @description Tooltip to explain why a cookie was blocked.
32
32
  */
33
- secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure',
33
+ secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection wasn’t secure',
34
34
  /**
35
35
  * @description Tooltip to explain why a cookie was blocked.
36
36
  */
37
- notOnPath: 'This cookie was blocked because its path was not an exact match for or a superdirectory of the request URL’s path',
37
+ notOnPath: 'This cookie was blocked because its path wasn’t an exact match for or a superdirectory of the request URL’s path',
38
38
  /**
39
39
  * @description Tooltip to explain why a cookie was blocked.
40
40
  */
@@ -46,15 +46,15 @@ const UIStrings = {
46
46
  /**
47
47
  * @description Tooltip to explain why a cookie was blocked.
48
48
  */
49
- sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation',
49
+ sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and wasn’t initiated by a top-level navigation',
50
50
  /**
51
51
  * @description Tooltip to explain why a cookie was blocked.
52
52
  */
53
- sameSiteUnspecifiedTreatedAsLax: 'This cookie didn’t specify a "`SameSite`" attribute when it was stored and was defaulted to "`SameSite=Lax`", and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',
53
+ sameSiteUnspecifiedTreatedAsLax: 'This cookie didn’t specify a "`SameSite`" attribute when it was stored and was defaulted to "`SameSite=Lax`", and was blocked because the request was made from a different site and wasn’t initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',
54
54
  /**
55
55
  * @description Tooltip to explain why a cookie was blocked.
56
56
  */
57
- sameSiteNoneInsecure: 'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "`Secure`". Cookies without SameSite restrictions must be marked "`Secure`" and sent over a secure connection.',
57
+ sameSiteNoneInsecure: 'This cookie was blocked because it had the "`SameSite=None`" attribute but wasn’t marked "`Secure`". Cookies without SameSite restrictions must be marked "`Secure`" and sent over a secure connection.',
58
58
  /**
59
59
  * @description Tooltip to explain why a cookie was blocked.
60
60
  */
@@ -90,7 +90,7 @@ const UIStrings = {
90
90
  /**
91
91
  * @description Tooltip to explain why a cookie was blocked.
92
92
  */
93
- theSchemeOfThisConnectionIsNot: 'The scheme of this connection is not allowed to store cookies',
93
+ theSchemeOfThisConnectionIsNot: 'The scheme of this connection isn’t allowed to store cookies',
94
94
  /**
95
95
  * @description Tooltip to explain why a cookie was blocked.
96
96
  */
@@ -98,24 +98,24 @@ const UIStrings = {
98
98
  /**
99
99
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
100
100
  */
101
- blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but was not received over a secure connection',
101
+ blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but wasn’t received over a secure connection',
102
102
  /**
103
103
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
104
104
  * @example {SameSite=Strict} PH1
105
105
  */
106
- blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation',
106
+ blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which wasn’t the response to a top-level navigation',
107
107
  /**
108
108
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
109
109
  */
110
- blockedReasonSameSiteUnspecifiedTreatedAsLax: 'This "`Set-Cookie`" header didn’t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax`", and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The "`Set-Cookie`" header had to have been set with "`SameSite=None`" to enable cross-site usage.',
110
+ blockedReasonSameSiteUnspecifiedTreatedAsLax: 'This "`Set-Cookie`" header didn’t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax`", and was blocked because it came from a cross-site response which wasn’t the response to a top-level navigation. The "`Set-Cookie`" header had to have been set with "`SameSite=None`" to enable cross-site usage.',
111
111
  /**
112
112
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
113
113
  */
114
- blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but did not have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"',
114
+ blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but didn’t have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"',
115
115
  /**
116
116
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
117
117
  */
118
- blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute',
118
+ blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it wasn’t sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute',
119
119
  /**
120
120
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
121
121
  */
@@ -109,7 +109,7 @@ export function toggleClassAndInjectStyleRule(this: Element, pseudoElementName:
109
109
  const classNamePrefix = '__web-inspector-hide';
110
110
  const classNameSuffix = '-shortcut__';
111
111
  const styleTagId = '__web-inspector-hide-shortcut-style__';
112
- const pseudoElementNameEscaped = pseudoElementName ? pseudoElementName.replace(/[\(\)\:]/g, '_') : '';
112
+ const pseudoElementNameEscaped = pseudoElementName ? pseudoElementName.replace(/[^a-zA-Z0-9_-]/g, '_') : '';
113
113
  const className = classNamePrefix + pseudoElementNameEscaped + classNameSuffix;
114
114
  this.classList.toggle(className, hidden);
115
115
 
@@ -291,6 +291,21 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
291
291
  this.dispatchEventToListeners(Events.FrameNavigatedWithinDocument, frame);
292
292
  }
293
293
 
294
+ frameStoppedLoading(frameId: Protocol.Page.FrameId): void {
295
+ const frame = this.framesInternal.get(frameId);
296
+ if (!frame) {
297
+ return;
298
+ }
299
+ // The renderer sends `Page.frameNavigated` before it tells the browser
300
+ // process about the commit, so the `Storage.getStorageKey` request issued
301
+ // from `ResourceTreeFrame.navigate()` may be answered for the previous
302
+ // document (and fails outright if that document had an opaque origin, e.g.
303
+ // the initial about:blank). `Page.frameStoppedLoading` comes from the
304
+ // browser process after the commit, so re-fetch the storage key here.
305
+ void frame.getStorageKey(/* forceFetch */ true);
306
+ void this.updateStorageKeys();
307
+ }
308
+
294
309
  frameDetached(frameId: Protocol.Page.FrameId, isSwap: boolean): void {
295
310
  // Do nothing unless cached resource tree is processed - it will overwrite everything.
296
311
  if (!this.#cachedResourcesProcessed) {
@@ -1145,7 +1160,8 @@ export class PageDispatcher implements ProtocolProxyApi.PageDispatcher {
1145
1160
  frameStartedLoading({}: Protocol.Page.FrameStartedLoadingEvent): void {
1146
1161
  }
1147
1162
 
1148
- frameStoppedLoading({}: Protocol.Page.FrameStoppedLoadingEvent): void {
1163
+ frameStoppedLoading({frameId}: Protocol.Page.FrameStoppedLoadingEvent): void {
1164
+ this.#resourceTreeModel.frameStoppedLoading(frameId);
1149
1165
  }
1150
1166
 
1151
1167
  frameRequestedNavigation({}: Protocol.Page.FrameRequestedNavigationEvent): void {
@@ -905,6 +905,12 @@ export class SourceMap {
905
905
  return this.hasEncodedScopeInfo() && (this.#scopesInfo?.hasOutlinedFunctions() ?? false);
906
906
  }
907
907
 
908
+ /** See {@link SourceMapScopesInfo.outlinedFunctionRanges}. Empty without encoded scopes. */
909
+ outlinedFunctionRanges(generatedLine: number, generatedColumn: number): PositionRange[] {
910
+ return this.hasEncodedScopeInfo() ? this.#scopesInfo?.outlinedFunctionRanges(generatedLine, generatedColumn) ?? [] :
911
+ [];
912
+ }
913
+
908
914
  /** See {@link SourceMapScopesInfo.artificialFunctionRanges}. Empty without encoded scopes. */
909
915
  artificialFunctionRanges(): PositionRange[] {
910
916
  return this.hasEncodedScopeInfo() ? this.#scopesInfo?.artificialFunctionRanges() ?? [] : [];
@@ -624,6 +624,31 @@ export class SourceMapScopesInfo {
624
624
  return hasOutlined(this.#generatedRanges);
625
625
  }
626
626
 
627
+ /**
628
+ * @returns the outlined parts of the authored function at the position: the hidden generated functions whose
629
+ * original scope lies within that function's original scope (see {@link GeneratedFrameKind.OUTLINED}).
630
+ * Includes the outlined part the position itself is in, if any. Sorted by start position.
631
+ */
632
+ outlinedFunctionRanges(generatedLine: number, generatedColumn: number): PositionRange[] {
633
+ const rangeChain = this.#findGeneratedRangeChain(generatedLine, generatedColumn);
634
+ const functionScope = this.#findFunctionScopeInOriginalScopeChain(rangeChain.at(-1)?.originalScope);
635
+ if (!functionScope) {
636
+ return [];
637
+ }
638
+ const isWithinFunction = (scope: ScopesCodec.OriginalScope|undefined): boolean =>
639
+ scope !== undefined && (scope === functionScope || isWithinFunction(scope.parent));
640
+ const result: PositionRange[] = [];
641
+ (function walk(ranges: ScopesCodec.GeneratedRange[]) {
642
+ for (const range of ranges) {
643
+ if (range.isStackFrame && range.isHidden && isWithinFunction(range.originalScope)) {
644
+ result.push({start: range.start, end: range.end});
645
+ }
646
+ walk(range.children);
647
+ }
648
+ })(this.#generatedRanges);
649
+ return result;
650
+ }
651
+
627
652
  /**
628
653
  * @returns the "artificial" generated functions (in the DWARF sense): functions that contain no authored code at all
629
654
  * (no original scope anywhere in their subtree), e.g. compiler helpers. Sorted by start position,
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  /**
40
40
  * @description Title of an option under the Rendering category that can be invoked through the Command Menu.
41
41
  */
42
- doNotHighlightAdFrames: 'Do not highlight ad frames',
42
+ doNotHighlightAdFrames: 'Don’t highlight ad frames',
43
43
  /**
44
44
  * @description Title of an option under the Rendering category that can be invoked through the Command Menu.
45
45
  */
@@ -71,11 +71,11 @@ const UIStrings = {
71
71
  /**
72
72
  * @description Title of a Rendering setting that can be invoked through the Command Menu.
73
73
  */
74
- doNotEmulateAFocusedPage: 'Do not emulate a focused page',
74
+ doNotEmulateAFocusedPage: 'Don’t emulate a focused page',
75
75
  /**
76
76
  * @description Title of a setting under the Rendering category that can be invoked through the Command Menu.
77
77
  */
78
- doNotEmulateCssMediaType: 'Do not emulate CSS media type',
78
+ doNotEmulateCssMediaType: 'Don’t emulate CSS media type',
79
79
  /**
80
80
  * @description A drop-down menu option to do not emulate css media type.
81
81
  */
@@ -108,7 +108,7 @@ const UIStrings = {
108
108
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
109
109
  * @example {prefers-color-scheme} PH1
110
110
  */
111
- doNotEmulateCss: 'Do not emulate CSS {PH1}',
111
+ doNotEmulateCss: 'Don’t emulate CSS {PH1}',
112
112
  /**
113
113
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
114
114
  * @example {prefers-color-scheme: light} PH1
@@ -172,7 +172,7 @@ const UIStrings = {
172
172
  /**
173
173
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
174
174
  */
175
- doNotEmulateAnyVisionDeficiency: 'Do not emulate any vision deficiency',
175
+ doNotEmulateAnyVisionDeficiency: 'Don’t emulate any vision deficiency',
176
176
  /**
177
177
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
178
178
  */
@@ -232,7 +232,7 @@ const UIStrings = {
232
232
  /**
233
233
  * @description Title of a setting under the Rendering category that can be invoked through the Command Menu.
234
234
  */
235
- doNotEmulateOsTextScale: 'Do not emulate OS text scale',
235
+ doNotEmulateOsTextScale: 'Don’t emulate OS text scale',
236
236
  /**
237
237
  * @description A drop-down menu option to not emulate OS text scale.
238
238
  */
@@ -340,7 +340,7 @@ const UIStrings = {
340
340
  * @description A command available in the command menu to stop automatically opening DevTools when
341
341
  * webpages create new popup windows.
342
342
  */
343
- doNotAutoOpen: 'Do not auto-open DevTools for popups',
343
+ doNotAutoOpen: 'Don’t auto-open DevTools for popups',
344
344
  /**
345
345
  * @description Title of an action that toggles the "forces CSS prefers-color-scheme" media feature.
346
346
  */
@@ -257,6 +257,7 @@ inspectorBackend.registerCommand("CSS.disable", [], [], "Disables the CSS agent
257
257
  inspectorBackend.registerCommand("CSS.enable", [], [], "Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.");
258
258
  inspectorBackend.registerCommand("CSS.forcePseudoState", [{"name": "nodeId", "type": "number", "optional": false, "description": "The element id for which to force the pseudo state.", "typeRef": "DOM.NodeId"}, {"name": "forcedPseudoClasses", "type": "array", "optional": false, "description": "Element pseudo classes to force when computing the element's style.", "typeRef": "string"}], [], "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.");
259
259
  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.");
260
+ inspectorBackend.registerCommand("CSS.forcePositionTryOption", [{"name": "nodeId", "type": "number", "optional": false, "description": "The element id for which to force the position-try option.", "typeRef": "DOM.NodeId"}, {"name": "index", "type": "number", "optional": true, "description": "The 1-based index of the position-try fallback option, 0 for base position (no fallback), or omitted to clear the forced state.", "typeRef": null}], [], "Forces a position-try option for the given node.");
260
261
  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"], "");
261
262
  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`.");
262
263
  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.`");
@@ -1566,7 +1567,7 @@ inspectorBackend.registerCommand("Debugger.setSkipAllPauses", [{"name": "skip",
1566
1567
  inspectorBackend.registerCommand("Debugger.setVariableValue", [{"name": "scopeNumber", "type": "number", "optional": false, "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.", "typeRef": null}, {"name": "variableName", "type": "string", "optional": false, "description": "Variable name.", "typeRef": null}, {"name": "newValue", "type": "object", "optional": false, "description": "New variable value.", "typeRef": "Runtime.CallArgument"}, {"name": "callFrameId", "type": "string", "optional": false, "description": "Id of callframe that holds variable.", "typeRef": "Debugger.CallFrameId"}], [], "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.");
1567
1568
  inspectorBackend.registerCommand("Debugger.stepInto", [{"name": "breakOnAsyncCall", "type": "boolean", "optional": true, "description": "Debugger will pause on the execution of the first async task which was scheduled before next pause.", "typeRef": null}, {"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step into.", "typeRef": "Debugger.LocationRange"}], [], "Steps into the function call.");
1568
1569
  inspectorBackend.registerCommand("Debugger.stepOut", [], [], "Steps out of the function call.");
1569
- inspectorBackend.registerCommand("Debugger.stepOver", [{"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step over.", "typeRef": "Debugger.LocationRange"}], [], "Steps over the statement.");
1570
+ inspectorBackend.registerCommand("Debugger.stepOver", [{"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step over.", "typeRef": "Debugger.LocationRange"}, {"name": "enterRanges", "type": "array", "optional": true, "description": "Functions whose source range lies within one of the enterRanges are entered as if by stepInto, even when they are called (directly or indirectly) from a call that is stepped over.", "typeRef": "Debugger.LocationRange"}], [], "Steps over the statement.");
1570
1571
  inspectorBackend.registerType("Debugger.Location", [{"name": "scriptId", "type": "string", "optional": false, "description": "Script identifier as reported in the `Debugger.scriptParsed`.", "typeRef": "Runtime.ScriptId"}, {"name": "lineNumber", "type": "number", "optional": false, "description": "Line number in the script (0-based).", "typeRef": null}, {"name": "columnNumber", "type": "number", "optional": true, "description": "Column number in the script (0-based).", "typeRef": null}]);
1571
1572
  inspectorBackend.registerType("Debugger.ScriptPosition", [{"name": "lineNumber", "type": "number", "optional": false, "description": "", "typeRef": null}, {"name": "columnNumber", "type": "number", "optional": false, "description": "", "typeRef": null}]);
1572
1573
  inspectorBackend.registerType("Debugger.LocationRange", [{"name": "scriptId", "type": "string", "optional": false, "description": "", "typeRef": "Runtime.ScriptId"}, {"name": "start", "type": "object", "optional": false, "description": "", "typeRef": "Debugger.ScriptPosition"}, {"name": "end", "type": "object", "optional": false, "description": "", "typeRef": "Debugger.ScriptPosition"}]);
@@ -1567,6 +1567,13 @@ export namespace ProtocolMapping {
1567
1567
  paramsType: [Protocol.CSS.ForceStartingStyleRequest];
1568
1568
  returnType: void;
1569
1569
  };
1570
+ /**
1571
+ * Forces a position-try option for the given node.
1572
+ */
1573
+ 'CSS.forcePositionTryOption': {
1574
+ paramsType: [Protocol.CSS.ForcePositionTryOptionRequest];
1575
+ returnType: void;
1576
+ };
1570
1577
  'CSS.getBackgroundColors': {
1571
1578
  paramsType: [Protocol.CSS.GetBackgroundColorsRequest];
1572
1579
  returnType: Protocol.CSS.GetBackgroundColorsResponse;
@@ -796,6 +796,11 @@ declare namespace ProtocolProxyApi {
796
796
  */
797
797
  invoke_forceStartingStyle(params: Protocol.CSS.ForceStartingStyleRequest): Promise<Protocol.ProtocolResponseWithError>;
798
798
 
799
+ /**
800
+ * Forces a position-try option for the given node.
801
+ */
802
+ invoke_forcePositionTryOption(params: Protocol.CSS.ForcePositionTryOptionRequest): Promise<Protocol.ProtocolResponseWithError>;
803
+
799
804
  invoke_getBackgroundColors(params: Protocol.CSS.GetBackgroundColorsRequest): Promise<Protocol.CSS.GetBackgroundColorsResponse>;
800
805
 
801
806
  /**
@@ -4066,6 +4066,18 @@ export namespace CSS {
4066
4066
  forced: boolean;
4067
4067
  }
4068
4068
 
4069
+ export interface ForcePositionTryOptionRequest {
4070
+ /**
4071
+ * The element id for which to force the position-try option.
4072
+ */
4073
+ nodeId: DOM.NodeId;
4074
+ /**
4075
+ * The 1-based index of the position-try fallback option, 0 for base position (no fallback),
4076
+ * or omitted to clear the forced state.
4077
+ */
4078
+ index?: integer;
4079
+ }
4080
+
4069
4081
  export interface GetBackgroundColorsRequest {
4070
4082
  /**
4071
4083
  * Id of the node to get background colors for.
@@ -21393,6 +21405,12 @@ export namespace Debugger {
21393
21405
  * The skipList specifies location ranges that should be skipped on step over.
21394
21406
  */
21395
21407
  skipList?: LocationRange[];
21408
+ /**
21409
+ * Functions whose source range lies within one of the enterRanges are
21410
+ * entered as if by stepInto, even when they are called (directly or
21411
+ * indirectly) from a call that is stepped over.
21412
+ */
21413
+ enterRanges?: LocationRange[];
21396
21414
  }
21397
21415
 
21398
21416
  /**
@@ -189,7 +189,7 @@ export interface ParsedAnswer {
189
189
 
190
190
  export type ParsedResponse = ParsedAnswer;
191
191
 
192
- export const MAX_STEPS = 10;
192
+ export const MAX_STEPS = 20;
193
193
 
194
194
  export interface ConversationSuggestion {
195
195
  title: string;
@@ -519,8 +519,6 @@ class CrossOriginError extends Error {
519
519
  *
520
520
  * TODO: missing a test that action code is yielded before the
521
521
  * confirmation dialog.
522
- * TODO: missing a test for an error if it took
523
- * more than MAX_STEPS iterations.
524
522
  */
525
523
  export abstract class AiAgent<T> {
526
524
  /**
@@ -994,7 +992,12 @@ export abstract class AiAgent<T> {
994
992
  break;
995
993
  }
996
994
  } else {
997
- yield this.#createErrorResponse(i - 1 === MAX_STEPS ? ErrorType.MAX_STEPS : ErrorType.UNKNOWN);
995
+ yield this.#createErrorResponse(ErrorType.UNKNOWN);
996
+ break;
997
+ }
998
+
999
+ if (i === MAX_STEPS - 1) {
1000
+ yield this.#createErrorResponse(ErrorType.MAX_STEPS);
998
1001
  break;
999
1002
  }
1000
1003
  }
@@ -47,6 +47,7 @@ First, examine the provided context, then use the functions to gather additional
47
47
  * After applying a fix, please ask the user to confirm if the fix worked or not.
48
48
  * ALWAYS OUTPUT a list of follow-up queries at the end of your text response. The format is SUGGESTIONS: ["suggestion1", "suggestion2", "suggestion3"]. Make sure that the array and the \`SUGGESTIONS: \` text is in the same line. You're also capable of executing the fix for the issue user mentioned. Reflect this in your suggestions.
49
49
  * Use the precision of Strunk & White, the brevity of Hemingway, and the simple clarity of Vonnegut. Don't add repeated information, and keep the whole answer short.
50
+ * If the target element is in a cross-origin iframe, stop and ask the user to select it in the Elements panel and start a new chat with that context.
50
51
  * **CRITICAL** NEVER write full Python programs - you should only write individual statements that invoke a single function from the provided library.
51
52
  * **CRITICAL** NEVER output text before a function call. Always do a function call first.
52
53
  * **CRITICAL** When answering questions about positioning or layout, ALWAYS inspect \`position\`, \`display\` and all other related properties. You MUST provide a specific list of CSS property names when calling functions to get styles. Do not use generic values like "all" or "*".
@@ -34,6 +34,11 @@ Lighthouse Version: 1.0.0
34
34
 
35
35
  ## Category Scores
36
36
  - Accessibility: 50
37
+
38
+ ## Failing audits
39
+
40
+ ### Accessibility (categoryId: "accessibility")
41
+ - Accessibility Audit: 50
37
42
  === end content
38
43
 
39
44
  Title: LighthouseContext with AI V2 architecture enabled returns the report summary as user facing details
@@ -41,7 +46,7 @@ Content:
41
46
  [
42
47
  {
43
48
  "title": "Lighthouse report",
44
- "text": "# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50"
49
+ "text": "# Lighthouse Report Summary\nURL: https://example.com\nFetch Time: 2026-03-12\nLighthouse Version: 1.0.0\n\n## Category Scores\n- Accessibility: 50\n\n## Failing audits\n\n### Accessibility (categoryId: \"accessibility\")\n- Accessibility Audit: 50"
45
50
  }
46
51
  ]
47
52
  === end content
@@ -58,8 +58,9 @@ export class LighthouseContext extends ConversationContext<LHModel.ReporterTypes
58
58
  this.#cachedPayload =
59
59
  '**CRITICAL**: The Lighthouse report failed to record or all category scores are error/unavailable (n/a). This indicates a failed run or missing data.';
60
60
  } else if (Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled) {
61
- // AI V2 sends only the summary; the agent fetches category audits on demand via `getLighthouseAudits`.
62
- this.#cachedPayload = formatter.summary(this.#lh);
61
+ // AI V2 sends failing audit titles without their details to keep the prompt small. The agent
62
+ // uses the category IDs in the list to fetch full details with `getLighthouseAudits`.
63
+ this.#cachedPayload = `${formatter.summary(this.#lh)}\n\n${formatter.failingAuditsSummary(this.#lh)}`;
63
64
  } else {
64
65
  // The V1 `AccessibilityAgent` expects the accessibility audits up front. Remove this branch with V1.
65
66
  this.#cachedPayload =
@@ -133,3 +133,14 @@ The following audits in this category have a score below 90 and may need attenti
133
133
  * **Resource Size**: 22.2 kB
134
134
  * **Est Savings**: 16.9 kB
135
135
  === end content
136
+
137
+ Title: LighthouseFormatter lists failing audits grouped by category with the category ID
138
+ Content:
139
+ ## Failing audits
140
+
141
+ ### Performance (categoryId: "performance")
142
+ - First Audit: 80
143
+
144
+ ### Accessibility (categoryId: "accessibility")
145
+ - No failing audits.
146
+ === end content