chrome-devtools-frontend 1.0.1681091 → 1.0.1681498

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 (86) hide show
  1. package/front_end/core/sdk/DOMModel.ts +8 -0
  2. package/front_end/core/sdk/NetworkManager.ts +9 -4
  3. package/front_end/core/sdk/OverlayModel.ts +3 -2
  4. package/front_end/core/sdk/SDKSettings.ts +19 -0
  5. package/front_end/entrypoints/main/main-meta.ts +82 -0
  6. package/front_end/entrypoints/shell/shell.ts +0 -3
  7. package/front_end/entrypoints/trace_app/trace_app.ts +0 -3
  8. package/front_end/models/ai_code_completion/debug.ts +6 -3
  9. package/front_end/models/ai_code_generation/debug.ts +6 -3
  10. package/front_end/models/badges/UserBadges.ts +9 -2
  11. package/front_end/models/emulation/DeviceModeModel.ts +16 -27
  12. package/front_end/models/emulation/EmulatedDevices.ts +30 -125
  13. package/front_end/models/extensions/ExtensionAPI.ts +34 -23
  14. package/front_end/models/logs/NetworkLog.ts +3 -3
  15. package/front_end/models/logs/logs-meta.ts +0 -60
  16. package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -1
  17. package/front_end/panels/application/ServiceWorkersView.ts +1 -1
  18. package/front_end/panels/application/StorageView.ts +2 -0
  19. package/front_end/panels/common/BadgeNotification.ts +1 -1
  20. package/front_end/panels/common/ExtensionPanel.ts +12 -7
  21. package/front_end/panels/common/ExtensionServer.ts +76 -16
  22. package/front_end/panels/common/GdpSignUpDialog.ts +1 -1
  23. package/front_end/panels/console/ConsoleView.ts +2 -1
  24. package/front_end/panels/console/ConsoleViewMessage.ts +3 -2
  25. package/front_end/panels/console/console-meta.ts +9 -0
  26. package/front_end/panels/elements/CSSRuleValidator.ts +12 -12
  27. package/front_end/panels/elements/CSSSpecificityBreakdown.ts +1 -1
  28. package/front_end/panels/elements/ClassesPaneWidget.ts +6 -6
  29. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
  30. package/front_end/panels/elements/ComputedStyleWidget.ts +4 -5
  31. package/front_end/panels/elements/DOMTreeContextMenu.ts +3 -6
  32. package/front_end/panels/elements/ElementIssueUtils.ts +20 -20
  33. package/front_end/panels/elements/ElementStatePaneWidget.ts +6 -6
  34. package/front_end/panels/elements/ElementsPanel.ts +10 -10
  35. package/front_end/panels/elements/ElementsTreeElement.ts +28 -28
  36. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -20
  37. package/front_end/panels/elements/EventListenersWidget.ts +8 -8
  38. package/front_end/panels/elements/LayersWidget.ts +4 -4
  39. package/front_end/panels/elements/LayoutPane.ts +11 -11
  40. package/front_end/panels/elements/MarkerDecorator.ts +3 -3
  41. package/front_end/panels/elements/PlatformFontsWidget.ts +8 -8
  42. package/front_end/panels/elements/PropertiesWidget.ts +4 -4
  43. package/front_end/panels/elements/PropertyRenderer.ts +2 -2
  44. package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
  45. package/front_end/panels/elements/StylePropertiesSection.ts +14 -14
  46. package/front_end/panels/elements/StylePropertyTreeElement.ts +21 -21
  47. package/front_end/panels/elements/StylesSidebarPane.ts +12 -13
  48. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +1 -1
  49. package/front_end/panels/elements/components/CSSHintDetailsView.ts +1 -1
  50. package/front_end/panels/elements/components/CSSVariableValueView.ts +3 -3
  51. package/front_end/panels/elements/components/ElementsBreadcrumbsUtils.ts +2 -2
  52. package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
  53. package/front_end/panels/elements/elements-meta.ts +13 -13
  54. package/front_end/panels/issues/AffectedCookiesView.ts +2 -0
  55. package/front_end/panels/issues/AffectedElementsView.ts +5 -0
  56. package/front_end/panels/issues/IssueView.ts +7 -2
  57. package/front_end/panels/layer_viewer/LayerDetailsView.ts +11 -7
  58. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +2 -0
  59. package/front_end/panels/network/NetworkLogView.ts +5 -2
  60. package/front_end/panels/network/NetworkOverview.ts +11 -5
  61. package/front_end/panels/network/NetworkPanel.ts +2 -1
  62. package/front_end/panels/network/NetworkWaterfallColumn.ts +16 -3
  63. package/front_end/panels/network/RequestHeadersView.ts +4 -4
  64. package/front_end/panels/network/components/ResponseHeaderSection.ts +6 -2
  65. package/front_end/panels/network/network-meta.ts +57 -0
  66. package/front_end/panels/settings/components/SyncSection.ts +1 -1
  67. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +0 -3
  68. package/front_end/panels/sources/NavigatorView.ts +6 -2
  69. package/front_end/panels/sources/SourcesNavigator.ts +8 -4
  70. package/front_end/panels/sources/SourcesPanel.ts +4 -2
  71. package/front_end/panels/sources/SourcesSearchScope.ts +3 -1
  72. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -2
  73. package/front_end/panels/web_audio/WebAudioView.ts +8 -0
  74. package/front_end/third_party/chromium/README.chromium +1 -1
  75. package/front_end/third_party/web-vitals/rebuild.sh +1 -1
  76. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +11 -11
  77. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -1
  78. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +19 -20
  79. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +2 -2
  80. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +164 -325
  81. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  82. package/mcp/mcp.ts +0 -3
  83. package/package.json +1 -1
  84. package/front_end/core/sdk/sdk-meta.ts +0 -40
  85. package/front_end/models/badges/badges-meta.ts +0 -27
  86. package/front_end/models/persistence/persistence-meta.ts +0 -69
@@ -45,7 +45,7 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
45
45
  this.#targetManager.observeModels(SDK.NetworkManager.NetworkManager, this);
46
46
  const recordLogSetting: Common.Settings.Setting<boolean> = this.#settings.moduleSetting('network-log.record-log');
47
47
  recordLogSetting.addChangeListener(() => {
48
- const preserveLogSetting = this.#settings.moduleSetting('network-log.preserve-log');
48
+ const preserveLogSetting = this.#settings.resolve(SDK.SDKSettings.preserveNetworkLogSettingDescriptor);
49
49
  if (!preserveLogSetting.get() && recordLogSetting.get()) {
50
50
  this.reset(true);
51
51
  }
@@ -296,7 +296,7 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
296
296
  }
297
297
 
298
298
  private willReloadPage(): void {
299
- if (!this.#settings.moduleSetting('network-log.preserve-log').get()) {
299
+ if (!this.#settings.resolve(SDK.SDKSettings.preserveNetworkLogSettingDescriptor).get()) {
300
300
  this.reset(true);
301
301
  }
302
302
  }
@@ -317,7 +317,7 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
317
317
  return;
318
318
  }
319
319
 
320
- const preserveLog = this.#settings.moduleSetting('network-log.preserve-log').get();
320
+ const preserveLog = this.#settings.resolve(SDK.SDKSettings.preserveNetworkLogSettingDescriptor).get();
321
321
 
322
322
  const oldRequests = this.#requests;
323
323
  const oldManagerRequests =
@@ -6,42 +6,6 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
 
8
8
  const UIStrings = {
9
- /**
10
- * @description Text to keep the log after refreshing.
11
- */
12
- keepLog: 'Keep log',
13
- /**
14
- * @description A term that can be used to search in the command menu, and will find the search
15
- * result 'Keep log on page reload / navigation'. This is an additional search term to help
16
- * the user find the setting even when they don't know the exact name of it.
17
- */
18
- keep: 'keep',
19
- /**
20
- * @description A term that can be used to search in the command menu, and will find the search
21
- * result 'Keep log on page reload / navigation'. This is an additional search term to help
22
- * the user find the setting even when they don't know the exact name of it.
23
- */
24
- preserve: 'preserve',
25
- /**
26
- * @description A term that can be used to search in the command menu, and will find the search
27
- * result 'Keep log on page reload / navigation'. This is an additional search term to help
28
- * the user find the setting even when they don't know the exact name of it.
29
- */
30
- clear: 'clear',
31
- /**
32
- * @description A term that can be used to search in the command menu, and will find the search
33
- * result 'Keep log on page reload / navigation'. This is an additional search term to help
34
- * the user find the setting even when they don't know the exact name of it.
35
- */
36
- reset: 'reset',
37
- /**
38
- * @description Title of a setting under the Network category that can be invoked through the Command Menu.
39
- */
40
- keepLogOnPageReload: 'Keep log on page reload / navigation',
41
- /**
42
- * @description Title of a setting under the Network category that can be invoked through the Command Menu.
43
- */
44
- doNotKeepLogOnPageReload: 'Don’t keep log on page reload / navigation',
45
9
  /**
46
10
  * @description Title of an action in the network tool to toggle recording.
47
11
  */
@@ -50,30 +14,6 @@ const UIStrings = {
50
14
  const str_ = i18n.i18n.registerUIStrings('models/logs/logs-meta.ts', UIStrings);
51
15
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
52
16
 
53
- Common.Settings.registerSettingExtension({
54
- category: Common.Settings.SettingCategory.NETWORK,
55
- title: i18nLazyString(UIStrings.keepLog),
56
- settingName: 'network-log.preserve-log',
57
- settingType: Common.Settings.SettingType.BOOLEAN,
58
- defaultValue: false,
59
- tags: [
60
- i18nLazyString(UIStrings.keep),
61
- i18nLazyString(UIStrings.preserve),
62
- i18nLazyString(UIStrings.clear),
63
- i18nLazyString(UIStrings.reset),
64
- ],
65
- options: [
66
- {
67
- value: true,
68
- title: i18nLazyString(UIStrings.keepLogOnPageReload),
69
- },
70
- {
71
- value: false,
72
- title: i18nLazyString(UIStrings.doNotKeepLogOnPageReload),
73
- },
74
- ],
75
- });
76
-
77
17
  Common.Settings.registerSettingExtension({
78
18
  category: Common.Settings.SettingCategory.NETWORK,
79
19
  title: i18nLazyString(UIStrings.recordNetworkLog),
@@ -18,6 +18,12 @@ import {PersistenceBinding, PersistenceImpl} from './PersistenceImpl.js';
18
18
 
19
19
  const forbiddenUrls = ['chromewebstore.google.com', 'chrome.google.com'];
20
20
 
21
+ export const persistenceNetworkOverridesEnabledSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
22
+ name: 'persistence-network-overrides-enabled',
23
+ type: Common.Settings.SettingType.BOOLEAN,
24
+ defaultValue: false,
25
+ };
26
+
21
27
  export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
22
28
  SDK.TargetManager.Observer {
23
29
  #bindings = new WeakMap<Workspace.UISourceCode.UISourceCode, PersistenceBinding>();
@@ -63,7 +69,7 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
63
69
  this.#isolatedFileSystemManager = isolatedFileSystemManager;
64
70
  this.#multitargetNetworkManager = multitargetNetworkManager;
65
71
 
66
- this.#enabledSetting = this.#settings.moduleSetting<boolean>('persistence-network-overrides-enabled');
72
+ this.#enabledSetting = this.#settings.resolve(persistenceNetworkOverridesEnabledSettingDescriptor);
67
73
  this.#enabledSetting.addChangeListener(this.enabledChanged, this);
68
74
 
69
75
  this.#interceptionHandlerBound = this.interceptionHandler.bind(this);
@@ -738,7 +738,7 @@ export const DEFAULT_SECTION_VIEW: SectionView =
738
738
  <span style="flex: 1 1 auto">${input.title}</span>
739
739
  ${renderHeaderButtons(input)}
740
740
  </devtools-report-section-header>
741
- <div class="service-worker-section">
741
+ <div class="service-worker-section" jslog=${VisualLogging.section('service-worker')}>
742
742
  ${renderSourceField(input, input.activeVersion ?? input.redundantVersion)}
743
743
  ${renderStatusField(input, input.activeVersion, input.waitingVersion, input.installingVersion, input.redundantVersion)}
744
744
  ${renderClientsField(input, input.activeVersion ?? input.redundantVersion)}
@@ -274,6 +274,7 @@ export class StorageView extends UI.Widget.VBox {
274
274
  quota.element.setAttribute('jslog', `${VisualLogging.section('usage')}`);
275
275
  this.quotaRow = quota.appendSelectableRow();
276
276
  this.quotaRow.classList.add('quota-usage-row');
277
+ this.quotaRow.setAttribute('jslog', `${VisualLogging.item('storage-usage')}`);
277
278
  const learnMoreRow = quota.appendRow();
278
279
  const learnMore = Link.create(
279
280
  'https://developer.chrome.com/docs/devtools/progressive-web-apps#opaque-responses',
@@ -286,6 +287,7 @@ export class StorageView extends UI.Widget.VBox {
286
287
  this.populatePieChart(0, []);
287
288
  const usageBreakdownRow = quota.appendRow();
288
289
  usageBreakdownRow.classList.add('usage-breakdown-row');
290
+ usageBreakdownRow.setAttribute('jslog', `${VisualLogging.item('usage-breakdown')}`);
289
291
  usageBreakdownRow.appendChild(this.pieChart);
290
292
 
291
293
  this.previousOverrideFieldValue = '';
@@ -139,7 +139,7 @@ const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement)
139
139
  type View = typeof DEFAULT_VIEW;
140
140
 
141
141
  function revealBadgeSettings(): void {
142
- void Common.Revealer.reveal(Common.Settings.Settings.instance().moduleSetting('receive-gdp-badges'));
142
+ void Common.Revealer.reveal(Common.Settings.Settings.instance().resolve(Badges.receiveGdpBadgesSettingDescriptor));
143
143
  }
144
144
 
145
145
  export class BadgeNotification extends UI.Widget.Widget {
@@ -200,14 +200,19 @@ export class ExtensionSidebarPane extends UI.View.SimpleView {
200
200
  callback('operation cancelled');
201
201
  return;
202
202
  }
203
- objectPropertiesView.element.removeChildren();
204
- const section = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection(object, title, undefined, undefined,
205
- /* editable: */ false);
206
- if (!title) {
207
- section.titleLessMode();
203
+ objectPropertiesView.detachChildWidgets();
204
+ const section = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionWidget();
205
+ section.objectTree = new ObjectUI.ObjectPropertiesSection.ObjectTree(object, {
206
+ readOnly: true,
207
+ propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
208
+ });
209
+ section.objectTree.expanded = true;
210
+ if (title) {
211
+ const span = document.createElement('span');
212
+ span.textContent = title;
213
+ section.title = span;
208
214
  }
209
- section.firstChild()?.expand();
210
- objectPropertiesView.element.appendChild(section.element);
215
+ section.show(objectPropertiesView.element);
211
216
  callback();
212
217
  }
213
218
  }
@@ -1349,15 +1349,76 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1349
1349
  return this.status.E_BADARG(
1350
1350
  'command', `expected ${Extensions.ExtensionAPI.PrivateAPI.Commands.ForwardKeyboardEvent}`);
1351
1351
  }
1352
- message.entries.forEach(handleEventEntry);
1352
+ if (!Array.isArray(message.entries)) {
1353
+ return this.status.E_BADARG('entries', 'expected array');
1354
+ }
1355
+
1356
+ const globalShortcutKeys = new Set(UI.ShortcutRegistry.ShortcutRegistry.instance().globalShortcutKeys());
1357
+ const validEvents: Array<{event: KeyboardEvent, keyCode: number}> = [];
1358
+
1359
+ for (const entry of message.entries) {
1360
+ if (!entry || typeof entry !== 'object') {
1361
+ return this.status.E_BADARG('entries', 'expected object');
1362
+ }
1363
+ if (entry.eventType !== 'keydown') {
1364
+ return this.status.E_BADARG('eventType', 'expected "keydown"');
1365
+ }
1366
+ if (typeof entry.key !== 'string') {
1367
+ return this.status.E_BADARGTYPE('key', typeof entry.key, 'string');
1368
+ }
1369
+ if (typeof entry.code !== 'string') {
1370
+ return this.status.E_BADARGTYPE('code', typeof entry.code, 'string');
1371
+ }
1372
+ if (typeof entry.keyCode !== 'number' || !Number.isFinite(entry.keyCode)) {
1373
+ return this.status.E_BADARGTYPE('keyCode', typeof entry.keyCode, 'number');
1374
+ }
1375
+ if (typeof entry.location !== 'number' || !Number.isFinite(entry.location)) {
1376
+ return this.status.E_BADARGTYPE('location', typeof entry.location, 'number');
1377
+ }
1378
+ if (typeof entry.ctrlKey !== 'boolean') {
1379
+ return this.status.E_BADARGTYPE('ctrlKey', typeof entry.ctrlKey, 'boolean');
1380
+ }
1381
+ if (typeof entry.altKey !== 'boolean') {
1382
+ return this.status.E_BADARGTYPE('altKey', typeof entry.altKey, 'boolean');
1383
+ }
1384
+ if (typeof entry.shiftKey !== 'boolean') {
1385
+ return this.status.E_BADARGTYPE('shiftKey', typeof entry.shiftKey, 'boolean');
1386
+ }
1387
+ if (typeof entry.metaKey !== 'boolean') {
1388
+ return this.status.E_BADARGTYPE('metaKey', typeof entry.metaKey, 'boolean');
1389
+ }
1390
+
1391
+ let keyCode = entry.keyCode;
1392
+ if (!keyCode && entry.key === Platform.KeyboardUtilities.ESCAPE_KEY) {
1393
+ keyCode = 27;
1394
+ }
1395
+ if (!Number.isInteger(keyCode) || keyCode < 0 || keyCode > 255) {
1396
+ return this.status.E_BADARG('keyCode', 'invalid keyCode');
1397
+ }
1398
+
1399
+ let modifiers = 0;
1400
+ if (entry.shiftKey) {
1401
+ modifiers |= UI.KeyboardShortcut.Modifiers.Shift.value;
1402
+ }
1403
+ if (entry.ctrlKey) {
1404
+ modifiers |= UI.KeyboardShortcut.Modifiers.Ctrl.value;
1405
+ }
1406
+ if (entry.altKey) {
1407
+ modifiers |= UI.KeyboardShortcut.Modifiers.Alt.value;
1408
+ }
1409
+ if (entry.metaKey) {
1410
+ modifiers |= UI.KeyboardShortcut.Modifiers.Meta.value;
1411
+ }
1412
+
1413
+ const keyCombination = (keyCode & 255) | (modifiers << 8);
1414
+ if (!globalShortcutKeys.has(keyCombination)) {
1415
+ return this.status.E_BADARG('entries', 'unexpected shortcut key');
1416
+ }
1353
1417
 
1354
- function handleEventEntry(entry: KeyboardEventInit&{eventType: string}): void {
1355
- // Fool around closure compiler -- it has its own notion of both KeyboardEvent constructor
1356
- // and initKeyboardEvent methods and overriding these in externs.js does not have effect.
1357
1418
  const event = new window.KeyboardEvent(entry.eventType, {
1358
1419
  key: entry.key,
1359
1420
  code: entry.code,
1360
- keyCode: entry.keyCode,
1421
+ keyCode,
1361
1422
  location: entry.location,
1362
1423
  ctrlKey: entry.ctrlKey,
1363
1424
  altKey: entry.altKey,
@@ -1365,24 +1426,23 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1365
1426
  metaKey: entry.metaKey,
1366
1427
  });
1367
1428
 
1429
+ validEvents.push({event, keyCode});
1430
+ }
1431
+
1432
+ for (const {event, keyCode} of validEvents) {
1368
1433
  // @ts-expect-error
1369
- event.__keyCode = keyCodeForEntry(entry);
1434
+ event.__keyCode = keyCode;
1370
1435
  document.dispatchEvent(event);
1371
1436
  }
1372
1437
 
1373
- function keyCodeForEntry(entry: KeyboardEventInit): unknown {
1374
- let keyCode = entry.keyCode;
1375
- if (!keyCode) {
1376
- // This is required only for synthetic events (e.g. dispatched in tests).
1377
- if (entry.key === Platform.KeyboardUtilities.ESCAPE_KEY) {
1378
- keyCode = 27;
1379
- }
1380
- }
1381
- return keyCode || 0;
1382
- }
1383
1438
  return undefined;
1384
1439
  }
1385
1440
 
1441
+ onForwardKeyboardEventForTest(message: Extensions.ExtensionAPI.PrivateAPI.ExtensionServerRequestMessage): Record
1442
+ |undefined {
1443
+ return this.onForwardKeyboardEvent(message);
1444
+ }
1445
+
1386
1446
  private dispatchCallback(requestId: unknown, port: MessagePort, result: unknown): void {
1387
1447
  if (requestId) {
1388
1448
  port.postMessage({command: 'callback', requestId, result});
@@ -222,7 +222,7 @@ export class GdpSignUpDialog extends UI.Widget.VBox {
222
222
  this.#keepMeUpdated ? Host.GdpClient.EmailPreference.ENABLED : Host.GdpClient.EmailPreference.DISABLED;
223
223
  const result = await Host.GdpClient.GdpClient.instance().createProfile({user, emailPreference});
224
224
  if (result) {
225
- Common.Settings.Settings.instance().moduleSetting('receive-gdp-badges').set(true);
225
+ Common.Settings.Settings.instance().resolve(Badges.receiveGdpBadgesSettingDescriptor).set(true);
226
226
  await Badges.UserBadges.instance().initialize();
227
227
  Badges.UserBadges.instance().recordAction(Badges.BadgeAction.GDP_SIGN_UP_COMPLETE);
228
228
  this.#onSuccess?.();
@@ -481,7 +481,8 @@ export class ConsoleView extends UI.Widget.VBox implements
481
481
  toolbar.appendToolbarItem(this.filterStatusText);
482
482
  toolbar.appendToolbarItem(this.showSettingsPaneButton);
483
483
 
484
- const monitoringXHREnabledSetting = Common.Settings.Settings.instance().moduleSetting('monitoring-xhr-enabled');
484
+ const monitoringXHREnabledSetting =
485
+ Common.Settings.Settings.instance().resolve(SDK.SDKSettings.monitoringXHREnabledSettingDescriptor);
485
486
  this.timestampsSetting = Common.Settings.Settings.instance().moduleSetting('console-timestamps-enabled');
486
487
  this.consoleHistoryAutocompleteSetting =
487
488
  Common.Settings.Settings.instance().moduleSetting('console-history-autocomplete');
@@ -895,8 +895,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
895
895
  if (obj.preview) {
896
896
  titleElement.classList.add('console-object-preview');
897
897
 
898
- render(this.previewFormatter.renderObjectPreview(obj.preview, includeNullOrUndefined), titleElement);
899
- ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.appendMemoryIcon(titleElement, obj);
898
+ render(html`${this.previewFormatter.renderObjectPreview(obj.preview, includeNullOrUndefined)}${
899
+ ObjectUI.ObjectPropertiesSection.getMemoryIcon(obj)}`,
900
+ titleElement);
900
901
  }
901
902
  };
902
903
 
@@ -23,6 +23,10 @@ const UIStrings = {
23
23
  * @description Title of a setting under the Console category in Settings.
24
24
  */
25
25
  customFormatters: 'Custom formatters',
26
+ /**
27
+ * @description Title of a setting under the Console category in Settings.
28
+ */
29
+ logXmlhttprequests: 'Log XMLHttpRequests',
26
30
  /**
27
31
  * @description Title of the Console tool.
28
32
  */
@@ -479,6 +483,11 @@ SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.customFormattersSettin
479
483
  title: i18nLazyString(UIStrings.customFormatters),
480
484
  });
481
485
 
486
+ SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.monitoringXHREnabledSettingDescriptor, {
487
+ category: Common.Settings.SettingCategory.CONSOLE,
488
+ title: i18nLazyString(UIStrings.logXmlhttprequests),
489
+ });
490
+
482
491
  Common.Revealer.registerRevealer({
483
492
  contextTypes() {
484
493
  return [
@@ -22,41 +22,41 @@ import {
22
22
 
23
23
  const UIStrings = {
24
24
  /**
25
- * @description The message shown in the Style pane when the user hovers over a property that has no effect due to some other property.
25
+ * @description The message shown in the Styles tab when the user hovers over a property that has no effect due to some other property.
26
26
  * @example {flex-wrap: nowrap} REASON_PROPERTY_DECLARATION_CODE
27
27
  * @example {align-content} AFFECTED_PROPERTY_DECLARATION_CODE
28
28
  */
29
29
  ruleViolatedBySameElementRuleReason:
30
30
  'The {REASON_PROPERTY_DECLARATION_CODE} property prevents {AFFECTED_PROPERTY_DECLARATION_CODE} from having an effect.',
31
31
  /**
32
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect due to some other property.
32
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect due to some other property.
33
33
  * @example {flex-wrap} PROPERTY_NAME
34
34
  * @example {nowrap} PROPERTY_VALUE
35
35
  */
36
36
  ruleViolatedBySameElementRuleFix: 'Try setting {PROPERTY_NAME} to something other than {PROPERTY_VALUE}.',
37
37
  /**
38
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect due to not being a flex or grid container.
38
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect due to not being a flex or grid container.
39
39
  * @example {display: grid} DISPLAY_GRID_RULE
40
40
  * @example {display: flex} DISPLAY_FLEX_RULE
41
41
  */
42
42
  ruleViolatedBySameElementRuleChangeFlexOrGrid:
43
43
  'Try adding {DISPLAY_GRID_RULE} or {DISPLAY_FLEX_RULE} to make this element into a container.',
44
44
  /**
45
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect due to the current property value.
45
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect due to the current property value.
46
46
  * @example {display: block} EXISTING_PROPERTY_DECLARATION
47
47
  * @example {display: flex} TARGET_PROPERTY_DECLARATION
48
48
  */
49
49
  ruleViolatedBySameElementRuleChangeSuggestion:
50
50
  'Try setting the {EXISTING_PROPERTY_DECLARATION} property to {TARGET_PROPERTY_DECLARATION}.',
51
51
  /**
52
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect due to properties of the parent element.
52
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect due to properties of the parent element.
53
53
  * @example {display: block} REASON_PROPERTY_DECLARATION_CODE
54
54
  * @example {flex} AFFECTED_PROPERTY_DECLARATION_CODE
55
55
  */
56
56
  ruleViolatedByParentElementRuleReason:
57
57
  'The {REASON_PROPERTY_DECLARATION_CODE} property on the parent element prevents {AFFECTED_PROPERTY_DECLARATION_CODE} from having an effect.',
58
58
  /**
59
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect due to the properties of the parent element.
59
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect due to the properties of the parent element.
60
60
  * @example {display: block} EXISTING_PARENT_ELEMENT_RULE
61
61
  * @example {display: flex} TARGET_PARENT_ELEMENT_RULE
62
62
  */
@@ -64,7 +64,7 @@ const UIStrings = {
64
64
  'Try setting the {EXISTING_PARENT_ELEMENT_RULE} property on the parent to {TARGET_PARENT_ELEMENT_RULE}.',
65
65
 
66
66
  /**
67
- * @description The warning text shown in Elements panel when font-variation-settings don't match allowed values
67
+ * @description The warning text shown in the Elements panel when font-variation-settings don't match allowed values.
68
68
  * @example {wdth} PH1
69
69
  * @example {100} PH2
70
70
  * @example {10} PH3
@@ -74,31 +74,31 @@ const UIStrings = {
74
74
  fontVariationSettingsWarning:
75
75
  'Value for setting "{PH1}" {PH2} is outside the supported range [{PH3}, {PH4}] for font-family "{PH5}".',
76
76
  /**
77
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect on flex or grid child items.
77
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect on flex or grid child items.
78
78
  * @example {flex} CONTAINER_DISPLAY_NAME
79
79
  * @example {align-contents} PROPERTY_NAME
80
80
  */
81
81
  flexGridContainerPropertyRuleReason:
82
82
  'This element is a {CONTAINER_DISPLAY_NAME} item, i.e. a child of a {CONTAINER_DISPLAY_NAME} container, but {PROPERTY_NAME} only applies to containers.',
83
83
  /**
84
- * @description The message shown in the Style pane when the user hovers over a property declaration that has no effect on flex or grid child items.
84
+ * @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect on flex or grid child items.
85
85
  * @example {align-contents} PROPERTY_NAME
86
86
  * @example {align-self} ALTERNATIVE_PROPERTY_NAME
87
87
  */
88
88
  flexGridContainerPropertyRuleFix:
89
89
  'Try setting the {PROPERTY_NAME} on the container element or use {ALTERNATIVE_PROPERTY_NAME} instead.',
90
90
  /**
91
- * @description The messages shown in the Style pane when the user hovers over a position-anchor declaration that has no affect on a non-anchor-positioned element.
91
+ * @description The message shown in the Styles tab when the user hovers over a position-anchor declaration that has no effect on a non-anchor-positioned element.
92
92
  * @example {relative} POSITION
93
93
  */
94
94
  invalidAnchorPositioning:
95
95
  'An anchor was defined but the element was not anchor-positioned but positioned "{POSITION}".',
96
96
  /**
97
- * @description The messages shown in the Style pane when the user hovers over a position-anchor declaration that has no affect on a non-anchor-positioned element.
97
+ * @description The message shown in the Styles tab when the user hovers over a position-anchor declaration that has no effect on a non-anchor-positioned element.
98
98
  */
99
99
  invalidAnchorPositioningFix: 'Set position to either "fixed" or "absolute".',
100
100
  /**
101
- * @description The messages shown in the Style pane when the user hovers over a position-anchor declaration that has no affect on hidden element.
101
+ * @description The message shown in the Styles tab when the user hovers over a position-anchor declaration that has no effect on a hidden element.
102
102
  */
103
103
  unusedAnchorPositioning: 'An anchor was defined but the element is hidden.',
104
104
  } as const;
@@ -7,7 +7,7 @@ import type * as Protocol from '../../generated/protocol.js';
7
7
 
8
8
  const UIStrings = {
9
9
  /**
10
- * @description Summary line in a tooltip explaining a CSS selector specificity.
10
+ * @description Summary line in a tooltip explaining CSS selector specificity.
11
11
  * @example {1} PH1
12
12
  * @example {2} PH2
13
13
  * @example {3} PH3
@@ -15,25 +15,25 @@ import {ElementsPanel} from './ElementsPanel.js';
15
15
 
16
16
  const UIStrings = {
17
17
  /**
18
- * @description Prompt text for a text field in the Classes Pane Widget of the Elements panel.
18
+ * @description Prompt text for a text field to add CSS classes to the selected element in the Styles tab of the Elements panel.
19
19
  * Class refers to a CSS class.
20
20
  */
21
21
  addNewClass: 'Add new class',
22
22
  /**
23
- * @description Screen reader announcement string when adding a CSS class via the Classes Pane Widget.
23
+ * @description Screen reader announcement string when adding CSS classes to the selected element in the Styles tab of the Elements panel.
24
24
  * @example {vbox flex-auto} PH1
25
25
  */
26
26
  classesSAdded: 'Classes {PH1} added',
27
27
  /**
28
- * @description Screen reader announcement string when adding a class via the Classes Pane Widget.
28
+ * @description Screen reader announcement string when adding a CSS class to the selected element in the Styles tab of the Elements panel.
29
29
  * @example {title-container} PH1
30
30
  */
31
31
  classSAdded: 'Class {PH1} added',
32
32
  /**
33
- * @description Accessible title read by screen readers for the Classes Pane Widget of the Elements
34
- * panel. Element is a HTML DOM Element and classes refers to CSS classes.
33
+ * @description Accessible title read by screen readers for the element classes widget in the Styles tab of the Elements
34
+ * panel. Element is an HTML DOM element and classes refers to CSS classes.
35
35
  */
36
- elementClasses: 'Element Classes',
36
+ elementClasses: 'Element classes',
37
37
  } as const;
38
38
  const str_ = i18n.i18n.registerUIStrings('panels/elements/ClassesPaneWidget.ts', UIStrings);
39
39
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -20,7 +20,7 @@ const UIStrings = {
20
20
  */
21
21
  openCubicBezierEditor: 'Open cubic bezier editor',
22
22
  /**
23
- * @description Tooltip text for an icon that opens shadow editor. The shadow editor is a tool
23
+ * @description Tooltip text for an icon that opens the shadow editor. The shadow editor is a tool
24
24
  * which allows the user to edit CSS shadow properties.
25
25
  */
26
26
  openShadowEditor: 'Open shadow editor',
@@ -58,17 +58,16 @@ const {bindToSetting} = UI.UIUtils;
58
58
  const UIStrings = {
59
59
  /**
60
60
  * @description Text for a checkbox setting that controls whether the user-supplied filter text
61
- * excludes all CSS propreties which are filtered out, or just greys them out. In Computed Style
62
- * Widget of the Elements panel
61
+ * excludes all CSS properties which are filtered out, or just grays them out. In the Computed styles
62
+ * tab of the Elements panel.
63
63
  */
64
64
  showAll: 'Show all',
65
65
  /**
66
66
  * @description Text for a checkbox setting that controls whether similar CSS properties should be
67
- * grouped together or not. In Computed Style Widget of the Elements panel.
67
+ * grouped together or not. In the Computed styles tab of the Elements panel.
68
68
  */
69
69
  group: 'Group',
70
70
  /**
71
- * [
72
71
  * @description Text shown to the user when a filter is applied to the computed CSS properties, but
73
72
  * no properties matched the filter and thus no results were returned.
74
73
  */
@@ -88,7 +87,7 @@ const UIStrings = {
88
87
  * @example {example} PH1
89
88
  * @example {5} PH2
90
89
  */
91
- filterUpdateAriaText: `Filter applied: {PH1}. Total Results: {PH2}`,
90
+ filterUpdateAriaText: 'Filter applied: {PH1}. Total results: {PH2}',
92
91
  } as const;
93
92
  const str_ = i18n.i18n.registerUIStrings('panels/elements/ComputedStyleWidget.ts', UIStrings);
94
93
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -440,7 +440,6 @@ export async function populateNodeContextMenu(contextMenu: UI.ContextMenu.Contex
440
440
  export async function showContextMenu(
441
441
  treeElement: ElementsTreeElement,
442
442
  event: Event,
443
- onSaveNodeToTempVariable?: (node: SDK.DOMModel.DOMNode) => void,
444
443
  ): Promise<UI.ContextMenu.ContextMenu|undefined> {
445
444
  if (UI.UIUtils.isEditing()) {
446
445
  return;
@@ -472,11 +471,9 @@ export async function showContextMenu(
472
471
  textNode = null;
473
472
  }
474
473
  const commentNode = (node as Element).enclosingNodeOrSelfWithClass?.('webkit-html-comment');
475
- if (onSaveNodeToTempVariable) {
476
- contextMenu.saveSection().appendItem(i18nString(UIStrings.storeAsGlobalVariable),
477
- () => onSaveNodeToTempVariable(domNode),
478
- {jslogContext: 'store-as-global-variable'});
479
- }
474
+ contextMenu.saveSection().appendItem(i18nString(UIStrings.storeAsGlobalVariable),
475
+ () => void domNode.saveNodeToTempVariable(),
476
+ {jslogContext: 'store-as-global-variable'});
480
477
  if (textNode) {
481
478
  if (!treeElement.isEditing) {
482
479
  contextMenu.editSection().appendItem(i18nString(UIStrings.editText),