chrome-devtools-frontend 1.0.970302 → 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 (100) hide show
  1. package/config/gni/devtools_grd_files.gni +11 -7
  2. package/config/gni/devtools_image_files.gni +1 -0
  3. package/front_end/Images/src/ic_changes.svg +5 -0
  4. package/front_end/core/common/ParsedURL.ts +33 -4
  5. package/front_end/core/host/UserMetrics.ts +4 -1
  6. package/front_end/core/i18n/locales/en-US.json +21 -3
  7. package/front_end/core/i18n/locales/en-XL.json +21 -3
  8. package/front_end/core/platform/UserVisibleError.ts +28 -0
  9. package/front_end/core/platform/platform.ts +2 -0
  10. package/front_end/core/sdk/CSSModel.ts +21 -0
  11. package/front_end/core/sdk/CSSStyleSheetHeader.ts +10 -10
  12. package/front_end/core/sdk/ChildTargetManager.ts +0 -1
  13. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +6 -4
  14. package/front_end/core/sdk/DOMDebuggerModel.ts +4 -3
  15. package/front_end/core/sdk/DebuggerModel.ts +21 -16
  16. package/front_end/core/sdk/NetworkManager.ts +17 -3
  17. package/front_end/core/sdk/NetworkRequest.ts +16 -5
  18. package/front_end/core/sdk/Resource.ts +10 -10
  19. package/front_end/core/sdk/ResourceTreeModel.ts +18 -13
  20. package/front_end/core/sdk/Script.ts +10 -10
  21. package/front_end/core/sdk/SourceMap.ts +3 -1
  22. package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +15 -6
  23. package/front_end/entrypoints/main/MainImpl.ts +8 -0
  24. package/front_end/generated/InspectorBackendCommands.js +14 -8
  25. package/front_end/generated/SupportedCSSProperties.js +2 -0
  26. package/front_end/generated/protocol-mapping.d.ts +5 -0
  27. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  28. package/front_end/generated/protocol.ts +20 -12
  29. package/front_end/models/bindings/BreakpointManager.ts +7 -5
  30. package/front_end/models/bindings/CSSWorkspaceBinding.ts +21 -0
  31. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -1
  32. package/front_end/models/bindings/ResourceMapping.ts +2 -1
  33. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -1
  34. package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
  35. package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +12 -12
  36. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataHttpNotFound.md → federatedAuthRequestClientMetadataHttpNotFound.md} +0 -0
  37. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataInvalidResponse.md → federatedAuthRequestClientMetadataInvalidResponse.md} +0 -0
  38. package/front_end/models/issues_manager/descriptions/{federatedAuthRequestClientIdMetadataNoResponse.md → federatedAuthRequestClientMetadataNoResponse.md} +0 -0
  39. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  40. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  41. package/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  42. package/front_end/models/persistence/Automapping.ts +3 -33
  43. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +12 -10
  44. package/front_end/models/persistence/IsolatedFileSystem.ts +26 -22
  45. package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -4
  46. package/front_end/models/persistence/PersistenceActions.ts +1 -4
  47. package/front_end/models/persistence/PlatformFileSystem.ts +6 -5
  48. package/front_end/{panels/sources/SourceMapNamesResolver.ts → models/source_map_scopes/NamesResolver.ts} +5 -5
  49. package/front_end/models/source_map_scopes/source_map_scopes.ts +7 -0
  50. package/front_end/models/text_utils/ContentProvider.ts +2 -1
  51. package/front_end/models/text_utils/StaticContentProvider.ts +5 -4
  52. package/front_end/models/workspace/UISourceCode.ts +18 -21
  53. package/front_end/models/workspace/WorkspaceImpl.ts +3 -1
  54. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  55. package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +0 -1
  56. package/front_end/panels/console/ConsolePrompt.ts +25 -2
  57. package/front_end/panels/console/ConsoleViewMessage.ts +41 -8
  58. package/front_end/panels/coverage/CoverageModel.ts +1 -1
  59. package/front_end/panels/elements/ElementsPanel.ts +25 -11
  60. package/front_end/panels/elements/ElementsTreeElement.ts +0 -6
  61. package/front_end/panels/elements/StylesSidebarPane.ts +214 -41
  62. package/front_end/panels/elements/elementsTreeOutline.css +0 -1
  63. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  64. package/front_end/panels/issues/AffectedSourcesView.ts +1 -1
  65. package/front_end/panels/lighthouse/LighthouseController.ts +30 -0
  66. package/front_end/panels/lighthouse/LighthousePanel.ts +7 -1
  67. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +6 -1
  68. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +0 -5
  69. package/front_end/panels/lighthouse/LighthouseStartView.ts +2 -2
  70. package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +39 -0
  71. package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
  72. package/front_end/panels/profiler/CPUProfileView.ts +1 -1
  73. package/front_end/panels/profiler/HeapProfileView.ts +0 -2
  74. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +0 -1
  75. package/front_end/panels/profiler/HeapSnapshotView.ts +2 -3
  76. package/front_end/panels/sensors/sensors.css +0 -1
  77. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +5 -5
  78. package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
  79. package/front_end/panels/sources/DebuggerPlugin.ts +5 -4
  80. package/front_end/panels/sources/NavigatorView.ts +10 -6
  81. package/front_end/panels/sources/ScopeChainSidebarPane.ts +6 -3
  82. package/front_end/panels/sources/SourcesNavigator.ts +7 -1
  83. package/front_end/panels/sources/TabbedEditorContainer.ts +9 -0
  84. package/front_end/panels/sources/sources-legacy.ts +5 -16
  85. package/front_end/panels/sources/sources.ts +0 -2
  86. package/front_end/panels/sources/sourcesView.css +0 -4
  87. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -47
  88. package/front_end/ui/legacy/ViewManager.ts +2 -1
  89. package/front_end/ui/legacy/closeButton.css +0 -1
  90. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -1
  91. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
  92. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +2 -3
  93. package/front_end/ui/legacy/components/utils/Linkifier.ts +20 -59
  94. package/front_end/ui/legacy/tabbedPane.css +0 -3
  95. package/front_end/ui/legacy/toolbar.css +28 -3
  96. package/package.json +1 -1
  97. package/scripts/npm_test.js +1 -1
  98. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +0 -1
  99. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +0 -1
  100. package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +0 -1
@@ -59,6 +59,7 @@ grd_files_release_sources = [
59
59
  "front_end/Images/flex-nowrap-icon.svg",
60
60
  "front_end/Images/flex-wrap-icon.svg",
61
61
  "front_end/Images/help_outline.svg",
62
+ "front_end/Images/ic_changes.svg",
62
63
  "front_end/Images/ic_checkmark_16x16.svg",
63
64
  "front_end/Images/ic_command_go_to_line.svg",
64
65
  "front_end/Images/ic_command_go_to_symbol.svg",
@@ -309,9 +310,9 @@ grd_files_release_sources = [
309
310
  "front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md",
310
311
  "front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md",
311
312
  "front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md",
312
- "front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md",
313
- "front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md",
314
- "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",
315
316
  "front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md",
316
317
  "front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md",
317
318
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md",
@@ -319,10 +320,10 @@ grd_files_release_sources = [
319
320
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md",
320
321
  "front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md",
321
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",
322
326
  "front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md",
323
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md",
324
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md",
325
- "front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md",
326
327
  "front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md",
327
328
  "front_end/models/issues_manager/descriptions/heavyAd.md",
328
329
  "front_end/models/issues_manager/descriptions/mixedContent.md",
@@ -334,6 +335,7 @@ grd_files_release_sources = [
334
335
  "front_end/models/persistence/persistence-legacy.js",
335
336
  "front_end/models/persistence/persistence-meta.js",
336
337
  "front_end/models/persistence/persistence.js",
338
+ "front_end/models/source_map_scopes/source_map_scopes.js",
337
339
  "front_end/models/text_utils/text_utils-legacy.js",
338
340
  "front_end/models/text_utils/text_utils.js",
339
341
  "front_end/models/timeline_model/timeline_model-legacy.js",
@@ -569,6 +571,7 @@ grd_files_debug_sources = [
569
571
  "front_end/core/i18n/time-utilities.js",
570
572
  "front_end/core/platform/DevToolsPath.js",
571
573
  "front_end/core/platform/UIString.js",
574
+ "front_end/core/platform/UserVisibleError.js",
572
575
  "front_end/core/platform/array-utilities.js",
573
576
  "front_end/core/platform/date-utilities.js",
574
577
  "front_end/core/platform/dcheck.js",
@@ -759,6 +762,7 @@ grd_files_debug_sources = [
759
762
  "front_end/models/persistence/WorkspaceSettingsTab.js",
760
763
  "front_end/models/persistence/editFileSystemView.css.js",
761
764
  "front_end/models/persistence/workspaceSettingsTab.css.js",
765
+ "front_end/models/source_map_scopes/NamesResolver.js",
762
766
  "front_end/models/text_utils/ContentProvider.js",
763
767
  "front_end/models/text_utils/StaticContentProvider.js",
764
768
  "front_end/models/text_utils/Text.js",
@@ -1044,6 +1048,7 @@ grd_files_debug_sources = [
1044
1048
  "front_end/panels/lighthouse/LighthouseReportSelector.js",
1045
1049
  "front_end/panels/lighthouse/LighthouseReporterTypes.js",
1046
1050
  "front_end/panels/lighthouse/LighthouseStartView.js",
1051
+ "front_end/panels/lighthouse/LighthouseStartViewFR.js",
1047
1052
  "front_end/panels/lighthouse/LighthouseStatusView.js",
1048
1053
  "front_end/panels/lighthouse/RadioSetting.js",
1049
1054
  "front_end/panels/lighthouse/lighthouseDialog.css.js",
@@ -1212,7 +1217,6 @@ grd_files_debug_sources = [
1212
1217
  "front_end/panels/sources/ScriptOriginPlugin.js",
1213
1218
  "front_end/panels/sources/SearchSourcesView.js",
1214
1219
  "front_end/panels/sources/SnippetsPlugin.js",
1215
- "front_end/panels/sources/SourceMapNamesResolver.js",
1216
1220
  "front_end/panels/sources/SourcesNavigator.js",
1217
1221
  "front_end/panels/sources/SourcesPanel.js",
1218
1222
  "front_end/panels/sources/SourcesSearchScope.js",
@@ -69,6 +69,7 @@ devtools_svg_sources = [
69
69
  "flex-nowrap-icon.svg",
70
70
  "flex-wrap-icon.svg",
71
71
  "help_outline.svg",
72
+ "ic_changes.svg",
72
73
  "ic_checkmark_16x16.svg",
73
74
  "ic_command_go_to_line.svg",
74
75
  "ic_command_go_to_symbol.svg",
@@ -0,0 +1,5 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.75 16.75V6.74572L12.4599 3.25H5.25V16.75H15.75ZM13 2L17 6.25V17C17 17.5523 16.5523 18 16 18H5C4.44772 18 4 17.5523 4 17V3C4 2.44772 4.44772 2 5 2H13Z" fill="black"/>
3
+ <path d="M11 6H10V8H8V9H10V11H11V9H13V8H11V6Z" fill="black"/>
4
+ <path d="M13 13L13 14L8 14L8 13L13 13Z" fill="black"/>
5
+ </svg>
@@ -162,6 +162,22 @@ export class ParsedURL {
162
162
  return new URL('/' + partiallyEncoded, 'file:///').pathname.substr(1) as Platform.DevToolsPath.EncodedPathString;
163
163
  }
164
164
 
165
+ /**
166
+ * @param name Must not be encoded
167
+ */
168
+ static encodedFromParentPathAndName(parentPath: Platform.DevToolsPath.EncodedPathString, name: string):
169
+ Platform.DevToolsPath.EncodedPathString {
170
+ return ParsedURL.concatenate(parentPath, '/', encodeURIComponent(name));
171
+ }
172
+
173
+ /**
174
+ * @param name Must not be encoded
175
+ */
176
+ static urlFromParentUrlAndName(parentUrl: Platform.DevToolsPath.UrlString, name: string):
177
+ Platform.DevToolsPath.UrlString {
178
+ return ParsedURL.concatenate(parentUrl, '/', encodeURIComponent(name));
179
+ }
180
+
165
181
  static encodedPathToRawPathString(encPath: Platform.DevToolsPath.EncodedPathString):
166
182
  Platform.DevToolsPath.RawPathString {
167
183
  return decodeURIComponent(encPath) as Platform.DevToolsPath.RawPathString;
@@ -181,8 +197,9 @@ export class ParsedURL {
181
197
  return new URL(preEncodedPath).toString() as Platform.DevToolsPath.UrlString;
182
198
  }
183
199
 
184
- static relativePathToUrlString(relativePath: string, baseURL: Platform.DevToolsPath.UrlString):
185
- Platform.DevToolsPath.UrlString {
200
+ static relativePathToUrlString(
201
+ relativePath: Platform.DevToolsPath.RawPathString,
202
+ baseURL: Platform.DevToolsPath.UrlString): Platform.DevToolsPath.UrlString {
186
203
  const preEncodedPath: string = ParsedURL.preEncodeSpecialCharactersInPath(
187
204
  relativePath.replace(/\\/g, '/') as Platform.DevToolsPath.RawPathString);
188
205
  return new URL(preEncodedPath, baseURL).toString() as Platform.DevToolsPath.UrlString;
@@ -198,6 +215,18 @@ export class ParsedURL {
198
215
  return decodedFileURL.substr('file://'.length) as Platform.DevToolsPath.RawPathString;
199
216
  }
200
217
 
218
+ static substr<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath.RawPathString|
219
+ Platform.DevToolsPath.EncodedPathString>(
220
+ devToolsPath: DevToolsPathType, from: number, length?: number): DevToolsPathType {
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;
228
+ }
229
+
201
230
  static urlWithoutHash(url: string): string {
202
231
  const hashIndex = url.indexOf('#');
203
232
  if (hashIndex !== -1) {
@@ -233,9 +262,9 @@ export class ParsedURL {
233
262
  return ParsedURL.urlRegexInstance;
234
263
  }
235
264
 
236
- static extractPath(url: string): string {
265
+ static extractPath(url: string): Platform.DevToolsPath.EncodedPathString {
237
266
  const parsedURL = this.fromString(url);
238
- return parsedURL ? parsedURL.path : '';
267
+ return (parsedURL ? parsedURL.path : '') as Platform.DevToolsPath.EncodedPathString;
239
268
  }
240
269
 
241
270
  static extractOrigin(url: string): string {
@@ -586,7 +586,10 @@ export enum DevtoolsExperiments {
586
586
  'bfcacheDisplayTree' = 54,
587
587
  'stylesPaneCSSChanges' = 55,
588
588
  'headerOverrides' = 56,
589
- 'MaxValue' = 57,
589
+ 'lighthousePanelFR' = 57,
590
+ 'evaluateExpressionsWithSourceMaps' = 58,
591
+ // Increment this when new experiments are added.
592
+ 'MaxValue' = 59,
590
593
  }
591
594
  /* eslint-enable @typescript-eslint/naming-convention */
592
595
 
@@ -1421,9 +1421,6 @@
1421
1421
  "models/logs/NetworkLog.ts | anonymous": {
1422
1422
  "message": "<anonymous>"
1423
1423
  },
1424
- "models/persistence/Automapping.ts | theAttemptToBindSInTheWorkspace": {
1425
- "message": "The attempt to bind \"{PH1}\" in the workspace failed as this URI is malformed."
1426
- },
1427
1424
  "models/persistence/EditFileSystemView.ts | add": {
1428
1425
  "message": "Add"
1429
1426
  },
@@ -4838,6 +4835,12 @@
4838
4835
  "panels/elements/StylesSidebarPane.ts | constructedStylesheet": {
4839
4836
  "message": "constructed stylesheet"
4840
4837
  },
4838
+ "panels/elements/StylesSidebarPane.ts | copiedToClipboard": {
4839
+ "message": "Copied to clipboard"
4840
+ },
4841
+ "panels/elements/StylesSidebarPane.ts | copyAllCSSChanges": {
4842
+ "message": "Copy all the CSS changes"
4843
+ },
4841
4844
  "panels/elements/StylesSidebarPane.ts | copyAllDeclarations": {
4842
4845
  "message": "Copy all declarations"
4843
4846
  },
@@ -5768,6 +5771,9 @@
5768
5771
  "panels/lighthouse/LighthouseController.ts | legacyNavigation": {
5769
5772
  "message": "Legacy navigation"
5770
5773
  },
5774
+ "panels/lighthouse/LighthouseController.ts | lighthouseMode": {
5775
+ "message": "Lighthouse mode"
5776
+ },
5771
5777
  "panels/lighthouse/LighthouseController.ts | localStorage": {
5772
5778
  "message": "Local Storage"
5773
5779
  },
@@ -5777,6 +5783,9 @@
5777
5783
  "panels/lighthouse/LighthouseController.ts | multipleTabsAreBeingControlledBy": {
5778
5784
  "message": "Multiple tabs are being controlled by the same service worker. Close your other tabs on the same origin to audit this page."
5779
5785
  },
5786
+ "panels/lighthouse/LighthouseController.ts | navigation": {
5787
+ "message": "Navigation"
5788
+ },
5780
5789
  "panels/lighthouse/LighthouseController.ts | performance": {
5781
5790
  "message": "Performance"
5782
5791
  },
@@ -5789,6 +5798,9 @@
5789
5798
  "panels/lighthouse/LighthouseController.ts | resetStorageLocalstorage": {
5790
5799
  "message": "Reset storage (cache, service workers, etc) before auditing. (Good for performance & PWA testing)"
5791
5800
  },
5801
+ "panels/lighthouse/LighthouseController.ts | runLighthouseInMode": {
5802
+ "message": "Run Lighthouse in navigation, timespan, or snapshot mode"
5803
+ },
5792
5804
  "panels/lighthouse/LighthouseController.ts | seo": {
5793
5805
  "message": "SEO"
5794
5806
  },
@@ -5798,6 +5810,9 @@
5798
5810
  "panels/lighthouse/LighthouseController.ts | simulatedThrottling": {
5799
5811
  "message": "Simulated throttling"
5800
5812
  },
5813
+ "panels/lighthouse/LighthouseController.ts | snapshot": {
5814
+ "message": "Snapshot"
5815
+ },
5801
5816
  "panels/lighthouse/LighthouseController.ts | thereMayBeStoredDataAffectingLoadingPlural": {
5802
5817
  "message": "There may be stored data affecting loading performance in these locations: {PH1}. Audit this page in an incognito window to prevent those resources from affecting your scores."
5803
5818
  },
@@ -5864,6 +5879,9 @@
5864
5879
  "panels/lighthouse/LighthouseStartView.ts | learnMore": {
5865
5880
  "message": "Learn more"
5866
5881
  },
5882
+ "panels/lighthouse/LighthouseStartViewFR.ts | mode": {
5883
+ "message": "Mode"
5884
+ },
5867
5885
  "panels/lighthouse/LighthouseStatusView.ts | ahSorryWeRanIntoAnError": {
5868
5886
  "message": "Ah, sorry! We ran into an error."
5869
5887
  },
@@ -1421,9 +1421,6 @@
1421
1421
  "models/logs/NetworkLog.ts | anonymous": {
1422
1422
  "message": "<âńôńŷḿôúŝ>"
1423
1423
  },
1424
- "models/persistence/Automapping.ts | theAttemptToBindSInTheWorkspace": {
1425
- "message": "T̂h́ê át̂t́êḿp̂t́ t̂ó b̂ín̂d́ \"{PH1}\" îń t̂h́ê ẃôŕk̂śp̂áĉé f̂áîĺêd́ âś t̂h́îś ÛŔÎ íŝ ḿâĺf̂ór̂ḿêd́."
1426
- },
1427
1424
  "models/persistence/EditFileSystemView.ts | add": {
1428
1425
  "message": "Âd́d̂"
1429
1426
  },
@@ -4838,6 +4835,12 @@
4838
4835
  "panels/elements/StylesSidebarPane.ts | constructedStylesheet": {
4839
4836
  "message": "ĉón̂śt̂ŕûćt̂éd̂ śt̂ýl̂éŝh́êét̂"
4840
4837
  },
4838
+ "panels/elements/StylesSidebarPane.ts | copiedToClipboard": {
4839
+ "message": "Ĉóp̂íêd́ t̂ó ĉĺîṕb̂óâŕd̂"
4840
+ },
4841
+ "panels/elements/StylesSidebarPane.ts | copyAllCSSChanges": {
4842
+ "message": "Ĉóp̂ý âĺl̂ t́ĥé ĈŚŜ ćĥán̂ǵêś"
4843
+ },
4841
4844
  "panels/elements/StylesSidebarPane.ts | copyAllDeclarations": {
4842
4845
  "message": "Ĉóp̂ý âĺl̂ d́êćl̂ár̂át̂íôńŝ"
4843
4846
  },
@@ -5768,6 +5771,9 @@
5768
5771
  "panels/lighthouse/LighthouseController.ts | legacyNavigation": {
5769
5772
  "message": "L̂éĝáĉý n̂áv̂íĝát̂íôń"
5770
5773
  },
5774
+ "panels/lighthouse/LighthouseController.ts | lighthouseMode": {
5775
+ "message": "L̂íĝh́t̂h́ôúŝé m̂ód̂é"
5776
+ },
5771
5777
  "panels/lighthouse/LighthouseController.ts | localStorage": {
5772
5778
  "message": "L̂óĉál̂ Śt̂ór̂áĝé"
5773
5779
  },
@@ -5777,6 +5783,9 @@
5777
5783
  "panels/lighthouse/LighthouseController.ts | multipleTabsAreBeingControlledBy": {
5778
5784
  "message": "M̂úl̂t́îṕl̂é t̂áb̂ś âŕê b́êín̂ǵ ĉón̂t́r̂ól̂ĺêd́ b̂ý t̂h́ê śâḿê service worker. Ćl̂óŝé ŷóûŕ ôt́ĥér̂ t́âb́ŝ ón̂ t́ĥé ŝám̂é ôŕîǵîń t̂ó âúd̂ít̂ t́ĥíŝ ṕâǵê."
5779
5785
  },
5786
+ "panels/lighthouse/LighthouseController.ts | navigation": {
5787
+ "message": "N̂áv̂íĝát̂íôń"
5788
+ },
5780
5789
  "panels/lighthouse/LighthouseController.ts | performance": {
5781
5790
  "message": "P̂ér̂f́ôŕm̂án̂ćê"
5782
5791
  },
@@ -5789,6 +5798,9 @@
5789
5798
  "panels/lighthouse/LighthouseController.ts | resetStorageLocalstorage": {
5790
5799
  "message": "R̂éŝét̂ śt̂ór̂áĝé (cache, service workers, êt́ĉ) b́êf́ôŕê áûd́ît́îńĝ. (Ǵôód̂ f́ôŕ p̂ér̂f́ôŕm̂án̂ćê & PWA t́êśt̂ín̂ǵ)"
5791
5800
  },
5801
+ "panels/lighthouse/LighthouseController.ts | runLighthouseInMode": {
5802
+ "message": "R̂ún̂ Ĺîǵĥt́ĥóûśê ín̂ ńâv́îǵât́îón̂, t́îḿêśp̂án̂, ór̂ śn̂áp̂śĥót̂ ḿôd́ê"
5803
+ },
5792
5804
  "panels/lighthouse/LighthouseController.ts | seo": {
5793
5805
  "message": "ŜÉÔ"
5794
5806
  },
@@ -5798,6 +5810,9 @@
5798
5810
  "panels/lighthouse/LighthouseController.ts | simulatedThrottling": {
5799
5811
  "message": "Ŝím̂úl̂át̂éd̂ t́ĥŕôt́t̂ĺîńĝ"
5800
5812
  },
5813
+ "panels/lighthouse/LighthouseController.ts | snapshot": {
5814
+ "message": "Ŝńâṕŝh́ôt́"
5815
+ },
5801
5816
  "panels/lighthouse/LighthouseController.ts | thereMayBeStoredDataAffectingLoadingPlural": {
5802
5817
  "message": "T̂h́êŕê ḿâý b̂é ŝt́ôŕêd́ d̂át̂á âf́f̂éĉt́îńĝ ĺôád̂ín̂ǵ p̂ér̂f́ôŕm̂án̂ćê ín̂ t́ĥéŝé l̂óĉát̂íôńŝ: {PH1}. Áûd́ît́ t̂h́îś p̂áĝé îń âń îńĉóĝńît́ô ẃîńd̂óŵ t́ô ṕr̂év̂én̂t́ t̂h́ôśê ŕêśôúr̂ćêś f̂ŕôḿ âf́f̂éĉt́îńĝ ýôúr̂ śĉór̂éŝ."
5803
5818
  },
@@ -5864,6 +5879,9 @@
5864
5879
  "panels/lighthouse/LighthouseStartView.ts | learnMore": {
5865
5880
  "message": "L̂éâŕn̂ ḿôŕê"
5866
5881
  },
5882
+ "panels/lighthouse/LighthouseStartViewFR.ts | mode": {
5883
+ "message": "M̂ód̂é"
5884
+ },
5867
5885
  "panels/lighthouse/LighthouseStatusView.ts | ahSorryWeRanIntoAnError": {
5868
5886
  "message": "Âh́, ŝór̂ŕŷ! Ẃê ŕâń îńt̂ó âń êŕr̂ór̂."
5869
5887
  },
@@ -0,0 +1,28 @@
1
+ // Copyright 2021 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 type {LocalizedString} from './UIString.js';
6
+
7
+ /**
8
+ * Represents an error that might become visible to the user. Where errors
9
+ * might be surfaced to the user (such as by displaying the message to the
10
+ * console), this class should be used to enforce that the message is
11
+ * localized on the way in.
12
+ */
13
+ export class UserVisibleError extends Error {
14
+ readonly message: LocalizedString;
15
+
16
+ constructor(message: LocalizedString) {
17
+ super(message);
18
+ this.message = message;
19
+ }
20
+ }
21
+
22
+ export function isUserVisibleError(error: unknown): error is UserVisibleError {
23
+ if (typeof error === 'object' && error !== null) {
24
+ return error instanceof UserVisibleError;
25
+ }
26
+
27
+ return false;
28
+ }
@@ -38,6 +38,7 @@ import * as SetUtilities from './set-utilities.js';
38
38
  import * as StringUtilities from './string-utilities.js';
39
39
  import * as TypeScriptUtilities from './typescript-utilities.js';
40
40
  import * as UIString from './UIString.js';
41
+ import * as UserVisibleError from './UserVisibleError.js';
41
42
 
42
43
  export {DCHECK} from './dcheck.js';
43
44
  /* `assertNotNull` also need to be exposed, as TypeScript does not
@@ -57,4 +58,5 @@ export {
57
58
  StringUtilities,
58
59
  TypeScriptUtilities,
59
60
  UIString,
61
+ UserVisibleError,
60
62
  };
@@ -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
 
@@ -140,7 +140,6 @@ export class ChildTargetManager extends SDKModel<EventTypes> implements Protocol
140
140
  } else if (targetInfo.type === 'auction_worklet') {
141
141
  type = Type.AuctionWorklet;
142
142
  }
143
-
144
143
  const target = this.#targetManager.createTarget(
145
144
  targetInfo.targetId, targetName, type, this.#parentTarget, sessionId, undefined, undefined, targetInfo);
146
145
  target.setInspectedURL(this.#parentTarget.inspectedURL());
@@ -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,16 +418,19 @@ 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)}`;
430
+ if (Host.Platform.isWin() && platformPath.match(/^.:\\/)) {
431
+ // Match upper or lower case drive letter
432
+ urlRegex = `[${platformPath[0].toUpperCase()}${platformPath[0].toLowerCase()}]` + urlRegex.substr(1);
433
+ }
431
434
  }
432
435
  // Adjust column if needed.
433
436
  let minColumnNumber = 0;
@@ -692,14 +695,14 @@ export class DebuggerModel extends SDKModel<EventTypes> {
692
695
  }
693
696
 
694
697
  parsedScriptSource(
695
- scriptId: Protocol.Runtime.ScriptId, sourceURL: string, startLine: number, startColumn: number, endLine: number,
696
- endColumn: number,
698
+ scriptId: Protocol.Runtime.ScriptId, sourceURL: Platform.DevToolsPath.UrlString, startLine: number,
699
+ startColumn: number, endLine: number, endColumn: number,
697
700
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
698
701
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
699
702
  executionContextId: number, hash: string, executionContextAuxData: any, isLiveEdit: boolean,
700
- sourceMapURL: string|undefined, hasSourceURLComment: boolean, hasSyntaxError: boolean, length: number,
701
- isModule: boolean|null, originStackTrace: Protocol.Runtime.StackTrace|null, codeOffset: number|null,
702
- 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,
703
706
  embedderName: string|null): Script {
704
707
  const knownScript = this.#scriptsInternal.get(scriptId);
705
708
  if (knownScript) {
@@ -736,7 +739,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
736
739
  return script;
737
740
  }
738
741
 
739
- setSourceMapURL(script: Script, newSourceMapURL: string): void {
742
+ setSourceMapURL(script: Script, newSourceMapURL: Platform.DevToolsPath.UrlString): void {
740
743
  let sourceMapId = DebuggerModel.sourceMapId(script.executionContextId, script.sourceURL, script.sourceMapURL);
741
744
  if (sourceMapId && this.#sourceMapIdToScript.get(sourceMapId) === script) {
742
745
  this.#sourceMapIdToScript.delete(sourceMapId);
@@ -1054,8 +1057,9 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
1054
1057
  return;
1055
1058
  }
1056
1059
  this.#debuggerModel.parsedScriptSource(
1057
- scriptId, url, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData,
1058
- 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,
1059
1063
  stackTrace || null, codeOffset || null, scriptLanguage || null, debugSymbols || null, embedderName || null);
1060
1064
  }
1061
1065
 
@@ -1082,9 +1086,10 @@ class DebuggerDispatcher implements ProtocolProxyApi.DebuggerDispatcher {
1082
1086
  return;
1083
1087
  }
1084
1088
  this.#debuggerModel.parsedScriptSource(
1085
- scriptId, url, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData,
1086
- false, sourceMapURL, Boolean(hasSourceURL), true, length || 0, isModule || null, stackTrace || null,
1087
- 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);
1088
1093
  }
1089
1094
 
1090
1095
  breakpointResolved({breakpointId, location}: Protocol.Debugger.BreakpointResolvedEvent): void {