chrome-devtools-frontend 1.0.971140 → 1.0.973253

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 (107) hide show
  1. package/config/gni/devtools_grd_files.gni +10 -8
  2. package/front_end/core/common/ParsedURL.ts +9 -3
  3. package/front_end/core/host/UserMetrics.ts +2 -1
  4. package/front_end/core/i18n/locales/en-US.json +24 -0
  5. package/front_end/core/i18n/locales/en-XL.json +24 -0
  6. package/front_end/core/sdk/CSSModel.ts +21 -0
  7. package/front_end/core/sdk/CSSStyleSheetHeader.ts +10 -10
  8. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +6 -4
  9. package/front_end/core/sdk/DOMDebuggerModel.ts +4 -3
  10. package/front_end/core/sdk/DebuggerModel.ts +17 -16
  11. package/front_end/core/sdk/NetworkManager.ts +17 -9
  12. package/front_end/core/sdk/NetworkRequest.ts +18 -16
  13. package/front_end/core/sdk/Resource.ts +10 -10
  14. package/front_end/core/sdk/ResourceTreeModel.ts +16 -13
  15. package/front_end/core/sdk/Script.ts +10 -10
  16. package/front_end/core/sdk/SourceMap.ts +8 -6
  17. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.ts → LighthouseWorkerService.ts} +69 -38
  18. package/front_end/entrypoints/lighthouse_worker/lighthouse_worker.ts +1 -1
  19. package/front_end/entrypoints/main/MainImpl.ts +5 -0
  20. package/front_end/generated/InspectorBackendCommands.js +14 -8
  21. package/front_end/generated/SupportedCSSProperties.js +2 -0
  22. package/front_end/generated/protocol-mapping.d.ts +5 -0
  23. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  24. package/front_end/generated/protocol.ts +20 -12
  25. package/front_end/models/bindings/BreakpointManager.ts +7 -5
  26. package/front_end/models/bindings/CSSWorkspaceBinding.ts +2 -16
  27. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -1
  28. package/front_end/models/bindings/ResourceMapping.ts +2 -1
  29. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -1
  30. package/front_end/models/bindings/SASSSourceMapping.ts +4 -3
  31. package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
  32. package/front_end/models/har/HARFormat.ts +4 -2
  33. package/front_end/models/har/Importer.ts +0 -1
  34. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +12 -12
  35. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataHttpNotFound.md → federatedAuthRequestClientMetadataHttpNotFound.md} +0 -0
  36. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataInvalidResponse.md → federatedAuthRequestClientMetadataInvalidResponse.md} +0 -0
  37. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataNoResponse.md → federatedAuthRequestClientMetadataNoResponse.md} +0 -0
  38. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  39. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  40. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  41. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +5 -5
  42. package/front_end/models/persistence/IsolatedFileSystem.ts +10 -13
  43. package/front_end/models/persistence/PersistenceActions.ts +1 -4
  44. package/front_end/models/persistence/PlatformFileSystem.ts +3 -3
  45. package/front_end/{panels/sources/SourceMapNamesResolver.ts → models/source_map_scopes/NamesResolver.ts} +5 -5
  46. package/front_end/models/source_map_scopes/source_map_scopes.ts +7 -0
  47. package/front_end/models/text_utils/ContentProvider.ts +2 -1
  48. package/front_end/models/text_utils/StaticContentProvider.ts +7 -5
  49. package/front_end/models/workspace/UISourceCode.ts +7 -7
  50. package/front_end/models/workspace/WorkspaceImpl.ts +1 -3
  51. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -8
  52. package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -2
  53. package/front_end/panels/changes/ChangesView.ts +4 -4
  54. package/front_end/panels/console/ConsolePrompt.ts +25 -2
  55. package/front_end/panels/console/ConsoleViewMessage.ts +41 -8
  56. package/front_end/panels/coverage/CoverageModel.ts +1 -1
  57. package/front_end/panels/elements/ElementsTreeElement.ts +0 -6
  58. package/front_end/panels/elements/StylesSidebarPane.ts +43 -33
  59. package/front_end/panels/elements/components/LayoutPane.ts +1 -1
  60. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  61. package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
  62. package/front_end/panels/lighthouse/LighthouseController.ts +13 -2
  63. package/front_end/panels/lighthouse/LighthousePanel.ts +57 -8
  64. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +94 -30
  65. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +0 -5
  66. package/front_end/panels/lighthouse/LighthouseStartView.ts +6 -2
  67. package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +61 -0
  68. package/front_end/panels/lighthouse/LighthouseTimespanView.ts +99 -0
  69. package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
  70. package/front_end/panels/profiler/CPUProfileView.ts +1 -1
  71. package/front_end/panels/profiler/HeapProfileView.ts +0 -2
  72. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +0 -1
  73. package/front_end/panels/profiler/HeapSnapshotView.ts +2 -3
  74. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  75. package/front_end/panels/sources/DebuggerPlugin.ts +5 -4
  76. package/front_end/panels/sources/NavigatorView.ts +5 -5
  77. package/front_end/panels/sources/ScopeChainSidebarPane.ts +6 -3
  78. package/front_end/panels/sources/SourcesNavigator.ts +7 -1
  79. package/front_end/panels/sources/sources-legacy.ts +5 -3
  80. package/front_end/panels/sources/sources.ts +0 -2
  81. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -47
  82. package/front_end/third_party/codemirror.next/bundle.ts +1 -1
  83. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  84. package/front_end/third_party/codemirror.next/chunk/json.js +2 -1
  85. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +28 -2
  86. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  87. package/front_end/third_party/codemirror.next/package.json +10 -10
  88. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1047 -1158
  89. package/front_end/third_party/lighthouse/locales/en-US.json +7 -1
  90. package/front_end/third_party/lighthouse/locales/en-XL.json +7 -1
  91. package/front_end/third_party/lighthouse/report/bundle.d.ts +0 -3
  92. package/front_end/third_party/lighthouse/report/bundle.js +38 -24
  93. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  94. package/front_end/ui/components/expandable_list/expandableList.css +1 -1
  95. package/front_end/ui/components/text_editor/config.ts +1 -0
  96. package/front_end/ui/legacy/ViewManager.ts +2 -1
  97. package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +7 -4
  98. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
  99. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
  100. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +2 -3
  101. package/front_end/ui/legacy/components/utils/Linkifier.ts +20 -59
  102. package/front_end/ui/legacy/tabbedPane.css +1 -0
  103. package/package.json +1 -1
  104. package/scripts/hosted_mode/server.js +13 -0
  105. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +0 -1
  106. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +0 -1
  107. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +0 -1
@@ -32,6 +32,7 @@
32
32
 
33
33
  import * as Common from '../../core/common/common.js';
34
34
  import * as SDK from '../../core/sdk/sdk.js';
35
+ import type * as Platform from '../../core/platform/platform.js';
35
36
  import type * as Protocol from '../../generated/protocol.js';
36
37
  import type * as TextUtils from '../text_utils/text_utils.js';
37
38
  import * as Workspace from '../workspace/workspace.js';
@@ -305,7 +306,7 @@ export type EventTypes = {
305
306
 
306
307
  export class Breakpoint implements SDK.TargetManager.SDKModelObserver<SDK.DebuggerModel.DebuggerModel> {
307
308
  readonly breakpointManager: BreakpointManager;
308
- urlInternal: string;
309
+ urlInternal: Platform.DevToolsPath.UrlString;
309
310
  readonly #lineNumberInternal: number;
310
311
  readonly #columnNumberInternal: number|undefined;
311
312
  readonly #uiLocations: Set<Workspace.UISourceCode.UILocation>;
@@ -317,8 +318,9 @@ export class Breakpoint implements SDK.TargetManager.SDKModelObserver<SDK.Debugg
317
318
  readonly #modelBreakpoints: Map<SDK.DebuggerModel.DebuggerModel, ModelBreakpoint>;
318
319
 
319
320
  constructor(
320
- breakpointManager: BreakpointManager, primaryUISourceCode: Workspace.UISourceCode.UISourceCode, url: string,
321
- lineNumber: number, columnNumber: number|undefined, condition: string, enabled: boolean) {
321
+ breakpointManager: BreakpointManager, primaryUISourceCode: Workspace.UISourceCode.UISourceCode,
322
+ url: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number|undefined, condition: string,
323
+ enabled: boolean) {
322
324
  this.breakpointManager = breakpointManager;
323
325
  this.urlInternal = url;
324
326
  this.#lineNumberInternal = lineNumber;
@@ -398,7 +400,7 @@ export class Breakpoint implements SDK.TargetManager.SDKModelObserver<SDK.Debugg
398
400
  }
399
401
  }
400
402
 
401
- url(): string {
403
+ url(): Platform.DevToolsPath.UrlString {
402
404
  return this.urlInternal;
403
405
  }
404
406
 
@@ -791,7 +793,7 @@ export class ModelBreakpoint {
791
793
  }
792
794
 
793
795
  interface Position {
794
- url: string;
796
+ url: Platform.DevToolsPath.UrlString;
795
797
  scriptId: Protocol.Runtime.ScriptId;
796
798
  scriptHash: string;
797
799
  lineNumber: number;
@@ -123,24 +123,10 @@ export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<S
123
123
 
124
124
  propertyUILocation(cssProperty: SDK.CSSProperty.CSSProperty, forName: boolean): Workspace.UISourceCode.UILocation
125
125
  |null {
126
- const style = cssProperty.ownerStyle;
127
- if (!style || style.type !== SDK.CSSStyleDeclaration.Type.Regular || !style.styleSheetId) {
128
- return null;
129
- }
130
- const header = style.cssModel().styleSheetHeaderForId(style.styleSheetId);
131
- if (!header) {
126
+ const rawLocation = this.propertyRawLocation(cssProperty, forName);
127
+ if (!rawLocation) {
132
128
  return null;
133
129
  }
134
-
135
- const range = forName ? cssProperty.nameRange() : cssProperty.valueRange();
136
- if (!range) {
137
- return null;
138
- }
139
-
140
- const lineNumber = range.startLine;
141
- const columnNumber = range.startColumn;
142
- const rawLocation = new SDK.CSSModel.CSSLocation(
143
- header, header.lineNumberInSource(lineNumber), header.columnNumberInSource(lineNumber, columnNumber));
144
130
  return this.rawLocationToUILocation(rawLocation);
145
131
  }
146
132
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
+ import type * as Platform from '../../core/platform/platform.js';
7
8
  import * as SDK from '../../core/sdk/sdk.js';
8
9
  import * as Protocol from '../../generated/protocol.js';
9
10
  import * as Workspace from '../workspace/workspace.js';
@@ -1315,7 +1316,7 @@ class ModelData {
1315
1316
  this.uiSourceCodeToScripts.set(uiSourceCode, [script]);
1316
1317
 
1317
1318
  const contentProvider = new SDK.CompilerSourceMappingContentProvider.CompilerSourceMappingContentProvider(
1318
- url, Common.ResourceType.resourceTypes.SourceMapScript, initiator);
1319
+ url as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.SourceMapScript, initiator);
1319
1320
  const mimeType = Common.ResourceType.ResourceType.mimeFromURL(url) || 'text/javascript';
1320
1321
  this.project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, null, mimeType);
1321
1322
  } else {
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
+ import type * as Platform from '../../core/platform/platform.js';
6
7
  import * as SDK from '../../core/sdk/sdk.js';
7
8
  import * as TextUtils from '../text_utils/text_utils.js';
8
9
  import * as Workspace from '../workspace/workspace.js';
@@ -420,7 +421,7 @@ class Binding implements TextUtils.ContentProvider.ContentProvider {
420
421
  return this.resources.values().next().value;
421
422
  }
422
423
 
423
- contentURL(): string {
424
+ contentURL(): Platform.DevToolsPath.UrlString {
424
425
  return this.firstResource().contentURL();
425
426
  }
426
427
 
@@ -30,6 +30,7 @@
30
30
 
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as i18n from '../../core/i18n/i18n.js';
33
+ import type * as Platform from '../../core/platform/platform.js';
33
34
  import * as SDK from '../../core/sdk/sdk.js';
34
35
  import * as Workspace from '../workspace/workspace.js';
35
36
  import type * as Protocol from '../../generated/protocol.js';
@@ -411,7 +412,7 @@ export class ResourceScriptFile extends Common.ObjectWrapper.ObjectWrapper<Resou
411
412
  Workspace.UISourceCode.Events.WorkingCopyCommitted, this.workingCopyCommitted, this);
412
413
  }
413
414
 
414
- addSourceMapURL(sourceMapURL: string): void {
415
+ addSourceMapURL(sourceMapURL: Platform.DevToolsPath.UrlString): void {
415
416
  if (!this.scriptInternal) {
416
417
  return;
417
418
  }
@@ -31,6 +31,7 @@
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as SDK from '../../core/sdk/sdk.js';
33
33
  import type * as Protocol from '../../generated/protocol.js';
34
+ import type * as Platform from '../../core/platform/platform.js';
34
35
  import * as Workspace from '../workspace/workspace.js';
35
36
 
36
37
  import {ContentProviderBasedProject} from './ContentProviderBasedProject.js';
@@ -78,7 +79,7 @@ export class SASSSourceMapping implements SourceMapping {
78
79
  for (const sourceURL of sourceMap.sourceURLs()) {
79
80
  let binding = bindings.get(sourceURL);
80
81
  if (!binding) {
81
- binding = new Binding(project, sourceURL);
82
+ binding = new Binding(project, sourceURL as Platform.DevToolsPath.UrlString);
82
83
  bindings.set(sourceURL, binding);
83
84
  }
84
85
  binding.addSourceMap(sourceMap, header.frameId);
@@ -163,11 +164,11 @@ const uiSourceCodeToBinding = new WeakMap<Workspace.UISourceCode.UISourceCode, B
163
164
 
164
165
  class Binding {
165
166
  readonly #project: ContentProviderBasedProject;
166
- readonly #url: string;
167
+ readonly #url: Platform.DevToolsPath.UrlString;
167
168
  referringSourceMaps: SDK.SourceMap.TextSourceMap[];
168
169
  uiSourceCode: Workspace.UISourceCode.UISourceCode|null;
169
170
 
170
- constructor(project: ContentProviderBasedProject, url: string) {
171
+ constructor(project: ContentProviderBasedProject, url: Platform.DevToolsPath.UrlString) {
171
172
  this.#project = project;
172
173
  this.#url = url;
173
174
 
@@ -29,6 +29,7 @@
29
29
  */
30
30
 
31
31
  import * as Common from '../../core/common/common.js';
32
+ import type * as Platform from '../../core/platform/platform.js';
32
33
  import * as SDK from '../../core/sdk/sdk.js';
33
34
  import type * as TextUtils from '../text_utils/text_utils.js';
34
35
  import * as Workspace from '../workspace/workspace.js';
@@ -297,7 +298,7 @@ export class StyleFile implements TextUtils.ContentProvider.ContentProvider {
297
298
  Common.EventTarget.removeEventListeners(this.#eventListeners);
298
299
  }
299
300
 
300
- contentURL(): string {
301
+ contentURL(): Platform.DevToolsPath.UrlString {
301
302
  console.assert(this.headers.size > 0);
302
303
  return this.headers.values().next().value.originalContentProvider().contentURL();
303
304
  }
@@ -2,6 +2,8 @@
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 type * as Platform from '../../core/platform/platform.js';
6
+
5
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
8
 
7
9
  class HARBase {
@@ -197,7 +199,7 @@ export class HAREntry extends HARBase {
197
199
 
198
200
  class HARRequest extends HARBase {
199
201
  method: string;
200
- url: string;
202
+ url: Platform.DevToolsPath.UrlString;
201
203
  httpVersion: string;
202
204
  cookies: HARCookie[];
203
205
  headers: HARHeader[];
@@ -209,7 +211,7 @@ class HARRequest extends HARBase {
209
211
  constructor(data: any) {
210
212
  super(data);
211
213
  this.method = String(data['method']);
212
- this.url = String(data['url']);
214
+ this.url = String(data['url']) as Platform.DevToolsPath.UrlString;
213
215
  this.httpVersion = String(data['httpVersion']);
214
216
  this.cookies = Array.isArray(data['cookies']) ? data['cookies'].map(cookie => new HARCookie(cookie)) : [];
215
217
  this.headers = Array.isArray(data['headers']) ? data['headers'].map(header => new HARHeader(header)) : [];
@@ -38,7 +38,6 @@ export class Importer {
38
38
  lineNumber: initiatorEntry.lineNumber,
39
39
  };
40
40
  }
41
-
42
41
  const request = SDK.NetworkRequest.NetworkRequest.createWithoutBackendRequest(
43
42
  'har-' + requests.length, entry.request.url, documentURL, initiator);
44
43
  const page = pageref ? pages.get(pageref) : undefined;
@@ -93,9 +93,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
93
93
  },
94
94
  ],
95
95
  [
96
- Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownHttpNotFound,
96
+ Protocol.Audits.FederatedAuthRequestIssueReason.ManifestHttpNotFound,
97
97
  {
98
- file: 'federatedAuthRequestWellKnownHttpNotFound.md',
98
+ file: 'federatedAuthRequestManifestHttpNotFound.md',
99
99
  links: [{
100
100
  link: 'https://fedidcg.github.io/FedCM/',
101
101
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -103,9 +103,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
103
103
  },
104
104
  ],
105
105
  [
106
- Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownNoResponse,
106
+ Protocol.Audits.FederatedAuthRequestIssueReason.ManifestNoResponse,
107
107
  {
108
- file: 'federatedAuthRequestWellKnownNoResponse.md',
108
+ file: 'federatedAuthRequestManifestNoResponse.md',
109
109
  links: [{
110
110
  link: 'https://fedidcg.github.io/FedCM/',
111
111
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -113,9 +113,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
113
113
  },
114
114
  ],
115
115
  [
116
- Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownInvalidResponse,
116
+ Protocol.Audits.FederatedAuthRequestIssueReason.ManifestInvalidResponse,
117
117
  {
118
- file: 'federatedAuthRequestWellKnownInvalidResponse.md',
118
+ file: 'federatedAuthRequestManifestInvalidResponse.md',
119
119
  links: [{
120
120
  link: 'https://fedidcg.github.io/FedCM/',
121
121
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -123,9 +123,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
123
123
  },
124
124
  ],
125
125
  [
126
- Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataHttpNotFound,
126
+ Protocol.Audits.FederatedAuthRequestIssueReason.ClientMetadataHttpNotFound,
127
127
  {
128
- file: 'federatedAuthRequestClientIdMetadataHttpNotFound.md',
128
+ file: 'federatedAuthRequestClientMetadataHttpNotFound.md',
129
129
  links: [{
130
130
  link: 'https://fedidcg.github.io/FedCM/',
131
131
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -133,9 +133,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
133
133
  },
134
134
  ],
135
135
  [
136
- Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataNoResponse,
136
+ Protocol.Audits.FederatedAuthRequestIssueReason.ClientMetadataNoResponse,
137
137
  {
138
- file: 'federatedAuthRequestClientIdMetadataNoResponse.md',
138
+ file: 'federatedAuthRequestClientMetadataNoResponse.md',
139
139
  links: [{
140
140
  link: 'https://fedidcg.github.io/FedCM/',
141
141
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -143,9 +143,9 @@ const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, La
143
143
  },
144
144
  ],
145
145
  [
146
- Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataInvalidResponse,
146
+ Protocol.Audits.FederatedAuthRequestIssueReason.ClientMetadataInvalidResponse,
147
147
  {
148
- file: 'federatedAuthRequestClientIdMetadataInvalidResponse.md',
148
+ file: 'federatedAuthRequestClientMetadataInvalidResponse.md',
149
149
  links: [{
150
150
  link: 'https://fedidcg.github.io/FedCM/',
151
151
  linkTitle: i18nLazyString(UIStrings.fedCm),
@@ -0,0 +1 @@
1
+ # The provider's FedCM manifest configuration cannot be found.
@@ -0,0 +1 @@
1
+ # Provider's FedCM manifest configuration is invalid.
@@ -0,0 +1 @@
1
+ # The response body is empty when fetching the provider's FedCM manifest configuration.
@@ -79,9 +79,9 @@ export class FileSystemWorkspaceBinding {
79
79
  return fileSystem.supportsAutomapping();
80
80
  }
81
81
 
82
- static completeURL(project: Workspace.Workspace.Project, relativePath: string): string {
82
+ static completeURL(project: Workspace.Workspace.Project, relativePath: string): Platform.DevToolsPath.UrlString {
83
83
  const fsProject = project as FileSystem;
84
- return fsProject.fileSystemBaseURL + relativePath;
84
+ return Common.ParsedURL.ParsedURL.concatenate(fsProject.fileSystemBaseURL, relativePath);
85
85
  }
86
86
 
87
87
  static fileSystemPath(projectId: string): string {
@@ -155,7 +155,7 @@ export class FileSystemWorkspaceBinding {
155
155
 
156
156
  export class FileSystem extends Workspace.Workspace.ProjectStore {
157
157
  readonly fileSystemInternal: PlatformFileSystem;
158
- readonly fileSystemBaseURL: string;
158
+ readonly fileSystemBaseURL: Platform.DevToolsPath.UrlString;
159
159
  private readonly fileSystemParentURL: string;
160
160
  private readonly fileSystemWorkspaceBinding: FileSystemWorkspaceBinding;
161
161
  private readonly fileSystemPathInternal: string;
@@ -171,7 +171,7 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
171
171
  super(workspace, id, Workspace.Workspace.projectTypes.FileSystem, displayName);
172
172
 
173
173
  this.fileSystemInternal = isolatedFileSystem;
174
- this.fileSystemBaseURL = this.fileSystemInternal.path() + '/';
174
+ this.fileSystemBaseURL = Common.ParsedURL.ParsedURL.concatenate(this.fileSystemInternal.path(), '/');
175
175
  this.fileSystemParentURL = this.fileSystemBaseURL.substr(0, fileSystemPath.lastIndexOf('/') + 1);
176
176
  this.fileSystemWorkspaceBinding = fileSystemWorkspaceBinding;
177
177
  this.fileSystemPathInternal = fileSystemPath;
@@ -414,7 +414,7 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
414
414
  void uiSourceCode.checkContentUpdated();
415
415
  }
416
416
 
417
- tooltipForURL(url: string): string {
417
+ tooltipForURL(url: Platform.DevToolsPath.UrlString): string {
418
418
  return this.fileSystemInternal.tooltipForURL(url);
419
419
  }
420
420
 
@@ -28,8 +28,6 @@
28
28
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
  */
30
30
 
31
- // TODO(crbug.com/1253323): All casts to UrlString will be removed from this file when migration to branded types is complete.
32
-
33
31
  import * as Common from '../../core/common/common.js';
34
32
  import * as Host from '../../core/host/host.js';
35
33
  import * as i18n from '../../core/i18n/i18n.js';
@@ -83,7 +81,6 @@ export class IsolatedFileSystem extends PlatformFileSystem {
83
81
 
84
82
  constructor(
85
83
  manager: IsolatedFileSystemManager, path: string, embedderPath: string, domFileSystem: FileSystem, type: string) {
86
- // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
87
84
  super(path, type);
88
85
  this.manager = manager;
89
86
  this.embedderPathInternal = embedderPath;
@@ -169,17 +166,18 @@ export class IsolatedFileSystem extends PlatformFileSystem {
169
166
  continue;
170
167
  }
171
168
  this.initialFilePathsInternal.add(Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
172
- entry.fullPath.substr(1) as Platform.DevToolsPath.RawPathString));
169
+ Common.ParsedURL.ParsedURL.substr(entry.fullPath as Platform.DevToolsPath.RawPathString, 1)));
173
170
  } else {
174
171
  if (entry.fullPath.endsWith('/.git')) {
175
172
  const lastSlash = entry.fullPath.lastIndexOf('/');
176
- const parentFolder = entry.fullPath.substring(1, lastSlash);
177
- this.initialGitFoldersInternal.add(Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
178
- parentFolder as Platform.DevToolsPath.RawPathString));
173
+ const parentFolder = Common.ParsedURL.ParsedURL.substr(
174
+ entry.fullPath as Platform.DevToolsPath.RawPathString, 1, lastSlash);
175
+ this.initialGitFoldersInternal.add(Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(parentFolder));
179
176
  }
180
177
  if (this.isFileExcluded(entry.fullPath + '/')) {
181
- this.excludedEmbedderFolders.push(Common.ParsedURL.ParsedURL.urlToRawPathString(
182
- this.path() + entry.fullPath as Platform.DevToolsPath.UrlString, Host.Platform.isWin()));
178
+ const url = Common.ParsedURL.ParsedURL.concatenate(this.path(), entry.fullPath);
179
+ this.excludedEmbedderFolders.push(
180
+ Common.ParsedURL.ParsedURL.urlToRawPathString(url, Host.Platform.isWin()));
183
181
  continue;
184
182
  }
185
183
  ++pendingRequests;
@@ -233,7 +231,7 @@ export class IsolatedFileSystem extends PlatformFileSystem {
233
231
  return null;
234
232
  }
235
233
  return Common.ParsedURL.ParsedURL.rawPathToEncodedPathString(
236
- fileEntry.fullPath.substr(1) as Platform.DevToolsPath.RawPathString);
234
+ Common.ParsedURL.ParsedURL.substr(fileEntry.fullPath as Platform.DevToolsPath.RawPathString, 1));
237
235
 
238
236
  function createFileCandidate(
239
237
  this: IsolatedFileSystem, name: string, newFileIndex?: number): Promise<FileEntry|null> {
@@ -559,10 +557,9 @@ export class IsolatedFileSystem extends PlatformFileSystem {
559
557
  Common.ResourceType.resourceTypes.Document;
560
558
  }
561
559
 
562
- tooltipForURL(url: string): string {
560
+ tooltipForURL(url: Platform.DevToolsPath.UrlString): string {
563
561
  const path = Platform.StringUtilities.trimMiddle(
564
- Common.ParsedURL.ParsedURL.urlToRawPathString(url as Platform.DevToolsPath.UrlString, Host.Platform.isWin()),
565
- 150);
562
+ Common.ParsedURL.ParsedURL.urlToRawPathString(url, Host.Platform.isWin()), 150);
566
563
  return i18nString(UIStrings.linkedToS, {PH1: path});
567
564
  }
568
565
 
@@ -5,7 +5,6 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
- import type * as Platform from '../../core/platform/platform.js';
9
8
  import * as SDK from '../../core/sdk/sdk.js';
10
9
 
11
10
  import type * as TextUtils from '../text_utils/text_utils.js';
@@ -93,9 +92,7 @@ export class ContextMenuProvider implements UI.ContextMenu.Provider {
93
92
  const binding = uiSourceCode && PersistenceImpl.instance().binding(uiSourceCode);
94
93
  const fileURL = binding ? binding.fileSystem.contentURL() : contentProvider.contentURL();
95
94
  if (fileURL.startsWith('file://')) {
96
- // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
97
- const path = Common.ParsedURL.ParsedURL.urlToRawPathString(
98
- fileURL as Platform.DevToolsPath.UrlString, Host.Platform.isWin());
95
+ const path = Common.ParsedURL.ParsedURL.urlToRawPathString(fileURL, Host.Platform.isWin());
99
96
  contextMenu.revealSection().appendItem(
100
97
  i18nString(UIStrings.openInContainingFolder),
101
98
  () => Host.InspectorFrontendHost.InspectorFrontendHostInstance.showItemInFolder(path));
@@ -35,8 +35,8 @@ export class PlatformFileSystem {
35
35
  return [];
36
36
  }
37
37
 
38
- path(): string {
39
- return this.pathInternal;
38
+ path(): Platform.DevToolsPath.UrlString {
39
+ return this.pathInternal as Platform.DevToolsPath.UrlString;
40
40
  }
41
41
 
42
42
  embedderPath(): string {
@@ -111,7 +111,7 @@ export class PlatformFileSystem {
111
111
  throw new Error('Not implemented');
112
112
  }
113
113
 
114
- tooltipForURL(_url: string): string {
114
+ tooltipForURL(_url: Platform.DevToolsPath.UrlString): string {
115
115
  throw new Error('Not implemented');
116
116
  }
117
117
 
@@ -1,13 +1,13 @@
1
- // Copyright 2016 The Chromium Authors. All rights reserved.
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
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
5
  import * as Platform from '../../core/platform/platform.js';
6
6
  import * as SDK from '../../core/sdk/sdk.js';
7
- import * as Bindings from '../../models/bindings/bindings.js';
8
- import * as Formatter from '../../models/formatter/formatter.js';
9
- import * as TextUtils from '../../models/text_utils/text_utils.js';
10
- import type * as Workspace from '../../models/workspace/workspace.js';
7
+ import * as Bindings from '../bindings/bindings.js';
8
+ import * as Formatter from '../formatter/formatter.js';
9
+ import * as TextUtils from '../text_utils/text_utils.js';
10
+ import type * as Workspace from '../workspace/workspace.js';
11
11
  import * as Protocol from '../../generated/protocol.js';
12
12
 
13
13
  interface CachedScopeMap {
@@ -0,0 +1,7 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as NamesResolver from './NamesResolver.js';
6
+
7
+ export {NamesResolver};
@@ -29,9 +29,10 @@
29
29
  */
30
30
 
31
31
  import type * as Common from '../../core/common/common.js';
32
+ import type * as Platform from '../../core/platform/platform.js';
32
33
 
33
34
  export abstract class ContentProvider {
34
- abstract contentURL(): string;
35
+ abstract contentURL(): Platform.DevToolsPath.UrlString;
35
36
  abstract contentType(): Common.ResourceType.ResourceType;
36
37
  abstract contentEncoded(): Promise<boolean>;
37
38
  abstract requestContent(): Promise<DeferredContent>;
@@ -3,17 +3,19 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type * as Common from '../../core/common/common.js';
6
+ import type * as Platform from '../../core/platform/platform.js';
6
7
 
7
8
  import type {ContentProvider, DeferredContent, SearchMatch} from './ContentProvider.js';
8
9
  import {performSearchInContent} from './TextUtils.js';
9
10
 
10
11
  export class StaticContentProvider implements ContentProvider {
11
- private readonly contentURLInternal: string;
12
+ private readonly contentURLInternal: Platform.DevToolsPath.UrlString;
12
13
  private readonly contentTypeInternal: Common.ResourceType.ResourceType;
13
14
  private readonly lazyContent: () => Promise<DeferredContent>;
14
15
 
15
16
  constructor(
16
- contentURL: string, contentType: Common.ResourceType.ResourceType, lazyContent: () => Promise<DeferredContent>) {
17
+ contentURL: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType,
18
+ lazyContent: () => Promise<DeferredContent>) {
17
19
  this.contentURLInternal = contentURL;
18
20
  this.contentTypeInternal = contentType;
19
21
  this.lazyContent = lazyContent;
@@ -25,11 +27,11 @@ export class StaticContentProvider implements ContentProvider {
25
27
  content: string,
26
28
  isEncoded: boolean,
27
29
  }> => Promise.resolve({content, isEncoded: false});
28
- return new StaticContentProvider(contentURL, contentType, lazyContent);
30
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
31
+ return new StaticContentProvider(contentURL as Platform.DevToolsPath.UrlString, contentType, lazyContent);
29
32
  }
30
33
 
31
- // TODO(crbug.com/1253323): Cast to PawPathString will be removed when migration to branded types is complete.
32
- contentURL(): string {
34
+ contentURL(): Platform.DevToolsPath.UrlString {
33
35
  return this.contentURLInternal;
34
36
  }
35
37
 
@@ -56,7 +56,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
56
56
  private projectInternal: Project;
57
57
  private urlInternal: string;
58
58
  private readonly originInternal: string;
59
- private readonly parentURLInternal: string;
59
+ private readonly parentURLInternal: Platform.DevToolsPath.UrlString;
60
60
  private nameInternal: string;
61
61
  private contentTypeInternal: Common.ResourceType.ResourceType;
62
62
  private requestContentPromise: Promise<TextUtils.ContentProvider.DeferredContent>|null;
@@ -81,7 +81,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
81
81
  const parsedURL = Common.ParsedURL.ParsedURL.fromString(url);
82
82
  if (parsedURL) {
83
83
  this.originInternal = parsedURL.securityOrigin();
84
- this.parentURLInternal = this.originInternal + parsedURL.folderPathComponents;
84
+ this.parentURLInternal = this.originInternal + parsedURL.folderPathComponents as Platform.DevToolsPath.UrlString;
85
85
  if (parsedURL.queryParams) {
86
86
  // in case file name contains query params, it doesn't look like a normal file name anymore
87
87
  // so it can as well remain encoded
@@ -92,7 +92,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
92
92
  }
93
93
  } else {
94
94
  this.originInternal = '';
95
- this.parentURLInternal = '';
95
+ this.parentURLInternal = '' as Platform.DevToolsPath.UrlString;
96
96
  this.nameInternal = url;
97
97
  }
98
98
 
@@ -122,11 +122,11 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
122
122
  return this.projectInternal.mimeType(this);
123
123
  }
124
124
 
125
- url(): string {
126
- return this.urlInternal;
125
+ url(): Platform.DevToolsPath.UrlString {
126
+ return this.urlInternal as Platform.DevToolsPath.UrlString;
127
127
  }
128
128
 
129
- parentURL(): string {
129
+ parentURL(): Platform.DevToolsPath.UrlString {
130
130
  return this.parentURLInternal;
131
131
  }
132
132
 
@@ -189,7 +189,7 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
189
189
  WorkspaceImplEvents.UISourceCodeRenamed, {oldURL: oldURL, uiSourceCode: this});
190
190
  }
191
191
 
192
- contentURL(): string {
192
+ contentURL(): Platform.DevToolsPath.UrlString {
193
193
  return this.url();
194
194
  }
195
195
 
@@ -29,7 +29,6 @@
29
29
  */
30
30
 
31
31
  import * as Common from '../../core/common/common.js';
32
- import type * as Platform from '../../core/platform/platform.js';
33
32
  import type * as TextUtils from '../text_utils/text_utils.js';
34
33
 
35
34
  import type {UISourceCodeMetadata} from './UISourceCode.js';
@@ -177,8 +176,7 @@ export abstract class ProjectStore implements Project {
177
176
  renameUISourceCode(uiSourceCode: UISourceCode, newName: string): void {
178
177
  const oldPath = uiSourceCode.url();
179
178
  const newPath = uiSourceCode.parentURL() ?
180
- Common.ParsedURL.ParsedURL.urlFromParentUrlAndName(
181
- uiSourceCode.parentURL() as Platform.DevToolsPath.UrlString, newName) :
179
+ Common.ParsedURL.ParsedURL.urlFromParentUrlAndName(uiSourceCode.parentURL(), newName) :
182
180
  encodeURIComponent(newName);
183
181
  const value = this.uiSourceCodesMap.get(oldPath) as {
184
182
  uiSourceCode: UISourceCode,