chrome-devtools-frontend 1.0.1656291 → 1.0.1657110

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 (63) hide show
  1. package/AUTHORS +2 -0
  2. package/docs/get_the_code.md +6 -6
  3. package/front_end/Tests.js +1 -1
  4. package/front_end/core/common/Settings.ts +0 -8
  5. package/front_end/core/host/Platform.ts +4 -0
  6. package/front_end/core/sdk/CSSMetadata.ts +11 -0
  7. package/front_end/core/sdk/CSSModel.ts +3 -0
  8. package/front_end/core/sdk/DOMModel.ts +44 -13
  9. package/front_end/core/sdk/DebuggerModel.ts +5 -4
  10. package/front_end/core/sdk/EmulationModel.ts +6 -4
  11. package/front_end/core/sdk/NetworkManager.ts +21 -14
  12. package/front_end/core/sdk/RuntimeModel.ts +1 -1
  13. package/front_end/core/sdk/SourceMapCache.ts +2 -4
  14. package/front_end/core/sdk/SourceMapManager.ts +8 -7
  15. package/front_end/core/sdk/TargetManager.ts +10 -0
  16. package/front_end/design_system_tokens.css +6 -0
  17. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -11
  18. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -1
  19. package/front_end/entrypoints/main/GlobalAiButton.ts +29 -35
  20. package/front_end/entrypoints/main/MainImpl.ts +1 -1
  21. package/front_end/entrypoints/main/SimpleApp.ts +0 -13
  22. package/front_end/entrypoints/main/main-meta.ts +2 -2
  23. package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +2 -3
  24. package/front_end/foundation/Universe.ts +44 -0
  25. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  26. package/front_end/generated/protocol.ts +5 -5
  27. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +2 -1
  28. package/front_end/models/crux-manager/CrUXManager.ts +16 -11
  29. package/front_end/models/emulation/DeviceModeModel.ts +43 -24
  30. package/front_end/models/live-metrics/LiveMetrics.ts +47 -23
  31. package/front_end/models/project_settings/ProjectSettingsModel.ts +2 -37
  32. package/front_end/models/workspace/FileManager.ts +9 -6
  33. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -1
  34. package/front_end/panels/application/ServiceWorkersView.ts +177 -163
  35. package/front_end/panels/application/components/StorageMetadataView.ts +7 -2
  36. package/front_end/panels/application/serviceWorkersView.css +8 -0
  37. package/front_end/panels/common/BadgeNotification.ts +1 -1
  38. package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -1
  39. package/front_end/panels/elements/ElementsPanel.ts +35 -28
  40. package/front_end/panels/elements/ElementsTreeElement.ts +208 -143
  41. package/front_end/panels/elements/ElementsTreeOutline.ts +3 -2
  42. package/front_end/panels/elements/components/AdornerManager.ts +1 -0
  43. package/front_end/panels/elements/elements-meta.ts +3 -2
  44. package/front_end/panels/emulation/DeviceModeToolbar.ts +19 -19
  45. package/front_end/panels/explain/components/ConsoleInsight.ts +2 -1
  46. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +13 -12
  47. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +8 -7
  48. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +6 -7
  49. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +3 -2
  50. package/front_end/panels/settings/components/SyncSection.ts +2 -1
  51. package/front_end/panels/timeline/AppenderUtils.ts +12 -4
  52. package/front_end/panels/timeline/ThreadAppender.ts +3 -3
  53. package/front_end/panels/timeline/TimelinePanel.ts +5 -5
  54. package/front_end/panels/timeline/timelineFlameChartView.css +2 -1
  55. package/front_end/third_party/chromium/README.chromium +1 -1
  56. package/front_end/third_party/chromium/ahem/ahem.js +792 -0
  57. package/front_end/tsconfig.json +7 -1
  58. package/front_end/ui/legacy/ActionRegistration.ts +1 -1
  59. package/front_end/ui/legacy/InspectorView.ts +1 -1
  60. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +109 -23
  61. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +2 -2
  62. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  63. package/package.json +1 -1
@@ -13,6 +13,7 @@ import * as Buttons from '../../ui/components/buttons/buttons.js';
13
13
  import {Link} from '../../ui/kit/kit.js';
14
14
  import * as Components from '../../ui/legacy/components/utils/utils.js';
15
15
  import * as UI from '../../ui/legacy/legacy.js';
16
+ import {html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
16
17
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
17
18
  import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
18
19
 
@@ -273,14 +274,14 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
273
274
  }
274
275
 
275
276
  this.eventListeners.set(serviceWorkerManager, [
276
- this.manager.addEventListener(
277
- SDK.ServiceWorkerManager.Events.REGISTRATION_UPDATED, this.registrationUpdated, this),
278
- this.manager.addEventListener(
279
- SDK.ServiceWorkerManager.Events.REGISTRATION_DELETED, this.registrationDeleted, this),
280
- this.securityOriginManager.addEventListener(
281
- SDK.SecurityOriginManager.Events.SecurityOriginAdded, this.updateSectionVisibility, this),
282
- this.securityOriginManager.addEventListener(
283
- SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this.updateSectionVisibility, this),
277
+ this.manager.addEventListener(SDK.ServiceWorkerManager.Events.REGISTRATION_UPDATED, this.registrationUpdated,
278
+ this),
279
+ this.manager.addEventListener(SDK.ServiceWorkerManager.Events.REGISTRATION_DELETED, this.registrationDeleted,
280
+ this),
281
+ this.securityOriginManager.addEventListener(SDK.SecurityOriginManager.Events.SecurityOriginAdded,
282
+ this.updateSectionVisibility, this),
283
+ this.securityOriginManager.addEventListener(SDK.SecurityOriginManager.Events.SecurityOriginRemoved,
284
+ this.updateSectionVisibility, this),
284
285
  ]);
285
286
  }
286
287
 
@@ -331,7 +332,7 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
331
332
 
332
333
  for (const section of movedSections) {
333
334
  const registration = section.registration;
334
- this.removeRegistrationFromList(registration);
335
+ this.removeRegistrationFromList(registration, true);
335
336
  this.updateRegistration(registration, true);
336
337
  }
337
338
 
@@ -399,8 +400,8 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
399
400
  return null;
400
401
  }
401
402
 
402
- private updateRegistration(registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration, skipUpdate?: boolean):
403
- void {
403
+ private updateRegistration(registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration,
404
+ skipUpdate?: boolean): void {
404
405
  let section = this.sections.get(registration);
405
406
  if (!section) {
406
407
  const title = registration.scopeURL;
@@ -426,13 +427,16 @@ export class ServiceWorkersView extends UI.Widget.VBox implements
426
427
  this.removeRegistrationFromList(event.data);
427
428
  }
428
429
 
429
- private removeRegistrationFromList(registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration): void {
430
+ private removeRegistrationFromList(registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration,
431
+ skipVisibilityUpdate = false): void {
430
432
  const section = this.sections.get(registration);
431
433
  if (section) {
432
434
  section.section.detach();
433
435
  }
434
436
  this.sections.delete(registration);
435
- this.updateSectionVisibility();
437
+ if (!skipVisibilityUpdate) {
438
+ this.updateSectionVisibility();
439
+ }
436
440
  }
437
441
 
438
442
  private isRegistrationVisible(registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration): boolean {
@@ -468,9 +472,8 @@ export class Section {
468
472
  private updateCycleField?: HTMLElement;
469
473
  private routerField?: HTMLElement;
470
474
 
471
- constructor(
472
- manager: SDK.ServiceWorkerManager.ServiceWorkerManager, section: UI.ReportView.Section,
473
- registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration) {
475
+ constructor(manager: SDK.ServiceWorkerManager.ServiceWorkerManager, section: UI.ReportView.Section,
476
+ registration: SDK.ServiceWorkerManager.ServiceWorkerRegistration) {
474
477
  this.manager = manager;
475
478
  this.section = section;
476
479
  this.registration = registration;
@@ -506,18 +509,19 @@ export class Section {
506
509
  this.section.appendButtonToHeader(this.deleteButton);
507
510
 
508
511
  // Preserve the order.
509
- this.sourceField = this.wrapWidget(this.section.appendField(i18nString(UIStrings.source)));
510
- this.statusField = this.wrapWidget(this.section.appendField(i18nString(UIStrings.status)));
511
- this.clientsField = this.wrapWidget(this.section.appendField(i18nString(UIStrings.clients)));
512
- this.createSyncNotificationField(
513
- i18nString(UIStrings.pushString), this.pushNotificationDataSetting.get(), i18nString(UIStrings.pushData),
514
- this.push.bind(this), 'push-message');
515
- this.createSyncNotificationField(
516
- i18nString(UIStrings.syncString), this.syncTagNameSetting.get(), i18nString(UIStrings.syncTag),
517
- this.sync.bind(this), 'sync-tag');
518
- this.createSyncNotificationField(
519
- i18nString(UIStrings.periodicSync), this.periodicSyncTagNameSetting.get(),
520
- i18nString(UIStrings.periodicSyncTag), tag => this.periodicSync(tag), 'periodic-sync-tag');
512
+ this.sourceField = this.section.appendField(i18nString(UIStrings.source));
513
+ this.statusField = this.section.appendField(i18nString(UIStrings.status));
514
+ this.clientsField = this.section.appendField(i18nString(UIStrings.clients));
515
+
516
+ UI.DOMUtilities.appendStyle(this.section.getFieldElement(), serviceWorkersViewStyles,
517
+ serviceWorkerUpdateCycleViewStyles);
518
+ this.createSyncNotificationField(i18nString(UIStrings.pushString), this.pushNotificationDataSetting.get(),
519
+ i18nString(UIStrings.pushData), this.push.bind(this), 'push-message');
520
+ this.createSyncNotificationField(i18nString(UIStrings.syncString), this.syncTagNameSetting.get(),
521
+ i18nString(UIStrings.syncTag), this.sync.bind(this), 'sync-tag');
522
+ this.createSyncNotificationField(i18nString(UIStrings.periodicSync), this.periodicSyncTagNameSetting.get(),
523
+ i18nString(UIStrings.periodicSyncTag), tag => this.periodicSync(tag),
524
+ 'periodic-sync-tag');
521
525
  this.createUpdateCycleField();
522
526
  this.maybeCreateRouterField();
523
527
 
@@ -525,26 +529,34 @@ export class Section {
525
529
  this.throttler = new Common.Throttler.Throttler(500);
526
530
  }
527
531
 
528
- private createSyncNotificationField(
529
- label: string, initialValue: string, placeholder: string, callback: (arg0: string) => void,
530
- jslogContext: string): void {
531
- const form =
532
- this.wrapWidget(this.section.appendField(label)).createChild('form', 'service-worker-editor-with-button');
533
- const editor = UI.UIUtils.createInput('source-code service-worker-notification-editor');
534
- editor.setAttribute('jslog', `${VisualLogging.textField().track({change: true}).context(jslogContext)}`);
535
- form.appendChild(editor);
536
- const button = UI.UIUtils.createTextButton(label, undefined, {jslogContext});
537
- button.type = 'submit';
538
- form.appendChild(button);
539
-
540
- editor.value = initialValue;
541
- editor.placeholder = placeholder;
542
- UI.ARIAUtils.setLabel(editor, label);
543
-
544
- form.addEventListener('submit', (e: Event) => {
545
- callback(editor.value || '');
546
- e.consume(true);
547
- });
532
+ private createSyncNotificationField(label: string, initialValue: string, placeholder: string,
533
+ callback: (arg0: string) => void, jslogContext: string): void {
534
+ const fieldElement = this.section.appendField(label);
535
+
536
+ // clang-format off
537
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
538
+ render(html`
539
+ <form class="service-worker-editor-with-button" @submit=${(e: Event) => {
540
+ const {editor} = e.target as HTMLFormElement;
541
+ callback(editor.value || '');
542
+ e.consume(true);
543
+ }}>
544
+ <input name="editor" class="source-code service-worker-notification-editor harmony-input" type="text"
545
+ .value=${initialValue}
546
+ placeholder=${placeholder}
547
+ aria-label=${label}
548
+ .spellcheck=${false}
549
+ jslog=${VisualLogging.textField().track({change: true}).context(jslogContext)}
550
+ >
551
+ <devtools-button .data=${{
552
+ type: 'submit',
553
+ variant: Buttons.Button.Variant.OUTLINED,
554
+ jslogContext} as Buttons.Button.ButtonData}>
555
+ ${label}
556
+ </devtools-button>
557
+ </form>
558
+ `, fieldElement);
559
+ // clang-format on
548
560
  }
549
561
 
550
562
  scheduleUpdate(): void {
@@ -555,13 +567,17 @@ export class Section {
555
567
  void this.throttler.schedule(this.performUpdate.bind(this));
556
568
  }
557
569
 
558
- private addVersion(versionsStack: Element, icon: string, label: string): Element {
559
- const installingEntry = versionsStack.createChild('div', 'service-worker-version');
560
- installingEntry.createChild('div', icon);
561
- const statusString = installingEntry.createChild('span', 'service-worker-version-string');
562
- statusString.textContent = label;
563
- UI.ARIAUtils.markAsAlert(statusString);
564
- return installingEntry;
570
+ private renderVersion(icon: string, label: string, content: LitTemplate = nothing): LitTemplate {
571
+ // clang-format off
572
+ return html`
573
+ <div class="service-worker-version">
574
+ <div class=${icon}></div>
575
+ <span class="service-worker-version-string" role="alert" aria-live="polite">
576
+ ${label}
577
+ </span>
578
+ ${content}
579
+ </div>`;
580
+ // clang-format on
565
581
  }
566
582
 
567
583
  private updateClientsField(version: SDK.ServiceWorkerManager.ServiceWorkerVersion): void {
@@ -571,7 +587,8 @@ export class Section {
571
587
  const clientLabelText = this.clientsField.createChild('div', 'service-worker-client') as HTMLElement;
572
588
  const info = this.clientInfoCache.get(client);
573
589
  if (info) {
574
- this.updateClientInfo(clientLabelText, info);
590
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
591
+ render(this.renderClientInfo(info), clientLabelText);
575
592
  }
576
593
  void this.manager.target()
577
594
  .targetAgent()
@@ -581,31 +598,31 @@ export class Section {
581
598
  }
582
599
 
583
600
  private updateSourceField(version: SDK.ServiceWorkerManager.ServiceWorkerVersion): void {
584
- this.sourceField.removeChildren();
585
601
  const fileName = Common.ParsedURL.ParsedURL.extractName(version.scriptURL);
586
- const name = this.sourceField.createChild('div', 'report-field-value-filename');
587
- const link = Components.Linkifier.Linkifier.linkifyURL(
588
- version.scriptURL, ({text: fileName} as Components.Linkifier.LinkifyURLOptions));
589
- link.tabIndex = 0;
590
- link.setAttribute('jslog', `${VisualLogging.link('source-location').track({click: true})}`);
591
- name.appendChild(link);
592
- if (this.registration.errors.length) {
593
- const errorsLabel = UI.UIUtils.createIconLabel({
594
- title: String(this.registration.errors.length),
595
- iconName: 'cross-circle-filled',
596
- color: 'var(--icon-error)',
597
- });
598
- errorsLabel.classList.add('devtools-link', 'link');
599
- errorsLabel.tabIndex = 0;
600
- UI.ARIAUtils.setLabel(
601
- errorsLabel, i18nString(UIStrings.sRegistrationErrors, {PH1: this.registration.errors.length}));
602
- self.onInvokeElement(errorsLabel, () => Common.Console.Console.instance().show());
603
- name.appendChild(errorsLabel);
604
- }
605
- if (version.scriptResponseTime !== undefined) {
606
- this.sourceField.createChild('div', 'report-field-value-subtitle').textContent =
607
- i18nString(UIStrings.receivedS, {PH1: new Date(version.scriptResponseTime * 1000).toLocaleString()});
608
- }
602
+ // clang-format off
603
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
604
+ render(html`
605
+ <div class="report-field-value-filename">
606
+ ${Components.Linkifier.Linkifier.renderLinkifiedUrl(version.scriptURL, {
607
+ text: fileName, tabStop: true, jslogContext: 'source-location'})}
608
+ ${this.registration.errors.length ? html`
609
+ <button
610
+ class="devtools-link link"
611
+ tabindex="0"
612
+ aria-label=${i18nString(UIStrings.sRegistrationErrors, {PH1: this.registration.errors.length})}
613
+ @click=${() => Common.Console.Console.instance().show()}>
614
+ <devtools-icon name="cross-circle-filled" class="error-icon">
615
+ </devtools-icon>
616
+ ${this.registration.errors.length}
617
+ </button>` : nothing}
618
+ </div>
619
+ ${version.scriptResponseTime !== undefined ? html`
620
+ <div class="report-field-value-subtitle">
621
+ ${i18nString(UIStrings.receivedS, {PH1: new Date(version.scriptResponseTime * 1000).toLocaleString()})}
622
+ </div>
623
+ ` : nothing}
624
+ `, this.sourceField);
625
+ // clang-format on
609
626
  }
610
627
 
611
628
  private performUpdate(): Promise<void> {
@@ -627,62 +644,69 @@ export class Section {
627
644
  const installing = versions.get(SDK.ServiceWorkerManager.ServiceWorkerVersion.Modes.INSTALLING);
628
645
  const redundant = versions.get(SDK.ServiceWorkerManager.ServiceWorkerVersion.Modes.REDUNDANT);
629
646
 
630
- this.statusField.removeChildren();
631
- const versionsStack = this.statusField.createChild('div', 'service-worker-version-stack');
632
- versionsStack.createChild('div', 'service-worker-version-stack-bar');
647
+ // clang-format off
648
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
649
+ render(html`
650
+ <div class="service-worker-version-stack">
651
+ <div class="service-worker-version-stack-bar"></div>
652
+ ${active ? this.renderVersion(
653
+ 'service-worker-active-circle',
654
+ i18nString(UIStrings.sActivatedAndIsS, {
655
+ PH1: active.id,
656
+ PH2: SDK.ServiceWorkerManager.ServiceWorkerVersion.RunningStatus[active.currentState.runningStatus](),
657
+ }),
658
+ active.isRunning() || active.isStarting() ? html`
659
+ <devtools-button .data=${{jslogContext: 'stop', variant: Buttons.Button.Variant.OUTLINED} as Buttons.Button.ButtonData}
660
+ @click=${this.stopButtonClicked.bind(this, active.id)}>
661
+ ${i18nString(UIStrings.stopString)}
662
+ </devtools-button>`
663
+ : active.isStartable() ? html`
664
+ <devtools-button .data=${{jslogContext: 'start', variant: Buttons.Button.Variant.OUTLINED} as Buttons.Button.ButtonData}
665
+ @click=${this.startButtonClicked.bind(this)}>
666
+ ${i18nString(UIStrings.startString)}
667
+ </devtools-button>`
668
+ : nothing)
669
+ : redundant ? this.renderVersion(
670
+ 'service-worker-redundant-circle',
671
+ i18nString(UIStrings.sIsRedundant, {PH1: redundant.id}))
672
+ : nothing}
673
+ ${waiting ? this.renderVersion(
674
+ 'service-worker-waiting-circle',
675
+ i18nString(UIStrings.sWaitingToActivate, {PH1: waiting.id}), html`
676
+ <devtools-button .data=${{
677
+ jslogContext: 'skip-waiting',
678
+ title: i18n.i18n.lockedString('skipWaiting'),
679
+ variant: Buttons.Button.Variant.OUTLINED} as Buttons.Button.ButtonData}
680
+ @click=${this.skipButtonClicked.bind(this)}>
681
+ ${i18n.i18n.lockedString('skipWaiting')}
682
+ </devtools-button>
683
+ ${waiting.scriptResponseTime !== undefined ? html`
684
+ <div class="service-worker-subtitle">
685
+ ${i18nString(UIStrings.receivedS, {PH1: new Date(waiting.scriptResponseTime * 1000).toLocaleString()})}
686
+ </div>
687
+ ` : nothing}
688
+ `,
689
+ ) : nothing}
690
+ ${installing ? this.renderVersion(
691
+ 'service-worker-installing-circle',
692
+ i18nString(UIStrings.sTryingToInstall, {PH1: installing.id}),
693
+ installing.scriptResponseTime !== undefined ? html`
694
+ <div class="service-worker-subtitle">
695
+ ${i18nString(UIStrings.receivedS, {PH1: new Date(installing.scriptResponseTime * 1000).toLocaleString()})}
696
+ </div>` : nothing) : nothing}
697
+ </div>
698
+ `, this.statusField);
699
+ // clang-format on
633
700
 
634
701
  if (active) {
635
702
  this.updateSourceField(active);
636
- const localizedRunningStatus =
637
- SDK.ServiceWorkerManager.ServiceWorkerVersion.RunningStatus[active.currentState.runningStatus]();
638
- // TODO(l10n): Don't concatenate strings here.
639
- const activeEntry = this.addVersion(
640
- versionsStack, 'service-worker-active-circle',
641
- i18nString(UIStrings.sActivatedAndIsS, {PH1: active.id, PH2: localizedRunningStatus}));
642
-
643
- if (active.isRunning() || active.isStarting()) {
644
- const stopButton = UI.UIUtils.createTextButton(
645
- i18nString(UIStrings.stopString), this.stopButtonClicked.bind(this, active.id), {jslogContext: 'stop'});
646
- activeEntry.appendChild(stopButton);
647
- } else if (active.isStartable()) {
648
- const startButton = UI.UIUtils.createTextButton(
649
- i18nString(UIStrings.startString), this.startButtonClicked.bind(this), {jslogContext: 'start'});
650
- activeEntry.appendChild(startButton);
651
- }
652
703
  this.updateClientsField(active);
653
704
  this.maybeCreateRouterField();
654
705
  } else if (redundant) {
655
706
  this.updateSourceField(redundant);
656
- this.addVersion(
657
- versionsStack, 'service-worker-redundant-circle', i18nString(UIStrings.sIsRedundant, {PH1: redundant.id}));
658
707
  this.updateClientsField(redundant);
659
708
  }
660
709
 
661
- if (waiting) {
662
- const waitingEntry = this.addVersion(
663
- versionsStack, 'service-worker-waiting-circle', i18nString(UIStrings.sWaitingToActivate, {PH1: waiting.id}));
664
- const skipWaitingButton =
665
- UI.UIUtils.createTextButton(i18n.i18n.lockedString('skipWaiting'), this.skipButtonClicked.bind(this), {
666
- title: i18n.i18n.lockedString('skipWaiting'),
667
- jslogContext: 'skip-waiting',
668
- });
669
- waitingEntry.appendChild(skipWaitingButton);
670
- if (waiting.scriptResponseTime !== undefined) {
671
- waitingEntry.createChild('div', 'service-worker-subtitle').textContent =
672
- i18nString(UIStrings.receivedS, {PH1: new Date(waiting.scriptResponseTime * 1000).toLocaleString()});
673
- }
674
- }
675
- if (installing) {
676
- const installingEntry = this.addVersion(
677
- versionsStack, 'service-worker-installing-circle',
678
- i18nString(UIStrings.sTryingToInstall, {PH1: installing.id}));
679
- if (installing.scriptResponseTime !== undefined) {
680
- installingEntry.createChild('div', 'service-worker-subtitle').textContent = i18nString(UIStrings.receivedS, {
681
- PH1: new Date(installing.scriptResponseTime * 1000).toLocaleString(),
682
- });
683
- }
684
- }
685
-
686
710
  this.updateCycleView.refresh();
687
711
 
688
712
  return Promise.resolve();
@@ -693,7 +717,7 @@ export class Section {
693
717
  }
694
718
 
695
719
  private createUpdateCycleField(): void {
696
- this.updateCycleField = this.wrapWidget(this.section.appendField(i18nString(UIStrings.updateCycle)));
720
+ this.updateCycleField = this.section.appendField(i18nString(UIStrings.updateCycle));
697
721
  this.updateCycleField.appendChild(this.updateCycleView.tableElement);
698
722
  }
699
723
 
@@ -704,7 +728,7 @@ export class Section {
704
728
  if (active?.routerRules && active.routerRules.length > 0) {
705
729
  // If there is at least one registered rule in the active version, append the router filed.
706
730
  if (!this.routerField) {
707
- this.routerField = this.wrapWidget(this.section.appendField(title));
731
+ this.routerField = this.section.appendField(title);
708
732
  }
709
733
  if (!this.routerField.lastElementChild) {
710
734
  this.routerView.show(this.routerField);
@@ -753,30 +777,34 @@ export class Section {
753
777
  return;
754
778
  }
755
779
  this.clientInfoCache.set(targetInfo.targetId, targetInfo);
756
- this.updateClientInfo(element, targetInfo);
780
+ // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
781
+ render(this.renderClientInfo(targetInfo), element);
757
782
  }
758
783
 
759
- private updateClientInfo(element: HTMLElement, targetInfo: Protocol.Target.TargetInfo): void {
760
- if (targetInfo.type !== 'page' && targetInfo.type === 'iframe') {
761
- const clientString = element.createChild('span', 'service-worker-client-string');
762
- UI.UIUtils.createTextChild(clientString, i18nString(UIStrings.workerS, {PH1: targetInfo.url}));
763
- return;
784
+ private renderClientInfo(targetInfo: Protocol.Target.TargetInfo): LitTemplate {
785
+ if (targetInfo.type !== 'page' && targetInfo.type !== 'iframe') {
786
+ // clang-format off
787
+ return html`<span class="service-worker-client-string">
788
+ ${i18nString(UIStrings.workerS, {PH1: targetInfo.url})}
789
+ </span>`;
790
+ // clang-format on
764
791
  }
765
- element.removeChildren();
766
- const clientString = element.createChild('span', 'service-worker-client-string');
767
- UI.UIUtils.createTextChild(clientString, targetInfo.url);
768
-
769
- const focusButton = new Buttons.Button.Button();
770
- focusButton.data = {
771
- iconName: 'select-element',
772
- variant: Buttons.Button.Variant.ICON,
773
- size: Buttons.Button.Size.SMALL,
774
- title: i18nString(UIStrings.focus),
775
- jslogContext: 'client-focus',
776
- };
777
- focusButton.className = 'service-worker-client-focus-link';
778
- focusButton.addEventListener('click', this.activateTarget.bind(this, targetInfo.targetId));
779
- element.appendChild(focusButton);
792
+
793
+ // clang-format off
794
+ return html`
795
+ <span class="service-worker-client-string">${targetInfo.url}</span>
796
+ <devtools-button
797
+ .data=${{
798
+ iconName: 'select-element',
799
+ variant: Buttons.Button.Variant.ICON,
800
+ size: Buttons.Button.Size.SMALL,
801
+ title: i18nString(UIStrings.focus),
802
+ jslogContext: 'client-focus',
803
+ } as Buttons.Button.ButtonData}
804
+ class="service-worker-client-focus-link"
805
+ @click=${this.activateTarget.bind(this, targetInfo.targetId)}
806
+ ></devtools-button>`;
807
+ // clang-format on
780
808
  }
781
809
 
782
810
  private activateTarget(targetId: Protocol.Target.TargetID): void {
@@ -794,18 +822,4 @@ export class Section {
794
822
  private stopButtonClicked(versionId: string): void {
795
823
  void this.manager.stopWorker(versionId);
796
824
  }
797
-
798
- private wrapWidget(container: Element): HTMLElement {
799
- const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(container, {
800
- cssFile: [
801
- serviceWorkersViewStyles,
802
- /* These styles are for the timing table in serviceWorkerUpdateCycleView but this is the widget that it is rendered
803
- * inside so we are registering the files here. */
804
- serviceWorkerUpdateCycleViewStyles,
805
- ],
806
- });
807
- const contentElement = document.createElement('div');
808
- shadowRoot.appendChild(contentElement);
809
- return contentElement;
810
- }
811
825
  }
@@ -254,6 +254,9 @@ export class StorageMetadataView extends LegacyWrapper.LegacyWrapper.WrappableCo
254
254
  ${this.key(i18nString(UIStrings.bucketName))}
255
255
  ${this.value(renderBucketName())}`;
256
256
  }
257
+ // If quota is 0, it means no custom quota limit has been set on the bucket.
258
+ // We do not render it here to avoid confusing the user (who might interpret
259
+ // a 0 quota as a full bucket/0 capacity rather than sharing the default origin limit).
257
260
  // clang-format off
258
261
  return html`
259
262
  ${this.key(i18nString(UIStrings.bucketName))}
@@ -262,8 +265,10 @@ export class StorageMetadataView extends LegacyWrapper.LegacyWrapper.WrappableCo
262
265
  ${this.value(persistent ? i18nString(UIStrings.yes) : i18nString(UIStrings.no))}
263
266
  ${this.key(i18nString(UIStrings.durability))}
264
267
  ${this.value(durability)}
265
- ${this.key(i18nString(UIStrings.quota))}
266
- ${this.value(i18n.ByteUtilities.bytesToString(quota))}
268
+ ${quota !== 0 ? html`
269
+ ${this.key(i18nString(UIStrings.quota))}
270
+ ${this.value(i18n.ByteUtilities.bytesToString(quota))}
271
+ ` : nothing}
267
272
  ${this.key(i18nString(UIStrings.expiration))}
268
273
  ${this.value(this.#getExpirationString())}`;
269
274
  }
@@ -154,3 +154,11 @@ button.link {
154
154
  button.link:focus-visible {
155
155
  background-color: inherit;
156
156
  }
157
+
158
+ devtools-icon.error-icon {
159
+ color: var(--sys-color-error-bright);
160
+ height: var(--sys-size-7);
161
+ margin-right: var(--sys-size-2);
162
+ vertical-align: bottom;
163
+ width: var(--sys-size-7);
164
+ }
@@ -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.moduleSetting('receive-gdp-badges'));
142
+ void Common.Revealer.reveal(Common.Settings.Settings.instance().moduleSetting('receive-gdp-badges'));
143
143
  }
144
144
 
145
145
  export class BadgeNotification extends UI.Widget.Widget {
@@ -437,7 +437,8 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
437
437
 
438
438
  #getConsoleInsightsEnabledSetting(): Common.Settings.Setting<boolean>|undefined {
439
439
  try {
440
- return Common.Settings.moduleSetting('console-insights-enabled') as Common.Settings.Setting<boolean>;
440
+ return Common.Settings.Settings.instance().moduleSetting('console-insights-enabled') as
441
+ Common.Settings.Setting<boolean>;
441
442
  } catch {
442
443
  return;
443
444
  }