chrome-devtools-frontend 1.0.1699061 → 1.0.1701636

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 (157) hide show
  1. package/front_end/core/root/Runtime.ts +5 -0
  2. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -11
  3. package/front_end/core/sdk/NetworkManager.ts +7 -0
  4. package/front_end/core/sdk/SecurityOrigin.ts +1 -0
  5. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
  6. package/front_end/core/sdk/SourceMap.ts +12 -1
  7. package/front_end/core/sdk/SourceMapCache.ts +12 -0
  8. package/front_end/core/sdk/SourceMapManager.ts +17 -8
  9. package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -19
  10. package/front_end/core/sdk/SourceMapScopesInfo.ts +21 -0
  11. package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
  12. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +7 -3
  13. package/front_end/entrypoints/formatter_worker/Substitute.ts +90 -26
  14. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
  15. package/front_end/entrypoints/main/ExecutionContextSelector.ts +17 -4
  16. package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
  17. package/front_end/entrypoints/main/MainImpl.ts +8 -1
  18. package/front_end/generated/InspectorBackendCommands.ts +13 -5
  19. package/front_end/generated/SupportedCSSProperties.ts +14 -0
  20. package/front_end/generated/protocol-mapping.d.ts +48 -9
  21. package/front_end/generated/protocol-proxy-api.d.ts +37 -7
  22. package/front_end/generated/protocol.ts +135 -22
  23. package/front_end/models/ai_assistance/debug.ts +10 -2
  24. package/front_end/models/bindings/NetworkProject.ts +30 -0
  25. package/front_end/models/bindings/ResourceScriptMapping.ts +62 -0
  26. package/front_end/models/change_tracker/ChangeTracker.ts +1 -1
  27. package/front_end/models/comment_manager/CD4ABridge.ts +4 -4
  28. package/front_end/models/comment_manager/CommentManager.ts +21 -0
  29. package/front_end/models/extensions/ExtensionAPI.ts +4 -2
  30. package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
  31. package/front_end/models/issues_manager/CookieIssue.ts +0 -2
  32. package/front_end/models/javascript_metadata/NativeFunctions.ts +7 -2
  33. package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
  34. package/front_end/models/source_map_scopes/NamesResolver.ts +65 -40
  35. package/front_end/models/source_map_scopes/ScopeChainModel.ts +21 -1
  36. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +70 -1
  37. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
  38. package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
  39. package/front_end/panels/application/AppManifestView.ts +128 -134
  40. package/front_end/panels/application/CrashReportContextView.ts +5 -5
  41. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +17 -17
  42. package/front_end/panels/application/DeviceBoundSessionsView.ts +136 -137
  43. package/front_end/panels/application/IndexedDBModel.ts +3 -0
  44. package/front_end/panels/application/OriginTrialTreeView.ts +18 -23
  45. package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
  46. package/front_end/panels/application/ReportingApiView.ts +6 -14
  47. package/front_end/panels/application/application-meta.ts +7 -7
  48. package/front_end/panels/common/CommentThreadWidget.ts +19 -6
  49. package/front_end/panels/common/CommentsOverlayWidget.ts +143 -10
  50. package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
  51. package/front_end/panels/common/ExtensionServer.ts +61 -42
  52. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
  53. package/front_end/panels/common/commentThreadWidget.css +18 -0
  54. package/front_end/panels/common/common-meta.ts +4 -1
  55. package/front_end/panels/console/ConsolePrompt.ts +1 -1
  56. package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
  57. package/front_end/panels/elements/ClassesPaneWidget.ts +2 -1
  58. package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
  59. package/front_end/panels/elements/{ElementsTreeOutline.ts → DOMTreeWidget.ts} +45 -31
  60. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  61. package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
  62. package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
  63. package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
  64. package/front_end/panels/elements/StylesSidebarPane.ts +4 -6
  65. package/front_end/panels/elements/TopLayerContainer.ts +1 -1
  66. package/front_end/panels/elements/elements.ts +4 -3
  67. package/front_end/panels/elements/elementsTreeOutline.css +4 -0
  68. package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
  69. package/front_end/panels/issues/IssuesPane.ts +34 -22
  70. package/front_end/panels/network/RequestPayloadView.ts +17 -15
  71. package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +1 -1
  72. package/front_end/panels/profiler/HeapProfileView.ts +8 -6
  73. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -1
  74. package/front_end/panels/profiler/HeapSnapshotView.ts +6 -4
  75. package/front_end/panels/recorder/RecordingView.ts +32 -53
  76. package/front_end/panels/recorder/controlButton.css +6 -0
  77. package/front_end/panels/recorder/recordingView.css +11 -2
  78. package/front_end/panels/security/SecurityPanel.ts +87 -99
  79. package/front_end/panels/sensors/SensorsView.ts +87 -0
  80. package/front_end/panels/sensors/sensors-meta.ts +69 -1
  81. package/front_end/panels/settings/keybindsSettingsTab.css +1 -1
  82. package/front_end/panels/sources/DebuggerPlugin.ts +136 -55
  83. package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
  84. package/front_end/panels/timeline/components/IgnoreListSetting.ts +0 -2
  85. package/front_end/panels/timeline/components/LiveMetricsView.ts +59 -64
  86. package/front_end/panels/timeline/components/liveMetricsView.css +1 -0
  87. package/front_end/third_party/chromium/README.chromium +1 -1
  88. package/front_end/third_party/lighthouse/README.chromium +2 -2
  89. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1580 -1524
  90. package/front_end/third_party/lighthouse/locales/ar-XB.json +111 -72
  91. package/front_end/third_party/lighthouse/locales/ar.json +113 -74
  92. package/front_end/third_party/lighthouse/locales/bg.json +112 -73
  93. package/front_end/third_party/lighthouse/locales/ca.json +112 -73
  94. package/front_end/third_party/lighthouse/locales/cs.json +112 -73
  95. package/front_end/third_party/lighthouse/locales/da.json +112 -73
  96. package/front_end/third_party/lighthouse/locales/de.json +112 -73
  97. package/front_end/third_party/lighthouse/locales/el.json +112 -73
  98. package/front_end/third_party/lighthouse/locales/en-GB.json +111 -72
  99. package/front_end/third_party/lighthouse/locales/en-US.json +102 -66
  100. package/front_end/third_party/lighthouse/locales/en-XA.json +111 -72
  101. package/front_end/third_party/lighthouse/locales/en-XL.json +102 -66
  102. package/front_end/third_party/lighthouse/locales/es-419.json +112 -73
  103. package/front_end/third_party/lighthouse/locales/es.json +112 -73
  104. package/front_end/third_party/lighthouse/locales/fi.json +112 -73
  105. package/front_end/third_party/lighthouse/locales/fil.json +112 -73
  106. package/front_end/third_party/lighthouse/locales/fr.json +112 -73
  107. package/front_end/third_party/lighthouse/locales/he.json +112 -73
  108. package/front_end/third_party/lighthouse/locales/hi.json +112 -73
  109. package/front_end/third_party/lighthouse/locales/hr.json +112 -73
  110. package/front_end/third_party/lighthouse/locales/hu.json +112 -73
  111. package/front_end/third_party/lighthouse/locales/id.json +112 -73
  112. package/front_end/third_party/lighthouse/locales/it.json +113 -74
  113. package/front_end/third_party/lighthouse/locales/ja.json +112 -73
  114. package/front_end/third_party/lighthouse/locales/ko.json +112 -73
  115. package/front_end/third_party/lighthouse/locales/lt.json +112 -73
  116. package/front_end/third_party/lighthouse/locales/lv.json +112 -73
  117. package/front_end/third_party/lighthouse/locales/nl.json +112 -73
  118. package/front_end/third_party/lighthouse/locales/no.json +112 -73
  119. package/front_end/third_party/lighthouse/locales/pl.json +112 -73
  120. package/front_end/third_party/lighthouse/locales/pt-PT.json +112 -73
  121. package/front_end/third_party/lighthouse/locales/pt.json +112 -73
  122. package/front_end/third_party/lighthouse/locales/ro.json +112 -73
  123. package/front_end/third_party/lighthouse/locales/ru.json +112 -73
  124. package/front_end/third_party/lighthouse/locales/sk.json +112 -73
  125. package/front_end/third_party/lighthouse/locales/sl.json +112 -73
  126. package/front_end/third_party/lighthouse/locales/sr-Latn.json +112 -73
  127. package/front_end/third_party/lighthouse/locales/sr.json +112 -73
  128. package/front_end/third_party/lighthouse/locales/sv.json +124 -85
  129. package/front_end/third_party/lighthouse/locales/ta.json +112 -73
  130. package/front_end/third_party/lighthouse/locales/te.json +112 -73
  131. package/front_end/third_party/lighthouse/locales/th.json +112 -73
  132. package/front_end/third_party/lighthouse/locales/tr.json +113 -74
  133. package/front_end/third_party/lighthouse/locales/uk.json +112 -73
  134. package/front_end/third_party/lighthouse/locales/vi.json +112 -73
  135. package/front_end/third_party/lighthouse/locales/zh-HK.json +112 -73
  136. package/front_end/third_party/lighthouse/locales/zh-TW.json +113 -74
  137. package/front_end/third_party/lighthouse/locales/zh.json +113 -74
  138. package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
  139. package/front_end/third_party/lighthouse/report/bundle.js +10 -3
  140. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
  141. package/front_end/third_party/lit/lit.ts +3 -0
  142. package/front_end/third_party/lit/package.json +3 -0
  143. package/front_end/third_party/lit/rebuild.sh +3 -2
  144. package/front_end/ui/comments/CommentAnchorResolver.ts +8 -2
  145. package/front_end/ui/comments/CommentOverlayManager.ts +2 -1
  146. package/front_end/ui/legacy/InspectorView.ts +4 -3
  147. package/front_end/ui/legacy/TabbedPane.ts +121 -80
  148. package/front_end/ui/legacy/Treeoutline.ts +37 -7
  149. package/front_end/ui/legacy/UIUtils.ts +7 -0
  150. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
  151. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +135 -146
  152. package/front_end/ui/legacy/treeoutline.css +2 -2
  153. package/front_end/ui/lit/lit.ts +1 -1
  154. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  155. package/inspector_overlay/highlight_anchor.ts +197 -0
  156. package/inspector_overlay/tool_highlight.ts +8 -0
  157. package/package.json +1 -1
@@ -13,7 +13,7 @@ import * as NetworkForward from '../../panels/network/forward/forward.js';
13
13
  import * as Buttons from '../../ui/components/buttons/buttons.js';
14
14
  import {createIcon, type Icon} from '../../ui/kit/kit.js';
15
15
  import * as UI from '../../ui/legacy/legacy.js';
16
- import {Directives, html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
16
+ import {Directives, html, type LitTemplate, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
17
17
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
18
18
 
19
19
  import lockIconStyles from './lockIcon.css.js';
@@ -1347,10 +1347,10 @@ interface DetailsTableRow {
1347
1347
  value: string|TemplateResult;
1348
1348
  }
1349
1349
 
1350
- function renderDetailsTable(rows: DetailsTableRow[]): TemplateResult {
1350
+ function renderDetailsTable(rows: DetailsTableRow[], additionalClasses: Directives.ClassInfo = {}): TemplateResult {
1351
1351
  // clang-format off
1352
1352
  return html`
1353
- <table class="details-table">
1353
+ <table class=${Directives.classMap({'details-table': true, ...additionalClasses})}>
1354
1354
  ${rows.map(row => html`
1355
1355
  <tr class="details-table-row">
1356
1356
  <td>${row.key ?? nothing}</td>
@@ -1492,6 +1492,74 @@ function renderCertificateSection(input: CertificateSectionInput): TemplateResul
1492
1492
  // clang-format on
1493
1493
  }
1494
1494
 
1495
+ interface CertificateTransparencySectionInput {
1496
+ securityDetails: Protocol.Network.SecurityDetails;
1497
+ isDetailsShown: boolean;
1498
+ onToggleDetails: () => void;
1499
+ }
1500
+
1501
+ function renderSctSummary(scts: Protocol.Network.SignedCertificateTimestamp[], isShown: boolean): TemplateResult {
1502
+ const rows = scts.map(sct => ({
1503
+ key: i18nString(UIStrings.sct),
1504
+ value: `${sct.logDescription} (${sct.origin}, ${sct.status})`,
1505
+ }));
1506
+ return renderDetailsTable(rows, {'sct-summary': true, hidden: !isShown});
1507
+ }
1508
+
1509
+ function renderSctDetails(scts: Protocol.Network.SignedCertificateTimestamp[], isShown: boolean): TemplateResult {
1510
+ // clang-format off
1511
+ return html`
1512
+ <div class=${Directives.classMap({'sct-details': true, hidden: !isShown})}>
1513
+ ${scts.map(sct => renderDetailsTable([
1514
+ {key: i18nString(UIStrings.logName), value: sct.logDescription},
1515
+ {key: i18nString(UIStrings.logId), value: sct.logId.replace(/(.{2})/g, '$1 ')},
1516
+ {key: i18nString(UIStrings.validationStatus), value: sct.status},
1517
+ {key: i18nString(UIStrings.source), value: sct.origin},
1518
+ {key: i18nString(UIStrings.issuedAt), value: new Date(sct.timestamp).toUTCString()},
1519
+ {key: i18nString(UIStrings.hashAlgorithm), value: sct.hashAlgorithm},
1520
+ {key: i18nString(UIStrings.signatureAlgorithm), value: sct.signatureAlgorithm},
1521
+ {key: i18nString(UIStrings.signatureData), value: sct.signatureData.replace(/(.{2})/g, '$1 ')},
1522
+ ]))}
1523
+ </div>`;
1524
+ // clang-format on
1525
+ }
1526
+
1527
+ function renderCertificateTransparencyNote(compliance: Protocol.Network.CertificateTransparencyCompliance):
1528
+ LitTemplate {
1529
+ if (compliance === Protocol.Network.CertificateTransparencyCompliance.Unknown) {
1530
+ return nothing;
1531
+ }
1532
+
1533
+ const note = compliance === Protocol.Network.CertificateTransparencyCompliance.Compliant ?
1534
+ i18nString(UIStrings.thisRequestCompliesWithChromes) :
1535
+ i18nString(UIStrings.thisRequestDoesNotComplyWith);
1536
+
1537
+ return html`<div class="origin-view-section-notes">${note}</div>`;
1538
+ }
1539
+
1540
+ function renderCertificateTransparencySection(input: CertificateTransparencySectionInput): TemplateResult {
1541
+ const {securityDetails, isDetailsShown, onToggleDetails} = input;
1542
+ const scts = securityDetails.signedCertificateTimestampList;
1543
+ const toggleButtonText =
1544
+ isDetailsShown ? i18nString(UIStrings.hideFullDetails) : i18nString(UIStrings.showFullDetails);
1545
+
1546
+ // clang-format off
1547
+ return html`
1548
+ <div class="origin-view-section-title" role="heading" aria-level="2">${i18nString(UIStrings.certificateTransparency)}</div>
1549
+ ${renderSctSummary(scts, !isDetailsShown)}
1550
+ ${renderSctDetails(scts, isDetailsShown)}
1551
+ ${scts.length ? html`
1552
+ <devtools-button
1553
+ class="details-toggle"
1554
+ .variant=${Buttons.Button.Variant.OUTLINED}
1555
+ .accessibleLabel=${toggleButtonText}
1556
+ .accessibleExpanded=${isDetailsShown}
1557
+ .jslogContext=${'security.toggle-scts-details'}
1558
+ @click=${onToggleDetails}>${toggleButtonText}</devtools-button>` : nothing}
1559
+ ${renderCertificateTransparencyNote(securityDetails.certificateTransparencyCompliance)}`;
1560
+ // clang-format on
1561
+ }
1562
+
1495
1563
  export class SecurityOriginView extends UI.Widget.VBox {
1496
1564
  readonly #origin: Platform.DevToolsPath.UrlString;
1497
1565
  readonly #titleSection: HTMLElement;
@@ -1516,80 +1584,10 @@ export class SecurityOriginView extends UI.Widget.VBox {
1516
1584
 
1517
1585
  const sctListLength = originState.securityDetails.signedCertificateTimestampList.length;
1518
1586
  const ctCompliance = originState.securityDetails.certificateTransparencyCompliance;
1519
- let sctSection;
1520
- if (sctListLength || ctCompliance !== Protocol.Network.CertificateTransparencyCompliance.Unknown) {
1521
- // Create the Certificate Transparency section outside the callback, so that it appears in the right place.
1522
- sctSection = this.element.createChild('div', 'origin-view-section');
1523
- const sctDiv = sctSection.createChild('div', 'origin-view-section-title');
1524
- sctDiv.textContent = i18nString(UIStrings.certificateTransparency);
1525
- UI.ARIAUtils.markAsHeading(sctDiv, 2);
1526
- }
1527
-
1528
- if (!sctSection) {
1587
+ if (!sctListLength && ctCompliance === Protocol.Network.CertificateTransparencyCompliance.Unknown) {
1529
1588
  return;
1530
1589
  }
1531
-
1532
- // Show summary of SCT(s) of Certificate Transparency.
1533
- const sctSummaryTable = new SecurityDetailsTable();
1534
- sctSummaryTable.element().classList.add('sct-summary');
1535
- sctSection.appendChild(sctSummaryTable.element());
1536
- for (let i = 0; i < sctListLength; i++) {
1537
- const sct = originState.securityDetails.signedCertificateTimestampList[i];
1538
- sctSummaryTable.addRow(
1539
- i18nString(UIStrings.sct), sct.logDescription + ' (' + sct.origin + ', ' + sct.status + ')');
1540
- }
1541
-
1542
- // Show detailed SCT(s) of Certificate Transparency.
1543
- const sctTableWrapper = sctSection.createChild('div', 'sct-details');
1544
- sctTableWrapper.classList.add('hidden');
1545
- for (let i = 0; i < sctListLength; i++) {
1546
- const sctTable = new SecurityDetailsTable();
1547
- sctTableWrapper.appendChild(sctTable.element());
1548
- const sct = originState.securityDetails.signedCertificateTimestampList[i];
1549
- sctTable.addRow(i18nString(UIStrings.logName), sct.logDescription);
1550
- sctTable.addRow(i18nString(UIStrings.logId), sct.logId.replace(/(.{2})/g, '$1 '));
1551
- sctTable.addRow(i18nString(UIStrings.validationStatus), sct.status);
1552
- sctTable.addRow(i18nString(UIStrings.source), sct.origin);
1553
- sctTable.addRow(i18nString(UIStrings.issuedAt), new Date(sct.timestamp).toUTCString());
1554
- sctTable.addRow(i18nString(UIStrings.hashAlgorithm), sct.hashAlgorithm);
1555
- sctTable.addRow(i18nString(UIStrings.signatureAlgorithm), sct.signatureAlgorithm);
1556
- sctTable.addRow(i18nString(UIStrings.signatureData), sct.signatureData.replace(/(.{2})/g, '$1 '));
1557
- }
1558
-
1559
- // Add link to toggle between displaying of the summary of the SCT(s) and the detailed SCT(s).
1560
- if (sctListLength) {
1561
- function toggleSctDetailsDisplay(): void {
1562
- let buttonText;
1563
- const isDetailsShown = !sctTableWrapper.classList.contains('hidden');
1564
- if (isDetailsShown) {
1565
- buttonText = i18nString(UIStrings.showFullDetails);
1566
- } else {
1567
- buttonText = i18nString(UIStrings.hideFullDetails);
1568
- }
1569
- toggleSctsDetailsLink.textContent = buttonText;
1570
- UI.ARIAUtils.setLabel(toggleSctsDetailsLink, buttonText);
1571
- UI.ARIAUtils.setExpanded(toggleSctsDetailsLink, !isDetailsShown);
1572
- sctSummaryTable.element().classList.toggle('hidden');
1573
- sctTableWrapper.classList.toggle('hidden');
1574
- }
1575
- const toggleSctsDetailsLink = UI.UIUtils.createTextButton(
1576
- i18nString(UIStrings.showFullDetails), toggleSctDetailsDisplay,
1577
- {className: 'details-toggle', jslogContext: 'security.toggle-scts-details'});
1578
- sctSection.appendChild(toggleSctsDetailsLink);
1579
- }
1580
-
1581
- switch (ctCompliance) {
1582
- case Protocol.Network.CertificateTransparencyCompliance.Compliant:
1583
- sctSection.createChild('div', 'origin-view-section-notes').textContent =
1584
- i18nString(UIStrings.thisRequestCompliesWithChromes);
1585
- break;
1586
- case Protocol.Network.CertificateTransparencyCompliance.NotCompliant:
1587
- sctSection.createChild('div', 'origin-view-section-notes').textContent =
1588
- i18nString(UIStrings.thisRequestDoesNotComplyWith);
1589
- break;
1590
- case Protocol.Network.CertificateTransparencyCompliance.Unknown:
1591
- break;
1592
- }
1590
+ this.#createCertificateTransparencySection(originState.securityDetails);
1593
1591
 
1594
1592
  const noteSection = this.element.createChild('div', 'origin-view-section origin-view-notes');
1595
1593
  if (originState.loadedFromCache) {
@@ -1640,6 +1638,20 @@ export class SecurityOriginView extends UI.Widget.VBox {
1640
1638
  updateCertificateSection();
1641
1639
  }
1642
1640
 
1641
+ #createCertificateTransparencySection(securityDetails: Protocol.Network.SecurityDetails): void {
1642
+ const section = this.element.createChild('div', 'origin-view-section certificate-transparency-section');
1643
+ let isDetailsShown = false;
1644
+ const onToggleDetails = (): void => {
1645
+ isDetailsShown = !isDetailsShown;
1646
+ updateSection();
1647
+ };
1648
+ const updateSection = (): void => {
1649
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
1650
+ render(renderCertificateTransparencySection({securityDetails, isDetailsShown, onToggleDetails}), section);
1651
+ };
1652
+ updateSection();
1653
+ }
1654
+
1643
1655
  #showCertificateViewer = async(event: Event): Promise<void> => {
1644
1656
  event.consume();
1645
1657
  const names = await SDK.NetworkManager.MultitargetNetworkManager.instance().getCertificate(this.#origin);
@@ -1667,30 +1679,6 @@ export class SecurityOriginView extends UI.Widget.VBox {
1667
1679
  };
1668
1680
  }
1669
1681
 
1670
- export class SecurityDetailsTable {
1671
- readonly #element: HTMLTableElement;
1672
-
1673
- constructor() {
1674
- this.#element = document.createElement('table');
1675
- this.#element.classList.add('details-table');
1676
- }
1677
-
1678
- element(): HTMLTableElement {
1679
- return this.#element;
1680
- }
1681
-
1682
- addRow(key: string, value: string|Node): void {
1683
- const row = this.#element.createChild('tr', 'details-table-row');
1684
- row.createChild('td').textContent = key;
1685
-
1686
- const valueCell = row.createChild('td');
1687
- if (typeof value === 'string') {
1688
- valueCell.textContent = value;
1689
- } else {
1690
- valueCell.appendChild(value);
1691
- }
1692
- }
1693
- }
1694
1682
  export interface OriginState {
1695
1683
  securityState: Protocol.Security.SecurityState;
1696
1684
  securityDetails: Protocol.Network.SecurityDetails|null;
@@ -12,6 +12,7 @@ import * as Geometry from '../../ui/geometry/geometry.js';
12
12
  import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
13
13
  import * as UI from '../../ui/legacy/legacy.js';
14
14
  import {Directives, html, render} from '../../ui/lit/lit.js';
15
+ import * as SettingUIRegistration from '../../ui/settings/settings.js';
15
16
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
16
17
  import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
17
18
 
@@ -128,6 +129,15 @@ const UIStrings = {
128
129
  * @description Description of the Emulate Idle State select in the Sensors view.
129
130
  */
130
131
  forcesSelectedIdleStateEmulation: 'Forces selected idle state emulation',
132
+ /**
133
+ * @description Description of the Emulate CPU Performance Tier select in the Sensors view.
134
+ */
135
+ forcesSelectedCpuPerformanceTierEmulation: 'Forces CPU performance tier emulation',
136
+ /**
137
+ * @description Option value for no CPU Performance override with default value
138
+ * @example {Tier 3: HIGH} PH1
139
+ */
140
+ cpuPerformanceNoOverrideWithDefault: 'No override ({PH1})',
131
141
  /**
132
142
  * @description Description of the Emulate CPU Pressure State select in the Sensors view.
133
143
  */
@@ -206,6 +216,8 @@ export class SensorsView extends UI.Widget.VBox {
206
216
  private boxMatrix?: DOMMatrix;
207
217
  private mouseDownVector?: Geometry.Vector|null;
208
218
  private originalBoxMatrix?: DOMMatrix;
219
+ readonly #cpuThrottlingManager: SDK.CPUThrottlingManager.CPUThrottlingManager;
220
+ #cpuPerformanceNoOverrideOptionElement?: HTMLOptionElement;
209
221
 
210
222
  constructor() {
211
223
  super({
@@ -215,6 +227,8 @@ export class SensorsView extends UI.Widget.VBox {
215
227
  this.registerRequiredCSS(sensorsStyles);
216
228
  this.contentElement.classList.add('sensors-view');
217
229
 
230
+ this.#cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance();
231
+
218
232
  this.#locationSetting = Common.Settings.Settings.instance().createSetting('emulation.location-override', '');
219
233
  this.#location = SDK.EmulationModel.Location.parseSetting(this.#locationSetting.get());
220
234
  this.#locationOverrideEnabled = false;
@@ -251,6 +265,10 @@ export class SensorsView extends UI.Widget.VBox {
251
265
  this.createPressureSection();
252
266
 
253
267
  this.createPanelSeparator();
268
+
269
+ this.createCPUPerformanceSection();
270
+
271
+ this.createPanelSeparator();
254
272
  }
255
273
 
256
274
  private createPanelSeparator(): void {
@@ -734,6 +752,75 @@ export class SensorsView extends UI.Widget.VBox {
734
752
  }
735
753
  }
736
754
 
755
+ private createCPUPerformanceSection(): void {
756
+ const container = this.contentElement.createChild('div', 'cpu-performance-section');
757
+ const control = SettingsUI.SettingsUI.createControlForSetting(
758
+ Common.Settings.Settings.instance().resolve(SDK.SDKSettings.cpuPerformanceSettingDescriptor),
759
+ i18nString(UIStrings.forcesSelectedCpuPerformanceTierEmulation));
760
+
761
+ if (control) {
762
+ container.appendChild(control);
763
+ // The text of the "no override" option element needs to be updated dynamically.
764
+ const noOverrideOption = control.querySelector<HTMLOptionElement>('select option[value="no-override"]');
765
+ if (noOverrideOption) {
766
+ this.#cpuPerformanceNoOverrideOptionElement = noOverrideOption;
767
+ this.#updateCPUPerformanceNoOverrideLabel();
768
+ } else {
769
+ this.#cpuPerformanceNoOverrideOptionElement = undefined;
770
+ }
771
+ }
772
+ }
773
+
774
+ override wasShown(): void {
775
+ super.wasShown();
776
+ if (this.#cpuPerformanceNoOverrideOptionElement) {
777
+ this.#cpuThrottlingManager.addEventListener(SDK.CPUThrottlingManager.Events.CPU_PERFORMANCE_TIER_CHANGED,
778
+ this.#updateCPUPerformanceNoOverrideLabel, this);
779
+ this.#cpuThrottlingManager.addEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED,
780
+ this.#updateCPUPerformanceNoOverrideLabel, this);
781
+ this.#updateCPUPerformanceNoOverrideLabel();
782
+ }
783
+ }
784
+
785
+ override willHide(): void {
786
+ super.willHide();
787
+ if (this.#cpuPerformanceNoOverrideOptionElement) {
788
+ this.#cpuThrottlingManager.removeEventListener(SDK.CPUThrottlingManager.Events.CPU_PERFORMANCE_TIER_CHANGED,
789
+ this.#updateCPUPerformanceNoOverrideLabel, this);
790
+ this.#cpuThrottlingManager.removeEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED,
791
+ this.#updateCPUPerformanceNoOverrideLabel, this);
792
+ }
793
+ }
794
+
795
+ #updateCPUPerformanceNoOverrideLabel(): void {
796
+ if (!this.#cpuPerformanceNoOverrideOptionElement) {
797
+ return;
798
+ }
799
+ // Helper function to retrieve the tier labels (i18n) from the settings.
800
+ const options =
801
+ SettingUIRegistration.SettingUIRegistration.resolve(SDK.SDKSettings.cpuPerformanceSettingDescriptor).options;
802
+ const getOptionTitle = (value: string): string => {
803
+ const opt = options.find(o => o.value === value);
804
+ if (!opt) {
805
+ return '';
806
+ }
807
+ return opt.title;
808
+ };
809
+ // Helper function to return a fallback title, to be used if the above fails.
810
+ const getFallbackTitle = (tier: SDK.CPUThrottlingManager.CPUPerformanceTier): string => {
811
+ return `Tier ${SDK.CPUThrottlingManager.tierToNumber(tier)}: ${tier.toUpperCase()}`;
812
+ };
813
+ // Update the text of the "no-override" element using the calculated tier.
814
+ const calculatedTier = this.#cpuThrottlingManager.calculatedCPUPerformanceTier();
815
+ if (calculatedTier !== undefined) {
816
+ const tierTitle = getOptionTitle(calculatedTier) || getFallbackTitle(calculatedTier);
817
+ this.#cpuPerformanceNoOverrideOptionElement.text =
818
+ i18nString(UIStrings.cpuPerformanceNoOverrideWithDefault, {PH1: tierTitle});
819
+ } else {
820
+ this.#cpuPerformanceNoOverrideOptionElement.text = getOptionTitle('no-override') || 'No override';
821
+ }
822
+ }
823
+
737
824
  private enableOrientationFields(disable: boolean|null): void {
738
825
  if (disable) {
739
826
  this.deviceOrientationFieldset.disabled = true;
@@ -119,6 +119,34 @@ const UIStrings = {
119
119
  * @description Command that shows the Locations settings tab.
120
120
  */
121
121
  showLocations: 'Show Locations',
122
+ /**
123
+ * @description Text for the CPU Performance Tier type to simulate on a device.
124
+ */
125
+ cpuPerformance: 'CPU Performance Tier',
126
+ /**
127
+ * @description Option value for no CPU Performance override
128
+ */
129
+ cpuPerformanceNoOverride: 'No override',
130
+ /**
131
+ * @description Label for Unknown CPU Performance tier
132
+ */
133
+ cpuPerformanceTierUnknown: 'Tier 0: UNKNOWN',
134
+ /**
135
+ * @description Label for Low CPU Performance tier
136
+ */
137
+ cpuPerformanceTierLow: 'Tier 1: LOW',
138
+ /**
139
+ * @description Label for Mid CPU Performance tier
140
+ */
141
+ cpuPerformanceTierMid: 'Tier 2: MID',
142
+ /**
143
+ * @description Label for High CPU Performance tier
144
+ */
145
+ cpuPerformanceTierHigh: 'Tier 3: HIGH',
146
+ /**
147
+ * @description Label for Ultra CPU Performance tier
148
+ */
149
+ cpuPerformanceTierUltra: 'Tier 4: ULTRA',
122
150
  } as const;
123
151
  const str_ = i18n.i18n.registerUIStrings('panels/sensors/sensors-meta.ts', UIStrings);
124
152
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
@@ -140,7 +168,11 @@ UI.ViewManager.registerViewExtension({
140
168
  persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
141
169
  order: 100,
142
170
  async loadView() {
143
- const Sensors = await loadEmulationModule();
171
+ const [Sensors] = await Promise.all([
172
+ loadEmulationModule(),
173
+ // Ensure that this is available when the sensors panel is constructed.
174
+ SDK.CPUThrottlingManager.CPUThrottlingManager.instance().updateHostDefaultCPUPerformanceTier(),
175
+ ]);
144
176
  return new Sensors.SensorsView.SensorsView();
145
177
  },
146
178
  tags: [
@@ -330,3 +362,39 @@ SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.idleDetectionSettingDe
330
362
  },
331
363
  ],
332
364
  });
365
+
366
+ SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.cpuPerformanceSettingDescriptor, {
367
+ title: i18nLazyString(UIStrings.cpuPerformance),
368
+ options: [
369
+ {
370
+ value: 'no-override',
371
+ title: i18nLazyString(UIStrings.cpuPerformanceNoOverride),
372
+ text: i18nLazyString(UIStrings.cpuPerformanceNoOverride),
373
+ },
374
+ {
375
+ value: 'unknown',
376
+ title: i18nLazyString(UIStrings.cpuPerformanceTierUnknown),
377
+ text: i18nLazyString(UIStrings.cpuPerformanceTierUnknown),
378
+ },
379
+ {
380
+ value: 'low',
381
+ title: i18nLazyString(UIStrings.cpuPerformanceTierLow),
382
+ text: i18nLazyString(UIStrings.cpuPerformanceTierLow),
383
+ },
384
+ {
385
+ value: 'mid',
386
+ title: i18nLazyString(UIStrings.cpuPerformanceTierMid),
387
+ text: i18nLazyString(UIStrings.cpuPerformanceTierMid),
388
+ },
389
+ {
390
+ value: 'high',
391
+ title: i18nLazyString(UIStrings.cpuPerformanceTierHigh),
392
+ text: i18nLazyString(UIStrings.cpuPerformanceTierHigh),
393
+ },
394
+ {
395
+ value: 'ultra',
396
+ title: i18nLazyString(UIStrings.cpuPerformanceTierUltra),
397
+ text: i18nLazyString(UIStrings.cpuPerformanceTierUltra),
398
+ },
399
+ ],
400
+ });
@@ -81,7 +81,7 @@
81
81
  }
82
82
 
83
83
  .keybinds-list-item:not(.keybinds-editing):hover .keybinds-edit-button,
84
- .keybinds-list-item:not(.keybinds-editing):focus-within .keybinds-edit-button {
84
+ .keybinds-list-item-wrapper:focus-within > .keybinds-list-item:not(.keybinds-editing) .keybinds-edit-button {
85
85
  display: inline-block;
86
86
  }
87
87