chrome-devtools-frontend 1.0.1654411 → 1.0.1656291

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 (196) hide show
  1. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
  2. package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
  3. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
  4. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
  5. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
  6. package/AUTHORS +1 -0
  7. package/config/owner/COMMON_OWNERS +0 -4
  8. package/docs/playbook.md +1 -1
  9. package/front_end/Tests.js +1 -0
  10. package/front_end/core/common/Settings.ts +47 -30
  11. package/front_end/core/sdk/CPUThrottlingManager.ts +10 -159
  12. package/front_end/core/sdk/ConsoleModel.ts +13 -11
  13. package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
  14. package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
  15. package/front_end/core/sdk/IsolateManager.ts +6 -6
  16. package/front_end/core/sdk/ResourceTreeModel.ts +5 -3
  17. package/front_end/core/sdk/TargetManager.ts +17 -0
  18. package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
  19. package/front_end/entrypoints/main/MainImpl.ts +12 -36
  20. package/front_end/foundation/Universe.ts +98 -3
  21. package/front_end/generated/InspectorBackendCommands.ts +5 -1
  22. package/front_end/generated/SupportedCSSProperties.js +2 -6
  23. package/front_end/generated/protocol-mapping.d.ts +8 -0
  24. package/front_end/generated/protocol-proxy-api.d.ts +15 -0
  25. package/front_end/generated/protocol.ts +36 -1
  26. package/front_end/models/ai_assistance/AiConversation.ts +0 -6
  27. package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
  28. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -156
  29. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
  30. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
  31. package/front_end/models/ai_assistance/ai_assistance.ts +0 -6
  32. package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
  33. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
  34. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
  35. package/front_end/models/autofill_manager/AutofillManager.ts +1 -2
  36. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  37. package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
  38. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +12 -9
  39. package/front_end/models/persistence/IsolatedFileSystemManager.ts +18 -9
  40. package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
  41. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
  42. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +3 -29
  43. package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
  44. package/front_end/panels/application/FrameDetailsView.ts +2 -1
  45. package/front_end/panels/application/ServiceWorkersView.ts +23 -16
  46. package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
  47. package/front_end/panels/common/ThrottlingUtils.ts +9 -4
  48. package/front_end/panels/common/common.ts +1 -1
  49. package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
  50. package/front_end/panels/elements/ElementsPanel.ts +0 -74
  51. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -4
  52. package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
  53. package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
  54. package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
  55. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
  56. package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
  57. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +15 -13
  58. package/front_end/panels/network/NetworkLogView.ts +0 -9
  59. package/front_end/panels/network/NetworkPanel.ts +1 -63
  60. package/front_end/panels/network/RequestInitiatorView.ts +29 -4
  61. package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
  62. package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
  63. package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
  64. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
  65. package/front_end/panels/network/components/RequestHeadersView.css +1 -1
  66. package/front_end/panels/security/SecurityPanel.ts +36 -23
  67. package/front_end/panels/settings/SettingsScreen.ts +18 -103
  68. package/front_end/panels/settings/settings-meta.ts +0 -24
  69. package/front_end/panels/timeline/TimelineController.ts +3 -2
  70. package/front_end/panels/timeline/TimelinePanel.ts +20 -3
  71. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +15 -14
  72. package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
  73. package/front_end/panels/utils/utils.ts +25 -24
  74. package/front_end/third_party/chromium/README.chromium +1 -1
  75. package/front_end/third_party/puppeteer/README.chromium +2 -2
  76. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
  77. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
  78. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
  79. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
  87. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
  92. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
  97. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
  101. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
  103. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
  108. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
  111. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
  116. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
  118. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
  123. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
  125. package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  126. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
  131. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
  135. package/front_end/third_party/puppeteer/package/package.json +4 -4
  136. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
  137. package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
  138. package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
  139. package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
  140. package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
  141. package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
  142. package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
  143. package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
  144. package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
  145. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
  146. package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
  147. package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
  148. package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
  149. package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
  150. package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
  151. package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
  152. package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
  153. package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
  154. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
  155. package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
  156. package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
  157. package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
  158. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  159. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
  160. package/front_end/ui/components/dialogs/Dialog.ts +3 -0
  161. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
  162. package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
  163. package/front_end/ui/legacy/TabbedPane.ts +1 -108
  164. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
  165. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +172 -123
  166. package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
  167. package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
  168. package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
  169. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
  170. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  171. package/package.json +1 -1
  172. package/front_end/Images/navigationControls.png +0 -0
  173. package/front_end/Images/navigationControls_2x.png +0 -0
  174. package/front_end/Images/popoverArrows.png +0 -0
  175. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
  176. package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
  177. package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
  178. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
  179. package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
  180. package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
  181. package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
  182. package/front_end/models/annotations/AnnotationRepository.ts +0 -238
  183. package/front_end/models/annotations/AnnotationType.ts +0 -10
  184. package/front_end/models/annotations/README.md +0 -7
  185. package/front_end/models/annotations/annotations.ts +0 -6
  186. package/front_end/models/greendev/Prototypes.ts +0 -68
  187. package/front_end/models/greendev/README.md +0 -5
  188. package/front_end/models/greendev/greendev.ts +0 -5
  189. package/front_end/panels/common/Annotation.ts +0 -184
  190. package/front_end/panels/common/AnnotationManager.ts +0 -208
  191. package/front_end/panels/common/annotation.css +0 -40
  192. package/front_end/panels/greendev/GreenDevPanel.css +0 -282
  193. package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
  194. package/front_end/panels/greendev/GreenDevShared.ts +0 -13
  195. package/front_end/panels/greendev/greendev-meta.ts +0 -52
  196. package/front_end/panels/greendev/greendev.ts +0 -9
@@ -5,7 +5,7 @@
5
5
  import * as Platform from '../platform/platform.js';
6
6
  import * as Root from '../root/root.js';
7
7
 
8
- import {Console} from './Console.js';
8
+ import type {Console} from './Console.js';
9
9
  import type {EventDescriptor, EventTargetEvent, GenericEvents} from './EventTarget.js';
10
10
  import {ObjectWrapper} from './Object.js';
11
11
  import {
@@ -30,6 +30,7 @@ export interface SettingsCreationOptions {
30
30
  settingRegistrations: SettingRegistration[];
31
31
  logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
32
32
  runSettingsMigration?: boolean;
33
+ console: Console;
33
34
  }
34
35
 
35
36
  export class Settings {
@@ -45,10 +46,18 @@ export class Settings {
45
46
  #registry = new Map<string, Setting<unknown>>();
46
47
  readonly moduleSettings = new Map<string, Setting<unknown>>();
47
48
  #logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
48
-
49
- constructor(
50
- {syncedStorage, globalStorage, localStorage, settingRegistrations, logSettingAccess, runSettingsMigration}:
51
- SettingsCreationOptions) {
49
+ readonly #console: Console;
50
+
51
+ constructor({
52
+ syncedStorage,
53
+ globalStorage,
54
+ localStorage,
55
+ settingRegistrations,
56
+ logSettingAccess,
57
+ runSettingsMigration,
58
+ console
59
+ }: SettingsCreationOptions) {
60
+ this.#console = console;
52
61
  this.syncedStorage = syncedStorage;
53
62
  this.globalStorage = globalStorage;
54
63
  this.localStorage = localStorage;
@@ -93,10 +102,17 @@ export class Settings {
93
102
  globalStorage: SettingsStorage|null,
94
103
  localStorage: SettingsStorage|null,
95
104
  settingRegistrations: SettingRegistration[]|null,
105
+ console: Console|null,
96
106
  logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>,
97
107
  runSettingsMigration?: boolean,
98
- } = {forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null, settingRegistrations: null}):
99
- Settings {
108
+ } = {
109
+ forceNew: null,
110
+ syncedStorage: null,
111
+ globalStorage: null,
112
+ localStorage: null,
113
+ settingRegistrations: null,
114
+ console: null
115
+ }): Settings {
100
116
  const {
101
117
  forceNew,
102
118
  syncedStorage,
@@ -104,10 +120,11 @@ export class Settings {
104
120
  localStorage,
105
121
  settingRegistrations,
106
122
  logSettingAccess,
107
- runSettingsMigration
123
+ runSettingsMigration,
124
+ console,
108
125
  } = opts;
109
126
  if (!Root.DevToolsContext.globalInstance().has(Settings) || forceNew) {
110
- if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations) {
127
+ if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations || !console) {
111
128
  throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
112
129
  }
113
130
 
@@ -117,7 +134,8 @@ export class Settings {
117
134
  localStorage,
118
135
  settingRegistrations,
119
136
  logSettingAccess,
120
- runSettingsMigration
137
+ runSettingsMigration,
138
+ console,
121
139
  }));
122
140
  }
123
141
 
@@ -195,7 +213,7 @@ export class Settings {
195
213
  const storage = this.storageFromType(storageType);
196
214
  let setting = this.#registry.get(key) as Setting<T>;
197
215
  if (!setting) {
198
- setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#logSettingAccess);
216
+ setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#console, this.#logSettingAccess);
199
217
  this.#registry.set(key, setting);
200
218
  }
201
219
  return setting;
@@ -208,11 +226,9 @@ export class Settings {
208
226
  createRegExpSetting(key: string, defaultValue: string, regexFlags?: string, storageType?: SettingStorageType):
209
227
  RegExpSetting {
210
228
  if (!this.#registry.get(key)) {
211
- this.#registry.set(
212
- key,
213
- new RegExpSetting(
214
- key, defaultValue, this.#eventSupport, this.storageFromType(storageType), regexFlags,
215
- this.#logSettingAccess));
229
+ this.#registry.set(key,
230
+ new RegExpSetting(key, defaultValue, this.#eventSupport, this.storageFromType(storageType),
231
+ this.#console, regexFlags, this.#logSettingAccess));
216
232
  }
217
233
  return this.#registry.get(key) as RegExpSetting;
218
234
  }
@@ -324,8 +340,8 @@ export class SettingsStorage {
324
340
  return Object.keys(this.object);
325
341
  }
326
342
 
327
- dumpSizes(): void {
328
- Console.instance().log('Ten largest settings: ');
343
+ dumpSizes(commonConsole: Console): void {
344
+ commonConsole.log('Ten largest settings: ');
329
345
  // @ts-expect-error __proto__ optimization
330
346
  const sizes: Record<string, number> = {__proto__: null};
331
347
  for (const key in this.object) {
@@ -340,7 +356,7 @@ export class SettingsStorage {
340
356
  keys.sort(comparator);
341
357
 
342
358
  for (let i = 0; i < 10 && i < keys.length; ++i) {
343
- Console.instance().log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]);
359
+ commonConsole.log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]);
344
360
  }
345
361
  }
346
362
  }
@@ -375,12 +391,13 @@ export class Setting<V> {
375
391
  #deprecation: Deprecation|null = null;
376
392
  #loggedInitialAccess = false;
377
393
  #logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
394
+ readonly #console: Console;
378
395
 
379
- constructor(
380
- readonly name: string, readonly defaultValue: V, private readonly eventSupport: ObjectWrapper<GenericEvents>,
381
- readonly storage: SettingsStorage,
382
- logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
396
+ constructor(readonly name: string, readonly defaultValue: V,
397
+ private readonly eventSupport: ObjectWrapper<GenericEvents>, readonly storage: SettingsStorage,
398
+ console: Console, logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
383
399
  storage.register(this.name);
400
+ this.#console = console;
384
401
  this.#logSettingAccess = logSettingAccess;
385
402
  }
386
403
 
@@ -532,7 +549,7 @@ export class Setting<V> {
532
549
  this.printSettingsSavingError(e.message, settingString);
533
550
  }
534
551
  } catch (e) {
535
- Console.instance().error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
552
+ this.#console.error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
536
553
  }
537
554
  this.eventSupport.dispatchEventToListeners(this.name, value);
538
555
  }
@@ -623,8 +640,8 @@ export class Setting<V> {
623
640
  const errorMessage =
624
641
  'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
625
642
  console.error(errorMessage);
626
- Console.instance().error(errorMessage);
627
- this.storage.dumpSizes();
643
+ this.#console.error(errorMessage);
644
+ this.storage.dumpSizes(this.#console);
628
645
  }
629
646
  }
630
647
 
@@ -633,10 +650,10 @@ export class RegExpSetting extends Setting<any> {
633
650
  #regexFlags?: string;
634
651
  #regex?: RegExp|null;
635
652
 
636
- constructor(
637
- name: string, defaultValue: string, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage,
638
- regexFlags?: string, logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
639
- super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, logSettingAccess);
653
+ constructor(name: string, defaultValue: string, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage,
654
+ console: Console, regexFlags?: string,
655
+ logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
656
+ super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, console, logSettingAccess);
640
657
  this.#regexFlags = regexFlags;
641
658
  }
642
659
 
@@ -3,54 +3,22 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
- import * as i18n from '../i18n/i18n.js';
7
6
  import * as Root from '../root/root.js';
8
7
 
9
8
  import {EmulationModel} from './EmulationModel.js';
10
9
  import {type SDKModelObserver, TargetManager} from './TargetManager.js';
11
10
 
12
- const UIStrings = {
13
- /**
14
- * @description Text label for a menu item indicating that no throttling is applied.
15
- */
16
- noThrottling: 'No throttling',
17
- /**
18
- * @description Text label for a menu item indicating that a specific slowdown multiplier is applied.
19
- * @example {2} PH1
20
- */
21
- dSlowdown: '{PH1}× slowdown',
22
- /**
23
- * @description Text label for a menu item indicating an average mobile device.
24
- */
25
- calibratedMidTierMobile: 'Mid-tier mobile',
26
- /**
27
- * @description Text label for a menu item indicating a below-average mobile device.
28
- */
29
- calibratedLowTierMobile: 'Low-tier mobile',
30
- /**
31
- * @description Text label indicating why an option is not available, because the user's device is not fast enough to emulate a device.
32
- */
33
- calibrationErrorDeviceTooWeak: 'Device is not powerful enough',
34
- } as const;
35
- const str_ = i18n.i18n.registerUIStrings('core/sdk/CPUThrottlingManager.ts', UIStrings);
36
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
37
- const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
38
-
39
11
  export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
40
12
  SDKModelObserver<EmulationModel> {
41
13
  readonly #targetManager: TargetManager;
42
- #cpuThrottlingOption: CPUThrottlingOption;
43
- #calibratedThrottlingSetting: Common.Settings.Setting<CalibratedCPUThrottling>;
14
+ #cpuThrottlingRate: number;
44
15
  #hardwareConcurrency?: number;
45
16
  #pendingMainTargetPromise?: (r: number) => void;
46
17
 
47
18
  constructor(settings: Common.Settings.Settings, targetManager: TargetManager) {
48
19
  super();
49
20
  this.#targetManager = targetManager;
50
- this.#cpuThrottlingOption = NoThrottlingOption;
51
- this.#calibratedThrottlingSetting = settings.createSetting<CalibratedCPUThrottling>(
52
- 'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
53
- this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
21
+ this.#cpuThrottlingRate = 1; // No throttling
54
22
  targetManager.observeModels(EmulationModel, this);
55
23
  }
56
24
 
@@ -75,43 +43,19 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
75
43
  }
76
44
 
77
45
  cpuThrottlingRate(): number {
78
- return this.#cpuThrottlingOption.rate();
79
- }
80
-
81
- cpuThrottlingOption(): CPUThrottlingOption {
82
- return this.#cpuThrottlingOption;
83
- }
84
-
85
- #onCalibratedSettingChanged(): void {
86
- // If a calibrated option is selected, need to propagate new rate.
87
- const currentOption = this.#cpuThrottlingOption;
88
- if (!currentOption.calibratedDeviceType) {
89
- return;
90
- }
91
-
92
- const rate = this.#cpuThrottlingOption.rate();
93
- if (rate === 0) {
94
- // This calibrated option is no longer valid.
95
- this.setCPUThrottlingOption(NoThrottlingOption);
96
- return;
97
- }
98
-
99
- for (const emulationModel of this.#targetManager.models(EmulationModel)) {
100
- void emulationModel.setCPUThrottlingRate(rate);
101
- }
102
- this.dispatchEventToListeners(Events.RATE_CHANGED, rate);
46
+ return this.#cpuThrottlingRate;
103
47
  }
104
48
 
105
- setCPUThrottlingOption(option: CPUThrottlingOption): void {
106
- if (option === this.#cpuThrottlingOption) {
49
+ setCPUThrottlingRate(rate: number): void {
50
+ if (rate === this.#cpuThrottlingRate) {
107
51
  return;
108
52
  }
109
53
 
110
- this.#cpuThrottlingOption = option;
54
+ this.#cpuThrottlingRate = rate;
111
55
  for (const emulationModel of this.#targetManager.models(EmulationModel)) {
112
- void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingOption.rate());
56
+ void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
113
57
  }
114
- this.dispatchEventToListeners(Events.RATE_CHANGED, this.#cpuThrottlingOption.rate());
58
+ this.dispatchEventToListeners(Events.RATE_CHANGED, this.#cpuThrottlingRate);
115
59
  }
116
60
 
117
61
  setHardwareConcurrency(concurrency: number): void {
@@ -166,8 +110,8 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
166
110
  }
167
111
 
168
112
  modelAdded(emulationModel: EmulationModel): void {
169
- if (this.#cpuThrottlingOption !== NoThrottlingOption) {
170
- void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingOption.rate());
113
+ if (this.#cpuThrottlingRate !== 1) {
114
+ void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
171
115
  }
172
116
  if (this.#hardwareConcurrency !== undefined) {
173
117
  void emulationModel.setHardwareConcurrency(this.#hardwareConcurrency);
@@ -195,96 +139,3 @@ export interface EventTypes {
195
139
  [Events.RATE_CHANGED]: number;
196
140
  [Events.HARDWARE_CONCURRENCY_CHANGED]: number;
197
141
  }
198
-
199
- export enum CPUThrottlingRates {
200
- NO_THROTTLING = 1,
201
- MID_TIER_MOBILE = 4,
202
- LOW_TIER_MOBILE = 6,
203
- EXTRA_SLOW = 20,
204
-
205
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
206
- MidTierMobile = MID_TIER_MOBILE,
207
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
208
- LowEndMobile = LOW_TIER_MOBILE,
209
- }
210
-
211
- export type CalibratedDeviceType = 'low-tier-mobile'|'mid-tier-mobile';
212
-
213
- export interface CPUThrottlingOption {
214
- title: () => string;
215
- rate: () => number;
216
- calibratedDeviceType?: CalibratedDeviceType;
217
- jslogContext: string;
218
- }
219
-
220
- function makeFixedPresetThrottlingOption(rate: CPUThrottlingRates): CPUThrottlingOption {
221
- return {
222
- title: rate === 1 ? i18nLazyString(UIStrings.noThrottling) : i18nLazyString(UIStrings.dSlowdown, {PH1: rate}),
223
- rate: () => rate,
224
- jslogContext: rate === 1 ? 'cpu-no-throttling' : `cpu-throttled-${rate}`,
225
- };
226
- }
227
-
228
- export const NoThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.NO_THROTTLING);
229
- export const MidTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.MID_TIER_MOBILE);
230
- export const LowTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.LOW_TIER_MOBILE);
231
- export const ExtraSlowThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.EXTRA_SLOW);
232
-
233
- function makeCalibratedThrottlingOption(calibratedDeviceType: CalibratedDeviceType): CPUThrottlingOption {
234
- const getSettingValue = (): number|CalibrationError|null => {
235
- const setting = Common.Settings.Settings.instance().createSetting<CalibratedCPUThrottling>(
236
- 'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
237
- const value = setting.get();
238
- if (calibratedDeviceType === 'low-tier-mobile') {
239
- return value.low ?? null;
240
- }
241
- if (calibratedDeviceType === 'mid-tier-mobile') {
242
- return value.mid ?? null;
243
- }
244
- return null;
245
- };
246
-
247
- return {
248
- title(): string {
249
- const typeString = calibratedDeviceType === 'low-tier-mobile' ? i18nString(UIStrings.calibratedLowTierMobile) :
250
- i18nString(UIStrings.calibratedMidTierMobile);
251
-
252
- const value = getSettingValue();
253
- if (typeof value === 'number') {
254
- return `${typeString} – ${value.toFixed(1)}×`;
255
- }
256
-
257
- return typeString;
258
- },
259
- rate(): number {
260
- const value = getSettingValue();
261
- if (typeof value === 'number') {
262
- return value;
263
- }
264
- return 0;
265
- },
266
- calibratedDeviceType,
267
- jslogContext: `cpu-throttled-calibrated-${calibratedDeviceType}`,
268
- };
269
- }
270
-
271
- export const CalibratedLowTierMobileThrottlingOption = makeCalibratedThrottlingOption('low-tier-mobile');
272
- export const CalibratedMidTierMobileThrottlingOption = makeCalibratedThrottlingOption('mid-tier-mobile');
273
-
274
- export interface CalibratedCPUThrottling {
275
- /** Either the CPU multiplier, or an error code for why it could not be determined. */
276
- low?: number|CalibrationError;
277
- mid?: number|CalibrationError;
278
- }
279
-
280
- export enum CalibrationError {
281
- DEVICE_TOO_WEAK = 'DEVICE_TOO_WEAK',
282
- }
283
-
284
- export function calibrationErrorToString(error: CalibrationError): string {
285
- if (error === CalibrationError.DEVICE_TOO_WEAK) {
286
- return i18nString(UIStrings.calibrationErrorDeviceTooWeak);
287
- }
288
-
289
- return error;
290
- }
@@ -71,6 +71,7 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/ConsoleModel.ts', UIStrings);
71
71
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
72
72
 
73
73
  export class ConsoleModel extends SDKModel<EventTypes> {
74
+ readonly #console: Common.Console.Console;
74
75
  #messages: ConsoleMessage[] = [];
75
76
  readonly #messagesByTimestamp = new Platform.MapUtilities.Multimap<number, ConsoleMessage>();
76
77
  readonly #messageByExceptionId = new Map<RuntimeModel, Map<number, ConsoleMessage>>();
@@ -82,6 +83,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
82
83
 
83
84
  constructor(target: Target) {
84
85
  super(target);
86
+ this.#console = target.targetManager().getConsole();
85
87
 
86
88
  const resourceTreeModel = target.model(ResourceTreeModel);
87
89
  if (!resourceTreeModel || resourceTreeModel.cachedResourcesLoaded()) {
@@ -159,7 +161,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
159
161
  if ('error' in result) {
160
162
  return;
161
163
  }
162
- await Common.Console.Console.instance().showPromise();
164
+ await this.#console.showPromise();
163
165
  this.dispatchEventToListeners(
164
166
  Events.CommandEvaluated,
165
167
  {result: result.object, commandMessage: originatingMessage, exceptionDetails: result.exceptionDetails});
@@ -297,9 +299,9 @@ export class ConsoleModel extends SDKModel<EventTypes> {
297
299
  if (settings.moduleSetting('preserve-console-log').get()) {
298
300
  const {frame} = event.data;
299
301
  if (frame.backForwardCacheDetails.restoredFromCache) {
300
- Common.Console.Console.instance().log(i18nString(UIStrings.bfcacheNavigation, {PH1: frame.url}));
302
+ this.#console.log(i18nString(UIStrings.bfcacheNavigation, {PH1: frame.url}));
301
303
  } else {
302
- Common.Console.Console.instance().log(i18nString(UIStrings.navigatedToS, {PH1: frame.url}));
304
+ this.#console.log(i18nString(UIStrings.navigatedToS, {PH1: frame.url}));
303
305
  }
304
306
  }
305
307
  }
@@ -418,6 +420,14 @@ export class ConsoleModel extends SDKModel<EventTypes> {
418
420
 
419
421
  async saveToTempVariable(currentExecutionContext: ExecutionContext|null, remoteObject: RemoteObject|null):
420
422
  Promise<void> {
423
+ const failedToSave = (result: RemoteObject|null): void => {
424
+ let message = i18nString(UIStrings.failedToSaveToTempVariable);
425
+ if (result) {
426
+ message = (message + ' ' + result.description as Common.UIString.LocalizedString);
427
+ }
428
+ this.#console.error(message);
429
+ };
430
+
421
431
  if (!remoteObject || !currentExecutionContext) {
422
432
  failedToSave(null);
423
433
  return;
@@ -456,14 +466,6 @@ export class ConsoleModel extends SDKModel<EventTypes> {
456
466
  this[name] = value;
457
467
  return name;
458
468
  }
459
-
460
- function failedToSave(result: RemoteObject|null): void {
461
- let message = i18nString(UIStrings.failedToSaveToTempVariable);
462
- if (result) {
463
- message = (message + ' ' + result.description as Common.UIString.LocalizedString);
464
- }
465
- Common.Console.Console.instance().error(message);
466
- }
467
469
  }
468
470
  }
469
471
 
@@ -6,6 +6,7 @@ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
6
6
  import * as Protocol from '../../generated/protocol.js';
7
7
  import type * as Common from '../common/common.js';
8
8
  import * as Platform from '../platform/platform.js';
9
+ import * as Root from '../root/root.js';
9
10
 
10
11
  import {CategorizedBreakpoint, Category} from './CategorizedBreakpoint.js';
11
12
  import type {EventListenerPausedDetailsAuxData, Location} from './DebuggerModel.js';
@@ -528,8 +529,6 @@ export class DOMEventListenerBreakpoint extends CategorizedBreakpoint {
528
529
  static readonly listener = 'listener:';
529
530
  }
530
531
 
531
- let domDebuggerManagerInstance: DOMDebuggerManager;
532
-
533
532
  export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
534
533
  readonly #xhrBreakpointsSetting: Common.Settings.Setting<Array<{url: string, enabled: boolean}>>;
535
534
  readonly #xhrBreakpoints = new Map<string, boolean>();
@@ -671,11 +670,18 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
671
670
  targetManager?: TargetManager,
672
671
  } = {forceNew: null}): DOMDebuggerManager {
673
672
  const {forceNew, targetManager} = opts;
674
- if (!domDebuggerManagerInstance || forceNew) {
675
- domDebuggerManagerInstance = new DOMDebuggerManager(targetManager);
673
+ if (!Root.DevToolsContext.globalInstance().has(DOMDebuggerManager) || forceNew) {
674
+ Root.DevToolsContext.globalInstance().set(
675
+ DOMDebuggerManager,
676
+ new DOMDebuggerManager(targetManager ?? TargetManager.instance()),
677
+ );
676
678
  }
677
679
 
678
- return domDebuggerManagerInstance;
680
+ return Root.DevToolsContext.globalInstance().get(DOMDebuggerManager);
681
+ }
682
+
683
+ static removeInstance(): void {
684
+ Root.DevToolsContext.globalInstance().delete(DOMDebuggerManager);
679
685
  }
680
686
 
681
687
  cspViolationBreakpoints(): CSPViolationBreakpoint[] {
@@ -2,6 +2,7 @@
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
+ import * as Root from '../../core/root/root.js';
5
6
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
6
7
 
7
8
  import {CategorizedBreakpoint, Category} from './CategorizedBreakpoint.js';
@@ -83,8 +84,6 @@ class EventListenerBreakpoint extends CategorizedBreakpoint {
83
84
  static readonly instrumentationPrefix = 'instrumentation:';
84
85
  }
85
86
 
86
- let eventBreakpointManagerInstance: EventBreakpointsManager;
87
-
88
87
  export class EventBreakpointsManager implements SDKModelObserver<EventBreakpointsModel> {
89
88
  readonly #eventListenerBreakpoints: EventListenerBreakpoint[] = [];
90
89
  readonly #targetManager: TargetManager;
@@ -151,11 +150,16 @@ export class EventBreakpointsManager implements SDKModelObserver<EventBreakpoint
151
150
  targetManager?: TargetManager,
152
151
  } = {forceNew: null}): EventBreakpointsManager {
153
152
  const {forceNew, targetManager} = opts;
154
- if (!eventBreakpointManagerInstance || forceNew) {
155
- eventBreakpointManagerInstance = new EventBreakpointsManager(targetManager);
153
+ if (!Root.DevToolsContext.globalInstance().has(EventBreakpointsManager) || forceNew) {
154
+ Root.DevToolsContext.globalInstance().set(EventBreakpointsManager,
155
+ new EventBreakpointsManager(targetManager ?? TargetManager.instance()));
156
156
  }
157
157
 
158
- return eventBreakpointManagerInstance;
158
+ return Root.DevToolsContext.globalInstance().get(EventBreakpointsManager);
159
+ }
160
+
161
+ static removeInstance(): void {
162
+ Root.DevToolsContext.globalInstance().delete(EventBreakpointsManager);
159
163
  }
160
164
 
161
165
  private createInstrumentationBreakpoints(category: Category, instrumentationNames: InstrumentationNames[]): void {
@@ -3,13 +3,12 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../common/common.js';
6
+ import * as Root from '../root/root.js';
6
7
 
7
8
  import type {HeapProfilerModel} from './HeapProfilerModel.js';
8
9
  import {RuntimeModel} from './RuntimeModel.js';
9
10
  import {type SDKModelObserver, TargetManager} from './TargetManager.js';
10
11
 
11
- let isolateManagerInstance: IsolateManager;
12
-
13
12
  export class IsolateManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
14
13
  SDKModelObserver<RuntimeModel> {
15
14
  readonly #isolates = new Map<string, Isolate>();
@@ -28,15 +27,16 @@ export class IsolateManager extends Common.ObjectWrapper.ObjectWrapper<EventType
28
27
  this.#targetManager.observeModels(RuntimeModel, this);
29
28
  }
30
29
 
31
- static instance({forceNew, targetManager}: {
30
+ static instance(opts: {
32
31
  forceNew: boolean,
33
32
  targetManager?: TargetManager,
34
33
  } = {forceNew: false}): IsolateManager {
35
- if (!isolateManagerInstance || forceNew) {
36
- isolateManagerInstance = new IsolateManager(targetManager);
34
+ const {forceNew, targetManager} = opts;
35
+ if (!Root.DevToolsContext.globalInstance().has(IsolateManager) || forceNew) {
36
+ Root.DevToolsContext.globalInstance().set(IsolateManager, new IsolateManager(targetManager));
37
37
  }
38
38
 
39
- return isolateManagerInstance;
39
+ return Root.DevToolsContext.globalInstance().get(IsolateManager);
40
40
  }
41
41
 
42
42
  observeIsolates(observer: Observer): void {
@@ -9,7 +9,7 @@ import * as i18n from '../i18n/i18n.js';
9
9
  import * as Platform from '../platform/platform.js';
10
10
 
11
11
  import {type DeferredDOMNode, DOMModel, type DOMNode} from './DOMModel.js';
12
- import {FrameManager} from './FrameManager.js';
12
+ import type {FrameManager} from './FrameManager.js';
13
13
  import {Events as NetworkManagerEvents, NetworkManager, type RequestUpdateDroppedEventData} from './NetworkManager.js';
14
14
  import type {NetworkRequest} from './NetworkRequest.js';
15
15
  import {Resource} from './Resource.js';
@@ -25,6 +25,7 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
25
25
  readonly storageAgent: ProtocolProxyApi.StorageApi;
26
26
  readonly #securityOriginManager: SecurityOriginManager;
27
27
  readonly #storageKeyManager: StorageKeyManager;
28
+ readonly #frameManager: FrameManager;
28
29
  readonly framesInternal = new Map<string, ResourceTreeFrame>();
29
30
  #cachedResourcesProcessed = false;
30
31
  #pendingReloadOptions: {
@@ -38,6 +39,7 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
38
39
 
39
40
  constructor(target: Target) {
40
41
  super(target);
42
+ this.#frameManager = target.targetManager().getFrameManager();
41
43
 
42
44
  const networkManager = target.model(NetworkManager);
43
45
  if (networkManager) {
@@ -216,8 +218,8 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
216
218
  void this.updateStorageKeys();
217
219
 
218
220
  if (frame.backForwardCacheDetails.restoredFromCache) {
219
- FrameManager.instance().modelRemoved(this);
220
- FrameManager.instance().modelAdded(this);
221
+ this.#frameManager.modelRemoved(this);
222
+ this.#frameManager.modelAdded(this);
221
223
  void this.#buildResourceTree();
222
224
  }
223
225
  }
@@ -10,6 +10,7 @@ import {assertNotNullOrUndefined} from '../platform/platform.js';
10
10
  import type * as ProtocolClient from '../protocol_client/protocol_client.js';
11
11
  import * as Root from '../root/root.js';
12
12
 
13
+ import {FrameManager} from './FrameManager.js';
13
14
  import {type RegistrationInfo, SDKModel, type SDKModelConstructor} from './SDKModel.js';
14
15
  import {Target, Type as TargetType} from './Target.js';
15
16
 
@@ -31,6 +32,22 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
31
32
  return this.context.get(Common.Settings.Settings);
32
33
  }
33
34
 
35
+ // TODO(crbug.com/493763857): Remove fallback once all unit tests use TestUniverse.
36
+ getConsole(): Common.Console.Console {
37
+ if ('has' in this.context && typeof this.context.has === 'function' && !this.context.has(Common.Console.Console)) {
38
+ return Common.Console.Console.instance();
39
+ }
40
+ return this.context.get(Common.Console.Console);
41
+ }
42
+
43
+ // TODO(crbug.com/493763857): Remove fallback once all unit tests use TestUniverse.
44
+ getFrameManager(): FrameManager {
45
+ if ('has' in this.context && typeof this.context.has === 'function' && !this.context.has(FrameManager)) {
46
+ return FrameManager.instance();
47
+ }
48
+ return this.context.get(FrameManager);
49
+ }
50
+
34
51
  /* eslint-disable @typescript-eslint/no-explicit-any */
35
52
  #modelListeners: Platform.MapUtilities.Multimap<string|symbol|number, {
36
53
  modelClass: SDKModelConstructor,
@@ -5,7 +5,6 @@ import '../shell/shell.js';
5
5
  import '../../panels/css_overview/css_overview-meta.js';
6
6
  import '../../panels/elements/elements-meta.js';
7
7
  import '../../panels/browser_debugger/browser_debugger-meta.js';
8
- import '../../panels/greendev/greendev-meta.js';
9
8
  import '../../panels/network/network-meta.js';
10
9
  import '../../panels/security/security-meta.js';
11
10
  import '../../panels/emulation/emulation-meta.js';