chrome-devtools-frontend 1.0.1000934 → 1.0.1002543

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 (187) hide show
  1. package/config/gni/devtools_grd_files.gni +4 -3
  2. package/front_end/.eslintrc.js +1 -0
  3. package/front_end/core/common/ParsedURL.ts +3 -3
  4. package/front_end/core/host/InspectorFrontendHost.ts +30 -1
  5. package/front_end/core/i18n/locales/en-US.json +177 -12
  6. package/front_end/core/i18n/locales/en-XL.json +177 -12
  7. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  8. package/front_end/core/root/Runtime.ts +7 -3
  9. package/front_end/core/sdk/ServiceWorkerManager.ts +6 -5
  10. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +14 -0
  11. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +491 -0
  12. package/front_end/entrypoints/formatter_worker/Substitute.ts +4 -440
  13. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +2 -0
  14. package/front_end/generated/InspectorBackendCommands.js +38 -10
  15. package/front_end/generated/protocol-mapping.d.ts +5 -1
  16. package/front_end/generated/protocol-proxy-api.d.ts +4 -1
  17. package/front_end/generated/protocol.ts +50 -10
  18. package/front_end/models/bindings/BreakpointManager.ts +12 -11
  19. package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
  20. package/front_end/models/issues_manager/AttributionReportingIssue.ts +5 -36
  21. package/front_end/models/issues_manager/DeprecationIssue.ts +233 -257
  22. package/front_end/models/issues_manager/Issue.ts +8 -4
  23. package/front_end/models/persistence/PersistenceImpl.ts +2 -2
  24. package/front_end/models/timeline_model/TimelineModel.ts +0 -48
  25. package/front_end/panels/application/AppManifestView.ts +3 -3
  26. package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -1
  27. package/front_end/panels/application/ApplicationPanelSidebar.ts +11 -6
  28. package/front_end/panels/application/ApplicationPanelTreeElement.ts +2 -2
  29. package/front_end/panels/application/BackgroundServiceView.ts +5 -4
  30. package/front_end/panels/application/ResourcesPanel.ts +1 -1
  31. package/front_end/panels/application/components/BackForwardCacheView.ts +4 -5
  32. package/front_end/panels/application/components/FrameDetailsView.ts +19 -19
  33. package/front_end/panels/application/components/PermissionsPolicySection.ts +2 -2
  34. package/front_end/panels/console/ConsoleViewMessage.ts +6 -3
  35. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
  36. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +3 -2
  37. package/front_end/panels/css_overview/cssOverviewCompletedView.css +4 -0
  38. package/front_end/panels/elements/StylePropertyTreeElement.ts +19 -13
  39. package/front_end/panels/elements/StylesSidebarPane.ts +53 -0
  40. package/front_end/panels/elements/components/QueryContainer.ts +1 -1
  41. package/front_end/panels/issues/AffectedResourcesView.ts +4 -3
  42. package/front_end/panels/issues/AffectedSourcesView.ts +2 -1
  43. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -43
  44. package/front_end/panels/issues/IssueView.ts +1 -1
  45. package/front_end/panels/lighthouse/LighthouseController.ts +5 -3
  46. package/front_end/panels/lighthouse/LighthouseReporterTypes.ts +2 -1
  47. package/front_end/panels/lighthouse/lighthousePanel.css +4 -0
  48. package/front_end/panels/network/components/RequestTrustTokensView.ts +7 -7
  49. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +2 -2
  50. package/front_end/panels/profiler/HeapSnapshotView.ts +2 -1
  51. package/front_end/panels/profiler/ProfileDataGrid.ts +1 -1
  52. package/front_end/panels/security/SecurityPanel.ts +6 -5
  53. package/front_end/panels/settings/SettingsScreen.ts +2 -3
  54. package/front_end/panels/sources/DebuggerPlugin.ts +10 -9
  55. package/front_end/panels/sources/JavaScriptBreakpointsSidebarPane.ts +3 -3
  56. package/front_end/panels/timeline/PerformanceModel.ts +2 -6
  57. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -14
  58. package/front_end/panels/timeline/TimelineUIUtils.ts +14 -12
  59. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1036 -1088
  60. package/front_end/third_party/lighthouse/locales/en-US.json +241 -4
  61. package/front_end/third_party/lighthouse/locales/en-XL.json +241 -4
  62. package/front_end/third_party/lighthouse/report/bundle.d.ts +2 -0
  63. package/front_end/third_party/lighthouse/report/bundle.js +18 -12
  64. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  65. package/front_end/third_party/puppeteer/package/README.md +11 -11
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts.map +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js +26 -2
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +7 -0
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +2 -2
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +19 -11
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +2 -2
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +6 -2
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.d.ts +3 -0
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.d.ts.map +1 -0
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.js +18 -0
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.js.map +1 -0
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.d.ts +2 -0
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.d.ts.map +1 -0
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.js +7 -0
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.js.map +1 -0
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +2 -0
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts.map +1 -0
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +5 -0
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js.map +1 -0
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.js +2 -15
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initialize-node.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js +23 -15
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +1 -0
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +17 -3
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.d.ts.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js +1 -6
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/esm/package.json +1 -0
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +3 -2
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +7 -0
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +2 -2
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +19 -11
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +2 -2
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +6 -2
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.d.ts +3 -0
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.d.ts.map +1 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.js +17 -0
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.js.map +1 -0
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.d.ts +2 -0
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.d.ts.map +1 -0
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.js +4 -0
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.js.map +1 -0
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +2 -0
  138. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts.map +1 -0
  139. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +2 -0
  140. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js.map +1 -0
  141. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -1
  142. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +2 -15
  143. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js.map +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +21 -13
  147. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  149. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +1 -0
  150. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +1 -1
  152. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +17 -3
  154. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +1 -6
  157. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  159. package/front_end/third_party/puppeteer/package/lib/types.d.ts +6 -6
  160. package/front_end/third_party/puppeteer/package/package.json +33 -18
  161. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +4 -1
  162. package/front_end/ui/components/data_grid/DataGrid.ts +1 -1
  163. package/front_end/ui/components/data_grid/DataGridUtils.ts +1 -1
  164. package/front_end/ui/components/docs/linkifier/simple-url.ts +2 -1
  165. package/front_end/ui/components/docs/panel_feedback/basic.ts +3 -2
  166. package/front_end/ui/components/docs/panel_feedback/button.ts +2 -1
  167. package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -3
  168. package/front_end/ui/components/linkifier/LinkifierUtils.ts +2 -3
  169. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +4 -6
  170. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +5 -4
  171. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +4 -4
  172. package/front_end/ui/legacy/EmptyWidget.ts +2 -1
  173. package/front_end/ui/legacy/UIUtils.ts +4 -4
  174. package/front_end/ui/legacy/XLink.ts +12 -13
  175. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -4
  176. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
  177. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +0 -2
  178. package/front_end/ui/legacy/components/utils/ImagePreview.ts +3 -7
  179. package/front_end/ui/legacy/components/utils/Linkifier.ts +23 -23
  180. package/front_end/ui/legacy/toolbar.css +1 -1
  181. package/front_end/ui/lit-html/lit-html.ts +3 -0
  182. package/package.json +1 -1
  183. package/scripts/eslint_rules/lib/lit_template_result_or_nothing.js +4 -0
  184. package/scripts/eslint_rules/tests/lit_template_result_or_nothing_test.js +13 -0
  185. package/front_end/models/issues_manager/descriptions/arInvalidAttributionSourceEventId.md +0 -3
  186. package/front_end/models/issues_manager/descriptions/arInvalidAttributionSourceExpiry.md +0 -4
  187. package/front_end/models/issues_manager/descriptions/arInvalidAttributionSourcePriority.md +0 -4
@@ -5,6 +5,7 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
+ import type * as Platform from '../../core/platform/platform.js';
8
9
  import type * as SDK from '../../core/sdk/sdk.js';
9
10
  import type * as Protocol from '../../generated/protocol.js';
10
11
 
@@ -204,14 +205,17 @@ export abstract class Issue<IssueCode extends string = string> {
204
205
  }
205
206
  }
206
207
 
207
- export function toZeroBasedLocation(location: Protocol.Audits.SourceCodeLocation|undefined):
208
- {url: string, scriptId: Protocol.Runtime.ScriptId|undefined, lineNumber: number, columnNumber: number|undefined}|
209
- undefined {
208
+ export function toZeroBasedLocation(location: Protocol.Audits.SourceCodeLocation|undefined): {
209
+ url: Platform.DevToolsPath.UrlString,
210
+ scriptId: Protocol.Runtime.ScriptId|undefined,
211
+ lineNumber: number,
212
+ columnNumber: number|undefined,
213
+ }|undefined {
210
214
  if (!location) {
211
215
  return undefined;
212
216
  }
213
217
  return {
214
- url: location.url,
218
+ url: location.url as Platform.DevToolsPath.UrlString,
215
219
  scriptId: location.scriptId,
216
220
  lineNumber: location.lineNumber,
217
221
  columnNumber: location.columnNumber === 0 ? undefined : location.columnNumber - 1,
@@ -256,8 +256,8 @@ export class PersistenceImpl extends Common.ObjectWrapper.ObjectWrapper<EventTyp
256
256
  Promise<void> {
257
257
  const breakpoints = this.breakpointManager.breakpointLocationsForUISourceCode(from).map(
258
258
  breakpointLocation => breakpointLocation.breakpoint);
259
- await Promise.all(breakpoints.map(breakpoint => {
260
- breakpoint.remove(false /* keepInStorage */);
259
+ await Promise.all(breakpoints.map(async breakpoint => {
260
+ await breakpoint.remove(false /* keepInStorage */);
261
261
  return this.breakpointManager.setBreakpoint(
262
262
  to, breakpoint.lineNumber(), breakpoint.columnNumber(), breakpoint.condition(), breakpoint.enabled());
263
263
  }));
@@ -98,7 +98,6 @@ export class TimelineModelImpl {
98
98
  private lastRecalculateStylesEvent!: SDK.TracingModel.Event|null;
99
99
  private currentScriptEvent!: SDK.TracingModel.Event|null;
100
100
  private eventStack!: SDK.TracingModel.Event[];
101
- private knownInputEvents!: Set<string>;
102
101
  private browserFrameTracking!: boolean;
103
102
  private persistentIds!: boolean;
104
103
  private legacyCurrentPage!: any;
@@ -573,7 +572,6 @@ export class TimelineModelImpl {
573
572
  this.lastRecalculateStylesEvent = null;
574
573
  this.currentScriptEvent = null;
575
574
  this.eventStack = [];
576
- this.knownInputEvents = new Set();
577
575
  this.browserFrameTracking = false;
578
576
  this.persistentIds = false;
579
577
  this.legacyCurrentPage = null;
@@ -833,44 +831,6 @@ export class TimelineModelImpl {
833
831
  group(TrackType.Animation).push(asyncEvent);
834
832
  continue;
835
833
  }
836
-
837
- if (asyncEvent.hasCategory(TimelineModelImpl.Category.LatencyInfo) ||
838
- asyncEvent.name === RecordType.ImplSideFling) {
839
- const lastStep = asyncEvent.steps[asyncEvent.steps.length - 1];
840
- if (!lastStep) {
841
- throw new Error('AsyncEvent.steps access is out of bounds.');
842
- }
843
- if (lastStep.phase !== SDK.TracingModel.Phase.NestableAsyncEnd) {
844
- continue;
845
- }
846
- const chromeLatencyInfo = asyncEvent.args['chrome_latency_info'];
847
-
848
- const data = chromeLatencyInfo?.['component_info'];
849
- asyncEvent.causedFrame =
850
- Boolean(data?.some((c: any) => c['component_type'] === 'COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP'));
851
- if (asyncEvent.hasCategory(TimelineModelImpl.Category.LatencyInfo)) {
852
- if (lastStep.id && !this.knownInputEvents.has(chromeLatencyInfo.trace_id)) {
853
- continue;
854
- }
855
- if (asyncEvent.name === RecordType.InputLatencyMouseMove && !asyncEvent.causedFrame) {
856
- continue;
857
- }
858
- // Coalesced events are not really been processed, no need to track them.
859
- if (!data || data['is_coalesced']) {
860
- continue;
861
- }
862
-
863
- const rendererMain =
864
- data?.find((c: any) => c['component_type'] === 'COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN');
865
- if (rendererMain) {
866
- const time = rendererMain['time_us'] / 1000;
867
- TimelineData.forEvent(asyncEvent.steps[0]).timeWaitingForMainThread =
868
- time - asyncEvent.steps[0].startTime;
869
- }
870
- }
871
- group(TrackType.Input).push(asyncEvent);
872
- continue;
873
- }
874
834
  }
875
835
  }
876
836
 
@@ -1210,13 +1170,6 @@ export class TimelineModelImpl {
1210
1170
  }
1211
1171
 
1212
1172
  private processBrowserEvent(event: SDK.TracingModel.Event): void {
1213
- if (event.name === RecordType.LatencyInfoFlow) {
1214
- if (event.args.chrome_latency_info?.trace_id) {
1215
- this.knownInputEvents.add(event.args.chrome_latency_info.trace_id);
1216
- }
1217
- return;
1218
- }
1219
-
1220
1173
  if (event.name === RecordType.ResourceWillSendRequest) {
1221
1174
  const requestId = event.args?.data?.requestId;
1222
1175
  if (typeof requestId === 'string') {
@@ -1715,7 +1668,6 @@ export class Track {
1715
1668
  export enum TrackType {
1716
1669
  MainThread = 'MainThread',
1717
1670
  Worker = 'Worker',
1718
- Input = 'Input',
1719
1671
  Animation = 'Animation',
1720
1672
  Timings = 'Timings',
1721
1673
  Console = 'Console',
@@ -433,7 +433,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
433
433
  .addChangeListener(this.updateManifest.bind(this, true));
434
434
 
435
435
  this.emptyView = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noManifestDetected));
436
- this.emptyView.appendLink('https://web.dev/add-manifest/');
436
+ this.emptyView.appendLink('https://web.dev/add-manifest/' as Platform.DevToolsPath.UrlString);
437
437
 
438
438
  this.emptyView.show(this.contentElement);
439
439
  this.emptyView.hideWidget();
@@ -693,7 +693,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
693
693
  this.newNoteUrlField.parentElement?.classList.toggle('hidden', !hasNewNoteUrl);
694
694
  this.newNoteUrlField.removeChildren();
695
695
  if (hasNewNoteUrl) {
696
- const completeURL = (Common.ParsedURL.ParsedURL.completeURL(url, newNoteUrl) as string);
696
+ const completeURL = (Common.ParsedURL.ParsedURL.completeURL(url, newNoteUrl) as Platform.DevToolsPath.UrlString);
697
697
  const link = Components.Linkifier.Linkifier.linkifyURL(
698
698
  completeURL, ({text: newNoteUrl} as Components.Linkifier.LinkifyURLOptions));
699
699
  link.tabIndex = 0;
@@ -763,7 +763,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
763
763
  shortcutSection.appendFlexedField('Description', shortcut.description);
764
764
  }
765
765
  const urlField = shortcutSection.appendFlexedField('URL');
766
- const shortcutUrl = (Common.ParsedURL.ParsedURL.completeURL(url, shortcut.url) as string);
766
+ const shortcutUrl = Common.ParsedURL.ParsedURL.completeURL(url, shortcut.url) as Platform.DevToolsPath.UrlString;
767
767
  const link = Components.Linkifier.Linkifier.linkifyURL(
768
768
  shortcutUrl, ({text: shortcut.url} as Components.Linkifier.LinkifyURLOptions));
769
769
  link.tabIndex = 0;
@@ -41,7 +41,9 @@ export class ServiceWorkerCacheTreeElement extends ExpandableApplicationPanelTre
41
41
  constructor(resourcesPanel: ResourcesPanel) {
42
42
  super(resourcesPanel, i18nString(UIStrings.cacheStorage), 'CacheStorage');
43
43
  const icon = UI.Icon.Icon.create('mediumicon-database', 'resource-tree-item');
44
- this.setLink('https://developer.chrome.com/docs/devtools/storage/cache/?utm_source=devtools');
44
+ this.setLink(
45
+ 'https://developer.chrome.com/docs/devtools/storage/cache/?utm_source=devtools' as
46
+ Platform.DevToolsPath.UrlString);
45
47
  this.setLeadingIcons([icon]);
46
48
  this.swCacheModel = null;
47
49
  this.swCacheTreeElements = new Set();
@@ -243,7 +243,8 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
243
243
  this.localStorageListTreeElement =
244
244
  new ExpandableApplicationPanelTreeElement(panel, i18nString(UIStrings.localStorage), 'LocalStorage');
245
245
  this.localStorageListTreeElement.setLink(
246
- 'https://developer.chrome.com/docs/devtools/storage/localstorage/?utm_source=devtools');
246
+ 'https://developer.chrome.com/docs/devtools/storage/localstorage/?utm_source=devtools' as
247
+ Platform.DevToolsPath.UrlString);
247
248
  const localStorageIcon = UI.Icon.Icon.create('mediumicon-table', 'resource-tree-item');
248
249
  this.localStorageListTreeElement.setLeadingIcons([localStorageIcon]);
249
250
 
@@ -251,19 +252,22 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
251
252
  this.sessionStorageListTreeElement =
252
253
  new ExpandableApplicationPanelTreeElement(panel, i18nString(UIStrings.sessionStorage), 'SessionStorage');
253
254
  this.sessionStorageListTreeElement.setLink(
254
- 'https://developer.chrome.com/docs/devtools/storage/sessionstorage/?utm_source=devtools');
255
+ 'https://developer.chrome.com/docs/devtools/storage/sessionstorage/?utm_source=devtools' as
256
+ Platform.DevToolsPath.UrlString);
255
257
  const sessionStorageIcon = UI.Icon.Icon.create('mediumicon-table', 'resource-tree-item');
256
258
  this.sessionStorageListTreeElement.setLeadingIcons([sessionStorageIcon]);
257
259
 
258
260
  storageTreeElement.appendChild(this.sessionStorageListTreeElement);
259
261
  this.indexedDBListTreeElement = new IndexedDBTreeElement(panel);
260
262
  this.indexedDBListTreeElement.setLink(
261
- 'https://developer.chrome.com/docs/devtools/storage/indexeddb/?utm_source=devtools');
263
+ 'https://developer.chrome.com/docs/devtools/storage/indexeddb/?utm_source=devtools' as
264
+ Platform.DevToolsPath.UrlString);
262
265
  storageTreeElement.appendChild(this.indexedDBListTreeElement);
263
266
  this.databasesListTreeElement =
264
267
  new ExpandableApplicationPanelTreeElement(panel, i18nString(UIStrings.webSql), 'Databases');
265
268
  this.databasesListTreeElement.setLink(
266
- 'https://developer.chrome.com/docs/devtools/storage/websql/?utm_source=devtools');
269
+ 'https://developer.chrome.com/docs/devtools/storage/websql/?utm_source=devtools' as
270
+ Platform.DevToolsPath.UrlString);
267
271
  const databaseIcon = UI.Icon.Icon.create('mediumicon-database', 'resource-tree-item');
268
272
  this.databasesListTreeElement.setLeadingIcons([databaseIcon]);
269
273
 
@@ -271,7 +275,8 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
271
275
  this.cookieListTreeElement =
272
276
  new ExpandableApplicationPanelTreeElement(panel, i18nString(UIStrings.cookies), 'Cookies');
273
277
  this.cookieListTreeElement.setLink(
274
- 'https://developer.chrome.com/docs/devtools/storage/cookies/?utm_source=devtools');
278
+ 'https://developer.chrome.com/docs/devtools/storage/cookies/?utm_source=devtools' as
279
+ Platform.DevToolsPath.UrlString);
275
280
  const cookieIcon = UI.Icon.Icon.create('mediumicon-cookie', 'resource-tree-item');
276
281
  this.cookieListTreeElement.setLeadingIcons([cookieIcon]);
277
282
  storageTreeElement.appendChild(this.cookieListTreeElement);
@@ -1505,7 +1510,7 @@ export class StorageCategoryView extends UI.Widget.VBox {
1505
1510
  this.emptyWidget.text = text;
1506
1511
  }
1507
1512
 
1508
- setLink(link: string|null): void {
1513
+ setLink(link: Platform.DevToolsPath.UrlString|null): void {
1509
1514
  if (link && !this.linkElement) {
1510
1515
  this.linkElement = this.emptyWidget.appendLink(link);
1511
1516
  }
@@ -47,7 +47,7 @@ export class ApplicationPanelTreeElement extends UI.TreeOutline.TreeElement {
47
47
  export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeElement {
48
48
  protected readonly expandedSetting: Common.Settings.Setting<boolean>;
49
49
  protected readonly categoryName: string;
50
- protected categoryLink: string|null;
50
+ protected categoryLink: Platform.DevToolsPath.UrlString|null;
51
51
 
52
52
  constructor(resourcesPanel: ResourcesPanel, categoryName: string, settingsKey: string, settingsDefault = false) {
53
53
  super(resourcesPanel, categoryName, false);
@@ -61,7 +61,7 @@ export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeE
61
61
  return 'category://' + this.categoryName as Platform.DevToolsPath.UrlString;
62
62
  }
63
63
 
64
- setLink(link: string): void {
64
+ setLink(link: Platform.DevToolsPath.UrlString): void {
65
65
  this.categoryLink = link;
66
66
  }
67
67
 
@@ -2,17 +2,18 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- // eslint-disable-next-line rulesdir/es_modules_import
6
- import emptyWidgetStyles from '../../ui/legacy/emptyWidget.css.js';
7
- import backgroundServiceViewStyles from './backgroundServiceView.css.js';
8
5
  import type * as Common from '../../core/common/common.js';
9
6
  import * as i18n from '../../core/i18n/i18n.js';
10
7
  import * as Platform from '../../core/platform/platform.js';
11
8
  import * as SDK from '../../core/sdk/sdk.js';
9
+ import * as Protocol from '../../generated/protocol.js';
12
10
  import * as Bindings from '../../models/bindings/bindings.js';
13
11
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
12
+ // eslint-disable-next-line rulesdir/es_modules_import
13
+ import emptyWidgetStyles from '../../ui/legacy/emptyWidget.css.js';
14
14
  import * as UI from '../../ui/legacy/legacy.js';
15
- import * as Protocol from '../../generated/protocol.js';
15
+
16
+ import backgroundServiceViewStyles from './backgroundServiceView.css.js';
16
17
 
17
18
  import type {BackgroundServiceModel} from './BackgroundServiceModel.js';
18
19
  import {Events} from './BackgroundServiceModel.js';
@@ -140,7 +140,7 @@ export class ResourcesPanel extends UI.Panel.PanelWithSidebar {
140
140
  return view;
141
141
  }
142
142
 
143
- showCategoryView(categoryName: string, categoryLink: string|null): void {
143
+ showCategoryView(categoryName: string, categoryLink: Platform.DevToolsPath.UrlString|null): void {
144
144
  if (!this.categoryView) {
145
145
  this.categoryView = new StorageCategoryView();
146
146
  }
@@ -311,7 +311,7 @@ export class BackForwardCacheView extends HTMLElement {
311
311
  }
312
312
 
313
313
  #maybeRenderFrameTree(explanationTree: Protocol.Page.BackForwardCacheNotRestoredExplanationTree|
314
- undefined): LitHtml.TemplateResult|{} {
314
+ undefined): LitHtml.LitTemplate {
315
315
  if (!explanationTree || (explanationTree.explanations.length === 0 && explanationTree.children.length === 0) ||
316
316
  !Root.Runtime.experiments.isEnabled('bfcacheDisplayTree')) {
317
317
  return LitHtml.nothing;
@@ -456,7 +456,7 @@ export class BackForwardCacheView extends HTMLElement {
456
456
 
457
457
  #maybeRenderExplanations(
458
458
  explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[],
459
- explanationTree: Protocol.Page.BackForwardCacheNotRestoredExplanationTree|undefined): LitHtml.TemplateResult|{} {
459
+ explanationTree: Protocol.Page.BackForwardCacheNotRestoredExplanationTree|undefined): LitHtml.LitTemplate {
460
460
  if (explanations.length === 0) {
461
461
  return LitHtml.nothing;
462
462
  }
@@ -508,8 +508,7 @@ export class BackForwardCacheView extends HTMLElement {
508
508
  // clang-format on
509
509
  }
510
510
 
511
- #maybeRenderReasonContext(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult|
512
- {} {
511
+ #maybeRenderReasonContext(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.LitTemplate {
513
512
  if (explanation.reason ===
514
513
  Protocol.Page.BackForwardCacheNotRestoredReason.EmbedderExtensionSentMessageToCachedFrame &&
515
514
  explanation.context) {
@@ -522,7 +521,7 @@ export class BackForwardCacheView extends HTMLElement {
522
521
  return LitHtml.nothing;
523
522
  }
524
523
 
525
- #renderFramesPerReason(frames: string[]|undefined): LitHtml.TemplateResult|{} {
524
+ #renderFramesPerReason(frames: string[]|undefined): LitHtml.LitTemplate {
526
525
  if (frames === undefined || frames.length === 0 || !Root.Runtime.experiments.isEnabled('bfcacheDisplayTree')) {
527
526
  return LitHtml.nothing;
528
527
  }
@@ -318,7 +318,7 @@ export class FrameDetailsReportView extends HTMLElement {
318
318
  });
319
319
  }
320
320
 
321
- #renderOriginTrial(): LitHtml.TemplateResult|{} {
321
+ #renderOriginTrial(): LitHtml.LitTemplate {
322
322
  if (!this.#frame) {
323
323
  return LitHtml.nothing;
324
324
  }
@@ -354,7 +354,7 @@ export class FrameDetailsReportView extends HTMLElement {
354
354
  `;
355
355
  }
356
356
 
357
- #renderDocumentSection(): LitHtml.TemplateResult|{} {
357
+ #renderDocumentSection(): LitHtml.LitTemplate {
358
358
  if (!this.#frame) {
359
359
  return LitHtml.nothing;
360
360
  }
@@ -381,7 +381,7 @@ export class FrameDetailsReportView extends HTMLElement {
381
381
  `;
382
382
  }
383
383
 
384
- #maybeRenderSourcesLinkForURL(): LitHtml.TemplateResult|{} {
384
+ #maybeRenderSourcesLinkForURL(): LitHtml.LitTemplate {
385
385
  if (!this.#frame || this.#frame.unreachableUrl()) {
386
386
  return LitHtml.nothing;
387
387
  }
@@ -393,7 +393,7 @@ export class FrameDetailsReportView extends HTMLElement {
393
393
  );
394
394
  }
395
395
 
396
- #maybeRenderNetworkLinkForURL(): LitHtml.TemplateResult|{} {
396
+ #maybeRenderNetworkLinkForURL(): LitHtml.LitTemplate {
397
397
  if (this.#frame) {
398
398
  const resource = this.#frame.resourceForURL(this.#frame.url);
399
399
  if (resource && resource.request) {
@@ -422,7 +422,7 @@ export class FrameDetailsReportView extends HTMLElement {
422
422
  return null;
423
423
  }
424
424
 
425
- #maybeRenderUnreachableURL(): LitHtml.TemplateResult|{} {
425
+ #maybeRenderUnreachableURL(): LitHtml.LitTemplate {
426
426
  if (!this.#frame || !this.#frame.unreachableUrl()) {
427
427
  return LitHtml.nothing;
428
428
  }
@@ -438,7 +438,7 @@ export class FrameDetailsReportView extends HTMLElement {
438
438
  `;
439
439
  }
440
440
 
441
- #renderNetworkLinkForUnreachableURL(): LitHtml.TemplateResult|{} {
441
+ #renderNetworkLinkForUnreachableURL(): LitHtml.LitTemplate {
442
442
  if (this.#frame) {
443
443
  const unreachableUrl = Common.ParsedURL.ParsedURL.fromString(this.#frame.unreachableUrl());
444
444
  if (unreachableUrl) {
@@ -464,7 +464,7 @@ export class FrameDetailsReportView extends HTMLElement {
464
464
  return LitHtml.nothing;
465
465
  }
466
466
 
467
- #maybeRenderOrigin(): LitHtml.TemplateResult|{} {
467
+ #maybeRenderOrigin(): LitHtml.LitTemplate {
468
468
  if (this.#frame && this.#frame.securityOrigin && this.#frame.securityOrigin !== '://') {
469
469
  return LitHtml.html`
470
470
  <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.origin)}</${
@@ -477,7 +477,7 @@ export class FrameDetailsReportView extends HTMLElement {
477
477
  return LitHtml.nothing;
478
478
  }
479
479
 
480
- async #renderOwnerElement(): Promise<LitHtml.TemplateResult|{}> {
480
+ async #renderOwnerElement(): Promise<LitHtml.LitTemplate> {
481
481
  if (this.#frame) {
482
482
  const linkTargetDOMNode = await this.#frame.getOwnerDOMNodeOrDocument();
483
483
  if (linkTargetDOMNode) {
@@ -507,7 +507,7 @@ export class FrameDetailsReportView extends HTMLElement {
507
507
  return LitHtml.nothing;
508
508
  }
509
509
 
510
- #maybeRenderCreationStacktrace(): LitHtml.TemplateResult|{} {
510
+ #maybeRenderCreationStacktrace(): LitHtml.LitTemplate {
511
511
  const creationStackTraceData = this.#frame?.getCreationStackTraceData();
512
512
  if (creationStackTraceData && creationStackTraceData.creationStackTrace) {
513
513
  // Disabled until https://crbug.com/1079231 is fixed.
@@ -549,7 +549,7 @@ export class FrameDetailsReportView extends HTMLElement {
549
549
  }
550
550
  }
551
551
 
552
- #maybeRenderAdStatus(): LitHtml.TemplateResult|{} {
552
+ #maybeRenderAdStatus(): LitHtml.LitTemplate {
553
553
  if (!this.#frame) {
554
554
  return LitHtml.nothing;
555
555
  }
@@ -572,7 +572,7 @@ export class FrameDetailsReportView extends HTMLElement {
572
572
  `;
573
573
  }
574
574
 
575
- #renderIsolationSection(): LitHtml.TemplateResult|{} {
575
+ #renderIsolationSection(): LitHtml.LitTemplate {
576
576
  if (!this.#frame) {
577
577
  return LitHtml.nothing;
578
578
  }
@@ -596,7 +596,7 @@ export class FrameDetailsReportView extends HTMLElement {
596
596
  `;
597
597
  }
598
598
 
599
- #maybeRenderSecureContextExplanation(): LitHtml.TemplateResult|{} {
599
+ #maybeRenderSecureContextExplanation(): LitHtml.LitTemplate {
600
600
  const explanation = this.#getSecureContextExplanation();
601
601
  if (explanation) {
602
602
  return LitHtml.html`<span class="inline-comment">${explanation}</span>`;
@@ -618,7 +618,7 @@ export class FrameDetailsReportView extends HTMLElement {
618
618
  return null;
619
619
  }
620
620
 
621
- async #maybeRenderCoopCoepStatus(): Promise<LitHtml.TemplateResult|{}> {
621
+ async #maybeRenderCoopCoepStatus(): Promise<LitHtml.LitTemplate> {
622
622
  if (this.#frame) {
623
623
  const model = this.#frame.resourceTreeModel().target().model(SDK.NetworkManager.NetworkManager);
624
624
  const info = model && await model.getSecurityIsolationStatus(this.#frame.id);
@@ -642,7 +642,7 @@ export class FrameDetailsReportView extends HTMLElement {
642
642
  info: Protocol.Network.CrossOriginEmbedderPolicyStatus|Protocol.Network.CrossOriginOpenerPolicyStatus|undefined,
643
643
  policyName: string,
644
644
  noneValue: Protocol.Network.CrossOriginEmbedderPolicyValue|
645
- Protocol.Network.CrossOriginOpenerPolicyValue): LitHtml.TemplateResult|{} {
645
+ Protocol.Network.CrossOriginOpenerPolicyValue): LitHtml.LitTemplate {
646
646
  if (!info) {
647
647
  return LitHtml.nothing;
648
648
  }
@@ -661,7 +661,7 @@ export class FrameDetailsReportView extends HTMLElement {
661
661
  `;
662
662
  }
663
663
 
664
- #renderApiAvailabilitySection(): LitHtml.TemplateResult|{} {
664
+ #renderApiAvailabilitySection(): LitHtml.LitTemplate {
665
665
  if (!this.#frame) {
666
666
  return LitHtml.nothing;
667
667
  }
@@ -680,7 +680,7 @@ export class FrameDetailsReportView extends HTMLElement {
680
680
  `;
681
681
  }
682
682
 
683
- #renderSharedArrayBufferAvailability(): LitHtml.TemplateResult|{} {
683
+ #renderSharedArrayBufferAvailability(): LitHtml.LitTemplate {
684
684
  if (this.#frame) {
685
685
  const features = this.#frame.getGatedAPIFeatures();
686
686
  if (features) {
@@ -694,7 +694,7 @@ export class FrameDetailsReportView extends HTMLElement {
694
694
  i18nString(UIStrings.sharedarraybufferConstructorIs) :
695
695
  (sabAvailable ? i18nString(UIStrings.sharedarraybufferConstructorIsAvailable) : '');
696
696
 
697
- function renderHint(frame: SDK.ResourceTreeModel.ResourceTreeFrame): LitHtml.TemplateResult|{} {
697
+ function renderHint(frame: SDK.ResourceTreeModel.ResourceTreeFrame): LitHtml.LitTemplate {
698
698
  switch (frame.getCrossOriginIsolatedContextType()) {
699
699
  case Protocol.Page.CrossOriginIsolatedContextType.Isolated:
700
700
  return LitHtml.nothing;
@@ -730,7 +730,7 @@ export class FrameDetailsReportView extends HTMLElement {
730
730
  return LitHtml.nothing;
731
731
  }
732
732
 
733
- #renderMeasureMemoryAvailability(): LitHtml.TemplateResult|{} {
733
+ #renderMeasureMemoryAvailability(): LitHtml.LitTemplate {
734
734
  if (this.#frame) {
735
735
  const measureMemoryAvailable = this.#frame.isCrossOriginIsolated();
736
736
  const availabilityText =
@@ -750,7 +750,7 @@ export class FrameDetailsReportView extends HTMLElement {
750
750
  return LitHtml.nothing;
751
751
  }
752
752
 
753
- #renderAdditionalInfoSection(): LitHtml.TemplateResult|{} {
753
+ #renderAdditionalInfoSection(): LitHtml.LitTemplate {
754
754
  if (!this.#frame) {
755
755
  return LitHtml.nothing;
756
756
  }
@@ -105,7 +105,7 @@ export class PermissionsPolicySection extends HTMLElement {
105
105
  void this.#render();
106
106
  }
107
107
 
108
- #renderAllowed(): LitHtml.TemplateResult|{} {
108
+ #renderAllowed(): LitHtml.LitTemplate {
109
109
  const allowed = this.#permissionsPolicySectionData.policies.filter(p => p.allowed).map(p => p.feature).sort();
110
110
  if (!allowed.length) {
111
111
  return LitHtml.nothing;
@@ -119,7 +119,7 @@ export class PermissionsPolicySection extends HTMLElement {
119
119
  `;
120
120
  }
121
121
 
122
- async #renderDisallowed(): Promise<LitHtml.TemplateResult|{}> {
122
+ async #renderDisallowed(): Promise<LitHtml.LitTemplate> {
123
123
  const disallowed = this.#permissionsPolicySectionData.policies.filter(p => !p.allowed)
124
124
  .sort((a, b) => a.feature.localeCompare(b.feature));
125
125
  if (!disallowed.length) {
@@ -1439,7 +1439,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1439
1439
  }
1440
1440
 
1441
1441
  // SyntaxErrors might not populate the URL field. Try to resolve it via scriptId.
1442
- const url = exceptionDetails.url || debuggerModel.scriptForId(scriptId)?.sourceURL;
1442
+ const url =
1443
+ exceptionDetails.url as Platform.DevToolsPath.UrlString || debuggerModel.scriptForId(scriptId)?.sourceURL;
1443
1444
  if (!url) {
1444
1445
  return;
1445
1446
  }
@@ -1531,7 +1532,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1531
1532
  }
1532
1533
 
1533
1534
  private linkifyWithCustomLinkifier(
1534
- string: string, linkifier: (arg0: string, arg1: string, arg2?: number, arg3?: number) => Node): DocumentFragment {
1535
+ string: string,
1536
+ linkifier: (arg0: string, arg1: Platform.DevToolsPath.UrlString, arg2?: number, arg3?: number) => Node):
1537
+ DocumentFragment {
1535
1538
  if (string.length > getMaxTokenizableStringLength()) {
1536
1539
  const propertyValue = new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(
1537
1540
  document.createElement('span'), string, getLongStringVisibleLength());
@@ -1563,7 +1566,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1563
1566
  if (splitResult) {
1564
1567
  linkNode = linkifier(token.text, sourceURL, splitResult.lineNumber, splitResult.columnNumber);
1565
1568
  } else {
1566
- linkNode = linkifier(token.text, '');
1569
+ linkNode = linkifier(token.text, Platform.DevToolsPath.EmptyUrlString);
1567
1570
  }
1568
1571
  container.appendChild(linkNode);
1569
1572
  break;
@@ -1074,7 +1074,7 @@ export class ElementNode extends DataGrid.SortableDataGrid.SortableDataGridNode<
1074
1074
  button.classList.add('show-element');
1075
1075
  UI.Tooltip.Tooltip.install(button, i18nString(UIStrings.showElement));
1076
1076
  button.tabIndex = 0;
1077
- button.onclick = (): void => this.data.node.scrollIntoView();
1077
+ button.onclick = (): Promise<void> => frontendNode.scrollIntoView();
1078
1078
  cell.appendChild(button);
1079
1079
  });
1080
1080
  return cell;
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as i18n from '../../../core/i18n/i18n.js';
6
+ import type * as Platform from '../../../core/platform/platform.js';
6
7
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
7
8
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
8
9
  import * as PanelFeedback from '../../../ui/components/panel_feedback/panel_feedback.js';
@@ -43,8 +44,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
43
44
 
44
45
  const {render, html} = LitHtml;
45
46
 
46
- const FEEDBACK_LINK = 'https://g.co/devtools/css-overview-feedback';
47
- const DOC_LINK = 'https://developer.chrome.com/docs/devtools/css-overview';
47
+ const FEEDBACK_LINK = 'https://g.co/devtools/css-overview-feedback' as Platform.DevToolsPath.UrlString;
48
+ const DOC_LINK = 'https://developer.chrome.com/docs/devtools/css-overview' as Platform.DevToolsPath.UrlString;
48
49
  export class OverviewStartRequestedEvent extends Event {
49
50
  static readonly eventName = 'overviewstartrequested';
50
51
 
@@ -336,6 +336,10 @@
336
336
  height: 20px;
337
337
  }
338
338
 
339
+ .nodeId-column .monospace {
340
+ overflow: hidden;
341
+ }
342
+
339
343
  .show-element {
340
344
  margin: 0 0 0 8px;
341
345
  padding: 0;
@@ -848,45 +848,46 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
848
848
  return;
849
849
  }
850
850
 
851
+ const contextMenu = this.createCopyContextMenu(event);
852
+ void contextMenu.show();
853
+ }
854
+
855
+ createCopyContextMenu(event: Event): UI.ContextMenu.ContextMenu {
851
856
  const contextMenu = new UI.ContextMenu.ContextMenu(event);
852
- contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyDeclaration), () => {
857
+ contextMenu.headerSection().appendItem(i18nString(UIStrings.copyDeclaration), () => {
853
858
  const propertyText = `${this.property.name}: ${this.property.value};`;
854
859
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(propertyText);
855
860
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.DeclarationViaContextMenu);
856
861
  });
857
862
 
858
- contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyProperty), () => {
863
+ contextMenu.headerSection().appendItem(i18nString(UIStrings.copyProperty), () => {
859
864
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.property.name);
860
865
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.PropertyViaContextMenu);
861
866
  });
862
867
 
863
- contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyValue), () => {
868
+ contextMenu.headerSection().appendItem(i18nString(UIStrings.copyValue), () => {
864
869
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.property.value);
865
870
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.ValueViaContextMenu);
866
871
  });
867
872
 
868
- contextMenu.defaultSection().appendItem(i18nString(UIStrings.copyRule), () => {
873
+ contextMenu.headerSection().appendItem(i18nString(UIStrings.copyRule), () => {
869
874
  const section = (this.section() as StylePropertiesSection);
870
875
  const ruleText = StylesSidebarPane.formatLeadingProperties(section).ruleText;
871
876
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(ruleText);
872
877
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.RuleViaContextMenu);
873
878
  });
874
879
 
875
- contextMenu.defaultSection().appendItem(i18nString(UIStrings.copyAllDeclarations), () => {
880
+ contextMenu.headerSection().appendItem(
881
+ i18nString(UIStrings.copyCssDeclarationAsJs), this.copyCssDeclarationAsJs.bind(this));
882
+
883
+ contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyAllDeclarations), () => {
876
884
  const section = (this.section() as StylePropertiesSection);
877
885
  const allDeclarationText = StylesSidebarPane.formatLeadingProperties(section).allDeclarationText;
878
886
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(allDeclarationText);
879
887
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.AllDeclarationsViaContextMenu);
880
888
  });
881
889
 
882
- contextMenu.defaultSection().appendItem(i18nString(UIStrings.viewComputedValue), () => {
883
- void this.viewComputedValue();
884
- });
885
-
886
890
  contextMenu.clipboardSection().appendItem(
887
- i18nString(UIStrings.copyCssDeclarationAsJs), this.copyCssDeclarationAsJs.bind(this));
888
-
889
- contextMenu.defaultSection().appendItem(
890
891
  i18nString(UIStrings.copyAllCssDeclarationsAsJs), this.copyAllCssDeclarationAsJs.bind(this));
891
892
 
892
893
  // TODO(changhaohan): conditionally add this item only when there are changes to copy
@@ -896,7 +897,11 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
896
897
  Host.userMetrics.styleTextCopied(Host.UserMetrics.StyleTextCopied.AllChangesViaStylesPane);
897
898
  });
898
899
 
899
- void contextMenu.show();
900
+ contextMenu.footerSection().appendItem(i18nString(UIStrings.viewComputedValue), () => {
901
+ void this.viewComputedValue();
902
+ });
903
+
904
+ return contextMenu;
900
905
  }
901
906
 
902
907
  private async viewComputedValue(): Promise<void> {
@@ -1513,6 +1518,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
1513
1518
  }
1514
1519
  if (updatedProperty) {
1515
1520
  this.listItemElement.classList.toggle('changed', this.isPropertyChanged(updatedProperty));
1521
+ this.parentPane().updateChangeStatus();
1516
1522
  }
1517
1523
 
1518
1524
  this.matchedStylesInternal.resetActiveProperties();