chrome-devtools-frontend 1.0.952284 → 1.0.952865

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 (133) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -0
  2. package/front_end/.eslintrc.js +1 -1
  3. package/front_end/core/host/UserMetrics.ts +2 -1
  4. package/front_end/core/i18n/locales/af.json +158 -176
  5. package/front_end/core/i18n/locales/am.json +163 -181
  6. package/front_end/core/i18n/locales/ar.json +162 -180
  7. package/front_end/core/i18n/locales/as.json +163 -181
  8. package/front_end/core/i18n/locales/az.json +161 -179
  9. package/front_end/core/i18n/locales/be.json +160 -178
  10. package/front_end/core/i18n/locales/bg.json +159 -177
  11. package/front_end/core/i18n/locales/bn.json +166 -184
  12. package/front_end/core/i18n/locales/bs.json +161 -179
  13. package/front_end/core/i18n/locales/ca.json +159 -177
  14. package/front_end/core/i18n/locales/cs.json +159 -177
  15. package/front_end/core/i18n/locales/cy.json +164 -182
  16. package/front_end/core/i18n/locales/da.json +158 -176
  17. package/front_end/core/i18n/locales/de.json +160 -178
  18. package/front_end/core/i18n/locales/el.json +158 -176
  19. package/front_end/core/i18n/locales/en-GB.json +158 -176
  20. package/front_end/core/i18n/locales/en-US.json +3 -0
  21. package/front_end/core/i18n/locales/en-XL.json +3 -0
  22. package/front_end/core/i18n/locales/es-419.json +160 -178
  23. package/front_end/core/i18n/locales/es.json +156 -174
  24. package/front_end/core/i18n/locales/et.json +161 -179
  25. package/front_end/core/i18n/locales/eu.json +159 -177
  26. package/front_end/core/i18n/locales/fa.json +166 -184
  27. package/front_end/core/i18n/locales/fi.json +161 -179
  28. package/front_end/core/i18n/locales/fil.json +162 -180
  29. package/front_end/core/i18n/locales/fr-CA.json +159 -177
  30. package/front_end/core/i18n/locales/fr.json +158 -176
  31. package/front_end/core/i18n/locales/gl.json +160 -178
  32. package/front_end/core/i18n/locales/gu.json +179 -197
  33. package/front_end/core/i18n/locales/he.json +160 -178
  34. package/front_end/core/i18n/locales/hi.json +166 -184
  35. package/front_end/core/i18n/locales/hr.json +161 -179
  36. package/front_end/core/i18n/locales/hu.json +161 -179
  37. package/front_end/core/i18n/locales/hy.json +157 -175
  38. package/front_end/core/i18n/locales/id.json +160 -178
  39. package/front_end/core/i18n/locales/is.json +163 -181
  40. package/front_end/core/i18n/locales/it.json +162 -180
  41. package/front_end/core/i18n/locales/ja.json +160 -178
  42. package/front_end/core/i18n/locales/ka.json +161 -179
  43. package/front_end/core/i18n/locales/kk.json +164 -182
  44. package/front_end/core/i18n/locales/km.json +160 -178
  45. package/front_end/core/i18n/locales/kn.json +162 -180
  46. package/front_end/core/i18n/locales/ko.json +162 -180
  47. package/front_end/core/i18n/locales/ky.json +160 -178
  48. package/front_end/core/i18n/locales/lo.json +159 -177
  49. package/front_end/core/i18n/locales/lt.json +159 -177
  50. package/front_end/core/i18n/locales/lv.json +162 -180
  51. package/front_end/core/i18n/locales/mk.json +162 -180
  52. package/front_end/core/i18n/locales/ml.json +160 -178
  53. package/front_end/core/i18n/locales/mn.json +164 -182
  54. package/front_end/core/i18n/locales/mr.json +163 -181
  55. package/front_end/core/i18n/locales/ms.json +163 -181
  56. package/front_end/core/i18n/locales/my.json +164 -182
  57. package/front_end/core/i18n/locales/ne.json +160 -178
  58. package/front_end/core/i18n/locales/nl.json +160 -178
  59. package/front_end/core/i18n/locales/no.json +281 -299
  60. package/front_end/core/i18n/locales/or.json +165 -183
  61. package/front_end/core/i18n/locales/pa.json +159 -177
  62. package/front_end/core/i18n/locales/pl.json +163 -181
  63. package/front_end/core/i18n/locales/pt-PT.json +160 -178
  64. package/front_end/core/i18n/locales/pt.json +159 -177
  65. package/front_end/core/i18n/locales/ro.json +161 -179
  66. package/front_end/core/i18n/locales/ru.json +159 -177
  67. package/front_end/core/i18n/locales/si.json +161 -179
  68. package/front_end/core/i18n/locales/sk.json +158 -176
  69. package/front_end/core/i18n/locales/sl.json +160 -178
  70. package/front_end/core/i18n/locales/sq.json +279 -297
  71. package/front_end/core/i18n/locales/sr-Latn.json +160 -178
  72. package/front_end/core/i18n/locales/sr.json +160 -178
  73. package/front_end/core/i18n/locales/sv.json +159 -177
  74. package/front_end/core/i18n/locales/sw.json +164 -182
  75. package/front_end/core/i18n/locales/ta.json +160 -178
  76. package/front_end/core/i18n/locales/te.json +165 -183
  77. package/front_end/core/i18n/locales/th.json +158 -176
  78. package/front_end/core/i18n/locales/tr.json +162 -180
  79. package/front_end/core/i18n/locales/uk.json +160 -178
  80. package/front_end/core/i18n/locales/ur.json +160 -178
  81. package/front_end/core/i18n/locales/uz.json +160 -178
  82. package/front_end/core/i18n/locales/vi.json +162 -180
  83. package/front_end/core/i18n/locales/zh-HK.json +160 -178
  84. package/front_end/core/i18n/locales/zh-TW.json +161 -179
  85. package/front_end/core/i18n/locales/zh.json +162 -180
  86. package/front_end/core/i18n/locales/zu.json +164 -182
  87. package/front_end/core/root/Runtime.ts +4 -12
  88. package/front_end/core/sdk/PageResourceLoader.ts +2 -1
  89. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +3 -3
  90. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +2 -2
  91. package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +9 -9
  92. package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +11 -11
  93. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +40 -40
  94. package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +14 -14
  95. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +15 -15
  96. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -0
  97. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +29 -29
  98. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +2 -2
  99. package/front_end/entrypoints/inspector_main/InspectorMain.ts +12 -12
  100. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
  101. package/front_end/entrypoints/main/ExecutionContextSelector.ts +26 -29
  102. package/front_end/entrypoints/main/MainImpl.ts +38 -38
  103. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +10 -10
  104. package/front_end/entrypoints/node_app/NodeMain.ts +3 -3
  105. package/front_end/legacy/legacy-defs.d.ts +0 -21
  106. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
  107. package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
  108. package/front_end/models/issues_manager/IssuesManager.ts +5 -0
  109. package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
  110. package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
  111. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  112. package/front_end/panels/console/ConsoleView.ts +1 -1
  113. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +86 -25
  114. package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
  115. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
  116. package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
  117. package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
  118. package/front_end/third_party/diff/DiffWrapper.ts +7 -0
  119. package/front_end/ui/components/data_grid/DataGrid.ts +2 -2
  120. package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
  121. package/front_end/ui/legacy/SearchableView.ts +13 -4
  122. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
  123. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
  124. package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
  125. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +22 -7
  126. package/package.json +1 -1
  127. package/config/gni/all_devtools_files.gni +0 -255
  128. package/scripts/build/devtools_file_hashes.py +0 -82
  129. package/scripts/devtools_run/devtools_run_cli +0 -49
  130. package/scripts/devtools_run/package.json +0 -13
  131. package/scripts/unzip.py +0 -20
  132. package/scripts/visualize_deps/jquery_svg.html +0 -57
  133. package/scripts/visualize_deps/run_visualize.js +0 -119
@@ -118,7 +118,7 @@ export class MainImpl {
118
118
 
119
119
  constructor() {
120
120
  MainImpl.instanceForTest = this;
121
- this.loaded();
121
+ this.#loaded();
122
122
  }
123
123
 
124
124
  static time(label: string): void {
@@ -135,7 +135,7 @@ export class MainImpl {
135
135
  console.timeEnd(label);
136
136
  }
137
137
 
138
- private async loaded(): Promise<void> {
138
+ async #loaded(): Promise<void> {
139
139
  console.timeStamp('Main._loaded');
140
140
  Root.Runtime.Runtime.setPlatform(Host.Platform.platform());
141
141
  const prefs = await new Promise<{[key: string]: string}>(resolve => {
@@ -143,7 +143,7 @@ export class MainImpl {
143
143
  });
144
144
 
145
145
  console.timeStamp('Main._gotPreferences');
146
- this.initializeGlobalsForLayoutTests();
146
+ this.#initializeGlobalsForLayoutTests();
147
147
  this.createSettings(prefs);
148
148
  await this.requestAndRegisterLocaleData();
149
149
 
@@ -152,10 +152,10 @@ export class MainImpl {
152
152
  Common.Settings.Settings.instance().moduleSetting<boolean>('sync_preferences').get());
153
153
  }
154
154
 
155
- this.createAppUI();
155
+ this.#createAppUI();
156
156
  }
157
157
 
158
- private initializeGlobalsForLayoutTests(): void {
158
+ #initializeGlobalsForLayoutTests(): void {
159
159
  // @ts-ignore layout test global
160
160
  self.Common = self.Common || {};
161
161
  // @ts-ignore layout test global
@@ -209,10 +209,10 @@ export class MainImpl {
209
209
  }
210
210
  }
211
211
 
212
- private createSettings(prefs: {
212
+ createSettings(prefs: {
213
213
  [x: string]: string,
214
214
  }): void {
215
- this.initializeExperiments();
215
+ this.#initializeExperiments();
216
216
  let storagePrefix = '';
217
217
  if (Host.Platform.isCustomDevtoolsFrontend()) {
218
218
  storagePrefix = '__custom__';
@@ -260,7 +260,7 @@ export class MainImpl {
260
260
  }
261
261
  }
262
262
 
263
- private initializeExperiments(): void {
263
+ #initializeExperiments(): void {
264
264
  Root.Runtime.experiments.register('applyCustomStylesheet', 'Allow extensions to load custom stylesheets');
265
265
  Root.Runtime.experiments.register('captureNodeCreationStacks', 'Capture node creation stacks');
266
266
  Root.Runtime.experiments.register('sourcesPrettyPrint', 'Automatically pretty print in the Sources Panel');
@@ -395,7 +395,7 @@ export class MainImpl {
395
395
  Host.userMetrics.experimentEnabledAtLaunch(experiment.name);
396
396
  }
397
397
  }
398
- private async createAppUI(): Promise<void> {
398
+ async #createAppUI(): Promise<void> {
399
399
  MainImpl.time('Main._createAppUI');
400
400
 
401
401
  // @ts-ignore layout test global
@@ -418,7 +418,7 @@ export class MainImpl {
418
418
  }
419
419
  UI.UIUtils.installComponentRootStyles((document.body as Element));
420
420
 
421
- this.addMainEventListeners(document);
421
+ this.#addMainEventListeners(document);
422
422
 
423
423
  const canDock = Boolean(Root.Runtime.Runtime.queryParam('can_dock'));
424
424
  // @ts-ignore layout test global
@@ -450,7 +450,7 @@ export class MainImpl {
450
450
  // @ts-ignore layout test global
451
451
  self.SDK.domDebuggerManager = SDK.DOMDebuggerModel.DOMDebuggerManager.instance({forceNew: true});
452
452
  SDK.TargetManager.TargetManager.instance().addEventListener(
453
- SDK.TargetManager.Events.SuspendStateChanged, this.onSuspendStateChanged.bind(this));
453
+ SDK.TargetManager.Events.SuspendStateChanged, this.#onSuspendStateChanged.bind(this));
454
454
 
455
455
  // @ts-ignore layout test global
456
456
  self.Workspace.fileManager = Workspace.FileManager.FileManager.instance({forceNew: true});
@@ -522,7 +522,7 @@ export class MainImpl {
522
522
  // @ts-ignore layout test global
523
523
  self.UI.shortcutRegistry =
524
524
  UI.ShortcutRegistry.ShortcutRegistry.instance({forceNew: true, actionRegistry: actionRegistryInstance});
525
- this.registerMessageSinkListener();
525
+ this.#registerMessageSinkListener();
526
526
 
527
527
  MainImpl.timeEnd('Main._createAppUI');
528
528
 
@@ -530,10 +530,10 @@ export class MainImpl {
530
530
  if (!appProvider) {
531
531
  throw new Error('Unable to boot DevTools, as the appprovider is missing');
532
532
  }
533
- await this.showAppUI(await appProvider.loadAppProvider());
533
+ await this.#showAppUI(await appProvider.loadAppProvider());
534
534
  }
535
535
 
536
- private async showAppUI(appProvider: Object): Promise<void> {
536
+ async #showAppUI(appProvider: Object): Promise<void> {
537
537
  MainImpl.time('Main._showAppUI');
538
538
  const app = (appProvider as Common.AppProvider.AppProvider).createApp();
539
539
  // It is important to kick controller lifetime after apps are instantiated.
@@ -549,7 +549,7 @@ export class MainImpl {
549
549
  }, this);
550
550
  }
551
551
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
552
- Host.InspectorFrontendHostAPI.Events.RevealSourceLine, this.revealSourceLine, this);
552
+ Host.InspectorFrontendHostAPI.Events.RevealSourceLine, this.#revealSourceLine, this);
553
553
 
554
554
  await UI.InspectorView.InspectorView.instance().createToolbars();
555
555
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.loadCompleted();
@@ -563,11 +563,11 @@ export class MainImpl {
563
563
  UI.ARIAUtils.alertElementInstance();
564
564
 
565
565
  // Allow UI cycles to repaint prior to creating connection.
566
- setTimeout(this.initializeTarget.bind(this), 0);
566
+ setTimeout(this.#initializeTarget.bind(this), 0);
567
567
  MainImpl.timeEnd('Main._showAppUI');
568
568
  }
569
569
 
570
- private async initializeTarget(): Promise<void> {
570
+ async #initializeTarget(): Promise<void> {
571
571
  MainImpl.time('Main._initializeTarget');
572
572
 
573
573
  // We rely on having the early initialization runnables registered in Common when an app loads its
@@ -579,11 +579,11 @@ export class MainImpl {
579
579
  // Used for browser tests.
580
580
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.readyForTest();
581
581
  // Asynchronously run the extensions.
582
- setTimeout(this.lateInitialization.bind(this), 100);
582
+ setTimeout(this.#lateInitialization.bind(this), 100);
583
583
  MainImpl.timeEnd('Main._initializeTarget');
584
584
  }
585
585
 
586
- private lateInitialization(): void {
586
+ #lateInitialization(): void {
587
587
  MainImpl.time('Main._lateInitialization');
588
588
  Extensions.ExtensionServer.ExtensionServer.instance().initializeExtensions();
589
589
  const promises: Promise<void>[] =
@@ -614,7 +614,7 @@ export class MainImpl {
614
614
  return this.#lateInitDonePromise;
615
615
  }
616
616
 
617
- private registerMessageSinkListener(): void {
617
+ #registerMessageSinkListener(): void {
618
618
  Common.Console.Console.instance().addEventListener(Common.Console.Events.MessageAdded, messageAdded);
619
619
 
620
620
  function messageAdded({data: message}: Common.EventTarget.EventTargetEvent<Common.Console.Message>): void {
@@ -624,8 +624,8 @@ export class MainImpl {
624
624
  }
625
625
  }
626
626
 
627
- private revealSourceLine(
628
- event: Common.EventTarget.EventTargetEvent<Host.InspectorFrontendHostAPI.RevealSourceLineEvent>): void {
627
+ #revealSourceLine(event: Common.EventTarget.EventTargetEvent<Host.InspectorFrontendHostAPI.RevealSourceLineEvent>):
628
+ void {
629
629
  const {url, lineNumber, columnNumber} = event.data;
630
630
  const uiSourceCode = Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(url);
631
631
  if (uiSourceCode) {
@@ -646,13 +646,13 @@ export class MainImpl {
646
646
  Workspace.Workspace.Events.UISourceCodeAdded, listener);
647
647
  }
648
648
 
649
- private postDocumentKeyDown(event: Event): void {
649
+ #postDocumentKeyDown(event: Event): void {
650
650
  if (!event.handled) {
651
651
  UI.ShortcutRegistry.ShortcutRegistry.instance().handleShortcut((event as KeyboardEvent));
652
652
  }
653
653
  }
654
654
 
655
- private redispatchClipboardEvent(event: Event): void {
655
+ #redispatchClipboardEvent(event: Event): void {
656
656
  const eventCopy = new CustomEvent('clipboard-' + event.type, {bubbles: true});
657
657
  // @ts-ignore Used in ElementsTreeOutline
658
658
  eventCopy['original'] = event;
@@ -666,22 +666,22 @@ export class MainImpl {
666
666
  }
667
667
  }
668
668
 
669
- private contextMenuEventFired(event: Event): void {
669
+ #contextMenuEventFired(event: Event): void {
670
670
  if (event.handled || (event.target as HTMLElement).classList.contains('popup-glasspane')) {
671
671
  event.preventDefault();
672
672
  }
673
673
  }
674
674
 
675
- private addMainEventListeners(document: Document): void {
676
- document.addEventListener('keydown', this.postDocumentKeyDown.bind(this), false);
677
- document.addEventListener('beforecopy', this.redispatchClipboardEvent.bind(this), true);
678
- document.addEventListener('copy', this.redispatchClipboardEvent.bind(this), false);
679
- document.addEventListener('cut', this.redispatchClipboardEvent.bind(this), false);
680
- document.addEventListener('paste', this.redispatchClipboardEvent.bind(this), false);
681
- document.addEventListener('contextmenu', this.contextMenuEventFired.bind(this), true);
675
+ #addMainEventListeners(document: Document): void {
676
+ document.addEventListener('keydown', this.#postDocumentKeyDown.bind(this), false);
677
+ document.addEventListener('beforecopy', this.#redispatchClipboardEvent.bind(this), true);
678
+ document.addEventListener('copy', this.#redispatchClipboardEvent.bind(this), false);
679
+ document.addEventListener('cut', this.#redispatchClipboardEvent.bind(this), false);
680
+ document.addEventListener('paste', this.#redispatchClipboardEvent.bind(this), false);
681
+ document.addEventListener('contextmenu', this.#contextMenuEventFired.bind(this), true);
682
682
  }
683
683
 
684
- private onSuspendStateChanged(): void {
684
+ #onSuspendStateChanged(): void {
685
685
  const suspended = SDK.TargetManager.TargetManager.instance().allTargetsSuspended();
686
686
  UI.InspectorView.InspectorView.instance().onSuspendStateChanged(suspended);
687
687
  }
@@ -771,7 +771,7 @@ let mainMenuItemInstance: MainMenuItem;
771
771
  export class MainMenuItem implements UI.Toolbar.Provider {
772
772
  readonly #itemInternal: UI.Toolbar.ToolbarMenuButton;
773
773
  constructor() {
774
- this.#itemInternal = new UI.Toolbar.ToolbarMenuButton(this.handleContextMenu.bind(this), true);
774
+ this.#itemInternal = new UI.Toolbar.ToolbarMenuButton(this.#handleContextMenu.bind(this), true);
775
775
  this.#itemInternal.element.classList.add('main-menu');
776
776
  this.#itemInternal.setTitle(i18nString(UIStrings.customizeAndControlDevtools));
777
777
  }
@@ -791,7 +791,7 @@ export class MainMenuItem implements UI.Toolbar.Provider {
791
791
  return this.#itemInternal;
792
792
  }
793
793
 
794
- private handleContextMenu(contextMenu: UI.ContextMenu.ContextMenu): void {
794
+ #handleContextMenu(contextMenu: UI.ContextMenu.ContextMenu): void {
795
795
  if (UI.DockController.DockController.instance().canDock()) {
796
796
  const dockItemElement = document.createElement('div');
797
797
  dockItemElement.classList.add('flex-centered');
@@ -952,12 +952,12 @@ export class SettingsButtonProvider implements UI.Toolbar.Provider {
952
952
  export class PauseListener {
953
953
  constructor() {
954
954
  SDK.TargetManager.TargetManager.instance().addModelListener(
955
- SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this.debuggerPaused, this);
955
+ SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this.#debuggerPaused, this);
956
956
  }
957
957
 
958
- private debuggerPaused(event: Common.EventTarget.EventTargetEvent<SDK.DebuggerModel.DebuggerModel>): void {
958
+ #debuggerPaused(event: Common.EventTarget.EventTargetEvent<SDK.DebuggerModel.DebuggerModel>): void {
959
959
  SDK.TargetManager.TargetManager.instance().removeModelListener(
960
- SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this.debuggerPaused, this);
960
+ SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this.#debuggerPaused, this);
961
961
  const debuggerModel = event.data;
962
962
  const debuggerPausedDetails = debuggerModel.debuggerPausedDetails();
963
963
  UI.Context.Context.instance().setFlavor(SDK.Target.Target, debuggerModel.target());
@@ -51,7 +51,7 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
51
51
  image.src = 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg';
52
52
 
53
53
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
54
- Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.devicesDiscoveryConfigChanged, this);
54
+ Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
55
55
 
56
56
  this.contentElement.tabIndex = 0;
57
57
  this.setDefaultFocusedElement(this.contentElement);
@@ -78,7 +78,7 @@ export class NodeConnectionsPanel extends UI.Panel.Panel {
78
78
  return nodeConnectionsPanelInstance;
79
79
  }
80
80
 
81
- private devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
81
+ #devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
82
82
  this.#config = config;
83
83
  this.#networkDiscoveryView.discoveryConfigChanged(this.#config.networkDiscoveryConfig);
84
84
  }
@@ -117,8 +117,8 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
117
117
  this.#editor = null;
118
118
 
119
119
  const addButton = UI.UIUtils.createTextButton(
120
- i18nString(UIStrings.addConnection), this.addNetworkTargetButtonClicked.bind(this), 'add-network-target-button',
121
- true /* primary */);
120
+ i18nString(UIStrings.addConnection), this.#addNetworkTargetButtonClicked.bind(this),
121
+ 'add-network-target-button', true /* primary */);
122
122
  this.element.appendChild(addButton);
123
123
 
124
124
  this.#networkDiscoveryConfig = [];
@@ -126,12 +126,12 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
126
126
  this.element.classList.add('node-frontend');
127
127
  }
128
128
 
129
- private update(): void {
129
+ #update(): void {
130
130
  const config = this.#networkDiscoveryConfig.map(item => item.address);
131
131
  this.#callback.call(null, config);
132
132
  }
133
133
 
134
- private addNetworkTargetButtonClicked(): void {
134
+ #addNetworkTargetButtonClicked(): void {
135
135
  this.#list.addNewItem(this.#networkDiscoveryConfig.length, {address: '', port: ''});
136
136
  }
137
137
 
@@ -155,7 +155,7 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
155
155
  removeItemRequested(rule: Adb.PortForwardingRule, index: number): void {
156
156
  this.#networkDiscoveryConfig.splice(index, 1);
157
157
  this.#list.removeItem(index);
158
- this.update();
158
+ this.#update();
159
159
  }
160
160
 
161
161
  commitEdit(rule: Adb.PortForwardingRule, editor: UI.ListWidget.Editor<Adb.PortForwardingRule>, isNew: boolean): void {
@@ -163,16 +163,16 @@ export class NodeConnectionsView extends UI.Widget.VBox implements UI.ListWidget
163
163
  if (isNew) {
164
164
  this.#networkDiscoveryConfig.push(rule);
165
165
  }
166
- this.update();
166
+ this.#update();
167
167
  }
168
168
 
169
169
  beginEdit(rule: Adb.PortForwardingRule): UI.ListWidget.Editor<Adb.PortForwardingRule> {
170
- const editor = this.createEditor();
170
+ const editor = this.#createEditor();
171
171
  editor.control('address').value = rule.address;
172
172
  return editor;
173
173
  }
174
174
 
175
- private createEditor(): UI.ListWidget.Editor<Adb.PortForwardingRule> {
175
+ #createEditor(): UI.ListWidget.Editor<Adb.PortForwardingRule> {
176
176
  if (this.#editor) {
177
177
  return this.#editor;
178
178
  }
@@ -63,12 +63,12 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
63
63
  this.#targetAgent.invoke_setDiscoverTargets({discover: true});
64
64
 
65
65
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
66
- Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.devicesDiscoveryConfigChanged, this);
66
+ Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
67
67
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(false);
68
68
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.setDevicesUpdatesEnabled(true);
69
69
  }
70
70
 
71
- private devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
71
+ #devicesDiscoveryConfigChanged({data: config}: Common.EventTarget.EventTargetEvent<Adb.Config>): void {
72
72
  const locations = [];
73
73
  for (const address of config.networkDiscoveryConfig) {
74
74
  const parts = address.split(':');
@@ -82,7 +82,7 @@ export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implemen
82
82
 
83
83
  dispose(): void {
84
84
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.removeEventListener(
85
- Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.devicesDiscoveryConfigChanged, this);
85
+ Host.InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged, this.#devicesDiscoveryConfigChanged, this);
86
86
 
87
87
  for (const sessionId of this.#childTargets.keys()) {
88
88
  this.detachedFromTarget({sessionId});
@@ -2,14 +2,6 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- interface Window {
6
- UI: {themeSupport: unknown}
7
- }
8
-
9
- interface RegExp {
10
- __fromRegExpQuery: boolean;
11
- }
12
-
13
5
  declare class AnchorBox {
14
6
  x: number;
15
7
  y: number;
@@ -123,19 +115,6 @@ declare function isEnterOrSpaceKey(event: Event): boolean;
123
115
  declare function isEscKey(event: Event): boolean;
124
116
  declare function onInvokeElement(element: Element, callback: (event: Event) => void): void;
125
117
 
126
- interface ServicePort {
127
- setHandlers(messageHandler: (arg: string) => void, closeHandler: () => void): void;
128
-
129
- send(message: string): Promise<boolean>;
130
-
131
- close(): Promise<boolean>;
132
- }
133
-
134
- declare class diff_match_patch {
135
- diff_main(text1: string, text2: string): Array<{0: number, 1: string}>;
136
- diff_cleanupSemantic(diff: Array<{0: number, 1: string}>): void;
137
- }
138
-
139
118
  // The following types exist in Chrome but were removed for various reasons
140
119
  // from the TypeScript DOM library.
141
120
  //
@@ -280,7 +280,7 @@ export class SearchConfig {
280
280
  this.jumpBackward = jumpBackward;
281
281
  }
282
282
 
283
- toSearchRegex(_global?: boolean): RegExp {
283
+ toSearchRegex(_global?: boolean): {regex: RegExp, fromQuery: boolean} {
284
284
  throw new Error('Unsupported operation on search config');
285
285
  }
286
286
  }
@@ -0,0 +1,95 @@
1
+ // Copyright 2021 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as i18n from '../../core/i18n/i18n.js';
6
+ import type * as SDK from '../../core/sdk/sdk.js';
7
+ import * as Protocol from '../../generated/protocol.js';
8
+
9
+ import {Issue, IssueCategory, IssueKind} from './Issue.js';
10
+ import type {MarkdownIssueDescription, LazyMarkdownIssueDescription} from './MarkdownIssueDescription.js';
11
+ import {resolveLazyDescription} from './MarkdownIssueDescription.js';
12
+
13
+ const UIStrings = {
14
+ /**
15
+ *@description Title for Client Hint specification url link
16
+ */
17
+ clientHintsInfrastructure: 'Client Hints Infrastructure',
18
+ };
19
+ const str_ = i18n.i18n.registerUIStrings('models/issues_manager/ClientHintIssue.ts', UIStrings);
20
+ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
21
+
22
+ export class ClientHintIssue extends Issue {
23
+ private issueDetails: Protocol.Audits.ClientHintIssueDetails;
24
+
25
+ constructor(issueDetails: Protocol.Audits.ClientHintIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
26
+ super(
27
+ {
28
+ code: Protocol.Audits.InspectorIssueCode.ClientHintIssue,
29
+ umaCode: [Protocol.Audits.InspectorIssueCode.ClientHintIssue, issueDetails.clientHintIssueReason].join('::'),
30
+ },
31
+ issuesModel);
32
+ this.issueDetails = issueDetails;
33
+ }
34
+
35
+ getCategory(): IssueCategory {
36
+ return IssueCategory.Other;
37
+ }
38
+
39
+ details(): Protocol.Audits.ClientHintIssueDetails {
40
+ return this.issueDetails;
41
+ }
42
+
43
+ getDescription(): MarkdownIssueDescription|null {
44
+ const description = issueDescriptions.get(this.issueDetails.clientHintIssueReason);
45
+ if (!description) {
46
+ return null;
47
+ }
48
+ return resolveLazyDescription(description);
49
+ }
50
+
51
+ sources(): Iterable<Protocol.Audits.SourceCodeLocation> {
52
+ return [this.issueDetails.sourceCodeLocation];
53
+ }
54
+
55
+ primaryKey(): string {
56
+ return JSON.stringify(this.issueDetails);
57
+ }
58
+
59
+ getKind(): IssueKind {
60
+ return IssueKind.BreakingChange;
61
+ }
62
+
63
+ static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
64
+ ClientHintIssue[] {
65
+ const details = inspectorIssue.details.clientHintIssueDetails;
66
+ if (!details) {
67
+ console.warn('Client Hint issue without details received.');
68
+ return [];
69
+ }
70
+ return [new ClientHintIssue(details, issuesModel)];
71
+ }
72
+ }
73
+
74
+ const issueDescriptions: Map<Protocol.Audits.ClientHintIssueReason, LazyMarkdownIssueDescription> = new Map([
75
+ [
76
+ Protocol.Audits.ClientHintIssueReason.MetaTagAllowListInvalidOrigin,
77
+ {
78
+ file: 'clientHintMetaTagAllowListInvalidOrigin.md',
79
+ links: [{
80
+ link: 'https://wicg.github.io/client-hints-infrastructure/',
81
+ linkTitle: i18nLazyString(UIStrings.clientHintsInfrastructure),
82
+ }],
83
+ },
84
+ ],
85
+ [
86
+ Protocol.Audits.ClientHintIssueReason.MetaTagModifiedHTML,
87
+ {
88
+ file: 'clientHintMetaTagModifiedHTML.md',
89
+ links: [{
90
+ link: 'https://wicg.github.io/client-hints-infrastructure/',
91
+ linkTitle: i18nLazyString(UIStrings.clientHintsInfrastructure),
92
+ }],
93
+ },
94
+ ],
95
+ ]);
@@ -8,6 +8,7 @@ import * as SDK from '../../core/sdk/sdk.js';
8
8
  import * as Protocol from '../../generated/protocol.js';
9
9
 
10
10
  import {AttributionReportingIssue} from './AttributionReportingIssue.js';
11
+ import {ClientHintIssue} from './ClientHintIssue.js';
11
12
  import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
12
13
  import {CorsIssue} from './CorsIssue.js';
13
14
  import {CrossOriginEmbedderPolicyIssue, isCrossOriginEmbedderPolicyIssue} from './CrossOriginEmbedderPolicyIssue.js';
@@ -104,6 +105,10 @@ const issueCodeHandlers = new Map<
104
105
  Protocol.Audits.InspectorIssueCode.DeprecationIssue,
105
106
  DeprecationIssue.fromInspectorIssue,
106
107
  ],
108
+ [
109
+ Protocol.Audits.InspectorIssueCode.ClientHintIssue,
110
+ ClientHintIssue.fromInspectorIssue,
111
+ ],
107
112
  ]);
108
113
 
109
114
  /**
@@ -0,0 +1,4 @@
1
+ # Client Hint meta tag contained invalid origin
2
+
3
+ Items in the accept-ch meta tag allow list must be valid origins.
4
+ No special values (e.g. self, none, and *) are permitted.
@@ -0,0 +1,4 @@
1
+ # Client Hint meta tag modified by javascript
2
+
3
+ Only accept-ch meta tags in the original HTML sent from the server
4
+ are respected. Any injected via javascript (or other means) are ignored.
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as AttributionReportingIssue from './AttributionReportingIssue.js';
6
+ import * as ClientHintIssue from './ClientHintIssue.js';
6
7
  import * as ContentSecurityPolicyIssue from './ContentSecurityPolicyIssue.js';
7
8
  import * as ContrastCheckTrigger from './ContrastCheckTrigger.js';
8
9
  import * as CorsIssue from './CorsIssue.js';
@@ -27,6 +28,7 @@ import * as WasmCrossOriginModuleSharingIssue from './WasmCrossOriginModuleShari
27
28
 
28
29
  export {
29
30
  AttributionReportingIssue,
31
+ ClientHintIssue,
30
32
  ContentSecurityPolicyIssue,
31
33
  ContrastCheckTrigger,
32
34
  CorsIssue,
@@ -1283,7 +1283,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1283
1283
  this.searchCanceled();
1284
1284
  this.searchableViewInternal.updateSearchMatchesCount(0);
1285
1285
 
1286
- this.searchRegex = searchConfig.toSearchRegex(true);
1286
+ this.searchRegex = searchConfig.toSearchRegex(true).regex;
1287
1287
 
1288
1288
  this.regexMatchRanges = [];
1289
1289
  this.currentMatchRangeIndex = -1;