chrome-devtools-frontend 1.0.1539728 → 1.0.1541169

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 (196) hide show
  1. package/eslint.config.mjs +167 -151
  2. package/front_end/core/common/Debouncer.ts +2 -2
  3. package/front_end/core/common/Gzip.ts +1 -1
  4. package/front_end/core/common/Revealer.ts +5 -0
  5. package/front_end/core/common/Throttler.ts +3 -3
  6. package/front_end/core/host/GdpClient.ts +4 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +10 -10
  8. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +181 -0
  9. package/front_end/core/protocol_client/InspectorBackend.ts +36 -203
  10. package/front_end/core/protocol_client/protocol_client.ts +2 -2
  11. package/front_end/core/sdk/DebuggerModel.ts +3 -16
  12. package/front_end/core/sdk/NetworkManager.ts +16 -11
  13. package/front_end/core/sdk/RemoteObject.ts +4 -0
  14. package/front_end/core/sdk/Target.ts +3 -6
  15. package/front_end/core/sdk/TargetManager.ts +1 -2
  16. package/front_end/core/sdk/sdk-meta.ts +0 -35
  17. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +1 -3
  18. package/front_end/entrypoints/node_app/app/NodeMain.ts +3 -2
  19. package/front_end/entrypoints/shell/shell.ts +1 -0
  20. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  21. package/front_end/generated/Deprecation.ts +8 -0
  22. package/front_end/generated/InspectorBackendCommands.ts +8 -5
  23. package/front_end/generated/SupportedCSSProperties.js +58 -4
  24. package/front_end/generated/protocol.ts +60 -4
  25. package/front_end/models/ai_assistance/EvaluateAction.ts +88 -5
  26. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
  27. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
  28. package/front_end/models/ai_assistance/injected.ts +15 -2
  29. package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
  30. package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
  31. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  32. package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
  33. package/front_end/models/trace/Processor.ts +5 -4
  34. package/front_end/models/trace/Styles.ts +1 -1
  35. package/front_end/models/trace/insights/types.ts +1 -1
  36. package/front_end/models/trace/types/TraceEvents.ts +1 -1
  37. package/front_end/models/workspace/IgnoreListManager.ts +41 -47
  38. package/front_end/models/workspace/workspace-meta.ts +40 -0
  39. package/front_end/panels/ai_assistance/PatchWidget.ts +22 -12
  40. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
  41. package/front_end/panels/animation/AnimationTimeline.ts +4 -4
  42. package/front_end/panels/animation/AnimationUI.ts +28 -34
  43. package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +4 -4
  44. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -2
  45. package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
  46. package/front_end/panels/elements/LayoutPane.ts +2 -2
  47. package/front_end/panels/elements/PropertiesWidget.ts +3 -2
  48. package/front_end/panels/elements/components/AdornerManager.ts +9 -9
  49. package/front_end/panels/elements/layoutPane.css +5 -9
  50. package/front_end/panels/event_listeners/EventListenersView.ts +10 -6
  51. package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
  52. package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
  53. package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
  54. package/front_end/panels/issues/IssueView.ts +1 -1
  55. package/front_end/panels/issues/IssuesPane.ts +12 -15
  56. package/front_end/panels/issues/issues.ts +0 -2
  57. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -3
  58. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +2 -2
  59. package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
  60. package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
  61. package/front_end/panels/network/RequestPayloadView.ts +2 -1
  62. package/front_end/panels/network/RequestTimingView.ts +17 -10
  63. package/front_end/panels/network/components/RequestHeadersView.ts +24 -17
  64. package/front_end/panels/network/network-meta.ts +11 -0
  65. package/front_end/panels/protocol_monitor/JSONEditor.ts +2 -2
  66. package/front_end/panels/recorder/RecorderController.ts +6 -7
  67. package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -3
  68. package/front_end/panels/settings/components/SyncSection.ts +1 -1
  69. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
  70. package/front_end/panels/sources/BreakpointsView.ts +3 -3
  71. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  72. package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
  73. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -3
  74. package/front_end/panels/sources/breakpointsView.css +1 -1
  75. package/front_end/panels/sources/sourcesPanel.css +2 -2
  76. package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
  77. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  78. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +9 -5
  79. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
  80. package/front_end/panels/timeline/components/LiveMetricsView.ts +20 -9
  81. package/front_end/panels/timeline/components/MetricCard.ts +4 -2
  82. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
  83. package/front_end/services/puppeteer/PuppeteerConnection.ts +2 -1
  84. package/front_end/third_party/chromium/README.chromium +1 -1
  85. package/front_end/third_party/puppeteer/README.chromium +2 -2
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +3 -0
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +1 -0
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +21 -0
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +6 -0
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +5 -0
  113. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +61 -26
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +3 -0
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +1 -0
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +21 -0
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +6 -0
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/types.d.ts +5 -0
  139. package/front_end/third_party/puppeteer/package/package.json +1 -1
  140. package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
  141. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
  142. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +32 -0
  143. package/front_end/third_party/puppeteer/package/src/cdp/ExtensionTransport.ts +5 -1
  144. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +8 -0
  145. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +36 -43
  146. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  147. package/front_end/ui/components/dialogs/ButtonDialog.ts +15 -5
  148. package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
  149. package/front_end/ui/components/helpers/helpers.ts +0 -2
  150. package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -0
  151. package/front_end/ui/components/menus/Menu.ts +5 -3
  152. package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
  153. package/front_end/ui/components/survey_link/SurveyLink.docs.ts +22 -0
  154. package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -2
  155. package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
  156. package/front_end/ui/legacy/SelectMenu.docs.ts +14 -0
  157. package/front_end/ui/legacy/UIUtils.ts +2 -1
  158. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
  159. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -1
  160. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +558 -439
  161. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
  162. package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
  163. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
  164. package/front_end/ui/legacy/inspectorCommon.css +3 -2
  165. package/mcp/mcp.ts +15 -1
  166. package/package.json +2 -1
  167. package/front_end/core/protocol_client/NodeURL.ts +0 -40
  168. package/front_end/ui/components/docs/combo_box/basic.html +0 -20
  169. package/front_end/ui/components/docs/combo_box/basic.ts +0 -49
  170. package/front_end/ui/components/docs/context_menu/basic.html +0 -45
  171. package/front_end/ui/components/docs/legacy_color_invert/basic.html +0 -77
  172. package/front_end/ui/components/docs/legacy_color_invert/basic.ts +0 -98
  173. package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
  174. package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
  175. package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
  176. package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
  177. package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
  178. package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
  179. package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
  180. package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
  181. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
  182. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
  183. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
  184. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
  185. package/front_end/ui/components/docs/snackbars/basic.html +0 -17
  186. package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
  187. package/front_end/ui/components/docs/survey_link/basic.html +0 -20
  188. package/front_end/ui/components/docs/survey_link/basic.ts +0 -28
  189. package/front_end/ui/components/docs/tree_outline/basic.html +0 -33
  190. package/front_end/ui/components/docs/tree_outline/basic.ts +0 -38
  191. package/front_end/ui/components/docs/tree_outline/custom-renderers.html +0 -32
  192. package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +0 -61
  193. package/front_end/ui/components/docs/tree_outline/lazy-children.html +0 -32
  194. package/front_end/ui/components/docs/tree_outline/lazy-children.ts +0 -91
  195. package/front_end/ui/components/docs/tree_outline/sample-data.ts +0 -67
  196. package/front_end/ui/components/helpers/directives.ts +0 -38
@@ -337,7 +337,7 @@ export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventT
337
337
  #initializeDimHighlightSVG(): void {
338
338
  // Set up the desaturation mask
339
339
  const defs = UI.UIUtils.createSVGChild(this.#dimHighlightSVG, 'defs');
340
- const mask = UI.UIUtils.createSVGChild(defs, 'mask') as SVGMaskElement;
340
+ const mask = UI.UIUtils.createSVGChild(defs, 'mask');
341
341
  mask.id = 'dim-highlight-cutouts';
342
342
  /* Within the mask...
343
343
  - black fill = punch, fully transparently, through to the next thing. these are the cutouts to the color.
@@ -357,7 +357,7 @@ export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventT
357
357
  // `mask` element.
358
358
  // The `mixBlendMode` is set to 'saturation', so this rectangle will completely desaturate the area it covers
359
359
  // within the mask.
360
- const desaturateRect = UI.UIUtils.createSVGChild(this.#dimHighlightSVG, 'rect', 'background') as SVGRectElement;
360
+ const desaturateRect = UI.UIUtils.createSVGChild(this.#dimHighlightSVG, 'rect', 'background');
361
361
  desaturateRect.setAttribute('width', '100%');
362
362
  desaturateRect.setAttribute('height', '100%');
363
363
  desaturateRect.setAttribute('fill', ThemeSupport.ThemeSupport.instance().getComputedValue('--color-background'));
@@ -374,7 +374,7 @@ export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventT
374
374
 
375
375
  // This polygon is for the bracket beyond the not desaturated area.
376
376
  const bracketColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-state-on-header-hover');
377
- const bracket = UI.UIUtils.createSVGChild(this.#dimHighlightSVG, 'polygon') as SVGRectElement;
377
+ const bracket = UI.UIUtils.createSVGChild(this.#dimHighlightSVG, 'polygon');
378
378
  bracket.setAttribute('fill', bracketColor);
379
379
 
380
380
  ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  :focus {
36
- outline-width: 0;
36
+ outline-style: none;
37
37
  }
38
38
 
39
39
  .pie-chart-total.selected {
@@ -320,7 +320,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
320
320
 
321
321
  linkifyRawLocation(
322
322
  rawLocation: SDK.DebuggerModel.Location, fallbackUrl: Platform.DevToolsPath.UrlString,
323
- className?: string): Element {
323
+ className?: string): HTMLElement {
324
324
  return this.linkifyScriptLocation(
325
325
  rawLocation.debuggerModel.target(), rawLocation.scriptId, fallbackUrl, rawLocation.lineNumber, {
326
326
  columnNumber: rawLocation.columnNumber,
@@ -35,7 +35,7 @@ body {
35
35
  }
36
36
 
37
37
  :focus {
38
- outline-width: 0;
38
+ outline-style: none;
39
39
  }
40
40
 
41
41
  /* Prevent UA stylesheet from overriding font-family for HTML elements. */
@@ -140,7 +140,8 @@ iframe.widget {
140
140
  inset: 0;
141
141
  }
142
142
 
143
- .hidden {
143
+ [hidden],
144
+ .hidden { /* TODO(crbug.com/458299714): remove the class */
144
145
  display: none !important; /* stylelint-disable-line declaration-no-important */
145
146
  }
146
147
 
package/mcp/mcp.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  * tests added to foundation_unittests. See front_end/core/i18n/BUILD.gn as an
8
8
  * example.
9
9
  */
10
+ export * as Common from '../front_end/core/common/common.js';
10
11
  export * as I18n from '../front_end/core/i18n/i18n.js';
11
12
  export {ConnectionTransport} from '../front_end/core/protocol_client/ConnectionTransport.js';
12
13
  export {
@@ -16,4 +17,17 @@ export {
16
17
  PerformanceTraceFormatter
17
18
  } from '../front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js';
18
19
  export {AgentFocus} from '../front_end/models/ai_assistance/performance/AIContext.js';
19
- export * as TraceEngine from '../front_end/models/trace/trace.js';
20
+ export {Issue} from '../front_end/models/issues_manager/Issue.js';
21
+ export {
22
+ AggregatedIssue,
23
+ Events as IssueAggregatorEvents,
24
+ IssueAggregator
25
+ } from '../front_end/models/issues_manager/IssueAggregator.js';
26
+ export {
27
+ createIssuesFromProtocolIssue,
28
+ Events as IssuesManagerEvents,
29
+ type EventTypes as IssuesManagerEventTypes,
30
+ IssuesManager
31
+ } from '../front_end/models/issues_manager/IssuesManager.js';
32
+ export {findTitleFromMarkdownAst} from '../front_end/models/issues_manager/MarkdownIssueDescription.js';
33
+ export * as Marked from '../front_end/third_party/marked/marked.js';
package/package.json CHANGED
@@ -62,6 +62,7 @@
62
62
  "eslint-plugin-eslint-plugin": "7.0.0",
63
63
  "eslint-plugin-import": "2.32.0",
64
64
  "eslint-plugin-jsdoc": "60.5.0",
65
+ "eslint-plugin-lit": "2.1.1",
65
66
  "eslint-plugin-mocha": "10.5.0",
66
67
  "glob": "7.1.7",
67
68
  "globals": "16.4.0",
@@ -102,5 +103,5 @@
102
103
  "flat-cache": "6.1.12"
103
104
  }
104
105
  },
105
- "version": "1.0.1539728"
106
+ "version": "1.0.1541169"
106
107
  }
@@ -1,40 +0,0 @@
1
- // Copyright 2018 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as Common from '../common/common.js';
6
- import * as Host from '../host/host.js';
7
- import type * as Platform from '../platform/platform.js';
8
-
9
- export class NodeURL {
10
- static patch(object: object): void {
11
- process(object, '');
12
-
13
- function process(object: {url?: string}, path: string): void {
14
- if (object.url && NodeURL.isPlatformPath(object.url, Host.Platform.isWin())) {
15
- // object.url can be of both types: RawPathString and UrlString
16
- object.url = Common.ParsedURL.ParsedURL.rawPathToUrlString(object.url as Platform.DevToolsPath.RawPathString);
17
- }
18
- for (const entry of Object.entries(object)) {
19
- const key = entry[0];
20
- const value = entry[1];
21
- const entryPath = path + '.' + key;
22
- if (entryPath !== '.result.result.value' && value !== null && typeof value === 'object') {
23
- process(
24
- (value as {
25
- url: string,
26
- }),
27
- entryPath);
28
- }
29
- }
30
- }
31
- }
32
-
33
- static isPlatformPath(fileSystemPath: string, isWindows: boolean): boolean {
34
- if (isWindows) {
35
- const re = /^([a-z]:[\/\\]|\\\\)/i;
36
- return re.test(fileSystemPath);
37
- }
38
- return fileSystemPath.length ? fileSystemPath[0] === '/' : false;
39
- }
40
- }
@@ -1,20 +0,0 @@
1
- <!--
2
- Copyright 2025 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Basic ComboBox example</title>
12
- </head>
13
- <body>
14
-
15
- <div id="container">
16
- </div>
17
-
18
- <script type="module" src="./basic.js"></script>
19
- </body>
20
- </html>
@@ -1,49 +0,0 @@
1
- // Copyright 2024 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as UI from '../../../legacy/legacy.js';
6
- import * as ComponentHelpers from '../../helpers/helpers.js';
7
-
8
- await ComponentHelpers.ComponentServerSetup.setup();
9
- function comboBoxExample({tabIndex, disabled}: {
10
- tabIndex: number,
11
- disabled: boolean,
12
- }): HTMLElement {
13
- const example = document.createElement('div');
14
- example.style.marginTop = '20px';
15
- const disabledExplanation = document.createElement('div');
16
- const tabbableExplanation = document.createElement('div');
17
- const component = UI.UIUtils.createSelect('Select an option', ['Hamster', 'Mouse', 'Cat']);
18
- component.disabled = disabled;
19
- component.tabIndex = tabIndex;
20
- disabledExplanation.textContent = `is disabled? ${component.disabled}`;
21
- tabbableExplanation.textContent = `is tabbable? ${component.tabIndex >= 0}`;
22
-
23
- example.appendChild(component);
24
- example.appendChild(disabledExplanation);
25
- example.appendChild(tabbableExplanation);
26
- return example;
27
- }
28
-
29
- function init(): void {
30
- const container = document.getElementById('container');
31
- if (!container) {
32
- return;
33
- }
34
-
35
- container.style.padding = '42px 42px';
36
- container.style.margin = '42px 42px';
37
- container.style.border = '1px solid rgb(0 0 0 / 20%)';
38
-
39
- // Basic
40
- container.appendChild(comboBoxExample({tabIndex: 0, disabled: false}));
41
-
42
- // Not tab reachable
43
- container.appendChild(comboBoxExample({tabIndex: -1, disabled: false}));
44
-
45
- // Disabled
46
- container.appendChild(comboBoxExample({tabIndex: 0, disabled: true}));
47
- }
48
-
49
- init();
@@ -1,45 +0,0 @@
1
- <!--
2
- Copyright 2025 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Context menu example</title>
12
- <style>
13
- body {
14
- overflow: auto !important; /* stylelint-disable-line declaration-no-important */
15
- }
16
-
17
- div:not(.vbox) {
18
- width: 500px;
19
- padding: 25px;
20
- display: flex;
21
- align-items: center;
22
- flex-wrap: wrap;
23
- gap: 10px;
24
- background-color: var(--sys-color-neutral-container);
25
- border-radius: var(--sys-shape-corner-medium);
26
- text-align: center;
27
-
28
- p {
29
- vertical-align: middle;
30
- }
31
- }
32
- </style>
33
- </head>
34
- <body>
35
- <header>DevTools menu button (lit-html)</header>
36
- <div id="menu-button"></div>
37
- <header>Various simple menu items (imperative API)</header>
38
- <div id="simple-items"><p>Right-click here</p></div>
39
- <header>Custom sections (imperative API)</header>
40
- <div id="custom-section"><p>Right-click here</p></div>
41
- <header>Sub menu (imperative API)</header>
42
- <div id="sub-menu"><p>Right-click here</p></div>
43
- <script type="module" src="./basic.js"></script>
44
- </body>
45
- </html>
@@ -1,77 +0,0 @@
1
- <!--
2
- Copyright 2020 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Legacy color input</title>
12
- <style>
13
- #container {
14
- margin: 20px;
15
- padding: 0;
16
- }
17
-
18
- form {
19
- display: flex;
20
- align-items: flex-end;
21
- margin-bottom: 20px;
22
- }
23
-
24
- form input[type="submit"] {
25
- margin-left: 20px;
26
- padding: 10px;
27
- font-size: 20px;
28
- background: var(--sys-color-primary);
29
- color: #fff;
30
- border: 1px solid var(--sys-color-divider);
31
- cursor: pointer;
32
- }
33
-
34
- form input[type="submit"]:hover {
35
- background: var(--color-primary-variant);
36
- }
37
-
38
- .text-input, span, pre {
39
- display: block;
40
- font-size: 16px;
41
- }
42
-
43
- .text-input input {
44
- display: block;
45
- margin: 10px 0 0 0;
46
- padding: 10px;
47
- border: 1px solid #ccc;
48
- }
49
-
50
- pre {
51
- margin: 10px 0;
52
- padding: 10px;
53
- border: 1px solid #ccc;
54
- user-select: all !important;
55
- }
56
- </style>
57
- </head>
58
- <body>
59
- <script type="module" src="./basic.js"></script>
60
- <div id="container">
61
- <form>
62
- <label class="text-input">
63
- CSS property:
64
- <input type="text" id="css-property" placeholder="background-color"/>
65
- </label>
66
- <label class="text-input">
67
- CSS value:
68
- <input type="text" id="css-value" placeholder="rgb(10 10 10)"/>
69
- </label>
70
- <input type="submit" value="Go!" />
71
- </form>
72
-
73
- <span>Dark mode legacy value:</span>
74
- <pre><code id="output"></code></pre>
75
- </div>
76
- </body>
77
- </html>
@@ -1,98 +0,0 @@
1
- // Copyright 2020 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as Common from '../../../../core/common/common.js';
6
- import * as Platform from '../../../../core/platform/platform.js';
7
- import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
8
- import * as ComponentHelpers from '../../helpers/helpers.js';
9
-
10
- await ComponentHelpers.ComponentServerSetup.setup();
11
- await FrontendHelpers.initializeGlobalVars();
12
-
13
- const form = document.querySelector<HTMLFormElement>('form');
14
- if (!form) {
15
- throw new Error('could not find form');
16
- }
17
-
18
- form.addEventListener('submit', event => {
19
- event.preventDefault();
20
- const property = form.querySelector<HTMLInputElement>('#css-property')?.value;
21
- const value = form.querySelector<HTMLInputElement>('#css-value')?.value;
22
- if (!property || !value) {
23
- return;
24
- }
25
- const output = legacyInvertVariableForDarkMode(property, value);
26
- const outputElem = document.querySelector<HTMLElement>('#output');
27
- if (outputElem) {
28
- outputElem.innerText = output;
29
- }
30
- });
31
-
32
- /**
33
- * This code is largely copy and pasted from the legacy ThemeSupport
34
- * around color patching. This is because we are working towards removing the
35
- * legacy color patching, but still may need to be able to generate legacy dark
36
- * mode values for light colors during the migration. This doc exists for that
37
- * reason.
38
- */
39
-
40
- type ColorUsage = 'unknown'|'foreground'|'background';
41
-
42
- function patchHSLA(hsla: number[], colorUsage: ColorUsage): void {
43
- const hue = hsla[0];
44
- const sat = hsla[1];
45
- let lit: number = hsla[2];
46
- const alpha = hsla[3];
47
-
48
- const minCap = colorUsage === 'background' ? 0.14 : 0;
49
- const maxCap = colorUsage === 'foreground' ? 0.9 : 1;
50
- lit = 1 - lit;
51
- if (lit < minCap * 2) {
52
- lit = minCap + lit / 2;
53
- } else if (lit > 2 * maxCap - 1) {
54
- lit = maxCap - 1 / 2 + lit / 2;
55
- }
56
- hsla[0] = Platform.NumberUtilities.clamp(hue, 0, 1);
57
- hsla[1] = Platform.NumberUtilities.clamp(sat, 0, 1);
58
- hsla[2] = Platform.NumberUtilities.clamp(lit, 0, 1);
59
- hsla[3] = Platform.NumberUtilities.clamp(alpha, 0, 1);
60
- }
61
-
62
- function patchColor(colorAsText: string, colorUsage: ColorUsage): string {
63
- const color = Common.Color.parse(colorAsText)?.as(Common.Color.Format.HSL);
64
- if (!color) {
65
- return colorAsText;
66
- }
67
- const hsla: Common.ColorUtils.Color4D = [color.h, color.s, color.l, color.alpha ?? 1];
68
- patchHSLA(hsla, colorUsage);
69
-
70
- const rgba = Common.Color.hsl2rgb(hsla);
71
- const outColor = new Common.Color.Legacy(rgba, Common.Color.Format.RGBA);
72
- let outText = outColor.asString();
73
- if (!outText) {
74
- outText = outColor.asString(outColor.hasAlpha() ? Common.Color.Format.RGBA : Common.Color.Format.RGB);
75
- }
76
- return outText || colorAsText;
77
- }
78
-
79
- function legacyInvertVariableForDarkMode(cssProperty: string, cssValue: string): string {
80
- let colorUsage: ColorUsage = 'unknown';
81
- if (cssProperty.indexOf('background') === 0 || cssProperty.indexOf('border') === 0) {
82
- colorUsage = 'background';
83
- }
84
- if (cssProperty.indexOf('background') === -1) {
85
- colorUsage = 'foreground';
86
- }
87
-
88
- const items = cssValue.replace(Common.Color.Regex, '\0$1\0').split('\0');
89
- const output = [];
90
- for (const item of items) {
91
- if (!item) {
92
- continue;
93
- }
94
- const newColor = patchColor(item, colorUsage);
95
- output.push(newColor);
96
- }
97
- return output.join(' ');
98
- }
@@ -1,25 +0,0 @@
1
- <!--
2
- Copyright 2020 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Linkifier example with URL</title>
12
- <style>
13
- body {
14
- padding: 50px;
15
- }
16
- </style>
17
- </head>
18
- <body>
19
-
20
- <div id="container">
21
- </div>
22
-
23
- <script type="module" src="./simple-url.js"></script>
24
- </body>
25
- </html>
@@ -1,25 +0,0 @@
1
- // Copyright 2020 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as Platform from '../../../../core/platform/platform.js';
6
- import * as ComponentHelpers from '../../helpers/helpers.js';
7
- import * as Linkifier from '../../linkifier/linkifier.js';
8
-
9
- await ComponentHelpers.ComponentServerSetup.setup();
10
-
11
- const link = new Linkifier.Linkifier.Linkifier();
12
-
13
- link.data = {
14
- url: 'example.com' as Platform.DevToolsPath.UrlString,
15
- lineNumber: 11,
16
- columnNumber: 1,
17
- };
18
-
19
- const container = document.getElementById('container');
20
-
21
- container?.addEventListener('linkifieractivated', (event: Event) => {
22
- const data = JSON.stringify((event as unknown as {data: unknown}).data, null, 2);
23
- alert(`Linkifier click: ${data}`);
24
- });
25
- container?.appendChild(link);
@@ -1,25 +0,0 @@
1
- <!--
2
- Copyright 2021 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Panel Feedback</title>
12
- <style>
13
- #container {
14
- width: 80%;
15
- border: 1px solid black;
16
- padding: 10px;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div id="container">
22
- </div>
23
- <script type="module" src="./basic.js"></script>
24
- </body>
25
- </html>
@@ -1,21 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as Platform from '../../../../core/platform/platform.js';
6
- import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
7
- import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
8
- import * as ComponentHelpers from '../../helpers/helpers.js';
9
-
10
- await ComponentHelpers.ComponentServerSetup.setup();
11
- await FrontendHelpers.initializeGlobalVars();
12
-
13
- const component = new PanelFeedback.PanelFeedback.PanelFeedback();
14
-
15
- component.data = {
16
- feedbackUrl: 'https://www.example.com' as Platform.DevToolsPath.UrlString,
17
- quickStartUrl: 'https://www.example.com' as Platform.DevToolsPath.UrlString,
18
- quickStartLinkText: 'Quick start: get started with the Recorder',
19
- };
20
-
21
- document.getElementById('container')?.appendChild(component);
@@ -1,25 +0,0 @@
1
- <!--
2
- Copyright 2021 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Feedback button</title>
12
- <style>
13
- #container {
14
- width: 80%;
15
- border: 1px solid black;
16
- padding: 10px;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div id="container">
22
- </div>
23
- <script type="module" src="./button.js"></script>
24
- </body>
25
- </html>
@@ -1,19 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as Platform from '../../../../core/platform/platform.js';
6
- import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
7
- import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
8
- import * as ComponentHelpers from '../../helpers/helpers.js';
9
-
10
- await ComponentHelpers.ComponentServerSetup.setup();
11
- await FrontendHelpers.initializeGlobalVars();
12
-
13
- const component = new PanelFeedback.FeedbackButton.FeedbackButton();
14
-
15
- component.data = {
16
- feedbackUrl: 'https://www.example.com' as Platform.DevToolsPath.UrlString,
17
- };
18
-
19
- document.getElementById('container')?.appendChild(component);
@@ -1,25 +0,0 @@
1
- <!--
2
- Copyright 2022 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>Panel Introduction Steps</title>
12
- <style>
13
- #container {
14
- width: 80%;
15
- border: 1px solid black;
16
- padding: 10px;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div id="container">
22
- </div>
23
- <script type="module" src="./basic.js"></script>
24
- </body>
25
- </html>
@@ -1,28 +0,0 @@
1
- // Copyright 2022 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import '../../../components/panel_introduction_steps/panel_introduction_steps.js';
6
-
7
- import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
8
- import * as Lit from '../../../lit/lit.js';
9
- import * as ComponentHelpers from '../../helpers/helpers.js';
10
-
11
- const {html} = Lit;
12
-
13
- await ComponentHelpers.ComponentServerSetup.setup();
14
- await FrontendHelpers.initializeGlobalVars();
15
-
16
- const container = document.getElementById('container');
17
- if (container) {
18
- Lit.render(
19
- html`
20
- <devtools-panel-introduction-steps>
21
- <span slot="title">Get actionable insights on your website's performance</span>
22
- <span slot="step-1">Record or import a trace into the Performance Insights panel</span>
23
- <span slot="step-2">Get an overview of your page’s runtime performance</span>
24
- <span slot="step-3">Identify improvements to your performance via a list of actionable insights</span>
25
- </devtools-panel-introduction-steps>
26
- `,
27
- container, {host: this});
28
- }
@@ -1,20 +0,0 @@
1
- <!--
2
- Copyright 2020 The Chromium Authors
3
- Use of this source code is governed by a BSD-style license that can be
4
- found in the LICENSE file.
5
- -->
6
- <!DOCTYPE html>
7
- <html>
8
- <head>
9
- <meta charset="UTF-8" />
10
- <meta name="viewport" content="width=device-width" />
11
- <title>PieChart example with a legend</title>
12
- </head>
13
- <body>
14
-
15
- <div id="container">
16
- </div>
17
-
18
- <script type="module" src="./basic-with-legend.js"></script>
19
- </body>
20
- </html>