chrome-devtools-frontend 1.0.971140 → 1.0.971727

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 (73) hide show
  1. package/config/gni/devtools_grd_files.gni +8 -7
  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/sdk/CSSModel.ts +21 -0
  5. package/front_end/core/sdk/CSSStyleSheetHeader.ts +10 -10
  6. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +6 -4
  7. package/front_end/core/sdk/DOMDebuggerModel.ts +4 -3
  8. package/front_end/core/sdk/DebuggerModel.ts +17 -16
  9. package/front_end/core/sdk/NetworkManager.ts +2 -2
  10. package/front_end/core/sdk/NetworkRequest.ts +5 -5
  11. package/front_end/core/sdk/Resource.ts +10 -10
  12. package/front_end/core/sdk/ResourceTreeModel.ts +18 -13
  13. package/front_end/core/sdk/Script.ts +10 -10
  14. package/front_end/core/sdk/SourceMap.ts +3 -1
  15. package/front_end/entrypoints/main/MainImpl.ts +5 -0
  16. package/front_end/generated/InspectorBackendCommands.js +14 -8
  17. package/front_end/generated/SupportedCSSProperties.js +2 -0
  18. package/front_end/generated/protocol-mapping.d.ts +5 -0
  19. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  20. package/front_end/generated/protocol.ts +20 -12
  21. package/front_end/models/bindings/BreakpointManager.ts +7 -5
  22. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -1
  23. package/front_end/models/bindings/ResourceMapping.ts +2 -1
  24. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -1
  25. package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
  26. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +12 -12
  27. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataHttpNotFound.md → federatedAuthRequestClientMetadataHttpNotFound.md} +0 -0
  28. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataInvalidResponse.md → federatedAuthRequestClientMetadataInvalidResponse.md} +0 -0
  29. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataNoResponse.md → federatedAuthRequestClientMetadataNoResponse.md} +0 -0
  30. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  31. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  32. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  33. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +1 -1
  34. package/front_end/models/persistence/IsolatedFileSystem.ts +10 -12
  35. package/front_end/models/persistence/PersistenceActions.ts +1 -4
  36. package/front_end/models/persistence/PlatformFileSystem.ts +3 -3
  37. package/front_end/{panels/sources/SourceMapNamesResolver.ts → models/source_map_scopes/NamesResolver.ts} +5 -5
  38. package/front_end/models/source_map_scopes/source_map_scopes.ts +7 -0
  39. package/front_end/models/text_utils/ContentProvider.ts +2 -1
  40. package/front_end/models/text_utils/StaticContentProvider.ts +5 -4
  41. package/front_end/models/workspace/UISourceCode.ts +7 -7
  42. package/front_end/models/workspace/WorkspaceImpl.ts +1 -3
  43. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  44. package/front_end/panels/console/ConsolePrompt.ts +25 -2
  45. package/front_end/panels/console/ConsoleViewMessage.ts +41 -8
  46. package/front_end/panels/coverage/CoverageModel.ts +1 -1
  47. package/front_end/panels/elements/ElementsTreeElement.ts +0 -6
  48. package/front_end/panels/elements/StylesSidebarPane.ts +16 -18
  49. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  50. package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
  51. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +0 -5
  52. package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
  53. package/front_end/panels/profiler/CPUProfileView.ts +1 -1
  54. package/front_end/panels/profiler/HeapProfileView.ts +0 -2
  55. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +0 -1
  56. package/front_end/panels/profiler/HeapSnapshotView.ts +2 -3
  57. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  58. package/front_end/panels/sources/DebuggerPlugin.ts +5 -4
  59. package/front_end/panels/sources/NavigatorView.ts +1 -1
  60. package/front_end/panels/sources/ScopeChainSidebarPane.ts +6 -3
  61. package/front_end/panels/sources/SourcesNavigator.ts +7 -1
  62. package/front_end/panels/sources/sources-legacy.ts +5 -3
  63. package/front_end/panels/sources/sources.ts +0 -2
  64. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -47
  65. package/front_end/ui/legacy/ViewManager.ts +2 -1
  66. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
  67. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
  68. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +2 -3
  69. package/front_end/ui/legacy/components/utils/Linkifier.ts +20 -59
  70. package/package.json +1 -1
  71. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +0 -1
  72. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +0 -1
  73. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +0 -1
@@ -310,9 +310,9 @@ grd_files_release_sources = [
310
310
  "front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md",
311
311
  "front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md",
312
312
  "front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md",
313
- "front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md",
314
- "front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md",
315
- "front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataNoResponse.md",
313
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md",
314
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md",
315
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md",
316
316
  "front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md",
317
317
  "front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md",
318
318
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md",
@@ -320,10 +320,10 @@ grd_files_release_sources = [
320
320
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md",
321
321
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md",
322
322
  "front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md",
323
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md",
324
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md",
325
+ "front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md",
323
326
  "front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md",
324
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md",
325
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md",
326
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md",
327
327
  "front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md",
328
328
  "front_end/models/issues_manager/descriptions/heavyAd.md",
329
329
  "front_end/models/issues_manager/descriptions/mixedContent.md",
@@ -335,6 +335,7 @@ grd_files_release_sources = [
335
335
  "front_end/models/persistence/persistence-legacy.js",
336
336
  "front_end/models/persistence/persistence-meta.js",
337
337
  "front_end/models/persistence/persistence.js",
338
+ "front_end/models/source_map_scopes/source_map_scopes.js",
338
339
  "front_end/models/text_utils/text_utils-legacy.js",
339
340
  "front_end/models/text_utils/text_utils.js",
340
341
  "front_end/models/timeline_model/timeline_model-legacy.js",
@@ -761,6 +762,7 @@ grd_files_debug_sources = [
761
762
  "front_end/models/persistence/WorkspaceSettingsTab.js",
762
763
  "front_end/models/persistence/editFileSystemView.css.js",
763
764
  "front_end/models/persistence/workspaceSettingsTab.css.js",
765
+ "front_end/models/source_map_scopes/NamesResolver.js",
764
766
  "front_end/models/text_utils/ContentProvider.js",
765
767
  "front_end/models/text_utils/StaticContentProvider.js",
766
768
  "front_end/models/text_utils/Text.js",
@@ -1215,7 +1217,6 @@ grd_files_debug_sources = [
1215
1217
  "front_end/panels/sources/ScriptOriginPlugin.js",
1216
1218
  "front_end/panels/sources/SearchSourcesView.js",
1217
1219
  "front_end/panels/sources/SnippetsPlugin.js",
1218
- "front_end/panels/sources/SourceMapNamesResolver.js",
1219
1220
  "front_end/panels/sources/SourcesNavigator.js",
1220
1221
  "front_end/panels/sources/SourcesPanel.js",
1221
1222
  "front_end/panels/sources/SourcesSearchScope.js",
@@ -167,7 +167,7 @@ export class ParsedURL {
167
167
  */
168
168
  static encodedFromParentPathAndName(parentPath: Platform.DevToolsPath.EncodedPathString, name: string):
169
169
  Platform.DevToolsPath.EncodedPathString {
170
- return parentPath + '/' + encodeURIComponent(name) as Platform.DevToolsPath.EncodedPathString;
170
+ return ParsedURL.concatenate(parentPath, '/', encodeURIComponent(name));
171
171
  }
172
172
 
173
173
  /**
@@ -175,7 +175,7 @@ export class ParsedURL {
175
175
  */
176
176
  static urlFromParentUrlAndName(parentUrl: Platform.DevToolsPath.UrlString, name: string):
177
177
  Platform.DevToolsPath.UrlString {
178
- return parentUrl + '/' + encodeURIComponent(name) as Platform.DevToolsPath.UrlString;
178
+ return ParsedURL.concatenate(parentUrl, '/', encodeURIComponent(name));
179
179
  }
180
180
 
181
181
  static encodedPathToRawPathString(encPath: Platform.DevToolsPath.EncodedPathString):
@@ -218,7 +218,13 @@ export class ParsedURL {
218
218
  static substr<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath.RawPathString|
219
219
  Platform.DevToolsPath.EncodedPathString>(
220
220
  devToolsPath: DevToolsPathType, from: number, length?: number): DevToolsPathType {
221
- return devToolsPath.substr(from, length) as typeof devToolsPath;
221
+ return devToolsPath.substr(from, length) as DevToolsPathType;
222
+ }
223
+
224
+ static concatenate<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath
225
+ .RawPathString|Platform.DevToolsPath.EncodedPathString>(
226
+ devToolsPath: DevToolsPathType, ...appendage: string[]): DevToolsPathType {
227
+ return devToolsPath.concat(...appendage) as DevToolsPathType;
222
228
  }
223
229
 
224
230
  static urlWithoutHash(url: string): string {
@@ -587,8 +587,9 @@ export enum DevtoolsExperiments {
587
587
  'stylesPaneCSSChanges' = 55,
588
588
  'headerOverrides' = 56,
589
589
  'lighthousePanelFR' = 57,
590
+ 'evaluateExpressionsWithSourceMaps' = 58,
590
591
  // Increment this when new experiments are added.
591
- 'MaxValue' = 58,
592
+ 'MaxValue' = 59,
592
593
  }
593
594
  /* eslint-enable @typescript-eslint/naming-convention */
594
595
 
@@ -429,6 +429,27 @@ export class CSSModel extends SDKModel<EventTypes> {
429
429
  }
430
430
  }
431
431
 
432
+ async setSupportsText(
433
+ styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange,
434
+ newSupportsText: string): Promise<boolean> {
435
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
436
+
437
+ try {
438
+ await this.ensureOriginalStyleSheetText(styleSheetId);
439
+ const {supports} = await this.agent.invoke_setSupportsText({styleSheetId, range, text: newSupportsText});
440
+
441
+ if (!supports) {
442
+ return false;
443
+ }
444
+ this.#domModel.markUndoableState();
445
+ const edit = new Edit(styleSheetId, range, newSupportsText, supports);
446
+ this.fireStyleSheetChanged(styleSheetId, edit);
447
+ return true;
448
+ } catch (e) {
449
+ return false;
450
+ }
451
+ }
452
+
432
453
  async addRule(styleSheetId: Protocol.CSS.StyleSheetId, ruleText: string, ruleLocation: TextUtils.TextRange.TextRange):
433
454
  Promise<CSSStyleRule|null> {
434
455
  try {
@@ -5,6 +5,7 @@
5
5
  import * as TextUtils from '../../models/text_utils/text_utils.js';
6
6
  import * as Common from '../common/common.js';
7
7
  import * as i18n from '../i18n/i18n.js';
8
+ import type * as Platform from '../platform/platform.js';
8
9
  import type * as Protocol from '../../generated/protocol.js';
9
10
 
10
11
  import type {CSSModel} from './CSSModel.js';
@@ -30,7 +31,7 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
30
31
  #cssModelInternal: CSSModel;
31
32
  id: Protocol.CSS.StyleSheetId;
32
33
  frameId: Protocol.Page.FrameId;
33
- sourceURL: string;
34
+ sourceURL: Platform.DevToolsPath.UrlString;
34
35
  hasSourceURL: boolean;
35
36
  origin: Protocol.CSS.StyleSheetOrigin;
36
37
  title: string;
@@ -51,7 +52,7 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
51
52
  this.#cssModelInternal = cssModel;
52
53
  this.id = payload.styleSheetId;
53
54
  this.frameId = payload.frameId;
54
- this.sourceURL = payload.sourceURL;
55
+ this.sourceURL = payload.sourceURL as Platform.DevToolsPath.UrlString;
55
56
  this.hasSourceURL = Boolean(payload.hasSourceURL);
56
57
  this.origin = payload.origin;
57
58
  this.title = payload.title;
@@ -102,19 +103,19 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
102
103
  return this.isConstructed && this.sourceURL.length === 0;
103
104
  }
104
105
 
105
- resourceURL(): string {
106
- return this.isViaInspector() ? this.viaInspectorResourceURL() : this.sourceURL;
106
+ resourceURL(): Platform.DevToolsPath.UrlString {
107
+ return (this.isViaInspector() ? this.viaInspectorResourceURL() : this.sourceURL);
107
108
  }
108
109
 
109
- private viaInspectorResourceURL(): string {
110
+ private viaInspectorResourceURL(): Platform.DevToolsPath.UrlString {
110
111
  const model = this.#cssModelInternal.target().model(ResourceTreeModel);
111
112
  console.assert(Boolean(model));
112
113
  if (!model) {
113
- return '';
114
+ return '' as Platform.DevToolsPath.UrlString;
114
115
  }
115
116
  const frame = model.frameForId(this.frameId);
116
117
  if (!frame) {
117
- return '';
118
+ return '' as Platform.DevToolsPath.UrlString;
118
119
  }
119
120
  console.assert(Boolean(frame));
120
121
  const parsedURL = new Common.ParsedURL.ParsedURL(frame.url);
@@ -123,7 +124,7 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
123
124
  fakeURL += '/';
124
125
  }
125
126
  fakeURL += 'inspector-stylesheet';
126
- return fakeURL;
127
+ return fakeURL as Platform.DevToolsPath.UrlString;
127
128
  }
128
129
 
129
130
  lineNumberInSource(lineNumberInStyleSheet: number): number {
@@ -145,8 +146,7 @@ export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentPro
145
146
  return afterStart && beforeEnd;
146
147
  }
147
148
 
148
- // TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
149
- contentURL(): string {
149
+ contentURL(): Platform.DevToolsPath.UrlString {
150
150
  return this.resourceURL();
151
151
  }
152
152
 
@@ -31,6 +31,7 @@
31
31
  import * as TextUtils from '../../models/text_utils/text_utils.js';
32
32
  import type * as Common from '../common/common.js';
33
33
  import * as i18n from '../i18n/i18n.js';
34
+ import type * as Platform from '../platform/platform.js';
34
35
 
35
36
  import type {PageResourceLoadInitiator} from './PageResourceLoader.js';
36
37
  import {PageResourceLoader} from './PageResourceLoader.js';
@@ -48,18 +49,19 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/CompilerSourceMappingContentP
48
49
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
49
50
 
50
51
  export class CompilerSourceMappingContentProvider implements TextUtils.ContentProvider.ContentProvider {
51
- readonly #sourceURL: string;
52
+ readonly #sourceURL: Platform.DevToolsPath.UrlString;
52
53
  readonly #contentTypeInternal: Common.ResourceType.ResourceType;
53
54
  readonly #initiator: PageResourceLoadInitiator;
54
55
 
55
- constructor(sourceURL: string, contentType: Common.ResourceType.ResourceType, initiator: PageResourceLoadInitiator) {
56
+ constructor(
57
+ sourceURL: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType,
58
+ initiator: PageResourceLoadInitiator) {
56
59
  this.#sourceURL = sourceURL;
57
60
  this.#contentTypeInternal = contentType;
58
61
  this.#initiator = initiator;
59
62
  }
60
63
 
61
- // TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
62
- contentURL(): string {
64
+ contentURL(): Platform.DevToolsPath.UrlString {
63
65
  return this.#sourceURL;
64
66
  }
65
67
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../common/common.js';
6
6
  import * as i18n from '../i18n/i18n.js';
7
+ import type * as Platform from '../platform/platform.js';
7
8
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
8
9
  import * as Protocol from '../../generated/protocol.js';
9
10
 
@@ -515,7 +516,7 @@ export class EventListener {
515
516
  readonly #handlerInternal: RemoteObject|null;
516
517
  readonly #originalHandlerInternal: RemoteObject|null;
517
518
  readonly #locationInternal: Location;
518
- readonly #sourceURLInternal: string;
519
+ readonly #sourceURLInternal: Platform.DevToolsPath.UrlString;
519
520
  readonly #customRemoveFunction: RemoteObject|null;
520
521
  #originInternal: string;
521
522
 
@@ -533,7 +534,7 @@ export class EventListener {
533
534
  this.#originalHandlerInternal = originalHandler || handler;
534
535
  this.#locationInternal = location;
535
536
  const script = location.script();
536
- this.#sourceURLInternal = script ? script.contentURL() : '';
537
+ this.#sourceURLInternal = script ? script.contentURL() : '' as Platform.DevToolsPath.UrlString;
537
538
  this.#customRemoveFunction = customRemoveFunction;
538
539
  this.#originInternal = origin || EventListener.Origin.Raw;
539
540
  }
@@ -566,7 +567,7 @@ export class EventListener {
566
567
  return this.#locationInternal;
567
568
  }
568
569
 
569
- sourceURL(): string {
570
+ sourceURL(): Platform.DevToolsPath.UrlString {
570
571
  return this.#sourceURLInternal;
571
572
  }
572
573
 
@@ -418,14 +418,13 @@ export class DebuggerModel extends SDKModel<EventTypes> {
418
418
  return this.agent.invoke_pauseOnAsyncCall({parentStackTraceId: parentStackTraceId});
419
419
  }
420
420
 
421
- async setBreakpointByURL(url: string, lineNumber: number, columnNumber?: number, condition?: string):
422
- Promise<SetBreakpointResult> {
421
+ async setBreakpointByURL(
422
+ url: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber?: number,
423
+ condition?: string): Promise<SetBreakpointResult> {
423
424
  // Convert file url to node-js path.
424
425
  let urlRegex;
425
426
  if (this.target().type() === Type.Node && url.startsWith('file://')) {
426
- // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
427
- const platformPath =
428
- Common.ParsedURL.ParsedURL.urlToRawPathString(url as Platform.DevToolsPath.UrlString, Host.Platform.isWin());
427
+ const platformPath = Common.ParsedURL.ParsedURL.urlToRawPathString(url, Host.Platform.isWin());
429
428
  urlRegex =
430
429
  `${Platform.StringUtilities.escapeForRegExp(platformPath)}|${Platform.StringUtilities.escapeForRegExp(url)}`;
431
430
  if (Host.Platform.isWin() && platformPath.match(/^.:\\/)) {
@@ -696,14 +695,14 @@ export class DebuggerModel extends SDKModel<EventTypes> {
696
695
  }
697
696
 
698
697
  parsedScriptSource(
699
- scriptId: Protocol.Runtime.ScriptId, sourceURL: string, startLine: number, startColumn: number, endLine: number,
700
- endColumn: number,
698
+ scriptId: Protocol.Runtime.ScriptId, sourceURL: Platform.DevToolsPath.UrlString, startLine: number,
699
+ startColumn: number, endLine: number, endColumn: number,
701
700
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
702
701
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
703
702
  executionContextId: number, hash: string, executionContextAuxData: any, isLiveEdit: boolean,
704
- sourceMapURL: string|undefined, hasSourceURLComment: boolean, hasSyntaxError: boolean, length: number,
705
- isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null, codeOffset: number|null,
706
- scriptLanguage: string|null, debugSymbols: Protocol.Debugger.DebugSymbols|null,
703
+ sourceMapURL: Platform.DevToolsPath.UrlString|undefined, hasSourceURLComment: boolean, hasSyntaxError: boolean,
704
+ length: number, isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null,
705
+ codeOffset: number|null, scriptLanguage: string|null, debugSymbols: Protocol.Debugger.DebugSymbols|null,
707
706
  embedderName: string|null): Script {
708
707
  const knownScript = this.#scriptsInternal.get(scriptId);
709
708
  if (knownScript) {
@@ -740,7 +739,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
740
739
  return script;
741
740
  }
742
741
 
743
- setSourceMapURL(script: Script, newSourceMapURL: string): void {
742
+ setSourceMapURL(script: Script, newSourceMapURL: Platform.DevToolsPath.UrlString): void {
744
743
  let sourceMapId = DebuggerModel.sourceMapId(script.executionContextId, script.sourceURL, script.sourceMapURL);
745
744
  if (sourceMapId && this.#sourceMapIdToScript.get(sourceMapId) === script) {
746
745
  this.#sourceMapIdToScript.delete(sourceMapId);
@@ -1058,8 +1057,9 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
1058
1057
  return;
1059
1058
  }
1060
1059
  this.#debuggerModel.parsedScriptSource(
1061
- scriptId, url, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData,
1062
- Boolean(isLiveEdit), sourceMapURL, Boolean(hasSourceURL), false, length || 0, isModule || null,
1060
+ scriptId, url as Platform.DevToolsPath.UrlString, startLine, startColumn, endLine, endColumn,
1061
+ executionContextId, hash, executionContextAuxData, Boolean(isLiveEdit),
1062
+ sourceMapURL as Platform.DevToolsPath.UrlString, Boolean(hasSourceURL), false, length || 0, isModule || null,
1063
1063
  stackTrace || null, codeOffset || null, scriptLanguage || null, debugSymbols || null, embedderName || null);
1064
1064
  }
1065
1065
 
@@ -1086,9 +1086,10 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
1086
1086
  return;
1087
1087
  }
1088
1088
  this.#debuggerModel.parsedScriptSource(
1089
- scriptId, url, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData,
1090
- false, sourceMapURL, Boolean(hasSourceURL), true, length || 0, isModule || null, stackTrace || null,
1091
- codeOffset || null, scriptLanguage || null, null, embedderName || null);
1089
+ scriptId, url as Platform.DevToolsPath.UrlString, startLine, startColumn, endLine, endColumn,
1090
+ executionContextId, hash, executionContextAuxData, false, sourceMapURL as Platform.DevToolsPath.UrlString,
1091
+ Boolean(hasSourceURL), true, length || 0, isModule || null, stackTrace || null, codeOffset || null,
1092
+ scriptLanguage || null, null, embedderName || null);
1092
1093
  }
1093
1094
 
1094
1095
  breakpointResolved({breakpointId, location}: Protocol.Debugger.BreakpointResolvedEvent): void {
@@ -630,7 +630,7 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
630
630
  const lastModifiedHeader = lowercaseHeaders['last-modified'];
631
631
  // We missed the requestWillBeSent.
632
632
  const eventData: RequestUpdateDroppedEventData = {
633
- url: response.url,
633
+ url: response.url as Platform.DevToolsPath.UrlString,
634
634
  frameId: frameId ?? null,
635
635
  loaderId: loaderId,
636
636
  resourceType: type,
@@ -1723,7 +1723,7 @@ export interface InterceptionPattern {
1723
1723
  export type RequestInterceptor = (request: InterceptedRequest) => Promise<void>;
1724
1724
 
1725
1725
  export interface RequestUpdateDroppedEventData {
1726
- url: string;
1726
+ url: Platform.DevToolsPath.UrlString;
1727
1727
  frameId: Protocol.Page.FrameId|null;
1728
1728
  loaderId: Protocol.Network.LoaderId;
1729
1729
  resourceType: Protocol.Network.ResourceType;
@@ -257,7 +257,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
257
257
  #includedRequestCookiesInternal: Cookie[];
258
258
  #blockedResponseCookiesInternal: BlockedSetCookieWithReason[];
259
259
  localizedFailDescription: string|null;
260
- #urlInternal!: string;
260
+ #urlInternal!: Platform.DevToolsPath.UrlString;
261
261
  #responseReceivedTimeInternal!: number;
262
262
  #transferSizeInternal!: number;
263
263
  #finishedInternal!: boolean;
@@ -406,7 +406,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
406
406
  return this.#backendRequestIdInternal;
407
407
  }
408
408
 
409
- url(): string {
409
+ url(): Platform.DevToolsPath.UrlString {
410
410
  return this.#urlInternal;
411
411
  }
412
412
 
@@ -414,12 +414,13 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
414
414
  return this.#urlInternal.startsWith('blob:');
415
415
  }
416
416
 
417
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
417
418
  setUrl(x: string): void {
418
419
  if (this.#urlInternal === x) {
419
420
  return;
420
421
  }
421
422
 
422
- this.#urlInternal = x;
423
+ this.#urlInternal = x as Platform.DevToolsPath.UrlString;
423
424
  this.#parsedURLInternal = new Common.ParsedURL.ParsedURL(x);
424
425
  this.#queryStringInternal = undefined;
425
426
  this.#parsedQueryParameters = undefined;
@@ -1186,8 +1187,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
1186
1187
  this.#contentDataProvider = dataProvider;
1187
1188
  }
1188
1189
 
1189
- // TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
1190
- contentURL(): string {
1190
+ contentURL(): Platform.DevToolsPath.UrlString {
1191
1191
  return this.#urlInternal;
1192
1192
  }
1193
1193
 
@@ -42,8 +42,8 @@ import type {ResourceTreeFrame, ResourceTreeModel} from './ResourceTreeModel.js'
42
42
  export class Resource implements TextUtils.ContentProvider.ContentProvider {
43
43
  readonly #resourceTreeModel: ResourceTreeModel;
44
44
  #requestInternal: NetworkRequest|null;
45
- #urlInternal!: string;
46
- readonly #documentURLInternal: string;
45
+ #urlInternal!: Platform.DevToolsPath.UrlString;
46
+ readonly #documentURLInternal: Platform.DevToolsPath.UrlString;
47
47
  readonly #frameIdInternal: Protocol.Page.FrameId|null;
48
48
  readonly #loaderIdInternal: Protocol.Network.LoaderId|null;
49
49
  readonly #type: Common.ResourceType.ResourceType;
@@ -58,9 +58,10 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
58
58
  #contentRequested?: boolean;
59
59
 
60
60
  constructor(
61
- resourceTreeModel: ResourceTreeModel, request: NetworkRequest|null, url: string, documentURL: string,
62
- frameId: Protocol.Page.FrameId|null, loaderId: Protocol.Network.LoaderId|null,
63
- type: Common.ResourceType.ResourceType, mimeType: string, lastModified: Date|null, contentSize: number|null) {
61
+ resourceTreeModel: ResourceTreeModel, request: NetworkRequest|null, url: Platform.DevToolsPath.UrlString,
62
+ documentURL: Platform.DevToolsPath.UrlString, frameId: Protocol.Page.FrameId|null,
63
+ loaderId: Protocol.Network.LoaderId|null, type: Common.ResourceType.ResourceType, mimeType: string,
64
+ lastModified: Date|null, contentSize: number|null) {
64
65
  this.#resourceTreeModel = resourceTreeModel;
65
66
  this.#requestInternal = request;
66
67
  this.url = url;
@@ -101,11 +102,11 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
101
102
  return this.#requestInternal;
102
103
  }
103
104
 
104
- get url(): string {
105
+ get url(): Platform.DevToolsPath.UrlString {
105
106
  return this.#urlInternal;
106
107
  }
107
108
 
108
- set url(x: string) {
109
+ set url(x: Platform.DevToolsPath.UrlString) {
109
110
  this.#urlInternal = x;
110
111
  this.#parsedURLInternal = new Common.ParsedURL.ParsedURL(x);
111
112
  }
@@ -114,7 +115,7 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
114
115
  return this.#parsedURLInternal;
115
116
  }
116
117
 
117
- get documentURL(): string {
118
+ get documentURL(): Platform.DevToolsPath.UrlString {
118
119
  return this.#documentURLInternal;
119
120
  }
120
121
 
@@ -150,8 +151,7 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
150
151
  this.#isGeneratedInternal = val;
151
152
  }
152
153
 
153
- // TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
154
- contentURL(): string {
154
+ contentURL(): Platform.DevToolsPath.UrlString {
155
155
  return this.#urlInternal;
156
156
  }
157
157
 
@@ -34,6 +34,7 @@
34
34
 
35
35
  import * as Common from '../common/common.js';
36
36
  import * as i18n from '../i18n/i18n.js';
37
+ import type * as Platform from '../platform/platform.js';
37
38
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
38
39
  import * as Protocol from '../../generated/protocol.js';
39
40
 
@@ -50,6 +51,8 @@ import {SDKModel} from './SDKModel.js';
50
51
  import {TargetManager} from './TargetManager.js';
51
52
  import {SecurityOriginManager} from './SecurityOriginManager.js';
52
53
 
54
+ // TODO(crbug.com/1253323): Casts to UrlString will be removed from this file when migration to branded types is complete.
55
+
53
56
  export class ResourceTreeModel extends SDKModel<EventTypes> {
54
57
  readonly agent: ProtocolProxyApi.PageApi;
55
58
  readonly #securityOriginManager: SecurityOriginManager;
@@ -237,8 +240,8 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
237
240
  const frame = this.framesInternal.get(framePayload.id);
238
241
  if (frame && !frame.getResourcesMap().get(framePayload.url)) {
239
242
  const frameResource = this.createResourceFromFramePayload(
240
- framePayload, framePayload.url, Common.ResourceType.resourceTypes.Document, framePayload.mimeType, null,
241
- null);
243
+ framePayload, framePayload.url as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Document,
244
+ framePayload.mimeType, null, null);
242
245
  frameResource.isGenerated = true;
243
246
  frame.addResource(frameResource);
244
247
  }
@@ -301,8 +304,8 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
301
304
  }
302
305
 
303
306
  const resource = new Resource(
304
- this, null, url, frame.url, frameId, data.loaderId, Common.ResourceType.resourceTypes[data.resourceType],
305
- data.mimeType, data.lastModified, null);
307
+ this, null, url, frame.url as Platform.DevToolsPath.UrlString, frameId, data.loaderId,
308
+ Common.ResourceType.resourceTypes[data.resourceType], data.mimeType, data.lastModified, null);
306
309
  frame.addResource(resource);
307
310
  }
308
311
 
@@ -342,25 +345,27 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
342
345
  for (let i = 0; i < frameTreePayload.resources.length; ++i) {
343
346
  const subresource = frameTreePayload.resources[i];
344
347
  const resource = this.createResourceFromFramePayload(
345
- framePayload, subresource.url, Common.ResourceType.resourceTypes[subresource.type], subresource.mimeType,
346
- subresource.lastModified || null, subresource.contentSize || null);
348
+ framePayload, subresource.url as Platform.DevToolsPath.UrlString,
349
+ Common.ResourceType.resourceTypes[subresource.type], subresource.mimeType, subresource.lastModified || null,
350
+ subresource.contentSize || null);
347
351
  frame.addResource(resource);
348
352
  }
349
353
 
350
354
  if (!frame.getResourcesMap().get(framePayload.url)) {
351
355
  const frameResource = this.createResourceFromFramePayload(
352
- framePayload, framePayload.url, Common.ResourceType.resourceTypes.Document, framePayload.mimeType, null,
353
- null);
356
+ framePayload, framePayload.url as Platform.DevToolsPath.UrlString, Common.ResourceType.resourceTypes.Document,
357
+ framePayload.mimeType, null, null);
354
358
  frame.addResource(frameResource);
355
359
  }
356
360
  }
357
361
 
358
362
  private createResourceFromFramePayload(
359
- frame: Protocol.Page.Frame, url: string, type: Common.ResourceType.ResourceType, mimeType: string,
360
- lastModifiedTime: number|null, contentSize: number|null): Resource {
363
+ frame: Protocol.Page.Frame, url: Platform.DevToolsPath.UrlString, type: Common.ResourceType.ResourceType,
364
+ mimeType: string, lastModifiedTime: number|null, contentSize: number|null): Resource {
361
365
  const lastModified = typeof lastModifiedTime === 'number' ? new Date(lastModifiedTime * 1000) : null;
362
366
  return new Resource(
363
- this, null, url, frame.url, frame.id, frame.loaderId, type, mimeType, lastModified, contentSize);
367
+ this, null, url, frame.url as Platform.DevToolsPath.UrlString, frame.id, frame.loaderId, type, mimeType,
368
+ lastModified, contentSize);
364
369
  }
365
370
 
366
371
  suspendReload(): void {
@@ -842,8 +847,8 @@ export class ResourceTreeFrame {
842
847
  return;
843
848
  }
844
849
  resource = new Resource(
845
- this.#model, request, request.url(), request.documentURL, request.frameId, request.loaderId,
846
- request.resourceType(), request.mimeType, null, null);
850
+ this.#model, request, request.url(), request.documentURL as Platform.DevToolsPath.UrlString, request.frameId,
851
+ request.loaderId, request.resourceType(), request.mimeType, null, null);
847
852
  this.resourcesMap.set(resource.url, resource);
848
853
  this.#model.dispatchEventToListeners(Events.ResourceAdded, resource);
849
854
  }
@@ -29,6 +29,7 @@
29
29
 
30
30
  import * as Protocol from '../../generated/protocol.js';
31
31
  import * as TextUtils from '../../models/text_utils/text_utils.js';
32
+ import type * as Platform from '../../core/platform/platform.js';
32
33
  import * as Common from '../common/common.js';
33
34
  import * as i18n from '../i18n/i18n.js';
34
35
 
@@ -56,7 +57,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
56
57
  export class Script implements TextUtils.ContentProvider.ContentProvider, FrameAssociated {
57
58
  debuggerModel: DebuggerModel;
58
59
  scriptId: Protocol.Runtime.ScriptId;
59
- sourceURL: string;
60
+ sourceURL: Platform.DevToolsPath.UrlString;
60
61
  lineOffset: number;
61
62
  columnOffset: number;
62
63
  endLine: number;
@@ -65,7 +66,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
65
66
  hash: string;
66
67
  readonly #isContentScriptInternal: boolean;
67
68
  readonly #isLiveEditInternal: boolean;
68
- sourceMapURL: string|undefined;
69
+ sourceMapURL: Platform.DevToolsPath.UrlString|undefined;
69
70
  debugSymbols: Protocol.Debugger.DebugSymbols|null;
70
71
  hasSourceURL: boolean;
71
72
  contentLength: number;
@@ -77,12 +78,12 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
77
78
  readonly #embedderNameInternal: string|null;
78
79
  readonly isModule: boolean|null;
79
80
  constructor(
80
- debuggerModel: DebuggerModel, scriptId: Protocol.Runtime.ScriptId, sourceURL: string, startLine: number,
81
- startColumn: number, endLine: number, endColumn: number, executionContextId: number, hash: string,
82
- isContentScript: boolean, isLiveEdit: boolean, sourceMapURL: string|undefined, hasSourceURL: boolean,
83
- length: number, isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null,
84
- codeOffset: number|null, scriptLanguage: string|null, debugSymbols: Protocol.Debugger.DebugSymbols|null,
85
- embedderName: string|null) {
81
+ debuggerModel: DebuggerModel, scriptId: Protocol.Runtime.ScriptId, sourceURL: Platform.DevToolsPath.UrlString,
82
+ startLine: number, startColumn: number, endLine: number, endColumn: number, executionContextId: number,
83
+ hash: string, isContentScript: boolean, isLiveEdit: boolean,
84
+ sourceMapURL: Platform.DevToolsPath.UrlString|undefined, hasSourceURL: boolean, length: number,
85
+ isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null, codeOffset: number|null,
86
+ scriptLanguage: string|null, debugSymbols: Protocol.Debugger.DebugSymbols|null, embedderName: string|null) {
86
87
  this.debuggerModel = debuggerModel;
87
88
  this.scriptId = scriptId;
88
89
  this.sourceURL = sourceURL;
@@ -163,8 +164,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
163
164
  return this.#isLiveEditInternal;
164
165
  }
165
166
 
166
- // TODO(crbug.com/1253323): Cast to RawPathString will be removed when migration to branded types is complete.
167
- contentURL(): string {
167
+ contentURL(): Platform.DevToolsPath.UrlString {
168
168
  return this.sourceURL;
169
169
  }
170
170
 
@@ -211,7 +211,9 @@ export class TextSourceMap implements SourceMap {
211
211
  if (info && info.content) {
212
212
  return TextUtils.StaticContentProvider.StaticContentProvider.fromString(sourceURL, contentType, info.content);
213
213
  }
214
- return new CompilerSourceMappingContentProvider(sourceURL, contentType, this.#initiator);
214
+ // TODO(crbug.com/1253323): Cast to UrlString will be removed when migration to branded types is complete.
215
+ return new CompilerSourceMappingContentProvider(
216
+ sourceURL as Platform.DevToolsPath.UrlString, contentType, this.#initiator);
215
217
  }
216
218
 
217
219
  embeddedContentByURL(sourceURL: string): string|null {
@@ -309,9 +309,14 @@ export class MainImpl {
309
309
  'timelineV8RuntimeCallStats', 'Timeline: V8 Runtime Call Stats on Timeline', true);
310
310
  Root.Runtime.experiments.register('timelineWebGL', 'Timeline: WebGL-based flamechart');
311
311
  Root.Runtime.experiments.register('timelineReplayEvent', 'Timeline: Replay input events', true);
312
+
313
+ // Debugging
312
314
  Root.Runtime.experiments.register(
313
315
  'wasmDWARFDebugging', 'WebAssembly Debugging: Enable DWARF support', undefined,
314
316
  'https://developer.chrome.com/blog/wasm-debugging-2020/');
317
+ Root.Runtime.experiments.register(
318
+ 'evaluateExpressionsWithSourceMaps', 'Console: Resolve variable names in expressions using source maps',
319
+ undefined);
315
320
 
316
321
  // Dual-screen
317
322
  Root.Runtime.experiments.register(