chrome-devtools-frontend 1.0.927127 → 1.0.928589

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 (144) hide show
  1. package/AUTHORS +1 -0
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +30 -4
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/Images/src/ic_preview_feature.svg +3 -0
  6. package/front_end/Tests.js +2 -3
  7. package/front_end/core/common/Settings.ts +26 -45
  8. package/front_end/core/host/UserMetrics.ts +2 -2
  9. package/front_end/core/i18n/locales/en-US.json +60 -15
  10. package/front_end/core/i18n/locales/en-XL.json +60 -15
  11. package/front_end/core/platform/keyboard-utilities.ts +1 -0
  12. package/front_end/core/root/Runtime.ts +62 -61
  13. package/front_end/core/sdk/AccessibilityModel.ts +73 -73
  14. package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
  15. package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
  17. package/front_end/core/sdk/CSSFontFace.ts +10 -10
  18. package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
  19. package/front_end/core/sdk/CSSMedia.ts +22 -22
  20. package/front_end/core/sdk/CSSMetadata.ts +53 -49
  21. package/front_end/core/sdk/CSSModel.ts +139 -135
  22. package/front_end/core/sdk/CSSProperty.ts +18 -18
  23. package/front_end/core/sdk/CSSRule.ts +15 -15
  24. package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
  25. package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
  26. package/front_end/core/sdk/ChildTargetManager.ts +41 -40
  27. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
  28. package/front_end/core/sdk/Connections.ts +81 -81
  29. package/front_end/core/sdk/ConsoleModel.ts +68 -68
  30. package/front_end/core/sdk/Cookie.ts +48 -48
  31. package/front_end/core/sdk/CookieModel.ts +13 -13
  32. package/front_end/core/sdk/CookieParser.ts +45 -45
  33. package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
  34. package/front_end/core/sdk/DOMModel.ts +264 -252
  35. package/front_end/core/sdk/DebuggerModel.ts +209 -205
  36. package/front_end/core/sdk/EmulationModel.ts +76 -76
  37. package/front_end/core/sdk/FilmStripModel.ts +29 -29
  38. package/front_end/core/sdk/FrameManager.ts +43 -42
  39. package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
  40. package/front_end/core/sdk/IsolateManager.ts +82 -82
  41. package/front_end/core/sdk/IssuesModel.ts +6 -6
  42. package/front_end/core/sdk/LayerTreeBase.ts +37 -37
  43. package/front_end/core/sdk/LogModel.ts +5 -5
  44. package/front_end/core/sdk/NetworkManager.ts +229 -225
  45. package/front_end/core/sdk/NetworkRequest.ts +368 -360
  46. package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
  47. package/front_end/core/sdk/OverlayModel.ts +155 -153
  48. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
  49. package/front_end/core/sdk/PageResourceLoader.ts +30 -30
  50. package/front_end/core/sdk/PaintProfiler.ts +16 -16
  51. package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
  52. package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
  53. package/front_end/core/sdk/RemoteObject.ts +108 -104
  54. package/front_end/core/sdk/Resource.ts +85 -84
  55. package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
  56. package/front_end/core/sdk/RuntimeModel.ts +38 -34
  57. package/front_end/core/sdk/SDKModel.ts +3 -3
  58. package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
  59. package/front_end/core/sdk/Script.ts +29 -29
  60. package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
  61. package/front_end/core/sdk/ServerTiming.ts +2 -2
  62. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
  63. package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
  64. package/front_end/core/sdk/SourceMap.ts +40 -36
  65. package/front_end/core/sdk/SourceMapManager.ts +57 -57
  66. package/front_end/core/sdk/Target.ts +64 -63
  67. package/front_end/core/sdk/TargetManager.ts +60 -56
  68. package/front_end/core/sdk/TracingManager.ts +39 -39
  69. package/front_end/core/sdk/TracingModel.ts +125 -125
  70. package/front_end/core/sdk/WebAuthnModel.ts +9 -9
  71. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
  72. package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
  73. package/front_end/entrypoints/main/MainImpl.ts +7 -2
  74. package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
  75. package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
  76. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
  77. package/front_end/models/issues_manager/GenericIssue.ts +86 -0
  78. package/front_end/models/issues_manager/Issue.ts +24 -0
  79. package/front_end/models/issues_manager/IssuesManager.ts +18 -6
  80. package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
  81. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  82. package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
  83. package/front_end/panels/console/ConsoleSidebar.ts +0 -3
  84. package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
  85. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
  86. package/front_end/panels/elements/components/LayoutPane.ts +5 -1
  87. package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
  88. package/front_end/panels/issues/IssueAggregator.ts +16 -0
  89. package/front_end/panels/issues/IssueKindView.ts +95 -0
  90. package/front_end/panels/issues/IssueView.ts +6 -0
  91. package/front_end/panels/issues/IssuesPane.ts +81 -18
  92. package/front_end/panels/issues/issuesTree.css +8 -3
  93. package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
  94. package/front_end/panels/network/NetworkItemView.ts +1 -1
  95. package/front_end/panels/network/networkLogView.css +5 -0
  96. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  97. package/front_end/panels/settings/SettingsScreen.ts +1 -0
  98. package/front_end/panels/settings/settingsScreen.css +24 -0
  99. package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
  100. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  101. package/front_end/panels/sources/sources-meta.ts +22 -7
  102. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  103. package/front_end/third_party/codemirror.next/package.json +4 -4
  104. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
  105. package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
  106. package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
  107. package/front_end/ui/components/docs/text_editor/basic.html +28 -0
  108. package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
  109. package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
  110. package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
  111. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
  112. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
  113. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
  114. package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
  115. package/front_end/ui/components/text_editor/config.ts +264 -0
  116. package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
  117. package/front_end/ui/components/text_editor/theme.ts +113 -0
  118. package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
  119. package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
  120. package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
  121. package/front_end/ui/legacy/ARIAUtils.ts +14 -11
  122. package/front_end/ui/legacy/TabbedPane.ts +32 -3
  123. package/front_end/ui/legacy/UIUtils.ts +3 -1
  124. package/front_end/ui/legacy/View.ts +6 -0
  125. package/front_end/ui/legacy/ViewManager.ts +5 -1
  126. package/front_end/ui/legacy/ViewRegistration.ts +5 -0
  127. package/front_end/ui/legacy/XLink.ts +1 -1
  128. package/front_end/ui/legacy/closeButton.css +6 -0
  129. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
  130. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
  131. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
  132. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
  133. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
  134. package/front_end/ui/legacy/filter.css +1 -0
  135. package/front_end/ui/legacy/tabbedPane.css +24 -0
  136. package/front_end/ui/legacy/toolbar.css +5 -0
  137. package/inspector_overlay/main.ts +2 -1
  138. package/inspector_overlay/tool_screenshot.ts +8 -1
  139. package/package.json +1 -1
  140. package/scripts/build/rollup.config.js +9 -0
  141. package/scripts/migration/class-fields/migrate.js +56 -0
  142. package/scripts/migration/class-fields/package.json +5 -0
  143. package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
  144. package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
@@ -14,29 +14,29 @@ import {Capability} from './Target.js';
14
14
  import {SDKModel} from './SDKModel.js';
15
15
 
16
16
  export class EmulationModel extends SDKModel<void> {
17
- private readonly emulationAgent: ProtocolProxyApi.EmulationApi;
18
- private readonly pageAgent: ProtocolProxyApi.PageApi;
19
- private readonly deviceOrientationAgent: ProtocolProxyApi.DeviceOrientationApi;
20
- private cssModel: CSSModel|null;
21
- private readonly overlayModelInternal: OverlayModel|null;
22
- private readonly mediaConfiguration: Map<string, string>;
23
- private touchEnabled: boolean;
24
- private touchMobile: boolean;
25
- private customTouchEnabled: boolean;
26
- private touchConfiguration: {
17
+ readonly #emulationAgent: ProtocolProxyApi.EmulationApi;
18
+ readonly #pageAgent: ProtocolProxyApi.PageApi;
19
+ readonly #deviceOrientationAgent: ProtocolProxyApi.DeviceOrientationApi;
20
+ #cssModel: CSSModel|null;
21
+ readonly #overlayModelInternal: OverlayModel|null;
22
+ readonly #mediaConfiguration: Map<string, string>;
23
+ #touchEnabled: boolean;
24
+ #touchMobile: boolean;
25
+ #customTouchEnabled: boolean;
26
+ #touchConfiguration: {
27
27
  enabled: boolean,
28
28
  configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration,
29
29
  };
30
30
 
31
31
  constructor(target: Target) {
32
32
  super(target);
33
- this.emulationAgent = target.emulationAgent();
34
- this.pageAgent = target.pageAgent();
35
- this.deviceOrientationAgent = target.deviceOrientationAgent();
36
- this.cssModel = target.model(CSSModel);
37
- this.overlayModelInternal = target.model(OverlayModel);
38
- if (this.overlayModelInternal) {
39
- this.overlayModelInternal.addEventListener(Events.InspectModeWillBeToggled, () => {
33
+ this.#emulationAgent = target.emulationAgent();
34
+ this.#pageAgent = target.pageAgent();
35
+ this.#deviceOrientationAgent = target.deviceOrientationAgent();
36
+ this.#cssModel = target.model(CSSModel);
37
+ this.#overlayModelInternal = target.model(OverlayModel);
38
+ if (this.#overlayModelInternal) {
39
+ this.#overlayModelInternal.addEventListener(Events.InspectModeWillBeToggled, () => {
40
40
  this.updateTouch();
41
41
  }, this);
42
42
  }
@@ -44,9 +44,9 @@ export class EmulationModel extends SDKModel<void> {
44
44
  const disableJavascriptSetting = Common.Settings.Settings.instance().moduleSetting('javaScriptDisabled');
45
45
  disableJavascriptSetting.addChangeListener(
46
46
  async () =>
47
- await this.emulationAgent.invoke_setScriptExecutionDisabled({value: disableJavascriptSetting.get()}));
47
+ await this.#emulationAgent.invoke_setScriptExecutionDisabled({value: disableJavascriptSetting.get()}));
48
48
  if (disableJavascriptSetting.get()) {
49
- this.emulationAgent.invoke_setScriptExecutionDisabled({value: true});
49
+ this.#emulationAgent.invoke_setScriptExecutionDisabled({value: true});
50
50
  }
51
51
 
52
52
  const touchSetting = Common.Settings.Settings.instance().moduleSetting('emulation.touch');
@@ -86,7 +86,7 @@ export class EmulationModel extends SDKModel<void> {
86
86
  // because we want to update these values per media type/feature
87
87
  // without having to search the `features` array (inefficient) or
88
88
  // hardcoding the indices (not readable/maintainable).
89
- this.mediaConfiguration = new Map([
89
+ this.#mediaConfiguration = new Map([
90
90
  ['type', mediaTypeSetting.get()],
91
91
  ['color-gamut', mediaFeatureColorGamutSetting.get()],
92
92
  ['prefers-color-scheme', mediaFeaturePrefersColorSchemeSetting.get()],
@@ -95,27 +95,27 @@ export class EmulationModel extends SDKModel<void> {
95
95
  ['prefers-reduced-motion', mediaFeaturePrefersReducedMotionSetting.get()],
96
96
  ]);
97
97
  mediaTypeSetting.addChangeListener(() => {
98
- this.mediaConfiguration.set('type', mediaTypeSetting.get());
98
+ this.#mediaConfiguration.set('type', mediaTypeSetting.get());
99
99
  this.updateCssMedia();
100
100
  });
101
101
  mediaFeatureColorGamutSetting.addChangeListener(() => {
102
- this.mediaConfiguration.set('color-gamut', mediaFeatureColorGamutSetting.get());
102
+ this.#mediaConfiguration.set('color-gamut', mediaFeatureColorGamutSetting.get());
103
103
  this.updateCssMedia();
104
104
  });
105
105
  mediaFeaturePrefersColorSchemeSetting.addChangeListener(() => {
106
- this.mediaConfiguration.set('prefers-color-scheme', mediaFeaturePrefersColorSchemeSetting.get());
106
+ this.#mediaConfiguration.set('prefers-color-scheme', mediaFeaturePrefersColorSchemeSetting.get());
107
107
  this.updateCssMedia();
108
108
  });
109
109
  mediaFeaturePrefersContrastSetting.addChangeListener(() => {
110
- this.mediaConfiguration.set('prefers-contrast', mediaFeaturePrefersContrastSetting.get());
110
+ this.#mediaConfiguration.set('prefers-contrast', mediaFeaturePrefersContrastSetting.get());
111
111
  this.updateCssMedia();
112
112
  });
113
113
  mediaFeaturePrefersReducedDataSetting.addChangeListener(() => {
114
- this.mediaConfiguration.set('prefers-reduced-data', mediaFeaturePrefersReducedDataSetting.get());
114
+ this.#mediaConfiguration.set('prefers-reduced-data', mediaFeaturePrefersReducedDataSetting.get());
115
115
  this.updateCssMedia();
116
116
  });
117
117
  mediaFeaturePrefersReducedMotionSetting.addChangeListener(() => {
118
- this.mediaConfiguration.set('prefers-reduced-motion', mediaFeaturePrefersReducedMotionSetting.get());
118
+ this.#mediaConfiguration.set('prefers-reduced-motion', mediaFeaturePrefersReducedMotionSetting.get());
119
119
  this.updateCssMedia();
120
120
  });
121
121
  this.updateCssMedia();
@@ -164,10 +164,10 @@ export class EmulationModel extends SDKModel<void> {
164
164
  updateDisabledImageFormats();
165
165
  }
166
166
 
167
- this.touchEnabled = false;
168
- this.touchMobile = false;
169
- this.customTouchEnabled = false;
170
- this.touchConfiguration = {
167
+ this.#touchEnabled = false;
168
+ this.#touchMobile = false;
169
+ this.#customTouchEnabled = false;
170
+ this.#touchConfiguration = {
171
171
  enabled: false,
172
172
  configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile,
173
173
  };
@@ -178,28 +178,28 @@ export class EmulationModel extends SDKModel<void> {
178
178
  }
179
179
 
180
180
  async resetPageScaleFactor(): Promise<void> {
181
- await this.emulationAgent.invoke_resetPageScaleFactor();
181
+ await this.#emulationAgent.invoke_resetPageScaleFactor();
182
182
  }
183
183
 
184
184
  async emulateDevice(metrics: Protocol.Page.SetDeviceMetricsOverrideRequest|null): Promise<void> {
185
185
  if (metrics) {
186
- await this.emulationAgent.invoke_setDeviceMetricsOverride(metrics);
186
+ await this.#emulationAgent.invoke_setDeviceMetricsOverride(metrics);
187
187
  } else {
188
- await this.emulationAgent.invoke_clearDeviceMetricsOverride();
188
+ await this.#emulationAgent.invoke_clearDeviceMetricsOverride();
189
189
  }
190
190
  }
191
191
 
192
192
  overlayModel(): OverlayModel|null {
193
- return this.overlayModelInternal;
193
+ return this.#overlayModelInternal;
194
194
  }
195
195
 
196
196
  async emulateLocation(location: Location|null): Promise<void> {
197
197
  if (!location || location.error) {
198
198
  await Promise.all([
199
- this.emulationAgent.invoke_clearGeolocationOverride(),
200
- this.emulationAgent.invoke_setTimezoneOverride({timezoneId: ''}),
201
- this.emulationAgent.invoke_setLocaleOverride({locale: ''}),
202
- this.emulationAgent.invoke_setUserAgentOverride(
199
+ this.#emulationAgent.invoke_clearGeolocationOverride(),
200
+ this.#emulationAgent.invoke_setTimezoneOverride({timezoneId: ''}),
201
+ this.#emulationAgent.invoke_setLocaleOverride({locale: ''}),
202
+ this.#emulationAgent.invoke_setUserAgentOverride(
203
203
  {userAgent: MultitargetNetworkManager.instance().currentUserAgent()}),
204
204
  ]);
205
205
  } else {
@@ -215,24 +215,24 @@ export class EmulationModel extends SDKModel<void> {
215
215
  }
216
216
 
217
217
  await Promise.all([
218
- this.emulationAgent
218
+ this.#emulationAgent
219
219
  .invoke_setGeolocationOverride({
220
220
  latitude: location.latitude,
221
221
  longitude: location.longitude,
222
222
  accuracy: Location.defaultGeoMockAccuracy,
223
223
  })
224
224
  .then(result => processEmulationResult('emulation-set-location', result)),
225
- this.emulationAgent
225
+ this.#emulationAgent
226
226
  .invoke_setTimezoneOverride({
227
227
  timezoneId: location.timezoneId,
228
228
  })
229
229
  .then(result => processEmulationResult('emulation-set-timezone', result)),
230
- this.emulationAgent
230
+ this.#emulationAgent
231
231
  .invoke_setLocaleOverride({
232
232
  locale: location.locale,
233
233
  })
234
234
  .then(result => processEmulationResult('emulation-set-locale', result)),
235
- this.emulationAgent
235
+ this.#emulationAgent
236
236
  .invoke_setUserAgentOverride({
237
237
  userAgent: MultitargetNetworkManager.instance().currentUserAgent(),
238
238
  acceptLanguage: location.locale,
@@ -244,10 +244,10 @@ export class EmulationModel extends SDKModel<void> {
244
244
 
245
245
  async emulateDeviceOrientation(deviceOrientation: DeviceOrientation|null): Promise<void> {
246
246
  if (deviceOrientation) {
247
- await this.deviceOrientationAgent.invoke_setDeviceOrientationOverride(
247
+ await this.#deviceOrientationAgent.invoke_setDeviceOrientationOverride(
248
248
  {alpha: deviceOrientation.alpha, beta: deviceOrientation.beta, gamma: deviceOrientation.gamma});
249
249
  } else {
250
- await this.deviceOrientationAgent.invoke_clearDeviceOrientationOverride();
250
+ await this.#deviceOrientationAgent.invoke_clearDeviceOrientationOverride();
251
251
  }
252
252
  }
253
253
 
@@ -255,20 +255,20 @@ export class EmulationModel extends SDKModel<void> {
255
255
  isUserActive: boolean,
256
256
  isScreenUnlocked: boolean,
257
257
  }): Promise<void> {
258
- await this.emulationAgent.invoke_setIdleOverride(emulationParams);
258
+ await this.#emulationAgent.invoke_setIdleOverride(emulationParams);
259
259
  }
260
260
 
261
261
  async clearIdleOverride(): Promise<void> {
262
- await this.emulationAgent.invoke_clearIdleOverride();
262
+ await this.#emulationAgent.invoke_clearIdleOverride();
263
263
  }
264
264
 
265
265
  private async emulateCSSMedia(type: string, features: {
266
266
  name: string,
267
267
  value: string,
268
268
  }[]): Promise<void> {
269
- await this.emulationAgent.invoke_setEmulatedMedia({media: type, features});
270
- if (this.cssModel) {
271
- this.cssModel.mediaQueryResultChanged();
269
+ await this.#emulationAgent.invoke_setEmulatedMedia({media: type, features});
270
+ if (this.#cssModel) {
271
+ this.#cssModel.mediaQueryResultChanged();
272
272
  }
273
273
  }
274
274
 
@@ -287,97 +287,97 @@ export class EmulationModel extends SDKModel<void> {
287
287
 
288
288
  private async emulateAutoDarkMode(setting: string): Promise<void> {
289
289
  const enabled = EmulationModel.parseAutoDarkModeSetting(setting);
290
- await this.emulationAgent.invoke_setAutoDarkModeOverride({enabled});
290
+ await this.#emulationAgent.invoke_setAutoDarkModeOverride({enabled});
291
291
  }
292
292
 
293
293
  private async emulateVisionDeficiency(type: Protocol.Emulation.SetEmulatedVisionDeficiencyRequestType):
294
294
  Promise<void> {
295
- await this.emulationAgent.invoke_setEmulatedVisionDeficiency({type});
295
+ await this.#emulationAgent.invoke_setEmulatedVisionDeficiency({type});
296
296
  }
297
297
 
298
298
  private setLocalFontsDisabled(disabled: boolean): void {
299
- if (!this.cssModel) {
299
+ if (!this.#cssModel) {
300
300
  return;
301
301
  }
302
- this.cssModel.setLocalFontsEnabled(!disabled);
302
+ this.#cssModel.setLocalFontsEnabled(!disabled);
303
303
  }
304
304
 
305
305
  private setDisabledImageTypes(imageTypes: Protocol.Emulation.DisabledImageType[]): void {
306
- this.emulationAgent.invoke_setDisabledImageTypes({imageTypes});
306
+ this.#emulationAgent.invoke_setDisabledImageTypes({imageTypes});
307
307
  }
308
308
 
309
309
  async setCPUThrottlingRate(rate: number): Promise<void> {
310
- await this.emulationAgent.invoke_setCPUThrottlingRate({rate});
310
+ await this.#emulationAgent.invoke_setCPUThrottlingRate({rate});
311
311
  }
312
312
 
313
313
  async emulateTouch(enabled: boolean, mobile: boolean): Promise<void> {
314
- this.touchEnabled = enabled;
315
- this.touchMobile = mobile;
314
+ this.#touchEnabled = enabled;
315
+ this.#touchMobile = mobile;
316
316
  await this.updateTouch();
317
317
  }
318
318
 
319
319
  async overrideEmulateTouch(enabled: boolean): Promise<void> {
320
- this.customTouchEnabled = enabled;
320
+ this.#customTouchEnabled = enabled;
321
321
  await this.updateTouch();
322
322
  }
323
323
 
324
324
  private async updateTouch(): Promise<void> {
325
325
  let configuration = {
326
- enabled: this.touchEnabled,
327
- configuration: this.touchMobile ? Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile :
328
- Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Desktop,
326
+ enabled: this.#touchEnabled,
327
+ configuration: this.#touchMobile ? Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile :
328
+ Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Desktop,
329
329
  };
330
- if (this.customTouchEnabled) {
330
+ if (this.#customTouchEnabled) {
331
331
  configuration = {
332
332
  enabled: true,
333
333
  configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile,
334
334
  };
335
335
  }
336
336
 
337
- if (this.overlayModelInternal && this.overlayModelInternal.inspectModeEnabled()) {
337
+ if (this.#overlayModelInternal && this.#overlayModelInternal.inspectModeEnabled()) {
338
338
  configuration = {
339
339
  enabled: false,
340
340
  configuration: Protocol.Emulation.SetEmitTouchEventsForMouseRequestConfiguration.Mobile,
341
341
  };
342
342
  }
343
343
 
344
- if (!this.touchConfiguration.enabled && !configuration.enabled) {
344
+ if (!this.#touchConfiguration.enabled && !configuration.enabled) {
345
345
  return;
346
346
  }
347
- if (this.touchConfiguration.enabled && configuration.enabled &&
348
- this.touchConfiguration.configuration === configuration.configuration) {
347
+ if (this.#touchConfiguration.enabled && configuration.enabled &&
348
+ this.#touchConfiguration.configuration === configuration.configuration) {
349
349
  return;
350
350
  }
351
351
 
352
- this.touchConfiguration = configuration;
353
- await this.emulationAgent.invoke_setTouchEmulationEnabled({enabled: configuration.enabled, maxTouchPoints: 1});
354
- await this.emulationAgent.invoke_setEmitTouchEventsForMouse(
352
+ this.#touchConfiguration = configuration;
353
+ await this.#emulationAgent.invoke_setTouchEmulationEnabled({enabled: configuration.enabled, maxTouchPoints: 1});
354
+ await this.#emulationAgent.invoke_setEmitTouchEventsForMouse(
355
355
  {enabled: configuration.enabled, configuration: configuration.configuration});
356
356
  }
357
357
 
358
358
  private updateCssMedia(): void {
359
- // See the note above, where this.mediaConfiguration is defined.
360
- const type = this.mediaConfiguration.get('type') ?? '';
359
+ // See the note above, where this.#mediaConfiguration is defined.
360
+ const type = this.#mediaConfiguration.get('type') ?? '';
361
361
  const features = [
362
362
  {
363
363
  name: 'color-gamut',
364
- value: this.mediaConfiguration.get('color-gamut') ?? '',
364
+ value: this.#mediaConfiguration.get('color-gamut') ?? '',
365
365
  },
366
366
  {
367
367
  name: 'prefers-color-scheme',
368
- value: this.mediaConfiguration.get('prefers-color-scheme') ?? '',
368
+ value: this.#mediaConfiguration.get('prefers-color-scheme') ?? '',
369
369
  },
370
370
  {
371
371
  name: 'prefers-contrast',
372
- value: this.mediaConfiguration.get('prefers-contrast') ?? '',
372
+ value: this.#mediaConfiguration.get('prefers-contrast') ?? '',
373
373
  },
374
374
  {
375
375
  name: 'prefers-reduced-data',
376
- value: this.mediaConfiguration.get('prefers-reduced-data') ?? '',
376
+ value: this.#mediaConfiguration.get('prefers-reduced-data') ?? '',
377
377
  },
378
378
  {
379
379
  name: 'prefers-reduced-motion',
380
- value: this.mediaConfiguration.get('prefers-reduced-motion') ?? '',
380
+ value: this.#mediaConfiguration.get('prefers-reduced-motion') ?? '',
381
381
  },
382
382
  ];
383
383
  this.emulateCSSMedia(type, features);
@@ -8,22 +8,22 @@ import type {Event, ObjectSnapshot} from './TracingModel.js';
8
8
  import {TracingModel} from './TracingModel.js';
9
9
 
10
10
  export class FilmStripModel {
11
- private framesInternal: Frame[];
12
- private zeroTimeInternal: number;
13
- private spanTimeInternal: number;
11
+ #framesInternal: Frame[];
12
+ #zeroTimeInternal: number;
13
+ #spanTimeInternal: number;
14
14
  constructor(tracingModel: TracingModel, zeroTime?: number) {
15
- this.framesInternal = [];
16
- this.zeroTimeInternal = 0;
17
- this.spanTimeInternal = 0;
15
+ this.#framesInternal = [];
16
+ this.#zeroTimeInternal = 0;
17
+ this.#spanTimeInternal = 0;
18
18
 
19
19
  this.reset(tracingModel, zeroTime);
20
20
  }
21
21
 
22
22
  reset(tracingModel: TracingModel, zeroTime?: number): void {
23
- this.zeroTimeInternal = zeroTime || tracingModel.minimumRecordTime();
24
- this.spanTimeInternal = tracingModel.maximumRecordTime() - this.zeroTimeInternal;
23
+ this.#zeroTimeInternal = zeroTime || tracingModel.minimumRecordTime();
24
+ this.#spanTimeInternal = tracingModel.maximumRecordTime() - this.#zeroTimeInternal;
25
25
 
26
- this.framesInternal = [];
26
+ this.#framesInternal = [];
27
27
  const browserMain = TracingModel.browserMainThread(tracingModel);
28
28
  if (!browserMain) {
29
29
  return;
@@ -32,7 +32,7 @@ export class FilmStripModel {
32
32
  const events = browserMain.events();
33
33
  for (let i = 0; i < events.length; ++i) {
34
34
  const event = events[i];
35
- if (event.startTime < this.zeroTimeInternal) {
35
+ if (event.startTime < this.#zeroTimeInternal) {
36
36
  continue;
37
37
  }
38
38
  if (!event.hasCategory(category)) {
@@ -41,31 +41,31 @@ export class FilmStripModel {
41
41
  if (event.name === TraceEvents.CaptureFrame) {
42
42
  const data = event.args['data'];
43
43
  if (data) {
44
- this.framesInternal.push(Frame.fromEvent(this, event, this.framesInternal.length));
44
+ this.#framesInternal.push(Frame.fromEvent(this, event, this.#framesInternal.length));
45
45
  }
46
46
  } else if (event.name === TraceEvents.Screenshot) {
47
- this.framesInternal.push(Frame.fromSnapshot(this, (event as ObjectSnapshot), this.framesInternal.length));
47
+ this.#framesInternal.push(Frame.fromSnapshot(this, (event as ObjectSnapshot), this.#framesInternal.length));
48
48
  }
49
49
  }
50
50
  }
51
51
 
52
52
  frames(): Frame[] {
53
- return this.framesInternal;
53
+ return this.#framesInternal;
54
54
  }
55
55
 
56
56
  zeroTime(): number {
57
- return this.zeroTimeInternal;
57
+ return this.#zeroTimeInternal;
58
58
  }
59
59
 
60
60
  spanTime(): number {
61
- return this.spanTimeInternal;
61
+ return this.#spanTimeInternal;
62
62
  }
63
63
 
64
64
  frameByTimestamp(timestamp: number): Frame|null {
65
65
  const index = Platform.ArrayUtilities.upperBound(
66
- this.framesInternal, timestamp, (timestamp, frame) => timestamp - frame.timestamp) -
66
+ this.#framesInternal, timestamp, (timestamp, frame) => timestamp - frame.timestamp) -
67
67
  1;
68
- return index >= 0 ? this.framesInternal[index] : null;
68
+ return index >= 0 ? this.#framesInternal[index] : null;
69
69
  }
70
70
  }
71
71
 
@@ -77,40 +77,40 @@ const TraceEvents = {
77
77
  };
78
78
 
79
79
  export class Frame {
80
- private readonly modelInternal: FilmStripModel;
80
+ readonly #modelInternal: FilmStripModel;
81
81
  timestamp: number;
82
82
  index: number;
83
- private imageData: string|null;
84
- private snapshot: ObjectSnapshot|null;
83
+ #imageData: string|null;
84
+ #snapshot: ObjectSnapshot|null;
85
85
  constructor(model: FilmStripModel, timestamp: number, index: number) {
86
- this.modelInternal = model;
86
+ this.#modelInternal = model;
87
87
  this.timestamp = timestamp;
88
88
  this.index = index;
89
- this.imageData = null;
90
- this.snapshot = null;
89
+ this.#imageData = null;
90
+ this.#snapshot = null;
91
91
  }
92
92
 
93
93
  static fromEvent(model: FilmStripModel, event: Event, index: number): Frame {
94
94
  const frame = new Frame(model, event.startTime, index);
95
- frame.imageData = event.args['data'];
95
+ frame.#imageData = event.args['data'];
96
96
  return frame;
97
97
  }
98
98
 
99
99
  static fromSnapshot(model: FilmStripModel, snapshot: ObjectSnapshot, index: number): Frame {
100
100
  const frame = new Frame(model, snapshot.startTime, index);
101
- frame.snapshot = snapshot;
101
+ frame.#snapshot = snapshot;
102
102
  return frame;
103
103
  }
104
104
 
105
105
  model(): FilmStripModel {
106
- return this.modelInternal;
106
+ return this.#modelInternal;
107
107
  }
108
108
 
109
109
  imageDataPromise(): Promise<string|null> {
110
- if (this.imageData || !this.snapshot) {
111
- return Promise.resolve(this.imageData);
110
+ if (this.#imageData || !this.#snapshot) {
111
+ return Promise.resolve(this.#imageData);
112
112
  }
113
113
 
114
- return this.snapshot.objectPromise() as Promise<string|null>;
114
+ return this.#snapshot.objectPromise() as Promise<string|null>;
115
115
  }
116
116
  }