chrome-devtools-frontend 1.0.1542501 → 1.0.1543472

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 (74) hide show
  1. package/AUTHORS +1 -0
  2. package/front_end/core/common/Gzip.ts +4 -4
  3. package/front_end/core/common/common.ts +0 -2
  4. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  5. package/front_end/core/root/DevToolsContext.ts +60 -0
  6. package/front_end/core/root/Runtime.ts +0 -10
  7. package/front_end/core/root/root.ts +6 -1
  8. package/front_end/core/sdk/NetworkManager.ts +0 -7
  9. package/front_end/core/sdk/NetworkRequest.ts +0 -10
  10. package/front_end/core/sdk/TargetManager.ts +5 -6
  11. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -13
  12. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +5 -5
  13. package/front_end/entrypoints/main/MainImpl.ts +3 -5
  14. package/front_end/entrypoints/main/main-meta.ts +1 -5
  15. package/front_end/foundation/Universe.ts +13 -1
  16. package/front_end/generated/Deprecation.ts +0 -14
  17. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  18. package/front_end/generated/protocol.ts +0 -1
  19. package/front_end/models/ai_assistance/BuiltInAi.ts +13 -7
  20. package/front_end/models/bindings/CompilerScriptMapping.ts +3 -2
  21. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +14 -9
  22. package/front_end/models/trace/handlers/SamplesHandler.ts +64 -6
  23. package/front_end/models/trace/types/TraceEvents.ts +16 -0
  24. package/front_end/models/workspace/IgnoreListManager.ts +10 -9
  25. package/front_end/models/workspace/WorkspaceImpl.ts +5 -10
  26. package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -1
  27. package/front_end/panels/application/OpenedWindowDetailsView.ts +0 -2
  28. package/front_end/panels/application/ServiceWorkersView.ts +0 -2
  29. package/front_end/panels/application/StorageView.ts +0 -1
  30. package/front_end/panels/application/components/BackForwardCacheView.ts +12 -9
  31. package/front_end/panels/application/components/FrameDetailsView.ts +468 -447
  32. package/front_end/panels/console/ConsolePrompt.ts +1 -1
  33. package/front_end/panels/console/ConsoleView.ts +12 -7
  34. package/front_end/panels/console/ConsoleViewMessage.ts +19 -9
  35. package/front_end/panels/explain/components/ConsoleInsight.ts +314 -310
  36. package/front_end/panels/network/NetworkDataGridNode.ts +0 -7
  37. package/front_end/panels/network/NetworkLogView.ts +1 -45
  38. package/front_end/panels/security/SecurityPanel.ts +0 -2
  39. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -16
  40. package/front_end/panels/security/security.ts +0 -2
  41. package/front_end/panels/settings/SettingsScreen.ts +3 -6
  42. package/front_end/panels/settings/components/SyncSection.ts +218 -226
  43. package/front_end/panels/settings/components/syncSection.css +81 -80
  44. package/front_end/panels/sources/DebuggerPlugin.ts +3 -1
  45. package/front_end/panels/sources/ResourceOriginPlugin.ts +7 -3
  46. package/front_end/panels/timeline/TimelinePanel.ts +0 -21
  47. package/front_end/third_party/chromium/README.chromium +1 -1
  48. package/front_end/ui/components/docs/component_docs.ts +0 -4
  49. package/front_end/ui/components/expandable_list/ExpandableList.docs.ts +30 -0
  50. package/front_end/ui/components/report_view/ReportView.ts +4 -1
  51. package/front_end/ui/legacy/ReportView.ts +0 -5
  52. package/front_end/ui/legacy/TextPrompt.ts +65 -19
  53. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +8 -4
  54. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +90 -92
  55. package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +114 -184
  56. package/front_end/ui/legacy/components/utils/Linkifier.ts +46 -2
  57. package/front_end/ui/{components/docs/theme_colors/basic.ts → legacy/theme_support/ThemeColors.docs.ts} +33 -23
  58. package/package.json +1 -1
  59. package/front_end/core/common/QueryParamHandler.ts +0 -7
  60. package/front_end/panels/security/IPProtectionTreeElement.ts +0 -21
  61. package/front_end/panels/security/IPProtectionView.ts +0 -287
  62. package/front_end/ui/components/docs/expandable_list/basic.html +0 -24
  63. package/front_end/ui/components/docs/expandable_list/basic.ts +0 -30
  64. package/front_end/ui/components/docs/input/basic.html +0 -31
  65. package/front_end/ui/components/docs/input/basic.ts +0 -12
  66. package/front_end/ui/components/docs/report/basic.html +0 -27
  67. package/front_end/ui/components/docs/report/basic.ts +0 -48
  68. package/front_end/ui/components/docs/text_prompt/basic.html +0 -35
  69. package/front_end/ui/components/docs/text_prompt/basic.ts +0 -19
  70. package/front_end/ui/components/docs/theme_colors/basic.html +0 -56
  71. package/front_end/ui/components/docs/toggle_dark_mode.ts +0 -36
  72. package/front_end/ui/components/docs/toggle_fonts.ts +0 -74
  73. package/front_end/ui/components/docs/user_agent_client_hints/basic.html +0 -25
  74. package/front_end/ui/components/docs/user_agent_client_hints/basic.ts +0 -26
package/AUTHORS CHANGED
@@ -68,6 +68,7 @@ Michael Rienstra <mrienstra@gmail.com>
68
68
  Mostafa Aboalkasim <mostafa.aboalkasim.offical@gmail.com>
69
69
  Muhammad Mahad <mahadtxt@gmail.com>
70
70
  Naoto Ono <onoto1998@gmail.com>
71
+ Nourhan Hasan <nourhan.m.hasan@gmail.com>
71
72
  Paras Awasthi <awasthiparas6@gmail.com>
72
73
  Paul Fisher <paul@pfish.zone>
73
74
  Peng Zhou <zhoupeng.1996@bytedance.com>
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Quickly determine if gzipped, by seeing if the first 3 bytes of the file header match the gzip signature
7
7
  */
8
- export function isGzip(ab: ArrayBuffer): boolean {
8
+ export function isGzip(ab: ArrayBufferLike): boolean {
9
9
  const buf = new Uint8Array(ab);
10
10
  if (!buf || buf.length < 3) {
11
11
  return false;
@@ -15,7 +15,7 @@ export function isGzip(ab: ArrayBuffer): boolean {
15
15
  }
16
16
 
17
17
  /** Decode a gzipped _or_ plain text ArrayBuffer to a decoded string */
18
- export async function arrayBufferToString(ab: ArrayBuffer): Promise<string> {
18
+ export async function arrayBufferToString(ab: ArrayBufferLike): Promise<string> {
19
19
  if (isGzip(ab)) {
20
20
  return await decompress(ab);
21
21
  }
@@ -37,7 +37,7 @@ export async function fileToString(file: File): Promise<string> {
37
37
  * Decompress a gzipped ArrayBuffer to a string.
38
38
  * Consider using `arrayBufferToString` instead, which can handle both gzipped and plain text buffers.
39
39
  */
40
- export async function decompress(gzippedBuffer: ArrayBuffer): Promise<string> {
40
+ export async function decompress(gzippedBuffer: ArrayBufferLike): Promise<string> {
41
41
  const buffer = await gzipCodec(gzippedBuffer, new DecompressionStream('gzip'));
42
42
  const str = new TextDecoder('utf-8').decode(buffer);
43
43
  return str;
@@ -50,7 +50,7 @@ export async function compress(str: string): Promise<ArrayBuffer> {
50
50
 
51
51
  /** Private coder/decoder **/
52
52
  async function gzipCodec(
53
- buffer: Uint8Array<ArrayBufferLike>|ArrayBuffer,
53
+ buffer: Uint8Array<ArrayBufferLike>|ArrayBufferLike,
54
54
  codecStream: CompressionStream|DecompressionStream): Promise<ArrayBuffer> {
55
55
  const readable = new ReadableStream({
56
56
  start(controller) {
@@ -21,7 +21,6 @@ import * as Mutex from './Mutex.js';
21
21
  import * as ObjectWrapper from './Object.js';
22
22
  import * as ParsedURL from './ParsedURL.js';
23
23
  import * as Progress from './Progress.js';
24
- import * as QueryParamHandler from './QueryParamHandler.js';
25
24
  import * as ResolverBase from './ResolverBase.js';
26
25
  import * as ResourceType from './ResourceType.js';
27
26
  import * as ReturnToPanel from './ReturnToPanel.js';
@@ -63,7 +62,6 @@ export {
63
62
  ObjectWrapper,
64
63
  ParsedURL,
65
64
  Progress,
66
- QueryParamHandler,
67
65
  ResolverBase,
68
66
  ResourceType,
69
67
  ReturnToPanel,
@@ -395,9 +395,6 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
395
395
  thirdPartyCookieHeuristicsEnabled: true,
396
396
  managedBlockThirdPartyCookies: 'Unset',
397
397
  },
398
- devToolsIpProtectionPanelInDevTools: {
399
- enabled: false,
400
- },
401
398
  devToolsFlexibleLayout: {
402
399
  verticalDrawerEnabled: true,
403
400
  },
@@ -0,0 +1,60 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ export type ConstructorT<T> = new (...args: any[]) => T;
6
+
7
+ /**
8
+ * Container for singletons scoped to a single DevTools universe.
9
+ */
10
+ export class DevToolsContext {
11
+ readonly #instances = new Map<ConstructorT<unknown>, unknown>();
12
+
13
+ get<T>(ctor: ConstructorT<T>): T {
14
+ const instance = this.#instances.get(ctor) as T | undefined;
15
+ if (!instance) {
16
+ throw new Error(`No instance for ${ctor.name}. Ensure the bootstrapper creates it.`);
17
+ }
18
+ return instance;
19
+ }
20
+
21
+ /** @deprecated Should only be used by existing `instance` accessors. */
22
+ has<T>(ctor: ConstructorT<T>): boolean {
23
+ return this.#instances.has(ctor);
24
+ }
25
+
26
+ /**
27
+ * @deprecated Should only be used by existing `instance` accessors and the bootstrapper.
28
+ * Exists on the public interface only for migration purposes for now.
29
+ */
30
+ set<T>(ctor: ConstructorT<T>, instance: T): void {
31
+ // TODO(crbug.com/458180550): We need to throw here if an instance was already set!
32
+ this.#instances.set(ctor, instance);
33
+ }
34
+
35
+ /** @deprecated Should only be used by existing `removeInstance` static methods. */
36
+ delete<T>(ctor: ConstructorT<T>): void {
37
+ this.#instances.delete(ctor);
38
+ }
39
+ }
40
+
41
+ let gInstance: DevToolsContext|null = null;
42
+
43
+ /**
44
+ * @deprecated Exists to migrate instance() methods.
45
+ */
46
+ export function globalInstance(): DevToolsContext {
47
+ if (!gInstance) {
48
+ // TODO(crbug.com/458180550): This should really throw to prevent side-effects and globals
49
+ // from leaking all over the place.
50
+ gInstance = new DevToolsContext();
51
+ }
52
+ return gInstance;
53
+ }
54
+
55
+ /**
56
+ * @deprecated Should only be called by test setup and MainImpl
57
+ */
58
+ export function setGlobalInstance(context: DevToolsContext|null): void {
59
+ gInstance = context;
60
+ }
@@ -465,10 +465,6 @@ export interface HostConfigThirdPartyCookieControls {
465
465
  managedBlockThirdPartyCookies: string|boolean;
466
466
  }
467
467
 
468
- export interface HostConfigIPProtection {
469
- enabled: boolean;
470
- }
471
-
472
468
  interface AiGeneratedTimelineLabels {
473
469
  enabled: boolean;
474
470
  }
@@ -482,10 +478,6 @@ interface AiSubmenuPrompts {
482
478
  featureName?: string;
483
479
  }
484
480
 
485
- interface IpProtectionInDevTools {
486
- enabled: boolean;
487
- }
488
-
489
481
  interface AiDebugWithAi {
490
482
  enabled: boolean;
491
483
  featureName?: string;
@@ -568,7 +560,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
568
560
  devToolsWellKnown: HostConfigWellKnown,
569
561
  devToolsPrivacyUI: HostConfigPrivacyUI,
570
562
  devToolsIndividualRequestThrottling: DevToolsIndividualRequestThrottling,
571
- devToolsIpProtectionPanelInDevTools: HostConfigIPProtection,
572
563
  /**
573
564
  * OffTheRecord here indicates that the user's profile is either incognito,
574
565
  * or guest mode, rather than a "normal" profile.
@@ -580,7 +571,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
580
571
  devToolsAiGeneratedTimelineLabels: AiGeneratedTimelineLabels,
581
572
  devToolsAllowPopoverForcing: AllowPopoverForcing,
582
573
  devToolsAiSubmenuPrompts: AiSubmenuPrompts,
583
- devToolsIpProtectionInDevTools: IpProtectionInDevTools,
584
574
  devToolsGlobalAiButton: GlobalAiButton,
585
575
  devToolsGdpProfiles: GdpProfiles,
586
576
  devToolsGdpProfilesAvailability: GdpProfilesAvailability,
@@ -1,6 +1,11 @@
1
1
  // Copyright 2020 The Chromium Authors
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
+
5
+ import * as DevToolsContext from './DevToolsContext.js';
4
6
  import * as Runtime from './Runtime.js';
5
7
 
6
- export {Runtime};
8
+ export {
9
+ DevToolsContext,
10
+ Runtime,
11
+ };
@@ -689,13 +689,6 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
689
689
  networkRequest.setSecurityDetails(response.securityDetails);
690
690
  }
691
691
 
692
- // TODO(crbug.com/425645896): Remove this guard once IP Protection is fully launched.
693
- if (Root.Runtime.hostConfig.devToolsIpProtectionInDevTools?.enabled) {
694
- if (response.isIpProtectionUsed) {
695
- networkRequest.setIsIpProtectionUsed(response.isIpProtectionUsed);
696
- }
697
- }
698
-
699
692
  const newResourceType = Common.ResourceType.ResourceType.fromMimeTypeOverride(networkRequest.mimeType);
700
693
  if (newResourceType) {
701
694
  networkRequest.setResourceType(newResourceType);
@@ -317,7 +317,6 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
317
317
  responseReceivedPromiseResolve?: () => void;
318
318
  directSocketInfo?: DirectSocketInfo;
319
319
  readonly #directSocketChunks: DirectSocketChunk[] = [];
320
- #isIpProtectionUsed: boolean;
321
320
  #isAdRelated: boolean;
322
321
  #appliedNetworkConditionsId?: string;
323
322
 
@@ -341,7 +340,6 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
341
340
  this.#loaderId = loaderId;
342
341
  this.#initiator = initiator;
343
342
  this.#hasUserGesture = hasUserGesture;
344
- this.#isIpProtectionUsed = false;
345
343
  this.#isAdRelated = false;
346
344
  }
347
345
 
@@ -1832,14 +1830,6 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
1832
1830
  return this.#isSameSite;
1833
1831
  }
1834
1832
 
1835
- setIsIpProtectionUsed(isIpProtectionUsed: boolean): void {
1836
- this.#isIpProtectionUsed = isIpProtectionUsed;
1837
- }
1838
-
1839
- isIpProtectionUsed(): boolean|null {
1840
- return this.#isIpProtectionUsed;
1841
- }
1842
-
1843
1833
  setIsAdRelated(isAdRelated: boolean): void {
1844
1834
  this.#isAdRelated = isAdRelated;
1845
1835
  }
@@ -13,7 +13,6 @@ import * as Root from '../root/root.js';
13
13
  import {SDKModel} from './SDKModel.js';
14
14
  import {Target, Type as TargetType} from './Target.js';
15
15
 
16
- let targetManagerInstance: TargetManager|undefined;
17
16
  type ModelClass<T = SDKModel> = new (arg1: Target) => T;
18
17
 
19
18
  export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
@@ -35,7 +34,7 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
35
34
  #defaultScopeSet: boolean;
36
35
  readonly #scopeChangeListeners: Set<() => void>;
37
36
 
38
- private constructor() {
37
+ constructor() {
39
38
  super();
40
39
  this.#targets = new Set();
41
40
  this.#observers = new Set();
@@ -52,15 +51,15 @@ export class TargetManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
52
51
  static instance({forceNew}: {
53
52
  forceNew: boolean,
54
53
  } = {forceNew: false}): TargetManager {
55
- if (!targetManagerInstance || forceNew) {
56
- targetManagerInstance = new TargetManager();
54
+ if (!Root.DevToolsContext.globalInstance().has(TargetManager) || forceNew) {
55
+ Root.DevToolsContext.globalInstance().set(TargetManager, new TargetManager());
57
56
  }
58
57
 
59
- return targetManagerInstance;
58
+ return Root.DevToolsContext.globalInstance().get(TargetManager);
60
59
  }
61
60
 
62
61
  static removeInstance(): void {
63
- targetManagerInstance = undefined;
62
+ Root.DevToolsContext.globalInstance().delete(TargetManager);
64
63
  }
65
64
 
66
65
  onInspectedURLChange(target: Target): void {
@@ -46,20 +46,8 @@ const UIStrings = {
46
46
  } as const;
47
47
  const str_ = i18n.i18n.registerUIStrings('entrypoints/inspector_main/InspectorMain.ts', UIStrings);
48
48
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
49
- let inspectorMainImplInstance: InspectorMainImpl;
50
49
 
51
50
  export class InspectorMainImpl implements Common.Runnable.Runnable {
52
- static instance(opts: {
53
- forceNew: boolean|null,
54
- } = {forceNew: null}): InspectorMainImpl {
55
- const {forceNew} = opts;
56
- if (!inspectorMainImplInstance || forceNew) {
57
- inspectorMainImplInstance = new InspectorMainImpl();
58
- }
59
-
60
- return inspectorMainImplInstance;
61
- }
62
-
63
51
  async run(): Promise<void> {
64
52
  let firstCall = true;
65
53
  await SDK.Connections.initMainConnection(async () => {
@@ -162,7 +150,7 @@ export class InspectorMainImpl implements Common.Runnable.Runnable {
162
150
  }
163
151
  }
164
152
 
165
- Common.Runnable.registerEarlyInitializationRunnable(InspectorMainImpl.instance);
153
+ Common.Runnable.registerEarlyInitializationRunnable(() => new InspectorMainImpl());
166
154
 
167
155
  export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegate {
168
156
  handleAction(_context: UI.Context.Context, actionId: string): boolean {
@@ -66,13 +66,13 @@ const UIStrings = {
66
66
  'Highlights elements (teal) that can slow down scrolling, including touch & wheel event handlers and other main-thread scrolling situations.',
67
67
  /**
68
68
  * @description The name of a checkbox setting in the Rendering tool. This setting highlights the
69
- * rendering frames for ads that are found on the page.
69
+ * rendering elements for ads that are found on the page.
70
70
  */
71
- highlightAdFrames: 'Highlight ad frames',
71
+ highlightAds: 'Highlight ads',
72
72
  /**
73
- * @description Explanation text for the 'Highlight ad frames' setting in the Rendering tool.
73
+ * @description Explanation text for the 'Highlight ads' setting in the Rendering tool.
74
74
  */
75
- highlightsFramesRedDetectedToBe: 'Highlights frames (red) detected to be ads.',
75
+ highlightsElementsRedDetectedToBe: 'Highlights elements (red) detected to be ads.',
76
76
  /**
77
77
  * @description The name of a checkbox setting in the Rendering tool. This setting prevents the
78
78
  * webpage from loading 'local' fonts. Local fonts are fonts that are installed on the user's
@@ -207,7 +207,7 @@ export class RenderingOptionsView extends UI.Widget.VBox {
207
207
  i18nString(UIStrings.scrollingPerformanceIssues), i18nString(UIStrings.highlightsElementsTealThatCan),
208
208
  Common.Settings.Settings.instance().moduleSetting('show-scroll-bottleneck-rects'));
209
209
  this.#appendCheckbox(
210
- i18nString(UIStrings.highlightAdFrames), i18nString(UIStrings.highlightsFramesRedDetectedToBe),
210
+ i18nString(UIStrings.highlightAds), i18nString(UIStrings.highlightsElementsRedDetectedToBe),
211
211
  Common.Settings.Settings.instance().moduleSetting('show-ad-highlights'));
212
212
  this.#appendCheckbox(
213
213
  i18nString(UIStrings.disableLocalFonts), i18nString(UIStrings.disablesLocalSourcesInFontface),
@@ -175,7 +175,8 @@ export class MainImpl {
175
175
  runSettingsMigration: !Host.InspectorFrontendHost.isUnderTest(),
176
176
  },
177
177
  };
178
- new Foundation.Universe.Universe(creationOptions);
178
+ const universe = new Foundation.Universe.Universe(creationOptions);
179
+ Root.DevToolsContext.setGlobalInstance(universe.context);
179
180
 
180
181
  await this.requestAndRegisterLocaleData();
181
182
 
@@ -445,7 +446,6 @@ export class MainImpl {
445
446
  SDK.TargetManager.Events.SUSPEND_STATE_CHANGED, this.#onSuspendStateChanged.bind(this));
446
447
 
447
448
  Workspace.FileManager.FileManager.instance({forceNew: true});
448
- Workspace.Workspace.WorkspaceImpl.instance();
449
449
 
450
450
  Bindings.NetworkProject.NetworkProjectManager.instance();
451
451
  const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(
@@ -458,14 +458,12 @@ export class MainImpl {
458
458
  resourceMapping,
459
459
  targetManager,
460
460
  });
461
- Workspace.IgnoreListManager.IgnoreListManager.instance({
462
- forceNew: true,
463
- });
464
461
  Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({
465
462
  forceNew: true,
466
463
  resourceMapping,
467
464
  targetManager,
468
465
  ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager.instance(),
466
+ workspace: Workspace.Workspace.WorkspaceImpl.instance(),
469
467
  });
470
468
  targetManager.setScopeTarget(targetManager.primaryPageTarget());
471
469
  UI.Context.Context.instance().addFlavorChangeListener(SDK.Target.Target, ({data}) => {
@@ -910,13 +910,9 @@ UI.Toolbar.registerToolbarItem({
910
910
  condition(config) {
911
911
  const isFlagEnabled = config?.devToolsGlobalAiButton?.enabled;
912
912
 
913
- const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance();
914
- const isLocaleRestricted = !devtoolsLocale.locale.startsWith('en-');
915
-
916
913
  const isGeoRestricted = config?.aidaAvailability?.blockedByGeo === true;
917
914
  const isPolicyRestricted = config?.aidaAvailability?.blockedByEnterprisePolicy === true;
918
- const isAgeRestricted = Boolean(config?.aidaAvailability?.blockedByAge);
919
- return Boolean(isFlagEnabled && !isLocaleRestricted && !isGeoRestricted && !isPolicyRestricted && !isAgeRestricted);
915
+ return Boolean(isFlagEnabled && !isGeoRestricted && !isPolicyRestricted);
920
916
  },
921
917
  async loadItem() {
922
918
  const Main = await loadMainModule();
@@ -3,6 +3,9 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../core/common/common.js';
6
+ import * as Root from '../core/root/root.js';
7
+ import * as SDK from '../core/sdk/sdk.js';
8
+ import * as Workspace from '../models/workspace/workspace.js';
6
9
 
7
10
  export interface CreationOptions {
8
11
  // Settings things
@@ -10,12 +13,21 @@ export interface CreationOptions {
10
13
  }
11
14
 
12
15
  export class Universe {
16
+ readonly context = new Root.DevToolsContext.DevToolsContext();
17
+
13
18
  constructor(options: CreationOptions) {
14
19
  // TODO(crbug.com/458180550): Store instance on a "DevToolsContext" instead.
15
20
  // For now the global is fine as we don't anticipate the MCP server to change settings.
16
- Common.Settings.Settings.instance({
21
+ const settings = Common.Settings.Settings.instance({
17
22
  forceNew: true,
18
23
  ...options.settingsCreationOptions,
19
24
  });
25
+
26
+ const targetManager = new SDK.TargetManager.TargetManager();
27
+ this.context.set(SDK.TargetManager.TargetManager, targetManager);
28
+ this.context.set(Workspace.Workspace.WorkspaceImpl, new Workspace.Workspace.WorkspaceImpl());
29
+
30
+ const ignoreListManager = new Workspace.IgnoreListManager.IgnoreListManager(settings, targetManager);
31
+ this.context.set(Workspace.IgnoreListManager.IgnoreListManager, ignoreListManager);
20
32
  }
21
33
  }
@@ -90,14 +90,6 @@ export const UIStrings = {
90
90
  * @description This warning occurs when a stylesheet loaded from a local file directive does not end in the file type `.css`.
91
91
  */
92
92
  LocalCSSFileExtensionRejected: "CSS cannot be loaded from `file:` URLs unless they end in a `.css` file extension.",
93
- /**
94
- * @description This is a deprecation warning to developers that occurs when the script attempts to use the Media Source Extensions API in a way that is no longer supported by the specification for the API. The usage that is problematic is when the script calls the `SourceBuffer.abort()` method at a time when there is still processing happening in response to a previous `SourceBuffer.remove()` call for the same SourceBuffer object. More precisely, we show this warning to developers when script calls the SourceBuffer abort() method while the asynchronous processing of a remove() call on that SourceBuffer is not yet complete. Early versions of the Media Source Extensions specification allowed such aborts, but standardization of the specification resulted in disallowing the aborts. The script should instead wait for the asynchronous remove() operation to complete, which is observable by listening for the associated 'updateend' event from the SourceBuffer. A note is also included in the warning, describing when abort() is meaningful and allowed by the specification for purposes other than interrupting a remove() operation's asynchronous steps. Those supported purposes include using abort() to interrupt processing that may still be happening in response to a previous appendBuffer() call on that SourceBuffer, or using abort() to clear the internal of any unprocessed data remaining from previous appendBuffer() calls. See https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-abort for the currently specified behavior, which would throw an exception once the deprecated removal abort is no longer supported. See https://github.com/w3c/media-source/issues/19 for the discussion that led to the specification change.
95
- */
96
- MediaSourceAbortRemove: "Using `SourceBuffer.abort()` to abort `remove()`'s asynchronous range removal is deprecated due to specification change. Support will be removed in the future. You should listen to the `updateend` event instead. `abort()` is intended to only abort an asynchronous media append or reset parser state.",
97
- /**
98
- * @description This is a deprecation warning to developers that occurs when the script attempts to use the Media Source Extensions API in a way that is no longer supported by the specification for the API. The usage that is problematic is when the script sets the duration attribute of a MediaSource object too low. The duration attribute of a MediaSource must be longer than the actual duration of any media (audio or video) already in the MediaSource. When set too low, the MediaSource must remove audio and video content that is beyond the time indicated by the new duration. Content removal that is caused by setting the duration attribute too low is no longer allowed by the specification. The message describes the minimum allowable duration value as the 'highest presentation timestamp of any buffered coded frames' as a more precise way of describing the duration of content already in the MediaSource: 'coded frames' are the specification's way of describing compressed audio frames or compressed video frames, and they each have a 'presentation timestamp' that describes precisely when that frame's playback occurs in the overall media presentation. Early versions of the Media Source Extensions specification allowed this to happen, but standardization of the specification resulted in disallowing this behavior. The underlying issue leading to this specification change was that setting the duration attribute should be synchronous, but setting it lower than the timestamp of something currently buffered would cause confusing removal of media between that new duration and the previous, larger, duration. The script should instead explicitly remove that range of media first, before lowering the duration. See https://www.w3.org/TR/media-source-2/#dom-mediasource-duration and https://www.w3.org/TR/media-source-2/#dom-mediasource-duration for the currently specified behavior, which would throw an exception once support is removed for deprecated implicit asynchronous range removal when duration is truncated. See both https://github.com/w3c/media-source/issues/20 and https://github.com/w3c/media-source/issues/26 for the discussion that led to the specification change.
99
- */
100
- MediaSourceDurationTruncatingBuffered: "Setting `MediaSource.duration` below the highest presentation timestamp of any buffered coded frames is deprecated due to specification change. Support for implicit removal of truncated buffered media will be removed in the future. You should instead perform explicit `remove(newDuration, oldDuration)` on all `sourceBuffers`, where `newDuration < oldDuration`.",
101
93
  /**
102
94
  * @description This warning occurs when the browser requests Web MIDI access as sysex (system exclusive messages) can be allowed via prompt even if the browser did not specifically request it.
103
95
  */
@@ -283,12 +275,6 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
283
275
  "LocalCSSFileExtensionRejected": {
284
276
  "milestone": 64
285
277
  },
286
- "MediaSourceAbortRemove": {
287
- "chromeStatusFeature": 6107495151960064
288
- },
289
- "MediaSourceDurationTruncatingBuffered": {
290
- "chromeStatusFeature": 6107495151960064
291
- },
292
278
  "NoSysexWebMIDIWithoutPermission": {
293
279
  "chromeStatusFeature": 5138066234671104,
294
280
  "milestone": 82
@@ -983,7 +983,7 @@ inspectorBackend.registerEnum("Page.AdFrameExplanation", {ParentIsAd: "ParentIsA
983
983
  inspectorBackend.registerEnum("Page.SecureContextType", {Secure: "Secure", SecureLocalhost: "SecureLocalhost", InsecureScheme: "InsecureScheme", InsecureAncestor: "InsecureAncestor"});
984
984
  inspectorBackend.registerEnum("Page.CrossOriginIsolatedContextType", {Isolated: "Isolated", NotIsolated: "NotIsolated", NotIsolatedFeatureDisabled: "NotIsolatedFeatureDisabled"});
985
985
  inspectorBackend.registerEnum("Page.GatedAPIFeatures", {SharedArrayBuffers: "SharedArrayBuffers", SharedArrayBuffersTransferAllowed: "SharedArrayBuffersTransferAllowed", PerformanceMeasureMemory: "PerformanceMeasureMemory", PerformanceProfile: "PerformanceProfile"});
986
- inspectorBackend.registerEnum("Page.PermissionsPolicyFeature", {Accelerometer: "accelerometer", AllScreensCapture: "all-screens-capture", AmbientLightSensor: "ambient-light-sensor", AriaNotify: "aria-notify", AttributionReporting: "attribution-reporting", Autoplay: "autoplay", Bluetooth: "bluetooth", BrowsingTopics: "browsing-topics", Camera: "camera", CapturedSurfaceControl: "captured-surface-control", ChDpr: "ch-dpr", ChDeviceMemory: "ch-device-memory", ChDownlink: "ch-downlink", ChEct: "ch-ect", ChPrefersColorScheme: "ch-prefers-color-scheme", ChPrefersReducedMotion: "ch-prefers-reduced-motion", ChPrefersReducedTransparency: "ch-prefers-reduced-transparency", ChRtt: "ch-rtt", ChSaveData: "ch-save-data", ChUa: "ch-ua", ChUaArch: "ch-ua-arch", ChUaBitness: "ch-ua-bitness", ChUaHighEntropyValues: "ch-ua-high-entropy-values", ChUaPlatform: "ch-ua-platform", ChUaModel: "ch-ua-model", ChUaMobile: "ch-ua-mobile", ChUaFormFactors: "ch-ua-form-factors", ChUaFullVersion: "ch-ua-full-version", ChUaFullVersionList: "ch-ua-full-version-list", ChUaPlatformVersion: "ch-ua-platform-version", ChUaWow64: "ch-ua-wow64", ChViewportHeight: "ch-viewport-height", ChViewportWidth: "ch-viewport-width", ChWidth: "ch-width", ClipboardRead: "clipboard-read", ClipboardWrite: "clipboard-write", ComputePressure: "compute-pressure", ControlledFrame: "controlled-frame", CrossOriginIsolated: "cross-origin-isolated", DeferredFetch: "deferred-fetch", DeferredFetchMinimal: "deferred-fetch-minimal", DeviceAttributes: "device-attributes", DigitalCredentialsCreate: "digital-credentials-create", DigitalCredentialsGet: "digital-credentials-get", DirectSockets: "direct-sockets", DirectSocketsMulticast: "direct-sockets-multicast", DirectSocketsPrivate: "direct-sockets-private", DisplayCapture: "display-capture", DocumentDomain: "document-domain", EncryptedMedia: "encrypted-media", ExecutionWhileOutOfViewport: "execution-while-out-of-viewport", ExecutionWhileNotRendered: "execution-while-not-rendered", FencedUnpartitionedStorageRead: "fenced-unpartitioned-storage-read", FocusWithoutUserActivation: "focus-without-user-activation", Fullscreen: "fullscreen", Frobulate: "frobulate", Gamepad: "gamepad", Geolocation: "geolocation", Gyroscope: "gyroscope", Hid: "hid", IdentityCredentialsGet: "identity-credentials-get", IdleDetection: "idle-detection", InterestCohort: "interest-cohort", JoinAdInterestGroup: "join-ad-interest-group", KeyboardMap: "keyboard-map", LanguageDetector: "language-detector", LanguageModel: "language-model", LocalFonts: "local-fonts", LocalNetworkAccess: "local-network-access", Magnetometer: "magnetometer", MediaPlaybackWhileNotVisible: "media-playback-while-not-visible", Microphone: "microphone", Midi: "midi", OnDeviceSpeechRecognition: "on-device-speech-recognition", OtpCredentials: "otp-credentials", Payment: "payment", PictureInPicture: "picture-in-picture", Popins: "popins", PrivateAggregation: "private-aggregation", PrivateStateTokenIssuance: "private-state-token-issuance", PrivateStateTokenRedemption: "private-state-token-redemption", PublickeyCredentialsCreate: "publickey-credentials-create", PublickeyCredentialsGet: "publickey-credentials-get", RecordAdAuctionEvents: "record-ad-auction-events", Rewriter: "rewriter", RunAdAuction: "run-ad-auction", ScreenWakeLock: "screen-wake-lock", Serial: "serial", SharedAutofill: "shared-autofill", SharedStorage: "shared-storage", SharedStorageSelectUrl: "shared-storage-select-url", SmartCard: "smart-card", SpeakerSelection: "speaker-selection", StorageAccess: "storage-access", SubApps: "sub-apps", Summarizer: "summarizer", SyncXhr: "sync-xhr", Translator: "translator", Unload: "unload", Usb: "usb", UsbUnrestricted: "usb-unrestricted", VerticalScroll: "vertical-scroll", WebAppInstallation: "web-app-installation", WebPrinting: "web-printing", WebShare: "web-share", WindowManagement: "window-management", Writer: "writer", XrSpatialTracking: "xr-spatial-tracking"});
986
+ inspectorBackend.registerEnum("Page.PermissionsPolicyFeature", {Accelerometer: "accelerometer", AllScreensCapture: "all-screens-capture", AmbientLightSensor: "ambient-light-sensor", AriaNotify: "aria-notify", AttributionReporting: "attribution-reporting", Autoplay: "autoplay", Bluetooth: "bluetooth", BrowsingTopics: "browsing-topics", Camera: "camera", CapturedSurfaceControl: "captured-surface-control", ChDpr: "ch-dpr", ChDeviceMemory: "ch-device-memory", ChDownlink: "ch-downlink", ChEct: "ch-ect", ChPrefersColorScheme: "ch-prefers-color-scheme", ChPrefersReducedMotion: "ch-prefers-reduced-motion", ChPrefersReducedTransparency: "ch-prefers-reduced-transparency", ChRtt: "ch-rtt", ChSaveData: "ch-save-data", ChUa: "ch-ua", ChUaArch: "ch-ua-arch", ChUaBitness: "ch-ua-bitness", ChUaHighEntropyValues: "ch-ua-high-entropy-values", ChUaPlatform: "ch-ua-platform", ChUaModel: "ch-ua-model", ChUaMobile: "ch-ua-mobile", ChUaFormFactors: "ch-ua-form-factors", ChUaFullVersion: "ch-ua-full-version", ChUaFullVersionList: "ch-ua-full-version-list", ChUaPlatformVersion: "ch-ua-platform-version", ChUaWow64: "ch-ua-wow64", ChViewportHeight: "ch-viewport-height", ChViewportWidth: "ch-viewport-width", ChWidth: "ch-width", ClipboardRead: "clipboard-read", ClipboardWrite: "clipboard-write", ComputePressure: "compute-pressure", ControlledFrame: "controlled-frame", CrossOriginIsolated: "cross-origin-isolated", DeferredFetch: "deferred-fetch", DeferredFetchMinimal: "deferred-fetch-minimal", DeviceAttributes: "device-attributes", DigitalCredentialsCreate: "digital-credentials-create", DigitalCredentialsGet: "digital-credentials-get", DirectSockets: "direct-sockets", DirectSocketsMulticast: "direct-sockets-multicast", DirectSocketsPrivate: "direct-sockets-private", DisplayCapture: "display-capture", DocumentDomain: "document-domain", EncryptedMedia: "encrypted-media", ExecutionWhileOutOfViewport: "execution-while-out-of-viewport", ExecutionWhileNotRendered: "execution-while-not-rendered", FencedUnpartitionedStorageRead: "fenced-unpartitioned-storage-read", FocusWithoutUserActivation: "focus-without-user-activation", Fullscreen: "fullscreen", Frobulate: "frobulate", Gamepad: "gamepad", Geolocation: "geolocation", Gyroscope: "gyroscope", Hid: "hid", IdentityCredentialsGet: "identity-credentials-get", IdleDetection: "idle-detection", InterestCohort: "interest-cohort", JoinAdInterestGroup: "join-ad-interest-group", KeyboardMap: "keyboard-map", LanguageDetector: "language-detector", LanguageModel: "language-model", LocalFonts: "local-fonts", LocalNetworkAccess: "local-network-access", Magnetometer: "magnetometer", MediaPlaybackWhileNotVisible: "media-playback-while-not-visible", Microphone: "microphone", Midi: "midi", OnDeviceSpeechRecognition: "on-device-speech-recognition", OtpCredentials: "otp-credentials", Payment: "payment", PictureInPicture: "picture-in-picture", PrivateAggregation: "private-aggregation", PrivateStateTokenIssuance: "private-state-token-issuance", PrivateStateTokenRedemption: "private-state-token-redemption", PublickeyCredentialsCreate: "publickey-credentials-create", PublickeyCredentialsGet: "publickey-credentials-get", RecordAdAuctionEvents: "record-ad-auction-events", Rewriter: "rewriter", RunAdAuction: "run-ad-auction", ScreenWakeLock: "screen-wake-lock", Serial: "serial", SharedAutofill: "shared-autofill", SharedStorage: "shared-storage", SharedStorageSelectUrl: "shared-storage-select-url", SmartCard: "smart-card", SpeakerSelection: "speaker-selection", StorageAccess: "storage-access", SubApps: "sub-apps", Summarizer: "summarizer", SyncXhr: "sync-xhr", Translator: "translator", Unload: "unload", Usb: "usb", UsbUnrestricted: "usb-unrestricted", VerticalScroll: "vertical-scroll", WebAppInstallation: "web-app-installation", WebPrinting: "web-printing", WebShare: "web-share", WindowManagement: "window-management", Writer: "writer", XrSpatialTracking: "xr-spatial-tracking"});
987
987
  inspectorBackend.registerEnum("Page.PermissionsPolicyBlockReason", {Header: "Header", IframeAttribute: "IframeAttribute", InFencedFrameTree: "InFencedFrameTree", InIsolatedApp: "InIsolatedApp"});
988
988
  inspectorBackend.registerEnum("Page.OriginTrialTokenStatus", {Success: "Success", NotSupported: "NotSupported", Insecure: "Insecure", Expired: "Expired", WrongOrigin: "WrongOrigin", InvalidSignature: "InvalidSignature", Malformed: "Malformed", WrongVersion: "WrongVersion", FeatureDisabled: "FeatureDisabled", TokenDisabled: "TokenDisabled", FeatureDisabledForUser: "FeatureDisabledForUser", UnknownTrial: "UnknownTrial"});
989
989
  inspectorBackend.registerEnum("Page.OriginTrialStatus", {Enabled: "Enabled", ValidTokenNotProvided: "ValidTokenNotProvided", OSNotSupported: "OSNotSupported", TrialNotAllowed: "TrialNotAllowed"});
@@ -13705,7 +13705,6 @@ export namespace Page {
13705
13705
  OtpCredentials = 'otp-credentials',
13706
13706
  Payment = 'payment',
13707
13707
  PictureInPicture = 'picture-in-picture',
13708
- Popins = 'popins',
13709
13708
  PrivateAggregation = 'private-aggregation',
13710
13709
  PrivateStateTokenIssuance = 'private-state-token-issuance',
13711
13710
  PrivateStateTokenRedemption = 'private-state-token-redemption',
@@ -185,13 +185,19 @@ export class BuiltInAi {
185
185
  async * getConsoleInsight(prompt: string, abortController: AbortController): AsyncGenerator<string> {
186
186
  // Clone the session to start a fresh conversation for each answer. Otherwise
187
187
  // previous dialog would pollute the context resulting in worse answers.
188
- const session = await this.#consoleInsightsSession.clone();
189
- const stream = session.promptStreaming(prompt, {
190
- signal: abortController.signal,
191
- });
192
- for await (const chunk of stream) {
193
- yield chunk;
188
+ let session: LanguageModel|null = null;
189
+ try {
190
+ session = await this.#consoleInsightsSession.clone();
191
+ const stream = session.promptStreaming(prompt, {
192
+ signal: abortController.signal,
193
+ });
194
+ for await (const chunk of stream) {
195
+ yield chunk;
196
+ }
197
+ } finally {
198
+ if (session) {
199
+ session.destroy();
200
+ }
194
201
  }
195
- session.destroy();
196
202
  }
197
203
  }
@@ -45,6 +45,7 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
45
45
  readonly #uiSourceCodeToSourceMaps =
46
46
  new Platform.MapUtilities.Multimap<Workspace.UISourceCode.UISourceCode, SDK.SourceMap.SourceMap>();
47
47
  readonly #debuggerModel: SDK.DebuggerModel.DebuggerModel;
48
+ readonly #ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager;
48
49
 
49
50
  constructor(
50
51
  debuggerModel: SDK.DebuggerModel.DebuggerModel, workspace: Workspace.Workspace.WorkspaceImpl,
@@ -52,6 +53,7 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
52
53
  this.#sourceMapManager = debuggerModel.sourceMapManager();
53
54
  this.#debuggerWorkspaceBinding = debuggerWorkspaceBinding;
54
55
  this.#debuggerModel = debuggerModel;
56
+ this.#ignoreListManager = debuggerWorkspaceBinding.ignoreListManager;
55
57
 
56
58
  this.#stubProject = new ContentProviderBasedProject(
57
59
  workspace, 'jsSourceMaps:stub:' + debuggerModel.target().id(), Workspace.Workspace.projectTypes.Service, '',
@@ -362,8 +364,7 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
362
364
  // Create stub UISourceCode for the time source mapping is being loaded.
363
365
  this.addStubUISourceCode(script);
364
366
  void this.#debuggerWorkspaceBinding.updateLocations(script);
365
- if (Workspace.IgnoreListManager.IgnoreListManager.instance().isUserIgnoreListedURL(
366
- script.sourceURL, {isContentScript: script.isContentScript()})) {
367
+ if (this.#ignoreListManager.isUserIgnoreListedURL(script.sourceURL, {isContentScript: script.isContentScript()})) {
367
368
  this.#sourceMapManager.cancelAttachSourceMap(script);
368
369
  }
369
370
  }
@@ -27,11 +27,15 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
27
27
  readonly #debuggerModelToData: Map<SDK.DebuggerModel.DebuggerModel, ModelData>;
28
28
  readonly #liveLocationPromises: Set<Promise<void|Location|StackTraceTopFrameLocation|null>>;
29
29
  readonly pluginManager: DebuggerLanguagePluginManager;
30
+ readonly ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager;
31
+ readonly workspace: Workspace.Workspace.WorkspaceImpl;
30
32
 
31
33
  private constructor(
32
34
  resourceMapping: ResourceMapping, targetManager: SDK.TargetManager.TargetManager,
33
- ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager) {
35
+ ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager, workspace: Workspace.Workspace.WorkspaceImpl) {
34
36
  this.resourceMapping = resourceMapping;
37
+ this.ignoreListManager = ignoreListManager;
38
+ this.workspace = workspace;
35
39
 
36
40
  this.#debuggerModelToData = new Map();
37
41
  targetManager.addModelListener(
@@ -39,7 +43,7 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
39
43
  targetManager.addModelListener(
40
44
  SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this.debuggerResumed, this);
41
45
  targetManager.observeModels(SDK.DebuggerModel.DebuggerModel, this);
42
- ignoreListManager.addEventListener(
46
+ this.ignoreListManager.addEventListener(
43
47
  Workspace.IgnoreListManager.Events.IGNORED_SCRIPT_RANGES_UPDATED, event => this.updateLocations(event.data));
44
48
 
45
49
  this.#liveLocationPromises = new Set();
@@ -60,17 +64,19 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
60
64
  resourceMapping: ResourceMapping|null,
61
65
  targetManager: SDK.TargetManager.TargetManager|null,
62
66
  ignoreListManager: Workspace.IgnoreListManager.IgnoreListManager|null,
63
- } = {forceNew: null, resourceMapping: null, targetManager: null, ignoreListManager: null}): DebuggerWorkspaceBinding {
64
- const {forceNew, resourceMapping, targetManager, ignoreListManager} = opts;
67
+ workspace: Workspace.Workspace.WorkspaceImpl|null,
68
+ } = {forceNew: null, resourceMapping: null, targetManager: null, ignoreListManager: null, workspace: null}):
69
+ DebuggerWorkspaceBinding {
70
+ const {forceNew, resourceMapping, targetManager, ignoreListManager, workspace} = opts;
65
71
  if (!debuggerWorkspaceBindingInstance || forceNew) {
66
- if (!resourceMapping || !targetManager || !ignoreListManager) {
72
+ if (!resourceMapping || !targetManager || !ignoreListManager || !workspace) {
67
73
  throw new Error(
68
74
  `Unable to create DebuggerWorkspaceBinding: resourceMapping, targetManager and IgnoreLIstManager must be provided: ${
69
75
  new Error().stack}`);
70
76
  }
71
77
 
72
78
  debuggerWorkspaceBindingInstance =
73
- new DebuggerWorkspaceBinding(resourceMapping, targetManager, ignoreListManager);
79
+ new DebuggerWorkspaceBinding(resourceMapping, targetManager, ignoreListManager, workspace);
74
80
  }
75
81
 
76
82
  return debuggerWorkspaceBindingInstance;
@@ -269,11 +275,10 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
269
275
  waitForUISourceCodeAdded(url: Platform.DevToolsPath.UrlString, target: SDK.Target.Target):
270
276
  Promise<Workspace.UISourceCode.UISourceCode> {
271
277
  return new Promise(resolve => {
272
- const workspace = Workspace.Workspace.WorkspaceImpl.instance();
273
- const descriptor = workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, event => {
278
+ const descriptor = this.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, event => {
274
279
  const uiSourceCode = event.data;
275
280
  if (uiSourceCode.url() === url && NetworkProject.targetForUISourceCode(uiSourceCode) === target) {
276
- workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, descriptor.listener);
281
+ this.workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, descriptor.listener);
277
282
  resolve(uiSourceCode);
278
283
  }
279
284
  });