chrome-devtools-frontend 1.0.1547147 → 1.0.1548870

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 (212) hide show
  1. package/.stylelintrc.json +5 -1
  2. package/docs/contributing/infrastructure.md +2 -2
  3. package/eslint.config.mjs +3 -2
  4. package/front_end/Images/generate-css-vars.js +1 -1
  5. package/front_end/core/common/common.ts +0 -2
  6. package/front_end/core/i18n/collect-ui-strings.js +1 -1
  7. package/front_end/core/i18n/generate-locales-js.js +1 -1
  8. package/front_end/core/platform/HostRuntime.ts +14 -7
  9. package/front_end/core/platform/api/HostRuntime.ts +28 -3
  10. package/front_end/core/platform/browser/HostRuntime.ts +66 -5
  11. package/front_end/core/platform/node/HostRuntime.ts +76 -4
  12. package/front_end/core/sdk/AnimationModel.ts +1 -1
  13. package/front_end/core/sdk/CSSModel.ts +1 -1
  14. package/front_end/core/sdk/CSSProperty.ts +1 -1
  15. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +1 -1
  16. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  17. package/front_end/core/sdk/Cookie.ts +1 -1
  18. package/front_end/core/sdk/DOMModel.ts +2 -2
  19. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  20. package/front_end/core/sdk/NetworkManager.ts +6 -0
  21. package/front_end/core/sdk/PreloadingModel.ts +1 -1
  22. package/front_end/core/sdk/RemoteObject.ts +1 -1
  23. package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
  24. package/front_end/core/sdk/Script.ts +4 -4
  25. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +2 -2
  26. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +15 -18
  27. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +8 -5
  28. package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
  29. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  30. package/front_end/generated/Deprecation.ts +19 -0
  31. package/front_end/generated/InspectorBackendCommands.ts +4 -3
  32. package/front_end/generated/SupportedCSSProperties.js +13 -13
  33. package/front_end/generated/protocol-mapping.d.ts +2 -0
  34. package/front_end/generated/protocol-proxy-api.d.ts +4 -0
  35. package/front_end/generated/protocol.ts +16 -27
  36. package/front_end/models/ai_assistance/AiConversation.ts +104 -24
  37. package/front_end/models/ai_assistance/BuiltInAi.ts +131 -134
  38. package/front_end/models/ai_assistance/ChangeManager.ts +9 -0
  39. package/front_end/models/ai_assistance/ConversationHandler.ts +23 -48
  40. package/front_end/models/ai_assistance/agents/AiAgent.ts +8 -5
  41. package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -10
  42. package/front_end/models/formatter/FormatterWorkerPool.ts +9 -7
  43. package/front_end/models/har/Importer.ts +1 -1
  44. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
  45. package/front_end/models/persistence/AutomaticFileSystemManager.ts +1 -1
  46. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  47. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +80 -153
  48. package/front_end/panels/ai_assistance/components/ChatView.ts +54 -31
  49. package/front_end/panels/application/ExtensionStorageModel.ts +1 -1
  50. package/front_end/panels/application/FrameDetailsView.ts +62 -34
  51. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  52. package/front_end/panels/application/components/components.ts +0 -2
  53. package/front_end/panels/console/ConsoleInsightTeaser.ts +166 -100
  54. package/front_end/panels/console/ConsolePrompt.ts +1 -1
  55. package/front_end/panels/console/ConsoleViewMessage.ts +77 -29
  56. package/front_end/panels/console/ConsoleViewport.ts +1 -1
  57. package/front_end/panels/console/consoleInsightTeaser.css +1 -0
  58. package/front_end/panels/coverage/CoverageModel.ts +2 -2
  59. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  60. package/front_end/panels/elements/ElementsTreeOutline.ts +17 -7
  61. package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -5
  62. package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -2
  63. package/front_end/panels/explain/components/ConsoleInsight.ts +1 -1
  64. package/front_end/panels/network/RequestConditionsDrawer.ts +64 -20
  65. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  66. package/front_end/panels/profiler/HeapSnapshotProxy.ts +15 -14
  67. package/front_end/panels/recorder/components/StepEditor.ts +1 -1
  68. package/front_end/panels/security/SecurityPanelSidebar.ts +1 -3
  69. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  70. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  71. package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
  72. package/front_end/panels/sources/NavigatorView.ts +1 -1
  73. package/front_end/panels/sources/SourcesSearchScope.ts +1 -1
  74. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +10 -2
  75. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  76. package/front_end/panels/timeline/TimelinePanel.ts +7 -7
  77. package/front_end/panels/timeline/TimelineUIUtils.ts +3 -1
  78. package/front_end/panels/timeline/enable-easter-egg.js +1 -1
  79. package/front_end/panels/timeline/utils/Treemap.ts +1 -1
  80. package/front_end/third_party/chromium/README.chromium +1 -1
  81. package/front_end/third_party/puppeteer/README.chromium +2 -2
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +57 -0
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +1 -6
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +0 -4
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +18 -23
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +16 -0
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +9 -73
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -3
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -10
  130. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +80 -81
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +66 -0
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +52 -0
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +1 -6
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +0 -4
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +18 -23
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +2 -0
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +16 -0
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +4 -62
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +6 -69
  159. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -3
  166. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
  168. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  170. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  172. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  173. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -10
  177. package/front_end/third_party/puppeteer/package/package.json +3 -3
  178. package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +79 -0
  179. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +1 -1
  180. package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
  181. package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
  182. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +1 -9
  183. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -31
  184. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +18 -0
  185. package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +6 -72
  186. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -4
  187. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +7 -2
  188. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +14 -0
  189. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  190. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  191. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
  192. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +4 -0
  193. package/front_end/ui/components/text_editor/javascript.ts +1 -1
  194. package/front_end/ui/legacy/ListWidget.ts +51 -18
  195. package/front_end/ui/legacy/ReportView.ts +1 -1
  196. package/front_end/ui/legacy/TabbedPane.ts +3 -3
  197. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  198. package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +1 -1
  199. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -2
  200. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +87 -111
  201. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -2
  202. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +40 -11
  203. package/front_end/ui/legacy/components/utils/jsUtils.css +28 -0
  204. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  205. package/front_end/ui/visual_logging/LoggingConfig.ts +2 -1
  206. package/inspector_overlay/tool_window_controls.ts +4 -1
  207. package/mcp/mcp.ts +1 -1
  208. package/package.json +2 -3
  209. package/front_end/core/common/Worker.ts +0 -60
  210. package/front_end/panels/application/components/StackTrace.ts +0 -238
  211. package/front_end/panels/application/components/stackTraceLinkButton.css +0 -16
  212. package/front_end/panels/application/components/stackTraceRow.css +0 -50
@@ -223,6 +223,14 @@ const UIStrings = {
223
223
  * @description Tooltip shown when user hovers over the cookie icon to explain that the button will bring the user to the cookie report
224
224
  */
225
225
  SeeIssueInCookieReport: 'Click to open privacy and security panel and show third-party cookie report',
226
+ /**
227
+ * @description Element text content in Object Properties Section
228
+ */
229
+ dots: '(...)',
230
+ /**
231
+ * @description Element title in Object Properties Section
232
+ */
233
+ invokePropertyGetter: 'Invoke property getter',
226
234
  } as const;
227
235
  const str_ = i18n.i18n.registerUIStrings('panels/console/ConsoleViewMessage.ts', UIStrings);
228
236
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -282,6 +290,14 @@ const hoverButtonObserver = new IntersectionObserver(results => {
282
290
  }
283
291
  });
284
292
 
293
+ function appendOrShow(parent: Element, child: DocumentFragment|UI.Widget.Widget): void {
294
+ if (child instanceof UI.Widget.Widget) {
295
+ child.show(parent, null, /* suppressOprhanWidgetError=*/ true);
296
+ } else {
297
+ parent.appendChild(child);
298
+ }
299
+ }
300
+
285
301
  export class ConsoleViewMessage implements ConsoleViewportElement {
286
302
  protected message: SDK.ConsoleModel.ConsoleMessage;
287
303
  private readonly linkifier: Components.Linkifier.Linkifier;
@@ -452,7 +468,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
452
468
  if (this.message.type === Protocol.Runtime.ConsoleAPICalledEventType.Assert) {
453
469
  this.messagePrefix = i18nString(UIStrings.assertionFailed);
454
470
  }
455
- if (this.message.parameters && this.message.parameters.length === 1) {
471
+ if (this.message.parameters?.length === 1) {
456
472
  const parameter = this.message.parameters[0];
457
473
  if (typeof parameter !== 'string' && parameter.type === 'string') {
458
474
  messageElement = this.tryFormatAsError((parameter.value as string));
@@ -528,7 +544,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
528
544
  this.selectableChildren.push({element: linkElement, forceSelect: () => linkElement.focus()});
529
545
  return linkElement;
530
546
  });
531
- messageElement.appendChild(fragment);
547
+ appendOrShow(messageElement, fragment);
532
548
  }
533
549
  return messageElement;
534
550
  }
@@ -767,7 +783,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
767
783
  for (let i = 0; i < parameters.length; ++i) {
768
784
  // Inline strings when formatting.
769
785
  if (shouldFormatMessage && parameters[i].type === 'string') {
770
- formattedResult.appendChild(this.linkifyStringAsFragment(parameters[i].description || ''));
786
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(parameters[i].description || ''));
771
787
  } else {
772
788
  formattedResult.appendChild(this.formatParameter(parameters[i], false, true));
773
789
  }
@@ -843,9 +859,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
843
859
  const result = document.createElement('span');
844
860
  const description = obj.description || '';
845
861
  if (description.length > getMaxTokenizableStringLength()) {
846
- const propertyValue =
847
- new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(description, getLongStringVisibleLength());
848
- result.appendChild(propertyValue.element);
862
+ const propertyValue = new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue();
863
+ propertyValue.text = description;
864
+ propertyValue.maxLength = getLongStringVisibleLength();
865
+ propertyValue.show(result, null, /* suppressOprhanWidgetError=*/ true);
849
866
  } else {
850
867
  UI.UIUtils.createTextChild(result, description);
851
868
  }
@@ -982,7 +999,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
982
999
  const text = Platform.StringUtilities.formatAsJSLiteral(description);
983
1000
  const result = document.createElement('span');
984
1001
  result.addEventListener('contextmenu', this.contextMenuEventFired.bind(this, output), false);
985
- result.appendChild(this.linkifyStringAsFragment(text));
1002
+ appendOrShow(result, this.linkifyStringAsFragment(text));
986
1003
  return result;
987
1004
  }
988
1005
 
@@ -999,7 +1016,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
999
1016
  let errorElement = this.tryFormatAsError(error.errorStack, details);
1000
1017
  if (!errorElement) {
1001
1018
  errorElement = document.createElement('span');
1002
- errorElement.append(this.linkifyStringAsFragment(error.errorStack));
1019
+ appendOrShow(errorElement, this.linkifyStringAsFragment(error.errorStack));
1003
1020
  }
1004
1021
 
1005
1022
  if (includeCausedByPrefix) {
@@ -1010,9 +1027,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1010
1027
  result.appendChild(errorElement);
1011
1028
  }
1012
1029
 
1013
- if (cause && cause.subtype === 'error') {
1030
+ if (cause?.subtype === 'error') {
1014
1031
  await formatErrorStack(cause, /* includeCausedByPrefix */ true);
1015
- } else if (cause && cause.type === 'string') {
1032
+ } else if (cause?.type === 'string') {
1016
1033
  const stringCauseElement = document.createElement('div');
1017
1034
  stringCauseElement.append(`Caused by: ${cause.value}`);
1018
1035
  result.append(stringCauseElement);
@@ -1037,11 +1054,43 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1037
1054
  return fragment;
1038
1055
  }
1039
1056
 
1057
+ createRemoteObjectAccessorPropertySpan(
1058
+ object: SDK.RemoteObject.RemoteObject|null, propertyPath: string[],
1059
+ callback: (arg0: SDK.RemoteObject.CallFunctionResult) => void): HTMLElement {
1060
+ const rootElement = document.createElement('span');
1061
+ const element = rootElement.createChild('span');
1062
+ element.textContent = i18nString(UIStrings.dots);
1063
+ if (!object) {
1064
+ return rootElement;
1065
+ }
1066
+ element.classList.add('object-value-calculate-value-button');
1067
+ UI.Tooltip.Tooltip.install(element, i18nString(UIStrings.invokePropertyGetter));
1068
+ element.addEventListener('click', onInvokeGetterClick, false);
1069
+
1070
+ function onInvokeGetterClick(event: Event): void {
1071
+ event.consume();
1072
+ if (object) {
1073
+ void object.callFunction(invokeGetter, [{value: JSON.stringify(propertyPath)}]).then(callback);
1074
+ }
1075
+ }
1076
+
1077
+ function invokeGetter(this: Object, arrayStr: string): Object {
1078
+ let result: Object = this;
1079
+ const properties = JSON.parse(arrayStr);
1080
+ for (let i = 0, n = properties.length; i < n; ++i) {
1081
+ // @ts-expect-error callFunction expects this to be a generic Object, so while this works we can't be more specific on types.
1082
+ result = result[properties[i]];
1083
+ }
1084
+ return result;
1085
+ }
1086
+
1087
+ return rootElement;
1088
+ }
1089
+
1040
1090
  private formatAsAccessorProperty(
1041
1091
  object: SDK.RemoteObject.RemoteObject|null, propertyPath: string[], isArrayEntry: boolean): HTMLElement {
1042
1092
  const rootElement =
1043
- ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(
1044
- object, propertyPath, onInvokeGetterClick.bind(this));
1093
+ this.createRemoteObjectAccessorPropertySpan(object, propertyPath, onInvokeGetterClick.bind(this));
1045
1094
 
1046
1095
  function onInvokeGetterClick(this: ConsoleViewMessage, result: SDK.RemoteObject.CallFunctionResult): void {
1047
1096
  const wasThrown = result.wasThrown;
@@ -1093,7 +1142,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1093
1142
  }
1094
1143
  case 'string': {
1095
1144
  if (currentStyle.size === 0) {
1096
- formattedResult.append(this.linkifyStringAsFragment(token.value));
1145
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(token.value));
1097
1146
  } else {
1098
1147
  const lines = token.value.split('\n');
1099
1148
  for (let i = 0; i < lines.length; i++) {
@@ -1104,7 +1153,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1104
1153
  wrapper.style.setProperty('contain', 'paint');
1105
1154
  wrapper.style.setProperty('display', 'inline-block');
1106
1155
  wrapper.style.setProperty('max-width', '100%');
1107
- wrapper.appendChild(this.linkifyStringAsFragment(lines[i]));
1156
+ appendOrShow(wrapper, this.linkifyStringAsFragment(lines[i]));
1108
1157
  for (const [property, {value, priority}] of currentStyle) {
1109
1158
  wrapper.style.setProperty(property, value, priority);
1110
1159
  }
@@ -1477,7 +1526,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1477
1526
  return false;
1478
1527
  }
1479
1528
  if (!Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').getIfNotDisabled() ||
1480
- !AiAssistanceModel.BuiltInAi.BuiltInAi.cachedIsAvailable()) {
1529
+ !AiAssistanceModel.BuiltInAi.BuiltInAi.instance().hasSession()) {
1481
1530
  return false;
1482
1531
  }
1483
1532
  const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance();
@@ -1757,13 +1806,13 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1757
1806
  for (let f = 0; f < frames.length; ++f) {
1758
1807
  const {name} = frames[f];
1759
1808
  const formattedLine = document.createElement('span');
1760
- formattedLine.appendChild(this.linkifyStringAsFragment(`${prefix} ${name} (`));
1809
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(`${prefix} ${name} (`));
1761
1810
  const scriptLocationLink = this.linkifier.linkifyScriptLocation(
1762
1811
  debuggerModel.target(), null, url, lineNumber, {columnNumber, inlineFrameIndex: f});
1763
1812
  scriptLocationLink.tabIndex = -1;
1764
1813
  this.selectableChildren.push({element: scriptLocationLink, forceSelect: () => scriptLocationLink.focus()});
1765
1814
  formattedLine.appendChild(scriptLocationLink);
1766
- formattedLine.appendChild(this.linkifyStringAsFragment(suffix));
1815
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(suffix));
1767
1816
  formattedLine.classList.add('formatted-stack-frame');
1768
1817
  stackTrace.insertBefore(formattedLine, insertBefore);
1769
1818
  }
@@ -1824,7 +1873,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1824
1873
  // where the error occurred. We use the source location from the
1825
1874
  // exceptionDetails and append it to the end of the message instead.
1826
1875
  if (!link && exceptionDetails && line.startsWith('SyntaxError')) {
1827
- formattedResult.appendChild(this.linkifyStringAsFragment(line));
1876
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(line));
1828
1877
  const maybeScriptLocation = this.createScriptLocationLinkForSyntaxError(debuggerModel, exceptionDetails);
1829
1878
  if (maybeScriptLocation) {
1830
1879
  formattedResult.append(' (at ');
@@ -1835,18 +1884,18 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1835
1884
  continue;
1836
1885
  }
1837
1886
  if (!isCallFrame) {
1838
- formattedResult.appendChild(this.linkifyStringAsFragment(`${line}${newline}`));
1887
+ appendOrShow(formattedResult, this.linkifyStringAsFragment(`${line}${newline}`));
1839
1888
  continue;
1840
1889
  }
1841
1890
  const formattedLine = document.createElement('span');
1842
1891
  if (!link) {
1843
- formattedLine.appendChild(this.linkifyStringAsFragment(`${line}${newline}`));
1892
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(`${line}${newline}`));
1844
1893
  formattedLine.classList.add('formatted-builtin-stack-frame');
1845
1894
  formattedResult.appendChild(formattedLine);
1846
1895
  continue;
1847
1896
  }
1848
1897
  const suffix = `${link.suffix}${newline}`;
1849
- formattedLine.appendChild(this.linkifyStringAsFragment(link.prefix));
1898
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(link.prefix));
1850
1899
  const scriptLocationLink = this.linkifier.linkifyScriptLocation(
1851
1900
  debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
1852
1901
  columnNumber: link.columnNumber,
@@ -1856,7 +1905,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1856
1905
  scriptLocationLink.tabIndex = -1;
1857
1906
  this.selectableChildren.push({element: scriptLocationLink, forceSelect: () => scriptLocationLink.focus()});
1858
1907
  formattedLine.appendChild(scriptLocationLink);
1859
- formattedLine.appendChild(this.linkifyStringAsFragment(suffix));
1908
+ appendOrShow(formattedLine, this.linkifyStringAsFragment(suffix));
1860
1909
  formattedLine.classList.add('formatted-stack-frame');
1861
1910
  formattedResult.appendChild(formattedLine);
1862
1911
 
@@ -1887,13 +1936,12 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1887
1936
  private linkifyWithCustomLinkifier(
1888
1937
  string: string,
1889
1938
  linkifier: (arg0: string, arg1: Platform.DevToolsPath.UrlString, arg2?: number, arg3?: number) => Node):
1890
- DocumentFragment {
1939
+ DocumentFragment|UI.Widget.Widget {
1891
1940
  if (string.length > getMaxTokenizableStringLength()) {
1892
- const propertyValue =
1893
- new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(string, getLongStringVisibleLength());
1894
- const fragment = document.createDocumentFragment();
1895
- fragment.appendChild(propertyValue.element);
1896
- return fragment;
1941
+ const propertyValue = new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue();
1942
+ propertyValue.text = string;
1943
+ propertyValue.maxLength = getLongStringVisibleLength();
1944
+ return propertyValue;
1897
1945
  }
1898
1946
  const container = document.createDocumentFragment();
1899
1947
  const tokens = ConsoleViewMessage.tokenizeMessageText(string);
@@ -1932,7 +1980,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1932
1980
  return container;
1933
1981
  }
1934
1982
 
1935
- private linkifyStringAsFragment(string: string): DocumentFragment {
1983
+ private linkifyStringAsFragment(string: string): DocumentFragment|UI.Widget.Widget {
1936
1984
  return this.linkifyWithCustomLinkifier(string, (text, url, lineNumber, columnNumber) => {
1937
1985
  const options = {text, lineNumber, columnNumber};
1938
1986
  const linkElement =
@@ -424,7 +424,7 @@ export class ConsoleViewport {
424
424
 
425
425
  for (let i = start; i <= end; i++) {
426
426
  const element = (this.providerElement(i) as ConsoleViewMessage);
427
- if (element && element.consoleMessage().type === 'table') {
427
+ if (element?.consoleMessage().type === 'table') {
428
428
  return true;
429
429
  }
430
430
  }
@@ -88,6 +88,7 @@
88
88
  padding: var(--sys-size-5) 0 0;
89
89
  display: flex;
90
90
  align-items: center;
91
+ height: 34px;
91
92
 
92
93
  devtools-checkbox {
93
94
  margin-left: auto;
@@ -895,7 +895,7 @@ export const mergeSegments = (segmentsA: CoverageSegment[], segmentsB: CoverageS
895
895
  const end = Math.min(a.end, b.end);
896
896
  const last = result[result.length - 1];
897
897
  const stamp = Math.min(a.stamp, b.stamp);
898
- if (!last || last.count !== count || last.stamp !== stamp) {
898
+ if (last?.count !== count || last.stamp !== stamp) {
899
899
  result.push({end, count, stamp});
900
900
  } else {
901
901
  last.end = end;
@@ -1078,7 +1078,7 @@ export class CoverageInfo {
1078
1078
  for (const segment of this.segments) {
1079
1079
  if (segment.count) {
1080
1080
  const last = ranges.length > 0 ? ranges[ranges.length - 1] : null;
1081
- if (last && last.end === start + offset) {
1081
+ if (last?.end === start + offset) {
1082
1082
  // We can extend the last segment.
1083
1083
  last.end = segment.end + offset;
1084
1084
  } else {
@@ -641,7 +641,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
641
641
  return;
642
642
  }
643
643
 
644
- if (!this.searchConfig || this.searchConfig.query !== query) {
644
+ if (this.searchConfig?.query !== query) {
645
645
  this.onSearchCanceled();
646
646
  } else {
647
647
  this.hideSearchHighlights();
@@ -104,6 +104,7 @@ interface ViewInput {
104
104
  interface ViewOutput {
105
105
  elementsTreeOutline?: ElementsTreeOutline;
106
106
  highlightedTreeElement: ElementsTreeElement|null;
107
+ isUpdatingHighlights: boolean;
107
108
  alreadyExpandedParentTreeElement: ElementsTreeElement|null;
108
109
  }
109
110
 
@@ -135,6 +136,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
135
136
  // Node highlighting logic. FIXME: express as a lit template.
136
137
  const previousHighlightedNode = output.highlightedTreeElement?.node() ?? null;
137
138
  if (previousHighlightedNode !== input.currentHighlightedNode) {
139
+ output.isUpdatingHighlights = true;
138
140
  let treeElement: ElementsTreeElement|null = null;
139
141
 
140
142
  if (output.highlightedTreeElement) {
@@ -172,6 +174,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
172
174
  output.highlightedTreeElement = treeElement;
173
175
  output.elementsTreeOutline.setHoverEffect(treeElement);
174
176
  treeElement?.reveal(true);
177
+ output.isUpdatingHighlights = false;
175
178
  }
176
179
  };
177
180
 
@@ -224,6 +227,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
224
227
  #viewOutput: ViewOutput = {
225
228
  highlightedTreeElement: null,
226
229
  alreadyExpandedParentTreeElement: null,
230
+ isUpdatingHighlights: false,
227
231
  };
228
232
  #highlightThrottler = new Common.Throttler.Throttler(100);
229
233
 
@@ -238,8 +242,8 @@ export class DOMTreeWidget extends UI.Widget.Widget {
238
242
  SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.HIGHLIGHT_NODE_REQUESTED, this.#highlightNode, this,
239
243
  {scoped: true});
240
244
  SDK.TargetManager.TargetManager.instance().addModelListener(
241
- SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.INSPECT_MODE_WILL_BE_TOGGLED, this.#clearState, this,
242
- {scoped: true});
245
+ SDK.OverlayModel.OverlayModel, SDK.OverlayModel.Events.INSPECT_MODE_WILL_BE_TOGGLED,
246
+ this.#clearHighlightedNode, this, {scoped: true});
243
247
  }
244
248
  }
245
249
 
@@ -250,7 +254,13 @@ export class DOMTreeWidget extends UI.Widget.Widget {
250
254
  });
251
255
  }
252
256
 
253
- #clearState(): void {
257
+ #clearHighlightedNode(): void {
258
+ // Highlighting an element via tree outline will emit the
259
+ // INSPECT_MODE_WILL_BE_TOGGLED event, therefore, we skip it if the view
260
+ // informed us that it is updating the element.
261
+ if (this.#viewOutput.isUpdatingHighlights) {
262
+ return;
263
+ }
254
264
  this.#currentHighlightedNode = null;
255
265
  this.requestUpdate();
256
266
  }
@@ -304,11 +314,11 @@ export class DOMTreeWidget extends UI.Widget.Widget {
304
314
  currentHighlightedNode: this.#currentHighlightedNode,
305
315
  onElementsTreeUpdated: this.onElementsTreeUpdated.bind(this),
306
316
  onSelectedNodeChanged: event => {
307
- this.#clearState();
317
+ this.#clearHighlightedNode();
308
318
  this.onSelectedNodeChanged(event);
309
319
  },
310
- onElementCollapsed: this.#clearState.bind(this),
311
- onElementExpanded: this.#clearState.bind(this),
320
+ onElementCollapsed: this.#clearHighlightedNode.bind(this),
321
+ onElementExpanded: this.#clearHighlightedNode.bind(this),
312
322
  },
313
323
  this.#viewOutput, this.contentElement);
314
324
  }
@@ -684,7 +694,7 @@ export class ElementsTreeOutline extends
684
694
  }
685
695
 
686
696
  resetClipboardIfNeeded(removedNode: SDK.DOMModel.DOMNode): void {
687
- if (this.clipboardNodeData && this.clipboardNodeData.node === removedNode) {
697
+ if (this.clipboardNodeData?.node === removedNode) {
688
698
  this.setClipboardData(null);
689
699
  }
690
700
  }
@@ -5,6 +5,7 @@
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
7
  import * as Bindings from '../../models/bindings/bindings.js';
8
+ import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
8
9
  import * as Components from '../../ui/legacy/components/utils/utils.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
10
11
  import {html, render} from '../../ui/lit/lit.js';
@@ -23,20 +24,20 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
24
  interface ViewInput {
24
25
  target?: SDK.Target.Target;
25
26
  linkifier: Components.Linkifier.Linkifier;
26
- options: Components.JSPresentationUtils.Options;
27
+ stackTrace?: StackTrace.StackTrace.StackTrace;
27
28
  }
28
29
 
29
30
  type View = (input: ViewInput, output: object, target: HTMLElement) => void;
30
31
 
31
32
  export const DEFAULT_VIEW: View = (input, _output, target) => {
32
- const {target: sdkTarget, linkifier, options} = input;
33
+ const {target: sdkTarget, linkifier, stackTrace} = input;
33
34
  // clang-format off
34
35
  render(html`
35
36
  <style>${nodeStackTraceWidgetStyles}</style>
36
- ${target && options.stackTrace ?
37
+ ${target && stackTrace ?
37
38
  html`<devtools-widget
38
39
  class="stack-trace"
39
- .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {target: sdkTarget, linkifier, options})}>
40
+ .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {target: sdkTarget, linkifier, stackTrace})}>
40
41
  </devtools-widget>` :
41
42
  html`<div class="gray-info-message">${i18nString(UIStrings.noStackTraceAvailable)}</div>`}`,
42
43
  target);
@@ -75,7 +76,7 @@ export class NodeStackTraceWidget extends UI.Widget.VBox {
75
76
  const input: ViewInput = {
76
77
  target,
77
78
  linkifier: this.#linkifier,
78
- options: {stackTrace},
79
+ stackTrace,
79
80
  };
80
81
  this.#view(input, {}, this.contentElement);
81
82
  }
@@ -2412,8 +2412,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2412
2412
  }
2413
2413
 
2414
2414
  if (this.valueElement) {
2415
- const lineBreakValue =
2416
- this.valueElement.firstElementChild && this.valueElement.firstElementChild.tagName === 'BR';
2415
+ const lineBreakValue = this.valueElement.firstElementChild?.tagName === 'BR';
2417
2416
  const separator = lineBreakValue ? ':' : ': ';
2418
2417
  this.listItemElement.createChild('span', 'styles-name-value-separator').textContent = separator;
2419
2418
  if (this.expandElement) {
@@ -368,7 +368,7 @@ function renderInsightSourcesList(
368
368
  sources: Console.PromptBuilder.Source[], isPageReloadRecommended: boolean): Lit.TemplateResult {
369
369
  // clang-format off
370
370
  return html`
371
- <div class="insight-sources">style>
371
+ <div class="insight-sources">
372
372
  <ul>
373
373
  ${Directives.repeat(sources, item => item.value, item => {
374
374
  return html`<li><x-link class="link" title="${localizeType(item.type)} ${i18nString(UIStrings.opensInNewTab)}" href="data:text/plain;charset=utf-8,${encodeURIComponent(item.value)}" jslog=${VisualLogging.link('source-' + item.type).track({click: true})}>
@@ -123,22 +123,42 @@ const UIStrings = {
123
123
  */
124
124
  learnMoreLabel: 'Learn more about URL pattern syntax',
125
125
  /**
126
- * @description Aria label on a button moving an entry up
126
+ * @description Tooltip on a button moving an entry up
127
+ * @example {*://example.com} PH1
127
128
  */
128
- increasePriority: 'Move up (higher patterns are checked first)',
129
+ increasePriority: 'Move up {PH1}',
129
130
  /**
130
- * @description Aria label on a button moving an entry down
131
+ * @description Tooltip on a button moving an entry down
132
+ * @example {*://example.com} PH1
131
133
  */
132
- decreasePriority: 'Move down (higher patterns are checked first)',
134
+ decreasePriority: 'Move down {PH1}',
133
135
  /**
134
136
  * @description Tooltip on a checkbox togging the effects for a pattern
135
137
  * @example {*://example.com} PH1
136
138
  */
137
139
  enableThrottlingToggleLabel: 'Throttle or block {PH1}',
138
140
  /**
139
- * @description Aria label on a combobox selecting the request conditions
141
+ * @description Tooltip on a combobox selecting the request conditions
140
142
  */
141
143
  requestConditionsLabel: 'Request conditions',
144
+ /**
145
+ * @description Aria announcement when a pattern was moved up
146
+ */
147
+ patternMovedUp: 'URL pattern was moved up',
148
+ /**
149
+ * @description Aria announcemenet when a pattern was moved down
150
+ */
151
+ patternMovedDown: 'URL pattern was moved down',
152
+ /**
153
+ * @description Text on a button to start editing text
154
+ * @example {*://example.com} PH1
155
+ */
156
+ editPattern: 'Edit {PH1}',
157
+ /**
158
+ * @description Label for an item to remove something
159
+ * @example {*://example.com} PH1
160
+ */
161
+ removePattern: 'Remove {PH1}',
142
162
  } as const;
143
163
  const str_ = i18n.i18n.registerUIStrings('panels/network/RequestConditionsDrawer.ts', UIStrings);
144
164
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -195,7 +215,9 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
195
215
  ${individualThrottlingEnabled ? i18nString(UIStrings.addRule) : i18nString(UIStrings.addPattern)}
196
216
  </devtools-button>
197
217
  </div>
198
- <devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox)}>${input.list.element}</devtools-widget>
218
+ <devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox)}>
219
+ ${input.list.element}
220
+ </devtools-widget>
199
221
  `,
200
222
  // clang-format on
201
223
  target);
@@ -379,6 +401,12 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
379
401
  const element = document.createElement('div');
380
402
  this.#listElements.set(condition, element);
381
403
  element.classList.add('blocked-url');
404
+ this.updateItem(element, condition, editable, index);
405
+ return element;
406
+ }
407
+
408
+ updateItem(element: HTMLElement, condition: SDK.NetworkManager.RequestCondition, editable: boolean, index: number):
409
+ void {
382
410
  const toggle = (e: Event): void => {
383
411
  if (editable) {
384
412
  e.consume(true);
@@ -396,12 +424,14 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
396
424
  if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled) {
397
425
  const moveUp = (e: Event): void => {
398
426
  if (this.manager.requestConditions.conditionsEnabled) {
427
+ UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedUp));
399
428
  e.consume(true);
400
429
  this.manager.requestConditions.increasePriority(condition);
401
430
  }
402
431
  };
403
432
  const moveDown = (e: Event): void => {
404
433
  if (this.manager.requestConditions.conditionsEnabled) {
434
+ UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedDown));
405
435
  e.consume(true);
406
436
  this.manager.requestConditions.decreasePriority(condition);
407
437
  }
@@ -413,13 +443,13 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
413
443
  @click=${toggle}
414
444
  type=checkbox
415
445
  title=${i18nString(UIStrings.enableThrottlingToggleLabel, {PH1: constructorStringOrWildcardURL})}
416
- ?checked=${enabled}
417
- ?disabled=${!editable || !originalOrUpgradedURLPattern}
418
- .jslog=${VisualLogging.toggle().track({ change: true })}>
446
+ .checked=${enabled}
447
+ .disabled=${!editable || !originalOrUpgradedURLPattern}
448
+ jslog=${VisualLogging.toggle().track({ change: true })}>
419
449
  <devtools-button
420
450
  .iconName=${'arrow-up'}
421
451
  .variant=${Buttons.Button.Variant.ICON}
422
- .title=${i18nString(UIStrings.decreasePriority)}
452
+ .title=${i18nString(UIStrings.decreasePriority, {PH1: constructorStringOrWildcardURL})}
423
453
  .jslogContext=${'decrease-priority'}
424
454
  ?disabled=${!editable || !originalOrUpgradedURLPattern}
425
455
  @click=${moveUp}>
@@ -427,7 +457,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
427
457
  <devtools-button
428
458
  .iconName=${'arrow-down'}
429
459
  .variant=${Buttons.Button.Variant.ICON}
430
- .title=${i18nString(UIStrings.increasePriority)}
460
+ .title=${i18nString(UIStrings.increasePriority, {PH1: constructorStringOrWildcardURL})}
431
461
  .jslogContext=${'increase-priority'}
432
462
  ?disabled=${!editable || !originalOrUpgradedURLPattern}
433
463
  @click=${moveDown}></devtools-button>
@@ -492,15 +522,14 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
492
522
  <input class=blocked-url-checkbox
493
523
  @click=${toggle}
494
524
  type=checkbox
495
- ?checked=${condition.enabled}
496
- ?disabled=${!editable}
497
- .jslog=${VisualLogging.toggle().track({ change: true })}>
525
+ .checked=${condition.enabled}
526
+ .disabled=${!editable}
527
+ jslog=${VisualLogging.toggle().track({ change: true })}>
498
528
  <div @click=${toggle} class=blocked-url-label>${wildcardURL}</div>
499
529
  <devtools-widget .widgetConfig=${widgetConfig(AffectedCountWidget, {condition, drawer: this})}></devtools-widget>`,
500
530
  // clang-format on
501
531
  element);
502
532
  }
503
- return element;
504
533
  }
505
534
 
506
535
  private toggleEnabled(): void {
@@ -585,11 +614,26 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
585
614
 
586
615
  update(): void {
587
616
  const enabled = this.manager.requestConditions.conditionsEnabled;
588
- this.list.clear();
589
- for (const pattern of this.manager.requestConditions.conditions) {
590
- if (Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled || pattern.wildcardURL) {
591
- this.list.appendItem(pattern, enabled);
592
- }
617
+ const newItems = Array.from(this.manager.requestConditions.conditions.filter(
618
+ pattern => Root.Runtime.hostConfig.devToolsIndividualRequestThrottling?.enabled || pattern.wildcardURL));
619
+
620
+ let oldIndex = 0;
621
+ for (; oldIndex < newItems.length; ++oldIndex) {
622
+ const pattern = newItems[oldIndex];
623
+ this.list.updateItem(
624
+ oldIndex,
625
+ pattern,
626
+ enabled,
627
+ /* focusable=*/ false,
628
+ {
629
+ edit: i18nString(UIStrings.editPattern, {PH1: pattern.constructorStringOrWildcardURL}),
630
+ delete: i18nString(UIStrings.removePattern, {PH1: pattern.constructorStringOrWildcardURL})
631
+ },
632
+ );
633
+ }
634
+
635
+ while (oldIndex < this.list.items.length) {
636
+ this.list.removeItem(oldIndex);
593
637
  }
594
638
  this.requestUpdate();
595
639
  }
@@ -434,7 +434,7 @@ export class HeapSnapshotGridNode extends
434
434
  }
435
435
 
436
436
  // Merge with the next range.
437
- if (nextRange && newEndOfRange === nextRange.from) {
437
+ if (newEndOfRange === nextRange?.from) {
438
438
  range.to = nextRange.to;
439
439
  // Remove "show next" button if there is one.
440
440
  this.removeChildByIndex(insertionIndex);