chrome-devtools-frontend 1.0.1544076 → 1.0.1547147

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 (178) hide show
  1. package/config/typescript/tsconfig.eslint.json +1 -0
  2. package/docs/styleguide/ux/styles.md +1 -1
  3. package/eslint.config.mjs +1 -1
  4. package/front_end/Images/src/arrow-down.svg +8 -1
  5. package/front_end/Images/src/arrow-up.svg +8 -1
  6. package/front_end/core/common/ParsedURL.ts +1 -1
  7. package/front_end/core/common/common.ts +0 -2
  8. package/front_end/core/host/AidaClient.ts +1 -1
  9. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  10. package/front_end/core/host/UserMetrics.ts +0 -5
  11. package/front_end/core/platform/HostRuntime.ts +18 -0
  12. package/front_end/core/platform/KeyboardUtilities.ts +2 -2
  13. package/front_end/core/platform/StringUtilities.ts +1 -1
  14. package/front_end/core/platform/api/HostRuntime.ts +20 -0
  15. package/front_end/core/platform/api/api.ts +7 -0
  16. package/front_end/core/platform/browser/HostRuntime.ts +14 -0
  17. package/front_end/core/platform/browser/browser.ts +7 -0
  18. package/front_end/core/platform/node/HostRuntime.ts +13 -0
  19. package/front_end/core/platform/node/node.ts +7 -0
  20. package/front_end/core/platform/platform.ts +2 -2
  21. package/front_end/core/protocol_client/CDPConnection.ts +3 -3
  22. package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -1
  23. package/front_end/core/sdk/CSSMetadata.ts +17 -5
  24. package/front_end/core/sdk/NetworkManager.ts +6 -8
  25. package/front_end/core/sdk/NetworkRequest.ts +4 -0
  26. package/front_end/core/sdk/SDKModel.ts +4 -2
  27. package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
  28. package/front_end/core/sdk/Target.ts +5 -14
  29. package/front_end/core/sdk/TargetManager.ts +39 -18
  30. package/front_end/core/sdk/sdk-meta.ts +62 -0
  31. package/front_end/devtools_compatibility.js +0 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +2 -2
  33. package/front_end/foundation/Universe.ts +2 -2
  34. package/front_end/generated/Deprecation.ts +11 -0
  35. package/front_end/generated/InspectorBackendCommands.ts +3 -6
  36. package/front_end/generated/SupportedCSSProperties.js +4 -25
  37. package/front_end/generated/protocol-mapping.d.ts +0 -15
  38. package/front_end/generated/protocol-proxy-api.d.ts +0 -11
  39. package/front_end/generated/protocol.ts +5 -36
  40. package/front_end/models/ai_assistance/AiConversation.ts +188 -0
  41. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
  42. package/front_end/models/ai_assistance/ConversationHandler.ts +5 -5
  43. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -3
  44. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
  45. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
  46. package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -9
  47. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  48. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
  49. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
  50. package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
  51. package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
  52. package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
  53. package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
  54. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
  55. package/front_end/models/crux-manager/CrUXManager.ts +7 -4
  56. package/front_end/models/issues_manager/GenericIssue.ts +12 -9
  57. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  58. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
  59. package/front_end/models/trace/helpers/Trace.ts +13 -0
  60. package/front_end/models/trace/types/TraceEvents.ts +2 -1
  61. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
  62. package/front_end/models/workspace/IgnoreListManager.ts +1 -2
  63. package/front_end/models/workspace/UISourceCode.ts +50 -0
  64. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
  65. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
  66. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
  67. package/front_end/panels/ai_assistance/components/UserActionRow.ts +2 -1
  68. package/front_end/panels/animation/AnimationTimeline.ts +0 -8
  69. package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -7
  70. package/front_end/panels/application/{components/FrameDetailsView.ts → FrameDetailsView.ts} +140 -171
  71. package/front_end/panels/application/{components/OriginTrialTreeView.ts → OriginTrialTreeView.ts} +9 -9
  72. package/front_end/panels/application/application.ts +4 -0
  73. package/front_end/panels/application/components/StackTrace.ts +89 -88
  74. package/front_end/panels/application/components/components.ts +2 -4
  75. package/front_end/panels/application/{components/frameDetailsReportView.css → frameDetailsReportView.css} +5 -1
  76. package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
  77. package/front_end/panels/common/BadgeNotification.ts +2 -1
  78. package/front_end/panels/common/DOMLinkifier.ts +7 -2
  79. package/front_end/panels/common/GdpSignUpDialog.ts +2 -1
  80. package/front_end/panels/common/common.ts +2 -1
  81. package/front_end/panels/console/ConsolePrompt.ts +3 -1
  82. package/front_end/panels/console/ConsoleViewport.ts +1 -2
  83. package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
  84. package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
  85. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  86. package/front_end/panels/elements/StylePropertyTreeElement.ts +23 -19
  87. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  88. package/front_end/panels/elements/cssValueTraceView.css +1 -1
  89. package/front_end/panels/elements/elements-meta.ts +1 -22
  90. package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
  91. package/front_end/panels/explain/components/consoleInsight.css +46 -1
  92. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
  93. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -6
  94. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
  95. package/front_end/panels/network/RequestConditionsDrawer.ts +54 -24
  96. package/front_end/panels/network/networkLogView.css +11 -0
  97. package/front_end/panels/network/networkTimingTable.css +8 -6
  98. package/front_end/panels/network/requestConditionsDrawer.css +10 -1
  99. package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
  100. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
  101. package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
  102. package/front_end/panels/settings/SettingsScreen.ts +3 -2
  103. package/front_end/panels/sources/CoveragePlugin.ts +5 -5
  104. package/front_end/panels/sources/Plugin.ts +1 -1
  105. package/front_end/panels/sources/ProfilePlugin.ts +22 -14
  106. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
  107. package/front_end/panels/sources/sources-meta.ts +0 -62
  108. package/front_end/panels/timeline/README.md +1 -9
  109. package/front_end/panels/timeline/ThreadAppender.ts +0 -7
  110. package/front_end/panels/timeline/TimelinePanel.ts +1 -1
  111. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -0
  112. package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
  113. package/front_end/panels/timeline/components/LiveMetricsView.ts +51 -6
  114. package/front_end/panels/timeline/components/MetricCard.ts +2 -2
  115. package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
  116. package/front_end/panels/timeline/components/insights/NodeLink.ts +2 -3
  117. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -1
  118. package/front_end/panels/timeline/timeline-meta.ts +0 -10
  119. package/front_end/panels/timeline/timeline.ts +0 -2
  120. package/front_end/panels/whats_new/ReleaseNoteView.ts +2 -1
  121. package/front_end/panels/whats_new/WhatsNewImpl.ts +3 -2
  122. package/front_end/third_party/chromium/README.chromium +1 -1
  123. package/front_end/tsconfig.json +1 -0
  124. package/front_end/ui/components/buttons/Button.docs.ts +6 -5
  125. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -0
  126. package/front_end/ui/components/snackbars/Snackbars.docs.ts +1 -1
  127. package/front_end/ui/components/spinners/Spinners.docs.ts +1 -1
  128. package/front_end/ui/components/survey_link/SurveyLink.docs.ts +2 -1
  129. package/front_end/ui/components/switch/Switch.docs.ts +1 -1
  130. package/front_end/ui/components/tooltips/Tooltip.docs.ts +3 -3
  131. package/front_end/ui/helpers/OpenInNewTab.ts +87 -0
  132. package/front_end/ui/helpers/helpers.ts +5 -0
  133. package/front_end/ui/legacy/ARIAUtils.ts +2 -2
  134. package/front_end/ui/legacy/ActionRegistration.ts +11 -0
  135. package/front_end/ui/legacy/ContextMenu.docs.ts +12 -11
  136. package/front_end/ui/legacy/RadioButton.docs.ts +1 -1
  137. package/front_end/ui/legacy/SelectMenu.docs.ts +1 -1
  138. package/front_end/ui/legacy/Slider.docs.ts +1 -1
  139. package/front_end/ui/legacy/SoftDropDown.ts +2 -2
  140. package/front_end/ui/legacy/TextPrompt.ts +3 -2
  141. package/front_end/ui/legacy/Treeoutline.ts +2 -1
  142. package/front_end/ui/legacy/UIUtils.ts +11 -43
  143. package/front_end/ui/legacy/Widget.ts +3 -2
  144. package/front_end/ui/legacy/XLink.ts +4 -4
  145. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
  146. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -2
  147. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +144 -143
  148. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
  149. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
  150. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
  151. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -7
  152. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -2
  153. package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
  154. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  155. package/front_end/ui/legacy/legacy.ts +2 -0
  156. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  157. package/mcp/tsconfig.json +16 -0
  158. package/package.json +2 -2
  159. package/front_end/core/common/Linkifier.ts +0 -55
  160. package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
  161. package/front_end/panels/timeline/CLSLinkifier.ts +0 -58
  162. package/front_end/ui/components/docs/README.md +0 -6
  163. package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
  164. package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
  165. package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
  166. package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
  167. package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
  168. package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
  169. package/front_end/ui/components/docs/component_docs.ts +0 -24
  170. package/front_end/ui/components/docs/component_docs_styles.css +0 -53
  171. package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
  172. package/front_end/ui/components/docs/slider/basic.html +0 -20
  173. package/front_end/ui/components/docs/switch/basic.html +0 -20
  174. /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
  175. /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
  176. /package/front_end/panels/application/{components/originTrialTokenRows.css → originTrialTokenRows.css} +0 -0
  177. /package/front_end/panels/application/{components/originTrialTreeView.css → originTrialTreeView.css} +0 -0
  178. /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
@@ -6,7 +6,6 @@ import * as AnimationsTrackAppender from './AnimationsTrackAppender.js';
6
6
  import * as AnnotationHelpers from './AnnotationHelpers.js';
7
7
  import * as AppenderUtils from './AppenderUtils.js';
8
8
  import * as BenchmarkEvents from './BenchmarkEvents.js';
9
- import * as CLSLinkifier from './CLSLinkifier.js';
10
9
  import * as CompatibilityTracksAppender from './CompatibilityTracksAppender.js';
11
10
  import * as CountersGraph from './CountersGraph.js';
12
11
  import * as EntriesFilter from './EntriesFilter.js';
@@ -51,7 +50,6 @@ export {
51
50
  AnnotationHelpers,
52
51
  AppenderUtils,
53
52
  BenchmarkEvents,
54
- CLSLinkifier,
55
53
  CompatibilityTracksAppender,
56
54
  CountersGraph,
57
55
  EntriesFilter,
@@ -8,6 +8,7 @@ import * as i18n from '../../core/i18n/i18n.js';
8
8
  import type * as Platform from '../../core/platform/platform.js';
9
9
  import * as Marked from '../../third_party/marked/marked.js';
10
10
  import * as Buttons from '../../ui/components/buttons/buttons.js';
11
+ import * as UIHelpers from '../../ui/helpers/helpers.js';
11
12
  import * as UI from '../../ui/legacy/legacy.js';
12
13
  import {html, render} from '../../ui/lit/lit.js';
13
14
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -131,7 +132,7 @@ export class ReleaseNoteView extends UI.Panel.Panel {
131
132
  this.#view(
132
133
  {
133
134
  getReleaseNote,
134
- openNewTab: UI.UIUtils.openInNewTab,
135
+ openNewTab: UIHelpers.openInNewTab,
135
136
  markdownContent,
136
137
  getThumbnailPath: this.#getThumbnailPath,
137
138
  },
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
+ import * as UIHelpers from '../../ui/helpers/helpers.js';
7
8
  import * as UI from '../../ui/legacy/legacy.js';
8
9
 
9
10
  import {getReleaseNote} from './ReleaseNoteText.js';
@@ -69,7 +70,7 @@ let releaseNotesActionDelegateInstance: ReleaseNotesActionDelegate;
69
70
  export class ReleaseNotesActionDelegate implements UI.ActionRegistration.ActionDelegate {
70
71
  handleAction(_context: UI.Context.Context, _actionId: string): boolean {
71
72
  const releaseNote = getReleaseNote();
72
- UI.UIUtils.openInNewTab(releaseNote.link);
73
+ UIHelpers.openInNewTab(releaseNote.link);
73
74
  return true;
74
75
  }
75
76
  static instance(opts: {forceNew: boolean|null} = {forceNew: null}): ReleaseNotesActionDelegate {
@@ -85,7 +86,7 @@ export class ReleaseNotesActionDelegate implements UI.ActionRegistration.ActionD
85
86
  let reportIssueActionDelegateInstance: ReportIssueActionDelegate;
86
87
  export class ReportIssueActionDelegate implements UI.ActionRegistration.ActionDelegate {
87
88
  handleAction(_context: UI.Context.Context, _actionId: string): boolean {
88
- UI.UIUtils.openInNewTab('https://goo.gle/devtools-bug');
89
+ UIHelpers.openInNewTab('https://goo.gle/devtools-bug');
89
90
  return true;
90
91
  }
91
92
  static instance(opts: {forceNew: boolean|null} = {forceNew: null}): ReportIssueActionDelegate {
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: https://chromium.googlesource.com/chromium/src
3
3
  Version: N/A
4
- Revision: 3e8720c1c3a43f134e2008e1764e70380a5b8bc1
4
+ Revision: 9964dcba17c15a0ec11126abaa933c551bae04d5
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -3,6 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "allowUmdGlobalAccess": true,
5
5
  "outDir": "ignored",
6
+ "rootDir": ".",
6
7
  "target": "ES2023",
7
8
  "lib": [
8
9
  "ES2023",
@@ -4,10 +4,11 @@
4
4
 
5
5
  import {Button, FloatingButton} from './buttons.js';
6
6
 
7
- export async function render(container: HTMLElement) {
7
+ export function render(container: HTMLElement) {
8
+ const buttonDocs = container.createChild('div', 'button-docs');
8
9
  const style = document.createElement('style');
9
10
  style.textContent = `
10
- #container > div {
11
+ .button-docs > div {
11
12
  width: 80%;
12
13
  padding: var(--sys-size-11);
13
14
  display: flex;
@@ -16,13 +17,13 @@ export async function render(container: HTMLElement) {
16
17
  gap: var(--sys-size-5);
17
18
  }
18
19
  `;
19
- container.appendChild(style);
20
+ buttonDocs.appendChild(style);
20
21
 
21
22
  const appendSection = (headerText: string, sectionElement: HTMLElement) => {
22
23
  const header = document.createElement('header');
23
24
  header.textContent = headerText;
24
- container.appendChild(header);
25
- container.appendChild(sectionElement);
25
+ buttonDocs.appendChild(header);
26
+ buttonDocs.appendChild(sectionElement);
26
27
  };
27
28
 
28
29
  const buttonsSection = document.createElement('div');
@@ -69,6 +69,7 @@ export const markdownLinks = new Map<string, string>([
69
69
  ],
70
70
  ['storagePartitioningExplainer', 'https://developers.google.com/privacy-sandbox/cookies/storage-partitioning'],
71
71
  ['storageAccessAPI', 'https://developer.mozilla.org/en-US/docs/Web/API/StorageAccessHandle/createObjectURL'],
72
+ ['https://goo.gle/ps-status', 'https://goo.gle/ps-status'],
72
73
  ]);
73
74
 
74
75
  export const getMarkdownLink = (key: string): string => {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {Snackbar} from './snackbars.js';
6
6
 
7
- export async function render(container: HTMLElement) {
7
+ export function render(container: HTMLElement) {
8
8
  const onActionClick = (): void => {
9
9
  // eslint-disable-next-line no-console
10
10
  console.log('Action button clicked!');
@@ -8,6 +8,6 @@ import * as Lit from '../../lit/lit.js';
8
8
 
9
9
  const {html} = Lit;
10
10
 
11
- export async function render(container: HTMLElement) {
11
+ export function render(container: HTMLElement) {
12
12
  Lit.render(html`<devtools-spinner></devtools-spinner>`, container);
13
13
  }
@@ -3,7 +3,8 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../../core/common/common.js';
6
- import {SurveyLink} from '../survey_link/survey_link.js';
6
+
7
+ import {SurveyLink} from './survey_link.js';
7
8
 
8
9
  export function render(container: HTMLElement): void {
9
10
  const link = new SurveyLink.SurveyLink();
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {Switch} from './switch.js';
6
6
 
7
- export async function render(container: HTMLElement) {
7
+ export function render(container: HTMLElement) {
8
8
  function switchExample({checked, disabled}: {checked: boolean, disabled: boolean}): HTMLElement {
9
9
  const example = document.createElement('div');
10
10
  example.style.marginTop = '20px';
@@ -4,11 +4,11 @@
4
4
 
5
5
  import * as Lit from '../../lit/lit.js';
6
6
 
7
- import {Tooltip} from './Tooltip.js';
7
+ import {Tooltip} from './tooltips.js';
8
8
 
9
9
  const {html} = Lit;
10
10
 
11
- export async function render(container: HTMLElement) {
11
+ export function render(container: HTMLElement) {
12
12
  Lit.render(
13
13
  html`
14
14
  <div style="position: relative; z-index: 0;">
@@ -44,7 +44,7 @@ export async function render(container: HTMLElement) {
44
44
  container);
45
45
 
46
46
  const anchor = container.querySelector('.anchor') as HTMLElement;
47
- const programmaticTooltip = new Tooltip({id: 'programatic', variant: 'rich', anchor});
47
+ const programmaticTooltip = new Tooltip.Tooltip({id: 'programatic', variant: 'rich', anchor});
48
48
  programmaticTooltip.append('Text content');
49
49
  anchor.insertAdjacentElement('afterend', programmaticTooltip);
50
50
 
@@ -0,0 +1,87 @@
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
+ /*
6
+ * Copyright (C) 2011 Google Inc. All rights reserved.
7
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
8
+ * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
9
+ * Copyright (C) 2009 Joseph Pecoraro
10
+ *
11
+ * Redistribution and use in source and binary forms, with or without
12
+ * modification, are permitted provided that the following conditions
13
+ * are met:
14
+ *
15
+ * 1. Redistributions of source code must retain the above copyright
16
+ * notice, this list of conditions and the following disclaimer.
17
+ * 2. Redistributions in binary form must reproduce the above copyright
18
+ * notice, this list of conditions and the following disclaimer in the
19
+ * documentation and/or other materials provided with the distribution.
20
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
21
+ * its contributors may be used to endorse or promote products derived
22
+ * from this software without specific prior written permission.
23
+ *
24
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
25
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
28
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ */
35
+
36
+ import * as Common from '../../core/common/common.js';
37
+ import * as Host from '../../core/host/host.js';
38
+ import * as Platform from '../../core/platform/platform.js';
39
+ import * as Root from '../../core/root/root.js';
40
+ import * as SDK from '../../core/sdk/sdk.js';
41
+
42
+ /**
43
+ * Opens the given `url` in a new Chrome tab.
44
+ *
45
+ * If the `url` is a Google owned documentation page (currently that includes
46
+ * `web.dev`, `developers.google.com`, and `developer.chrome.com`), the `url`
47
+ * will also be checked for UTM parameters:
48
+ *
49
+ * - If no `utm_source` search parameter is present, this method will add a new
50
+ * search parameter `utm_source=devtools` to `url`.
51
+ * - If no `utm_campaign` search parameter is present, and DevTools is running
52
+ * within a branded build, this method will add `utm_campaign=<channel>` to
53
+ * the search parameters, with `<channel>` being the release channel of
54
+ * Chrome ("stable", "beta", "dev", or "canary").
55
+ *
56
+ * @param url the URL to open in a new tab.
57
+ * @throws TypeError if `url` is not a valid URL.
58
+ * @see https://en.wikipedia.org/wiki/UTM_parameters
59
+ */
60
+ export function openInNewTab(url: URL|string): void {
61
+ url = new URL(`${url}`);
62
+ // Navigating to a chrome:// link via a normal anchor doesn't work, so we "navigate"
63
+ // there using CDP.
64
+ if (Common.ParsedURL.schemeIs(url, 'chrome:')) {
65
+ const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();
66
+ if (rootTarget === null) {
67
+ return;
68
+ }
69
+
70
+ void rootTarget.targetAgent().invoke_createTarget({url: url.toString()}).then(result => {
71
+ if (result.getError()) {
72
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(Platform.DevToolsPath.urlString`${url}`);
73
+ }
74
+ });
75
+ } else {
76
+ if (['developer.chrome.com', 'developers.google.com', 'web.dev'].includes(url.hostname)) {
77
+ if (!url.searchParams.has('utm_source')) {
78
+ url.searchParams.append('utm_source', 'devtools');
79
+ }
80
+ const {channel} = Root.Runtime.hostConfig;
81
+ if (!url.searchParams.has('utm_campaign') && typeof channel === 'string') {
82
+ url.searchParams.append('utm_campaign', channel);
83
+ }
84
+ }
85
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(Platform.DevToolsPath.urlString`${url}`);
86
+ }
87
+ }
@@ -0,0 +1,5 @@
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
+ export {openInNewTab} from './OpenInNewTab.js';
@@ -5,6 +5,7 @@
5
5
  import * as Platform from '../../core/platform/platform.js';
6
6
 
7
7
  import {Dialog} from './Dialog.js';
8
+ import {getEnclosingShadowRootForNode} from './DOMUtilities.js';
8
9
 
9
10
  let id = 0;
10
11
 
@@ -348,8 +349,7 @@ export function setActiveDescendant(element: Element, activedescendant: Element|
348
349
 
349
350
  if (activedescendant.isConnected && element.isConnected) {
350
351
  console.assert(
351
- Platform.DOMUtilities.getEnclosingShadowRootForNode(activedescendant) ===
352
- Platform.DOMUtilities.getEnclosingShadowRootForNode(element),
352
+ getEnclosingShadowRootForNode(activedescendant) === getEnclosingShadowRootForNode(element),
353
353
  'elements are not in the same shadow dom');
354
354
  }
355
355
 
@@ -215,6 +215,10 @@ export class Action extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
215
215
  return this.actionRegistration.bindings;
216
216
  }
217
217
 
218
+ configurableBindings(): boolean {
219
+ return this.actionRegistration.configurableBindings ?? true;
220
+ }
221
+
218
222
  experiment(): string|undefined {
219
223
  return this.actionRegistration.experiment;
220
224
  }
@@ -536,6 +540,13 @@ export interface ActionRegistration {
536
540
  * are flavors of the current appliaction context.
537
541
  */
538
542
  bindings?: Binding[];
543
+ /**
544
+ * Whether the action's bindings should be displayed for configuration in the
545
+ * Settings UI. Setting this to `false` will hide the action from the Shortcuts
546
+ * tab. Defaults to `true`.
547
+ */
548
+ // TODO(crbug.com/436764687): Consider removing this again if parametrized actions get moved to a separate mechanism
549
+ configurableBindings?: boolean;
539
550
  /**
540
551
  * The name of the experiment an action is associated with. Enabling and disabling the declared
541
552
  * experiment will enable and disable the action respectively.
@@ -8,10 +8,11 @@ import {ContextMenu} from './legacy.js';
8
8
 
9
9
  const {html} = Lit;
10
10
 
11
- export async function render(container: HTMLElement) {
11
+ export function render(container: HTMLElement) {
12
+ const menuDocs = container.createChild('div', 'menu-docs');
12
13
  const style = document.createElement('style');
13
14
  style.textContent = `
14
- #container > div {
15
+ .menu-docs > div {
15
16
  width: var(--sys-size-34);
16
17
  padding: var(--sys-size-11);
17
18
  display: flex;
@@ -27,13 +28,13 @@ export async function render(container: HTMLElement) {
27
28
  }
28
29
  }
29
30
  `;
30
- container.appendChild(style);
31
+ menuDocs.appendChild(style);
31
32
 
32
33
  const menuButtonSection = document.createElement('div');
33
34
  const menuButtonHeader = document.createElement('header');
34
35
  menuButtonHeader.textContent = 'DevTools menu button (lit-html)';
35
- container.appendChild(menuButtonHeader);
36
- container.appendChild(menuButtonSection);
36
+ menuDocs.appendChild(menuButtonHeader);
37
+ menuDocs.appendChild(menuButtonSection);
37
38
 
38
39
  Lit.render(
39
40
  html`
@@ -53,8 +54,8 @@ export async function render(container: HTMLElement) {
53
54
  simpleItemsSection.innerHTML = '<p>Right-click here</p>';
54
55
  const simpleItemsHeader = document.createElement('header');
55
56
  simpleItemsHeader.textContent = 'Various simple menu items (imperative API)';
56
- container.appendChild(simpleItemsHeader);
57
- container.appendChild(simpleItemsSection);
57
+ menuDocs.appendChild(simpleItemsHeader);
58
+ menuDocs.appendChild(simpleItemsSection);
58
59
 
59
60
  let checked = true;
60
61
  simpleItemsSection.addEventListener('contextmenu', onSimpleMenu);
@@ -93,8 +94,8 @@ export async function render(container: HTMLElement) {
93
94
  customSection.innerHTML = '<p>Right-click here</p>';
94
95
  const customSectionHeader = document.createElement('header');
95
96
  customSectionHeader.textContent = 'Custom sections (imperative API)';
96
- container.appendChild(customSectionHeader);
97
- container.appendChild(customSection);
97
+ menuDocs.appendChild(customSectionHeader);
98
+ menuDocs.appendChild(customSection);
98
99
 
99
100
  customSection.addEventListener('contextmenu', onCustomSectionMenu);
100
101
 
@@ -117,8 +118,8 @@ export async function render(container: HTMLElement) {
117
118
  subMenuSection.innerHTML = '<p>Right-click here</p>';
118
119
  const subMenuHeader = document.createElement('header');
119
120
  subMenuHeader.textContent = 'Sub menu (imperative API)';
120
- container.appendChild(subMenuHeader);
121
- container.appendChild(subMenuSection);
121
+ menuDocs.appendChild(subMenuHeader);
122
+ menuDocs.appendChild(subMenuSection);
122
123
 
123
124
  subMenuSection.addEventListener('contextmenu', onSubMenu);
124
125
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {UIUtils} from './legacy.js';
6
6
 
7
- export async function render(container: HTMLElement) {
7
+ export function render(container: HTMLElement) {
8
8
  const styleElement = document.createElement('style');
9
9
  styleElement.textContent = 'fieldset { label { display: block; } }';
10
10
  container.appendChild(styleElement);
@@ -9,7 +9,7 @@ import {UIUtils} from './legacy.js';
9
9
 
10
10
  const {html} = Lit;
11
11
 
12
- export async function render(container: HTMLElement) {
12
+ export function render(container: HTMLElement) {
13
13
  function createDivWithP(text: string): HTMLDivElement {
14
14
  const div = document.createElement('div');
15
15
  div.style.paddingLeft = '25px';
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {UIUtils} from './legacy.js';
6
6
 
7
- export async function render(container: HTMLElement) {
7
+ export function render(container: HTMLElement) {
8
8
  function sliderExample({min, max, tabIndex, disabled}: {
9
9
  min: number,
10
10
  max: number,
@@ -5,12 +5,12 @@
5
5
 
6
6
  import type * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
- import * as Platform from '../../core/platform/platform.js';
9
8
  import * as Geometry from '../../models/geometry/geometry.js';
10
9
  import * as IconButton from '../components/icon_button/icon_button.js';
11
10
  import * as VisualLogging from '../visual_logging/visual_logging.js';
12
11
 
13
12
  import * as ARIAUtils from './ARIAUtils.js';
13
+ import {appendStyle} from './DOMUtilities.js';
14
14
  import {AnchorBehavior, GlassPane, MarginBehavior, PointerEventsBehavior} from './GlassPane.js';
15
15
  import {ListControl, type ListDelegate, ListMode} from './ListControl.js';
16
16
  import {Events as ListModelEvents, type ItemsReplacedEvent, type ListModel} from './ListModel.js';
@@ -54,7 +54,7 @@ export class SoftDropDown<T> implements ListDelegate<T> {
54
54
  );
55
55
  }
56
56
  this.element.classList.add('soft-dropdown');
57
- Platform.DOMUtilities.appendStyle(this.element, softDropDownButtonStyles);
57
+ appendStyle(this.element, softDropDownButtonStyles);
58
58
  this.titleElement = this.element.createChild('span', 'title');
59
59
  const dropdownArrowIcon = IconButton.Icon.create('triangle-down');
60
60
  this.element.appendChild(dropdownArrowIcon);
@@ -38,6 +38,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
38
38
  import * as VisualLogging from '../visual_logging/visual_logging.js';
39
39
 
40
40
  import * as ARIAUtils from './ARIAUtils.js';
41
+ import {appendStyle, rangeOfWord} from './DOMUtilities.js';
41
42
  import {SuggestBox, type SuggestBoxDelegate, type Suggestion} from './SuggestBox.js';
42
43
  import textPromptStyles from './textPrompt.css.js';
43
44
  import {Tooltip} from './Tooltip.js';
@@ -344,7 +345,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
344
345
  this.boundClearAutocomplete = this.clearAutocomplete.bind(this);
345
346
  this.boundOnBlur = this.onBlur.bind(this);
346
347
  this.proxyElement = element.ownerDocument.createElement('span');
347
- Platform.DOMUtilities.appendStyle(this.proxyElement, textPromptStyles);
348
+ appendStyle(this.proxyElement, textPromptStyles);
348
349
  this.contentElement = this.proxyElement.createChild('div', 'text-prompt-root');
349
350
  this.proxyElement.style.display = this.proxyElementDisplay;
350
351
  if (element.parentElement) {
@@ -740,7 +741,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
740
741
  return;
741
742
  }
742
743
 
743
- const wordQueryRange = Platform.DOMUtilities.rangeOfWord(
744
+ const wordQueryRange = rangeOfWord(
744
745
  selectionRange.startContainer, selectionRange.startOffset, this.completionStopCharacters, this.element(),
745
746
  'backward');
746
747
 
@@ -45,6 +45,7 @@ import * as Lit from '../lit/lit.js';
45
45
  import * as VisualLogging from '../visual_logging/visual_logging.js';
46
46
 
47
47
  import * as ARIAUtils from './ARIAUtils.js';
48
+ import {appendStyle} from './DOMUtilities.js';
48
49
  import {type Config, InplaceEditor} from './InplaceEditor.js';
49
50
  import {Keys} from './KeyboardShortcut.js';
50
51
  import type {SearchableView} from './SearchableView.js';
@@ -428,7 +429,7 @@ export class TreeOutlineInShadow extends TreeOutline {
428
429
 
429
430
  registerRequiredCSS(...cssFiles: Array<string&{_tag: 'CSS-in-JS'}>): void {
430
431
  for (const cssFile of cssFiles) {
431
- Platform.DOMUtilities.appendStyle(this.shadowRoot, cssFile);
432
+ appendStyle(this.shadowRoot, cssFile);
432
433
  }
433
434
  }
434
435
 
@@ -40,7 +40,6 @@ import * as Common from '../../core/common/common.js';
40
40
  import * as Host from '../../core/host/host.js';
41
41
  import * as i18n from '../../core/i18n/i18n.js';
42
42
  import * as Platform from '../../core/platform/platform.js';
43
- import * as Root from '../../core/root/root.js';
44
43
  import * as Geometry from '../../models/geometry/geometry.js';
45
44
  import * as TextUtils from '../../models/text_utils/text_utils.js';
46
45
  import * as Buttons from '../components/buttons/buttons.js';
@@ -54,6 +53,7 @@ import * as ARIAUtils from './ARIAUtils.js';
54
53
  import checkboxTextLabelStyles from './checkboxTextLabel.css.js';
55
54
  import confirmDialogStyles from './confirmDialog.css.js';
56
55
  import {Dialog} from './Dialog.js';
56
+ import {appendStyle, deepActiveElement, rangeOfWord} from './DOMUtilities.js';
57
57
  import {GlassPane, PointerEventsBehavior, SizeBehavior} from './GlassPane.js';
58
58
  import inspectorCommonStyles from './inspectorCommon.css.js';
59
59
  import {InspectorView} from './InspectorView.js';
@@ -359,7 +359,7 @@ export function isEditing(): boolean {
359
359
  return true;
360
360
  }
361
361
 
362
- const focused = Platform.DOMUtilities.deepActiveElement(document);
362
+ const focused = deepActiveElement(document);
363
363
  if (!focused) {
364
364
  return false;
365
365
  }
@@ -581,8 +581,8 @@ export function handleElementValueModifications(
581
581
  }
582
582
 
583
583
  const originalValue = element.textContent;
584
- const wordRange = Platform.DOMUtilities.rangeOfWord(
585
- selectionRange.startContainer, selectionRange.startOffset, StyleValueDelimiters, element);
584
+ const wordRange =
585
+ rangeOfWord(selectionRange.startContainer, selectionRange.startOffset, StyleValueDelimiters, element);
586
586
  const wordString = wordRange.toString();
587
587
 
588
588
  if (suggestionHandler?.(wordString)) {
@@ -656,8 +656,8 @@ export function addPlatformClass(element: HTMLElement): void {
656
656
  }
657
657
 
658
658
  export function installComponentRootStyles(element: HTMLElement): void {
659
- Platform.DOMUtilities.appendStyle(element, inspectorCommonStyles);
660
- Platform.DOMUtilities.appendStyle(element, Buttons.textButtonStyles);
659
+ appendStyle(element, inspectorCommonStyles);
660
+ appendStyle(element, Buttons.textButtonStyles);
661
661
 
662
662
  // Detect overlay scrollbar enable by checking for nonzero scrollbar width.
663
663
  if (!Host.Platform.isMac() && measuredScrollbarWidth(element.ownerDocument) === 0) {
@@ -682,7 +682,7 @@ export class ElementFocusRestorer {
682
682
  private previous: HTMLElement|null;
683
683
  constructor(element: Element) {
684
684
  this.element = (element as HTMLElement | null);
685
- this.previous = (Platform.DOMUtilities.deepActiveElement(element.ownerDocument) as HTMLElement | null);
685
+ this.previous = (deepActiveElement(element.ownerDocument) as HTMLElement | null);
686
686
  (element as HTMLElement).focus();
687
687
  }
688
688
 
@@ -1931,7 +1931,7 @@ function updateWidgetfocusWidgetForNode(node: Node|null): void {
1931
1931
  function focusChanged(event: Event): void {
1932
1932
  const target = event.target as HTMLElement;
1933
1933
  const document = target ? target.ownerDocument : null;
1934
- const element = document ? Platform.DOMUtilities.deepActiveElement(document) : null;
1934
+ const element = document ? deepActiveElement(document) : null;
1935
1935
  updateWidgetfocusWidgetForNode(element);
1936
1936
  }
1937
1937
 
@@ -1954,11 +1954,11 @@ export function createShadowRootWithCoreStyles(element: Element, options: {
1954
1954
  const {cssFile, delegatesFocus} = options;
1955
1955
 
1956
1956
  const shadowRoot = element.attachShadow({mode: 'open', delegatesFocus});
1957
- Platform.DOMUtilities.appendStyle(shadowRoot, inspectorCommonStyles, Buttons.textButtonStyles);
1957
+ appendStyle(shadowRoot, inspectorCommonStyles, Buttons.textButtonStyles);
1958
1958
  if (Array.isArray(cssFile)) {
1959
- Platform.DOMUtilities.appendStyle(shadowRoot, ...cssFile);
1959
+ appendStyle(shadowRoot, ...cssFile);
1960
1960
  } else if (cssFile) {
1961
- Platform.DOMUtilities.appendStyle(shadowRoot, cssFile);
1961
+ appendStyle(shadowRoot, cssFile);
1962
1962
  }
1963
1963
  shadowRoot.addEventListener('focus', focusChanged, true);
1964
1964
  return shadowRoot;
@@ -1989,38 +1989,6 @@ export function measuredScrollbarWidth(document?: Document|null): number {
1989
1989
  return cachedMeasuredScrollbarWidth;
1990
1990
  }
1991
1991
 
1992
- /**
1993
- * Opens the given `url` in a new Chrome tab.
1994
- *
1995
- * If the `url` is a Google owned documentation page (currently that includes
1996
- * `web.dev`, `developers.google.com`, and `developer.chrome.com`), the `url`
1997
- * will also be checked for UTM parameters:
1998
- *
1999
- * - If no `utm_source` search parameter is present, this method will add a new
2000
- * search parameter `utm_source=devtools` to `url`.
2001
- * - If no `utm_campaign` search parameter is present, and DevTools is running
2002
- * within a branded build, this method will add `utm_campaign=<channel>` to
2003
- * the search parameters, with `<channel>` being the release channel of
2004
- * Chrome ("stable", "beta", "dev", or "canary").
2005
- *
2006
- * @param url the URL to open in a new tab.
2007
- * @throws TypeError if `url` is not a valid URL.
2008
- * @see https://en.wikipedia.org/wiki/UTM_parameters
2009
- */
2010
- export function openInNewTab(url: URL|string): void {
2011
- url = new URL(`${url}`);
2012
- if (['developer.chrome.com', 'developers.google.com', 'web.dev'].includes(url.hostname)) {
2013
- if (!url.searchParams.has('utm_source')) {
2014
- url.searchParams.append('utm_source', 'devtools');
2015
- }
2016
- const {channel} = Root.Runtime.hostConfig;
2017
- if (!url.searchParams.has('utm_campaign') && typeof channel === 'string') {
2018
- url.searchParams.append('utm_campaign', channel);
2019
- }
2020
- }
2021
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(Platform.DevToolsPath.urlString`${url}`);
2022
- }
2023
-
2024
1992
  export interface PromotionDisplayState {
2025
1993
  displayCount: number;
2026
1994
  firstRegistered: number;
@@ -35,6 +35,7 @@ import * as Platform from '../../core/platform/platform.js';
35
35
  import * as Geometry from '../../models/geometry/geometry.js';
36
36
  import * as Lit from '../../ui/lit/lit.js';
37
37
 
38
+ import {appendStyle, deepActiveElement} from './DOMUtilities.js';
38
39
  import {cloneCustomElement, createShadowRootWithCoreStyles} from './UIUtils.js';
39
40
 
40
41
  // Remember the original DOM mutation methods here, since we
@@ -766,7 +767,7 @@ export class Widget {
766
767
 
767
768
  registerRequiredCSS(...cssFiles: Array<string&{_tag: 'CSS-in-JS'}>): void {
768
769
  for (const cssFile of cssFiles) {
769
- Platform.DOMUtilities.appendStyle(this.#shadowRoot ?? this.element, cssFile);
770
+ appendStyle(this.#shadowRoot ?? this.element, cssFile);
770
771
  }
771
772
  }
772
773
 
@@ -1106,7 +1107,7 @@ export class WidgetFocusRestorer {
1106
1107
  private previous: HTMLElement|null;
1107
1108
  constructor(widget: Widget) {
1108
1109
  this.widget = widget;
1109
- this.previous = (Platform.DOMUtilities.deepActiveElement(widget.element.ownerDocument) as HTMLElement | null);
1110
+ this.previous = (deepActiveElement(widget.element.ownerDocument) as HTMLElement | null);
1110
1111
  widget.focus();
1111
1112
  }
1112
1113