chrome-devtools-frontend 1.0.1539972 → 1.0.1541552

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 (106) hide show
  1. package/eslint.config.mjs +167 -151
  2. package/front_end/Tests.js +5 -1
  3. package/front_end/core/common/Revealer.ts +5 -0
  4. package/front_end/core/common/Settings.ts +106 -95
  5. package/front_end/core/host/InspectorFrontendHost.ts +10 -10
  6. package/front_end/core/sdk/NetworkManager.ts +16 -11
  7. package/front_end/core/sdk/sdk-meta.ts +0 -35
  8. package/front_end/entrypoints/main/MainImpl.ts +15 -7
  9. package/front_end/entrypoints/shell/shell.ts +1 -0
  10. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  11. package/front_end/foundation/README.md +10 -0
  12. package/front_end/foundation/Universe.ts +29 -0
  13. package/front_end/foundation/foundation.ts +7 -0
  14. package/front_end/generated/InspectorBackendCommands.ts +6 -3
  15. package/front_end/generated/SupportedCSSProperties.js +13 -0
  16. package/front_end/generated/protocol.ts +58 -2
  17. package/front_end/models/ai_assistance/BuiltInAi.ts +2 -1
  18. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +44 -34
  19. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
  20. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
  21. package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
  22. package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
  23. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  24. package/front_end/models/trace/Processor.ts +5 -4
  25. package/front_end/models/trace/insights/types.ts +1 -1
  26. package/front_end/models/trace/types/TraceEvents.ts +1 -1
  27. package/front_end/models/workspace/IgnoreListManager.ts +41 -47
  28. package/front_end/models/workspace/workspace-meta.ts +40 -0
  29. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +1 -1
  30. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
  31. package/front_end/panels/animation/AnimationTimeline.ts +4 -4
  32. package/front_end/panels/animation/AnimationUI.ts +28 -34
  33. package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
  34. package/front_end/panels/elements/LayoutPane.ts +2 -2
  35. package/front_end/panels/elements/components/AdornerManager.ts +9 -9
  36. package/front_end/panels/elements/layoutPane.css +5 -9
  37. package/front_end/panels/event_listeners/EventListenersView.ts +1 -1
  38. package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
  39. package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
  40. package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
  41. package/front_end/panels/issues/IssueView.ts +1 -1
  42. package/front_end/panels/issues/IssuesPane.ts +12 -15
  43. package/front_end/panels/issues/issues.ts +0 -2
  44. package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
  45. package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
  46. package/front_end/panels/network/RequestTimingView.ts +13 -8
  47. package/front_end/panels/network/network-meta.ts +11 -0
  48. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
  49. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  50. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -1
  51. package/front_end/panels/sources/breakpointsView.css +1 -1
  52. package/front_end/panels/sources/sourcesPanel.css +2 -2
  53. package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
  54. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  55. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
  56. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
  57. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -1
  58. package/front_end/third_party/chromium/README.chromium +1 -1
  59. package/front_end/third_party/puppeteer/README.chromium +2 -2
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +3 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +4 -4
  68. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +3 -1
  70. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  72. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  73. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  75. package/front_end/third_party/puppeteer/package/package.json +1 -1
  76. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +3 -1
  77. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  78. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  79. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  80. package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
  81. package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
  82. package/front_end/ui/legacy/UIUtils.ts +2 -1
  83. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
  84. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +148 -125
  85. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
  86. package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
  87. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
  88. package/front_end/ui/legacy/inspectorCommon.css +3 -2
  89. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  90. package/mcp/mcp.ts +16 -0
  91. package/package.json +2 -1
  92. package/front_end/ui/components/docs/context_menu/basic.html +0 -45
  93. package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
  94. package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
  95. package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
  96. package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
  97. package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
  98. package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
  99. package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
  100. package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
  101. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
  102. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
  103. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
  104. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
  105. package/front_end/ui/components/docs/snackbars/basic.html +0 -17
  106. package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
@@ -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
 
@@ -3831,6 +3831,7 @@ export const knownContextValues = new Set([
3831
3831
  'timeline.annotation-sidebar.delete',
3832
3832
  'timeline.annotations-tab',
3833
3833
  'timeline.annotations.',
3834
+ 'timeline.annotations.ai-generate-label',
3834
3835
  'timeline.annotations.create-entries-link',
3835
3836
  'timeline.annotations.create-entry-label',
3836
3837
  'timeline.annotations.create-entry-link',
package/mcp/mcp.ts CHANGED
@@ -7,8 +7,10 @@
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';
13
+ export * as Foundation from '../front_end/foundation/foundation.js';
12
14
  export {
13
15
  PerformanceInsightFormatter
14
16
  } from '../front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js';
@@ -16,4 +18,18 @@ export {
16
18
  PerformanceTraceFormatter
17
19
  } from '../front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js';
18
20
  export {AgentFocus} from '../front_end/models/ai_assistance/performance/AIContext.js';
21
+ export {Issue} from '../front_end/models/issues_manager/Issue.js';
22
+ export {
23
+ AggregatedIssue,
24
+ Events as IssueAggregatorEvents,
25
+ IssueAggregator
26
+ } from '../front_end/models/issues_manager/IssueAggregator.js';
27
+ export {
28
+ createIssuesFromProtocolIssue,
29
+ Events as IssuesManagerEvents,
30
+ type EventTypes as IssuesManagerEventTypes,
31
+ IssuesManager
32
+ } from '../front_end/models/issues_manager/IssuesManager.js';
33
+ export {findTitleFromMarkdownAst} from '../front_end/models/issues_manager/MarkdownIssueDescription.js';
19
34
  export * as TraceEngine from '../front_end/models/trace/trace.js';
35
+ 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.1539972"
106
+ "version": "1.0.1541552"
106
107
  }
@@ -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,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>
@@ -1,20 +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 FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
6
- import * as PerfUI from '../../../legacy/components/perf_ui/perf_ui.js';
7
-
8
- await FrontendHelpers.initializeGlobalVars();
9
-
10
- const chart = new PerfUI.PieChart.PieChart();
11
- document.getElementById('container')?.appendChild(chart);
12
-
13
- chart.data = {
14
- chartName: 'Nice Chart',
15
- size: 110,
16
- formatter: value => String(value) + ' %',
17
- showLegend: true,
18
- total: 100,
19
- slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}],
20
- };
@@ -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 without a legend</title>
12
- </head>
13
- <body>
14
-
15
- <div id="container">
16
- </div>
17
-
18
- <script type="module" src="./basic-without-legend.js"></script>
19
- </body>
20
- </html>
@@ -1,18 +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
- import * as PerfUI from '../../../legacy/components/perf_ui/perf_ui.js';
7
-
8
- const chart = new PerfUI.PieChart.PieChart();
9
- document.getElementById('container')?.appendChild(chart);
10
-
11
- chart.data = {
12
- chartName: 'Nice Chart',
13
- size: 110,
14
- formatter: value => String(value) + ' %',
15
- showLegend: false,
16
- total: 100,
17
- slices: [{value: 75, color: 'crimson', title: 'Filling'}, {value: 25, color: 'burlywood', title: 'Crust'}],
18
- };
@@ -1,17 +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>Toast example</title>
12
- </head>
13
- <body>
14
- <div id="container"></div>
15
- <script type="module" src="./basic.js"></script>
16
- </body>
17
- </html>
@@ -1,50 +0,0 @@
1
- // Copyright 2025 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
6
- import * as ComponentHelpers from '../../helpers/helpers.js';
7
- import * as Snackbars from '../../snackbars/snackbars.js';
8
-
9
- await FrontendHelpers.initializeGlobalVars();
10
- await ComponentHelpers.ComponentServerSetup.setup();
11
- const container = document.getElementById('container');
12
-
13
- if (!container) {
14
- throw new Error('No component container found.');
15
- }
16
-
17
- const onActionClick = (): void => {
18
- // eslint-disable-next-line no-console
19
- console.log('Action button clicked!');
20
- };
21
-
22
- const showButton1 = document.createElement('button');
23
- showButton1.textContent = 'Show Long Action Snackbar';
24
- showButton1.addEventListener('click', () => {
25
- Snackbars.Snackbar.Snackbar.show({
26
- message: 'This is a snackbar demonstrating a long action and closable state.',
27
- closable: true,
28
- actionProperties: {
29
- label: 'This is a long action button',
30
- title: 'Click here to perform the designated action',
31
- onClick: onActionClick,
32
- }
33
- });
34
- });
35
- container.appendChild(showButton1);
36
-
37
- const showButton2 = document.createElement('button');
38
- showButton2.textContent = 'Show Action Snackbar';
39
- showButton2.addEventListener('click', () => {
40
- Snackbars.Snackbar.Snackbar.show({
41
- message: 'This is a snackbar demonstrating an action and closable state.',
42
- closable: true,
43
- actionProperties: {
44
- label: 'Action',
45
- title: 'Click here to perform the designated action',
46
- onClick: onActionClick,
47
- }
48
- });
49
- });
50
- container.appendChild(showButton2);