chrome-devtools-frontend 1.0.939277 → 1.0.941095

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 (61) hide show
  1. package/.stylelintrc.json +1 -7
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +2 -0
  4. package/docs/triage_guidelines.md +13 -11
  5. package/front_end/Tests.js +47 -0
  6. package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -0
  7. package/front_end/core/host/UserMetrics.ts +72 -0
  8. package/front_end/core/i18n/locales/en-US.json +42 -9
  9. package/front_end/core/i18n/locales/en-XL.json +42 -9
  10. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  11. package/front_end/core/root/Runtime.ts +4 -0
  12. package/front_end/core/sdk/CategorizedBreakpoint.ts +35 -0
  13. package/front_end/core/sdk/DOMDebuggerModel.ts +28 -42
  14. package/front_end/core/sdk/EventBreakpointsModel.ts +178 -0
  15. package/front_end/core/sdk/Target.ts +2 -1
  16. package/front_end/core/sdk/sdk.ts +4 -0
  17. package/front_end/devtools_compatibility.js +5 -0
  18. package/front_end/entrypoints/main/MainImpl.ts +6 -3
  19. package/front_end/entrypoints/main/main-meta.ts +1 -2
  20. package/front_end/entrypoints/shell/shell.js +1 -0
  21. package/front_end/entrypoints/shell/shell.json +0 -1
  22. package/front_end/models/logs/LogManager.ts +1 -0
  23. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
  24. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  25. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  26. package/front_end/panels/application/BackForwardCacheView.ts +24 -24
  27. package/front_end/panels/browser_debugger/CSPViolationBreakpointsSidebarPane.ts +2 -2
  28. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +7 -7
  29. package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +14 -6
  30. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +6 -8
  31. package/front_end/panels/css_overview/components/cssOverviewStartView.css +7 -1
  32. package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
  33. package/front_end/panels/issues/IssueKindView.ts +22 -4
  34. package/front_end/panels/lighthouse/LighthouseController.ts +10 -33
  35. package/front_end/panels/lighthouse/LighthousePanel.ts +2 -1
  36. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +2 -1
  37. package/front_end/panels/network/NetworkLogView.ts +3 -0
  38. package/front_end/panels/network/RequestPayloadView.ts +2 -0
  39. package/front_end/panels/network/requestPayloadTree.css +5 -0
  40. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  41. package/front_end/panels/settings/components/SyncSection.ts +25 -4
  42. package/front_end/panels/sources/DebuggerPausedMessage.ts +14 -7
  43. package/front_end/panels/sources/SourcesPanel.ts +9 -5
  44. package/front_end/third_party/codemirror.next/bundle-tsconfig.json +1 -1
  45. package/front_end/ui/components/buttons/Button.ts +11 -0
  46. package/front_end/ui/components/buttons/button.css +4 -0
  47. package/front_end/ui/components/docs/button/basic.ts +10 -0
  48. package/front_end/ui/components/docs/panel_feedback/basic.html +25 -0
  49. package/front_end/ui/components/docs/panel_feedback/basic.ts +20 -0
  50. package/front_end/ui/components/helpers/get-stylesheet.ts +1 -0
  51. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +100 -0
  52. package/front_end/ui/components/panel_feedback/panelFeedback.css +76 -0
  53. package/front_end/ui/components/panel_feedback/panel_feedback.ts +5 -0
  54. package/front_end/ui/components/report_view/reportValue.css +1 -0
  55. package/front_end/ui/legacy/softContextMenu.css +1 -0
  56. package/package.json +2 -2
  57. package/scripts/eslint_rules/lib/check_component_naming.js +1 -1
  58. package/scripts/eslint_rules/lib/enforce_custom_event_names.js +1 -1
  59. package/scripts/eslint_rules/lib/l10n_no_i18nString_calls_module_instantiation.js +1 -1
  60. package/scripts/eslint_rules/lib/no_underscored_properties.js +1 -1
  61. package/front_end/entrypoints/main/module.json +0 -5
@@ -11,10 +11,13 @@ let eventListenerBreakpointsSidebarPaneInstance: EventListenerBreakpointsSidebar
11
11
 
12
12
  export class EventListenerBreakpointsSidebarPane extends CategorizedBreakpointsSidebarPane {
13
13
  private constructor() {
14
- const categories = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints().map(
15
- breakpoint => breakpoint.category());
14
+ let breakpoints: SDK.CategorizedBreakpoint.CategorizedBreakpoint[] =
15
+ SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints();
16
+ const nonDomBreakpoints = SDK.EventBreakpointsModel.EventBreakpointsManager.instance().eventListenerBreakpoints();
17
+ breakpoints = breakpoints.concat(nonDomBreakpoints);
18
+
19
+ const categories = breakpoints.map(breakpoint => breakpoint.category());
16
20
  categories.sort();
17
- const breakpoints = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().eventListenerBreakpoints();
18
21
  super(
19
22
  categories, breakpoints, 'sources.eventListenerBreakpoints', Protocol.Debugger.PausedEventReason.EventListener);
20
23
  }
@@ -27,10 +30,15 @@ export class EventListenerBreakpointsSidebarPane extends CategorizedBreakpointsS
27
30
  }
28
31
 
29
32
  getBreakpointFromPausedDetails(details: SDK.DebuggerModel.DebuggerPausedDetails):
30
- SDK.DOMDebuggerModel.CategorizedBreakpoint|null {
31
- return SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpoint(details.auxData as {
33
+ SDK.CategorizedBreakpoint.CategorizedBreakpoint|null {
34
+ const auxData = details.auxData as {
32
35
  eventName: string,
33
36
  targetName: string,
34
- });
37
+ };
38
+ const domBreakpoint = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpoint(auxData);
39
+ if (domBreakpoint) {
40
+ return domBreakpoint;
41
+ }
42
+ return SDK.EventBreakpointsModel.EventBreakpointsManager.instance().resolveEventListenerBreakpoint(auxData);
35
43
  }
36
44
  }
@@ -6,6 +6,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
6
6
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
7
7
  import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
8
8
  import * as IconButton from '../../../ui/components/icon_button/icon_button.js';
9
+ import * as Legacy from '../../../ui/legacy/legacy.js';
9
10
  import * as LitHtml from '../../../ui/lit-html/lit-html.js';
10
11
 
11
12
  import cssOverviewStartViewStyles from './cssOverviewStartView.css.js';
@@ -76,14 +77,12 @@ export class OverviewStartRequestedEvent extends Event {
76
77
  export class CSSOverviewStartView extends HTMLElement {
77
78
  static readonly litTagName = LitHtml.literal`devtools-css-overview-start-view`;
78
79
  readonly #shadow = this.attachShadow({mode: 'open'});
79
- #feedbackLink: HTMLAnchorElement;
80
+ #feedbackLink: HTMLElement;
80
81
 
81
82
  constructor() {
82
83
  super();
83
- this.#feedbackLink = document.createElement('a');
84
- this.#feedbackLink.href = FEEDBACK_LINK;
85
- this.#feedbackLink.target = '_blank';
86
- this.#feedbackLink.innerText = i18nString(UIStrings.feedbackInline);
84
+ this.#feedbackLink =
85
+ Legacy.XLink.XLink.create(FEEDBACK_LINK, i18nString(UIStrings.feedbackInline), 'devtools-link');
87
86
  }
88
87
 
89
88
  connectedCallback(): void {
@@ -106,7 +105,6 @@ export class CSSOverviewStartView extends HTMLElement {
106
105
  private render(): void {
107
106
  // Disabled until https://crbug.com/1079231 is fixed.
108
107
  // clang-format off
109
- // eslint-disable-next-line rulesdir/ban_a_tags_in_lit_html
110
108
  render(html`
111
109
  <div class="css-overview-start-view">
112
110
  <h1 class="summary-header">${i18nString(UIStrings.identifyCSSImprovements)}</h1>
@@ -144,11 +142,11 @@ export class CSSOverviewStartView extends HTMLElement {
144
142
  </div>
145
143
  <div>
146
144
  <h1 class="video-doc-header">${i18nString(UIStrings.videoAndDocumentation)}</h1>
147
- <a href=${DOC_LINK} target="_blank">${i18nString(UIStrings.quickStartWithCSSOverview)}</a>
145
+ <x-link class="devtools-link" href=${DOC_LINK}>${i18nString(UIStrings.quickStartWithCSSOverview)}</x-link>
148
146
  </div>
149
147
  </div>
150
148
  </section>
151
- <a class="feedback-standalone" href=${FEEDBACK_LINK} target="_blank">${i18nString(UIStrings.feedbackStandalone)}</a>
149
+ <x-link class="feedback-standalone" href=${FEEDBACK_LINK}>${i18nString(UIStrings.feedbackStandalone)}</x-link>
152
150
  </div>
153
151
  `, this.#shadow, {
154
152
  host: this,
@@ -95,6 +95,12 @@ h1 {
95
95
  margin-bottom: 24px;
96
96
  }
97
97
 
98
+ .feedback-prompt .devtools-link {
99
+ color: -webkit-link;
100
+ cursor: pointer;
101
+ text-decoration: underline;
102
+ }
103
+
98
104
  .resources {
99
105
  display: flex;
100
106
  flex-direction: row;
@@ -125,7 +131,7 @@ h1 {
125
131
  font-weight: bold;
126
132
  }
127
133
 
128
- .resources a {
134
+ .resources .devtools-link {
129
135
  font-size: 14px;
130
136
  line-height: 22px;
131
137
  letter-spacing: 0.04em;
@@ -1827,7 +1827,8 @@ export class StylePropertiesSection {
1827
1827
  containerElement.data = {
1828
1828
  container: ElementsComponents.Helper.legacyNodeToElementsComponentsNode(container.containerNode),
1829
1829
  queryName: containerQuery.name,
1830
- onContainerLinkClick: (): void => {
1830
+ onContainerLinkClick: (event): void => {
1831
+ event.preventDefault();
1831
1832
  ElementsPanel.instance().revealAndSelectNode(container.containerNode, true, true);
1832
1833
  container.containerNode.scrollIntoView();
1833
1834
  },
@@ -14,10 +14,17 @@ import * as Components from './components/components.js';
14
14
 
15
15
  const UIStrings = {
16
16
  /**
17
- * @description Menu entry for hiding all current issues belonging to a particular kind.
18
- * @example {Page Errors} PH1
17
+ * @description Menu entry for hiding all current Page Errors.
19
18
  */
20
- hideAllCurrent: 'Hide all current {PH1}',
19
+ hideAllCurrentPageErrors: 'Hide all current Page Errors',
20
+ /**
21
+ * @description Menu entry for hiding all current Breaking Changes.
22
+ */
23
+ hideAllCurrentBreakingChanges: 'Hide all current Breaking Changes',
24
+ /**
25
+ * @description Menu entry for hiding all current Page Errors.
26
+ */
27
+ hideAllCurrentImprovements: 'Hide all current Improvements',
21
28
  };
22
29
  const str_ = i18n.i18n.registerUIStrings('panels/issues/IssueKindView.ts', UIStrings);
23
30
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -70,6 +77,17 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
70
77
  return this.kind;
71
78
  }
72
79
 
80
+ getHideAllCurrentKindString(): Common.UIString.LocalizedString {
81
+ switch (this.kind) {
82
+ case IssuesManager.Issue.IssueKind.PageError:
83
+ return i18nString(UIStrings.hideAllCurrentPageErrors);
84
+ case IssuesManager.Issue.IssueKind.Improvement:
85
+ return i18nString(UIStrings.hideAllCurrentImprovements);
86
+ case IssuesManager.Issue.IssueKind.BreakingChange:
87
+ return i18nString(UIStrings.hideAllCurrentBreakingChanges);
88
+ }
89
+ }
90
+
73
91
  private appendHeader(): void {
74
92
  const header = document.createElement('div');
75
93
  header.classList.add('header');
@@ -93,7 +111,7 @@ export class IssueKindView extends UI.TreeOutline.TreeElement {
93
111
  const hideAvailableIssuesBtn = new Components.HideIssuesMenu.HideIssuesMenu();
94
112
  hideAvailableIssuesBtn.classList.add('hide-available-issues');
95
113
  hideAvailableIssuesBtn.data = {
96
- menuItemLabel: i18nString(UIStrings.hideAllCurrent, {PH1: IssuesManager.Issue.getIssueKindName(this.kind)}),
114
+ menuItemLabel: this.getHideAllCurrentKindString(),
97
115
  menuItemAction: (): void => {
98
116
  const setting = IssuesManager.IssuesManager.getHideIssueByCodeSetting();
99
117
  const values = setting.get();
@@ -262,42 +262,19 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
262
262
  return '';
263
263
  }
264
264
  const mainTarget = this.manager.target();
265
- const runtimeModel = mainTarget.model(SDK.RuntimeModel.RuntimeModel);
266
- const executionContext = runtimeModel && runtimeModel.defaultExecutionContext();
267
- let inspectedURL = mainTarget.inspectedURL();
268
- if (!executionContext) {
269
- return inspectedURL;
270
- }
265
+ // target.inspectedURL is reliably populated, however it lacks any url #hash
266
+ const inspectedURL = mainTarget.inspectedURL();
271
267
 
272
- // Evaluate location.href for a more specific URL than inspectedURL provides so that SPA hash navigation routes
273
- // will be respected and audited.
274
- try {
275
- const result = await executionContext.evaluate(
276
- {
277
- expression: 'window.location.href',
278
- objectGroup: 'lighthouse',
279
- includeCommandLineAPI: false,
280
- silent: false,
281
- returnByValue: true,
282
- generatePreview: false,
283
- allowUnsafeEvalBlockedByCSP: undefined,
284
- disableBreaks: undefined,
285
- replMode: undefined,
286
- throwOnSideEffect: undefined,
287
- timeout: undefined,
288
- },
289
- /* userGesture */ false, /* awaitPromise */ false);
290
- if ((!('exceptionDetails' in result) || !result.exceptionDetails) && 'object' in result && result.object) {
291
- if (result.object.value) {
292
- inspectedURL = result.object.value;
293
- }
294
- result.object.release();
295
- }
296
- } catch (err) {
297
- console.error(err);
268
+ // We'll use the navigationHistory to acquire the current URL including hash
269
+ const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);
270
+ const navHistory = resourceTreeModel && await resourceTreeModel.navigationHistory();
271
+ if (!resourceTreeModel || !navHistory) {
272
+ return inspectedURL;
298
273
  }
299
274
 
300
- return inspectedURL;
275
+ const {currentIndex, entries} = navHistory;
276
+ const navigationEntry = entries[currentIndex];
277
+ return navigationEntry.url;
301
278
  }
302
279
 
303
280
  getFlags(): {internalDisableDeviceScreenEmulation: boolean, emulatedFormFactor: (string|undefined)} {
@@ -263,7 +263,8 @@ export class LighthousePanel extends UI.Panel.Panel {
263
263
 
264
264
  const reportContainer = this.auditResultsElement.createChild('div', 'lh-vars lh-root lh-devtools');
265
265
 
266
- const dom = new LighthouseReport.DOM(this.auditResultsElement.ownerDocument as Document);
266
+ // @ts-ignore: Second argument will soon be required.
267
+ const dom = new LighthouseReport.DOM(this.auditResultsElement.ownerDocument as Document, reportContainer);
267
268
  const renderer = new LighthouseReportRenderer(dom) as LighthouseReport.ReportRenderer;
268
269
 
269
270
  const el = renderer.renderReport(lighthouseResult, reportContainer);
@@ -221,8 +221,9 @@ export class LighthouseReportUIFeatures extends LighthouseReport.ReportUIFeature
221
221
  }
222
222
 
223
223
  getDocument(): Document {
224
- return this._document;
224
+ return this._dom.document();
225
225
  }
226
+
226
227
  resetUIState(): void {
227
228
  this._resetUIState();
228
229
  }
@@ -1548,6 +1548,8 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
1548
1548
  footerSection.appendItem(i18nString(UIStrings.copyAllAsCurlCmd), this.copyAllCurlCommand.bind(this, 'win'));
1549
1549
  footerSection.appendItem(i18nString(UIStrings.copyAllAsCurlBash), this.copyAllCurlCommand.bind(this, 'unix'));
1550
1550
  } else {
1551
+ footerSection.appendItem(
1552
+ i18nString(UIStrings.copyAsPowershell), this.copyPowerShellCommand.bind(this, request), disableIfBlob);
1551
1553
  footerSection.appendItem(
1552
1554
  i18nString(UIStrings.copyAsFetch), this.copyFetchCall.bind(this, request, FetchStyle.Browser),
1553
1555
  disableIfBlob);
@@ -1556,6 +1558,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
1556
1558
  disableIfBlob);
1557
1559
  footerSection.appendItem(
1558
1560
  i18nString(UIStrings.copyAsCurl), this.copyCurlCommand.bind(this, request, 'unix'), disableIfBlob);
1561
+ footerSection.appendItem(i18nString(UIStrings.copyAllAsPowershell), this.copyAllPowerShellCommand.bind(this));
1559
1562
  footerSection.appendItem(
1560
1563
  i18nString(UIStrings.copyAllAsFetch), this.copyAllFetchCall.bind(this, FetchStyle.Browser));
1561
1564
  footerSection.appendItem(
@@ -491,6 +491,8 @@ export class RequestPayloadView extends UI.Widget.VBox {
491
491
  private createToggleButton(title: string): Element {
492
492
  const button = document.createElement('span');
493
493
  button.classList.add('payload-toggle');
494
+ button.tabIndex = 0;
495
+ button.setAttribute('role', 'button');
494
496
  button.textContent = title;
495
497
  return button;
496
498
  }
@@ -64,6 +64,11 @@
64
64
  color: var(--color-text-primary);
65
65
  }
66
66
 
67
+ .tree-outline li.expanded .payload-toggle:focus-visible {
68
+ border: 2px solid var(--color-button-outline-focus);
69
+ border-radius: 5px;
70
+ }
71
+
67
72
  .tree-outline li .header-toggle:hover {
68
73
  color: var(--color-text-secondary);
69
74
  cursor: pointer;
@@ -142,6 +142,7 @@ export class ProtocolMonitorImpl extends UI.Widget.VBox {
142
142
  clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {
143
143
  this.messages = [];
144
144
  this.dataGridIntegrator.update({...this.dataGridIntegrator.data(), rows: []});
145
+ this.infoWidget.render(null);
145
146
  });
146
147
  topToolbar.appendToolbarItem(clearButton);
147
148
 
@@ -8,6 +8,7 @@ import type * as Host from '../../../core/host/host.js';
8
8
  import * as i18n from '../../../core/i18n/i18n.js';
9
9
  import * as LitHtml from '../../../ui/lit-html/lit-html.js';
10
10
  import * as Settings from '../../../ui/components/settings/settings.js';
11
+ import * as SDK from '../../../core/sdk/sdk.js';
11
12
 
12
13
  import syncSectionStyles from './syncSection.css.js';
13
14
 
@@ -81,21 +82,31 @@ export class SyncSection extends HTMLElement {
81
82
  }
82
83
  }
83
84
 
85
+ /* x-link doesn't work with custom click/keydown handlers */
86
+ /* eslint-disable rulesdir/ban_a_tags_in_lit_html */
87
+
84
88
  function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.SyncInformation): LitHtml.TemplateResult {
85
89
  if (!syncInfo.isSyncActive) {
90
+ const link = 'chrome://settings/syncSetup';
91
+ // Disabled until https://crbug.com/1079231 is fixed.
92
+ // clang-format off
86
93
  return LitHtml.html`
87
94
  <span class="warning">
88
- ${i18nString(UIStrings.syncDisabled)} <x-link href="chrome://settings/syncSetup" class="link">${
89
- i18nString(UIStrings.settings)}</x-link>
95
+ ${i18nString(UIStrings.syncDisabled)} <a href="${link}" class="link" target="_blank"
96
+ @click=${(e: Event): void => openSettingsTab(link, e)}
97
+ @keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
90
98
  </span>`;
99
+ // clang-format on
91
100
  }
92
101
  if (!syncInfo.arePreferencesSynced) {
102
+ const link = 'chrome://settings/syncSetup/advanced';
93
103
  // Disabled until https://crbug.com/1079231 is fixed.
94
104
  // clang-format off
95
105
  return LitHtml.html`
96
106
  <span class="warning">
97
- ${i18nString(UIStrings.preferencesSyncDisabled)} <x-link href="chrome://settings/syncSetup/advanced" class="link">${
98
- i18nString(UIStrings.settings)}</x-link>
107
+ ${i18nString(UIStrings.preferencesSyncDisabled)} <a href="${link}" class="link" target="_blank"
108
+ @click=${(e: Event): void => openSettingsTab(link, e)}
109
+ @keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
99
110
  </span>`;
100
111
  // clang-format on
101
112
  }
@@ -109,6 +120,16 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
109
120
  </div>`;
110
121
  }
111
122
 
123
+ // Navigating to a chrome:// link via a normal anchor doesn't work, so we "navigate"
124
+ // there using CDP.
125
+ function openSettingsTab(url: string, event: Event): void {
126
+ if (event.type === 'click' || (event.type === 'keydown' && self.isEnterOrSpaceKey(event))) {
127
+ const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
128
+ mainTarget && mainTarget.targetAgent().invoke_createTarget({url});
129
+ event.consume(true);
130
+ }
131
+ }
132
+
112
133
  ComponentHelpers.CustomElements.defineComponent('devtools-sync-section', SyncSection);
113
134
 
114
135
  declare global {
@@ -191,13 +191,20 @@ export class DebuggerPausedMessage {
191
191
  } else if (details.reason === Protocol.Debugger.PausedEventReason.EventListener) {
192
192
  let eventNameForUI = '';
193
193
  if (details.auxData) {
194
- eventNameForUI =
195
- SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle((details.auxData as {
196
- directiveText: string,
197
- eventName: string,
198
- targetName: string,
199
- webglErrorName: string,
200
- }));
194
+ const maybeNonDomEventNameForUI =
195
+ SDK.EventBreakpointsModel.EventBreakpointsManager.instance().resolveEventListenerBreakpointTitle(
196
+ (details.auxData as {eventName: string}));
197
+ if (maybeNonDomEventNameForUI) {
198
+ eventNameForUI = maybeNonDomEventNameForUI;
199
+ } else {
200
+ eventNameForUI = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle(
201
+ (details.auxData as {
202
+ directiveText: string,
203
+ eventName: string,
204
+ targetName: string,
205
+ webglErrorName: string,
206
+ }));
207
+ }
201
208
  }
202
209
  messageWrapper = buildWrapper(i18nString(UIStrings.pausedOnEventListener), eventNameForUI);
203
210
  } else if (details.reason === Protocol.Debugger.PausedEventReason.XHR) {
@@ -424,7 +424,8 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
424
424
  private debuggerPaused(event: Common.EventTarget.EventTargetEvent<SDK.DebuggerModel.DebuggerModel>): void {
425
425
  const debuggerModel = event.data;
426
426
  const details = debuggerModel.debuggerPausedDetails();
427
- if (!this.pausedInternal) {
427
+ if (!this.pausedInternal &&
428
+ Common.Settings.Settings.instance().moduleSetting('autoFocusOnDebuggerPausedEnabled').get()) {
428
429
  this.setAsCurrentPanel();
429
430
  }
430
431
 
@@ -986,6 +987,9 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
986
987
  }
987
988
 
988
989
  private revealDebuggerSidebar(): void {
990
+ if (!Common.Settings.Settings.instance().moduleSetting('autoFocusOnDebuggerPausedEnabled').get()) {
991
+ return;
992
+ }
989
993
  this.setAsCurrentPanel();
990
994
  this.splitWidget.showBoth(true);
991
995
  }
@@ -1083,10 +1087,7 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
1083
1087
  }
1084
1088
 
1085
1089
  setAsCurrentPanel(): Promise<void> {
1086
- if (Common.Settings.Settings.instance().moduleSetting('autoFocusOnDebuggerPausedEnabled').get()) {
1087
- return UI.ViewManager.ViewManager.instance().showView('sources');
1088
- }
1089
- return Promise.resolve();
1090
+ return UI.ViewManager.ViewManager.instance().showView('sources');
1090
1091
  }
1091
1092
 
1092
1093
  private extensionSidebarPaneAdded(
@@ -1207,6 +1208,9 @@ export class DebuggerPausedDetailsRevealer implements Common.Revealer.Revealer {
1207
1208
  }
1208
1209
 
1209
1210
  reveal(_object: Object): Promise<void> {
1211
+ if (!Common.Settings.Settings.instance().moduleSetting('autoFocusOnDebuggerPausedEnabled').get()) {
1212
+ return Promise.resolve();
1213
+ }
1210
1214
  return SourcesPanel.instance().setAsCurrentPanel();
1211
1215
  }
1212
1216
  }
@@ -16,6 +16,6 @@
16
16
  "chunk/php.js",
17
17
  "chunk/python.js",
18
18
  "chunk/wast.js",
19
- "chunk/xml.js",
19
+ "chunk/xml.js"
20
20
  ]
21
21
  }
@@ -30,6 +30,7 @@ interface ButtonState {
30
30
  variant?: Variant;
31
31
  size?: Size;
32
32
  disabled: boolean;
33
+ active: boolean;
33
34
  }
34
35
 
35
36
  export type ButtonData = {
@@ -37,11 +38,13 @@ export type ButtonData = {
37
38
  iconUrl: string,
38
39
  size?: Size,
39
40
  disabled?: boolean,
41
+ active?: boolean,
40
42
  }|{
41
43
  variant: Variant.PRIMARY | Variant.SECONDARY,
42
44
  iconUrl?: string,
43
45
  size?: Size,
44
46
  disabled?: boolean,
47
+ active?: boolean,
45
48
  };
46
49
 
47
50
  export class Button extends HTMLElement {
@@ -52,6 +55,7 @@ export class Button extends HTMLElement {
52
55
  private readonly props: ButtonState = {
53
56
  size: Size.MEDIUM,
54
57
  disabled: false,
58
+ active: false,
55
59
  };
56
60
  private isEmpty = true;
57
61
 
@@ -69,6 +73,7 @@ export class Button extends HTMLElement {
69
73
  this.props.variant = data.variant;
70
74
  this.props.iconUrl = data.iconUrl;
71
75
  this.props.size = data.size || Size.MEDIUM;
76
+ this.props.active = Boolean(data.active);
72
77
  this.setDisabledProperty(data.disabled || false);
73
78
  ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
74
79
  }
@@ -93,6 +98,11 @@ export class Button extends HTMLElement {
93
98
  ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
94
99
  }
95
100
 
101
+ set active(active: boolean) {
102
+ this.props.active = active;
103
+ ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
104
+ }
105
+
96
106
  private setDisabledProperty(disabled: boolean): void {
97
107
  this.props.disabled = disabled;
98
108
  this.toggleAttribute('disabled', disabled);
@@ -140,6 +150,7 @@ export class Button extends HTMLElement {
140
150
  'text-with-icon': Boolean(this.props.iconUrl) && !this.isEmpty,
141
151
  'only-icon': Boolean(this.props.iconUrl) && this.isEmpty,
142
152
  small: Boolean(this.props.size === Size.SMALL),
153
+ active: this.props.active,
143
154
  };
144
155
  // clang-format off
145
156
  LitHtml.render(
@@ -80,6 +80,7 @@ button.primary:hover {
80
80
  border: 1px solid var(--color-button-primary-background-hovering);
81
81
  }
82
82
 
83
+ button.primary.active,
83
84
  button.primary:active {
84
85
  background: var(--color-button-primary-background-pressed);
85
86
  border: 1px solid var(--color-button-primary-background-pressed);
@@ -103,6 +104,7 @@ button.secondary:hover {
103
104
  background: var(--color-button-secondary-background-hovering);
104
105
  }
105
106
 
107
+ button.secondary.active,
106
108
  button.secondary:active {
107
109
  background: var(--color-button-secondary-background-pressed);
108
110
  border: 1px solid var(--color-button-secondary-background-pressed);
@@ -120,6 +122,7 @@ button.secondary:disabled:hover {
120
122
  cursor: not-allowed;
121
123
  }
122
124
 
125
+ button.secondary.active:focus-visible,
123
126
  button.secondary:active:focus-visible {
124
127
  border: 1px solid var(--color-button-secondary-background-pressed);
125
128
  }
@@ -128,6 +131,7 @@ button.toolbar:hover {
128
131
  background-color: var(--color-button-secondary-background-hovering);
129
132
  }
130
133
 
134
+ button.toolbar.active,
131
135
  button.toolbar:active {
132
136
  background-color: var(--color-button-secondary-background-pressed);
133
137
  }
@@ -32,6 +32,16 @@ primaryButton.innerText = 'Click me';
32
32
  primaryButton.onclick = () => alert('clicked');
33
33
  appendButton(primaryButton);
34
34
 
35
+ // Primary (forced active)
36
+ const forcedActive = new Buttons.Button.Button();
37
+ forcedActive.data = {
38
+ variant: Buttons.Button.Variant.PRIMARY,
39
+ active: true,
40
+ };
41
+ forcedActive.innerText = 'Forced active';
42
+ forcedActive.onclick = () => alert('clicked');
43
+ appendButton(forcedActive);
44
+
35
45
  // Secondary
36
46
  const secondaryButton = new Buttons.Button.Button();
37
47
  secondaryButton.innerText = 'Click me';
@@ -0,0 +1,25 @@
1
+ <!--
2
+ Copyright 2021 The Chromium Authors. All rights reserved.
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>
@@ -0,0 +1,20 @@
1
+ // Copyright 2021 The Chromium Authors. All rights reserved.
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 '../../../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
6
+ import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
7
+ import * as ComponentHelpers from '../../helpers/helpers.js';
8
+
9
+ await ComponentHelpers.ComponentServerSetup.setup();
10
+ await FrontendHelpers.initializeGlobalVars();
11
+
12
+ const component = new PanelFeedback.PanelFeedback.PanelFeedback();
13
+
14
+ component.data = {
15
+ feedbackUrl: 'https://www.example.com',
16
+ quickStartUrl: 'https://www.example.com',
17
+ quickStartLinkText: 'Quick start: get started with the Recorder',
18
+ };
19
+
20
+ document.getElementById('container')?.appendChild(component);
@@ -56,4 +56,5 @@ export const CSS_RESOURCES_TO_LOAD_INTO_RUNTIME = [
56
56
  'ui/legacy/components/source_frame/jsonView.css',
57
57
  'ui/legacy/searchableView.css',
58
58
  'ui/legacy/toolbar.css',
59
+ 'ui/legacy/inspectorViewTabbedPane.css',
59
60
  ];