chrome-devtools-frontend 1.0.927127 → 1.0.928589

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 (144) hide show
  1. package/AUTHORS +1 -0
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +30 -4
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/Images/src/ic_preview_feature.svg +3 -0
  6. package/front_end/Tests.js +2 -3
  7. package/front_end/core/common/Settings.ts +26 -45
  8. package/front_end/core/host/UserMetrics.ts +2 -2
  9. package/front_end/core/i18n/locales/en-US.json +60 -15
  10. package/front_end/core/i18n/locales/en-XL.json +60 -15
  11. package/front_end/core/platform/keyboard-utilities.ts +1 -0
  12. package/front_end/core/root/Runtime.ts +62 -61
  13. package/front_end/core/sdk/AccessibilityModel.ts +73 -73
  14. package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
  15. package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
  17. package/front_end/core/sdk/CSSFontFace.ts +10 -10
  18. package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
  19. package/front_end/core/sdk/CSSMedia.ts +22 -22
  20. package/front_end/core/sdk/CSSMetadata.ts +53 -49
  21. package/front_end/core/sdk/CSSModel.ts +139 -135
  22. package/front_end/core/sdk/CSSProperty.ts +18 -18
  23. package/front_end/core/sdk/CSSRule.ts +15 -15
  24. package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
  25. package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
  26. package/front_end/core/sdk/ChildTargetManager.ts +41 -40
  27. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
  28. package/front_end/core/sdk/Connections.ts +81 -81
  29. package/front_end/core/sdk/ConsoleModel.ts +68 -68
  30. package/front_end/core/sdk/Cookie.ts +48 -48
  31. package/front_end/core/sdk/CookieModel.ts +13 -13
  32. package/front_end/core/sdk/CookieParser.ts +45 -45
  33. package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
  34. package/front_end/core/sdk/DOMModel.ts +264 -252
  35. package/front_end/core/sdk/DebuggerModel.ts +209 -205
  36. package/front_end/core/sdk/EmulationModel.ts +76 -76
  37. package/front_end/core/sdk/FilmStripModel.ts +29 -29
  38. package/front_end/core/sdk/FrameManager.ts +43 -42
  39. package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
  40. package/front_end/core/sdk/IsolateManager.ts +82 -82
  41. package/front_end/core/sdk/IssuesModel.ts +6 -6
  42. package/front_end/core/sdk/LayerTreeBase.ts +37 -37
  43. package/front_end/core/sdk/LogModel.ts +5 -5
  44. package/front_end/core/sdk/NetworkManager.ts +229 -225
  45. package/front_end/core/sdk/NetworkRequest.ts +368 -360
  46. package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
  47. package/front_end/core/sdk/OverlayModel.ts +155 -153
  48. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
  49. package/front_end/core/sdk/PageResourceLoader.ts +30 -30
  50. package/front_end/core/sdk/PaintProfiler.ts +16 -16
  51. package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
  52. package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
  53. package/front_end/core/sdk/RemoteObject.ts +108 -104
  54. package/front_end/core/sdk/Resource.ts +85 -84
  55. package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
  56. package/front_end/core/sdk/RuntimeModel.ts +38 -34
  57. package/front_end/core/sdk/SDKModel.ts +3 -3
  58. package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
  59. package/front_end/core/sdk/Script.ts +29 -29
  60. package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
  61. package/front_end/core/sdk/ServerTiming.ts +2 -2
  62. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
  63. package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
  64. package/front_end/core/sdk/SourceMap.ts +40 -36
  65. package/front_end/core/sdk/SourceMapManager.ts +57 -57
  66. package/front_end/core/sdk/Target.ts +64 -63
  67. package/front_end/core/sdk/TargetManager.ts +60 -56
  68. package/front_end/core/sdk/TracingManager.ts +39 -39
  69. package/front_end/core/sdk/TracingModel.ts +125 -125
  70. package/front_end/core/sdk/WebAuthnModel.ts +9 -9
  71. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
  72. package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
  73. package/front_end/entrypoints/main/MainImpl.ts +7 -2
  74. package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
  75. package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
  76. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
  77. package/front_end/models/issues_manager/GenericIssue.ts +86 -0
  78. package/front_end/models/issues_manager/Issue.ts +24 -0
  79. package/front_end/models/issues_manager/IssuesManager.ts +18 -6
  80. package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
  81. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  82. package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
  83. package/front_end/panels/console/ConsoleSidebar.ts +0 -3
  84. package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
  85. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
  86. package/front_end/panels/elements/components/LayoutPane.ts +5 -1
  87. package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
  88. package/front_end/panels/issues/IssueAggregator.ts +16 -0
  89. package/front_end/panels/issues/IssueKindView.ts +95 -0
  90. package/front_end/panels/issues/IssueView.ts +6 -0
  91. package/front_end/panels/issues/IssuesPane.ts +81 -18
  92. package/front_end/panels/issues/issuesTree.css +8 -3
  93. package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
  94. package/front_end/panels/network/NetworkItemView.ts +1 -1
  95. package/front_end/panels/network/networkLogView.css +5 -0
  96. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  97. package/front_end/panels/settings/SettingsScreen.ts +1 -0
  98. package/front_end/panels/settings/settingsScreen.css +24 -0
  99. package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
  100. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  101. package/front_end/panels/sources/sources-meta.ts +22 -7
  102. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  103. package/front_end/third_party/codemirror.next/package.json +4 -4
  104. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
  105. package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
  106. package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
  107. package/front_end/ui/components/docs/text_editor/basic.html +28 -0
  108. package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
  109. package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
  110. package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
  111. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
  112. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
  113. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
  114. package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
  115. package/front_end/ui/components/text_editor/config.ts +264 -0
  116. package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
  117. package/front_end/ui/components/text_editor/theme.ts +113 -0
  118. package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
  119. package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
  120. package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
  121. package/front_end/ui/legacy/ARIAUtils.ts +14 -11
  122. package/front_end/ui/legacy/TabbedPane.ts +32 -3
  123. package/front_end/ui/legacy/UIUtils.ts +3 -1
  124. package/front_end/ui/legacy/View.ts +6 -0
  125. package/front_end/ui/legacy/ViewManager.ts +5 -1
  126. package/front_end/ui/legacy/ViewRegistration.ts +5 -0
  127. package/front_end/ui/legacy/XLink.ts +1 -1
  128. package/front_end/ui/legacy/closeButton.css +6 -0
  129. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
  130. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
  131. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
  132. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
  133. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
  134. package/front_end/ui/legacy/filter.css +1 -0
  135. package/front_end/ui/legacy/tabbedPane.css +24 -0
  136. package/front_end/ui/legacy/toolbar.css +5 -0
  137. package/inspector_overlay/main.ts +2 -1
  138. package/inspector_overlay/tool_screenshot.ts +8 -1
  139. package/package.json +1 -1
  140. package/scripts/build/rollup.config.js +9 -0
  141. package/scripts/migration/class-fields/migrate.js +56 -0
  142. package/scripts/migration/class-fields/package.json +5 -0
  143. package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
  144. package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
package/AUTHORS CHANGED
@@ -29,6 +29,7 @@ Gautham Banasandra <gautham.bangalore@gmail.com>
29
29
  Jake Mulhern <mulherje@gmail.com>
30
30
  Jeffrey Chen <jeffreyca16@gmail.com>
31
31
  Jesper van den Ende <jespertheend@gmail.com>
32
+ Juba Borgohain <chromiumjuba@gmail.com>
32
33
  Julian Geppert <spctstr@gmail.com>
33
34
  Karntino Areros <karntino.c.areros@gmail.com>
34
35
  Krishnal Ciccolella <ciccolella.krishnal@gmail.com>
@@ -26,7 +26,6 @@ all_devtools_files = [
26
26
  "front_end/legacy_test_runner/application_test_runner/ServiceWorkersTestRunner.js",
27
27
  "front_end/legacy_test_runner/application_test_runner/StorageTestRunner.js",
28
28
  "front_end/legacy_test_runner/lighthouse_test_runner/lighthouse_test_runner.js",
29
- "front_end/entrypoints/lighthouse_worker/LighthouseService.js",
30
29
  "front_end/panels/lighthouse/module.json",
31
30
  "front_end/legacy_test_runner/axe_core_test_runner/axe_core_test_runner.js",
32
31
  "front_end/third_party/axe-core/axe.js",
@@ -83,6 +83,7 @@ grd_files_release_sources = [
83
83
  "front_end/Images/ic_memory_16x16.svg",
84
84
  "front_end/Images/ic_page_next_16x16_icon.svg",
85
85
  "front_end/Images/ic_page_prev_16x16_icon.svg",
86
+ "front_end/Images/ic_preview_feature.svg",
86
87
  "front_end/Images/ic_redo_16x16_icon.svg",
87
88
  "front_end/Images/ic_request_response.svg",
88
89
  "front_end/Images/ic_response.svg",
@@ -216,7 +217,6 @@ grd_files_release_sources = [
216
217
  "front_end/entrypoints/inspector_main/inspector_main.js",
217
218
  "front_end/entrypoints/js_app/JsMain.js",
218
219
  "front_end/entrypoints/js_app/js_app.js",
219
- "front_end/entrypoints/lighthouse_worker/LighthouseService.js",
220
220
  "front_end/entrypoints/lighthouse_worker/lighthouse_worker.js",
221
221
  "front_end/entrypoints/main/main-legacy.js",
222
222
  "front_end/entrypoints/main/main-meta.js",
@@ -302,6 +302,7 @@ grd_files_release_sources = [
302
302
  "front_end/models/issues_manager/descriptions/cspTrustedTypesSinkViolation.md",
303
303
  "front_end/models/issues_manager/descriptions/cspURLViolation.md",
304
304
  "front_end/models/issues_manager/descriptions/deprecationNavigatorUserAgent.md",
305
+ "front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md",
305
306
  "front_end/models/issues_manager/descriptions/heavyAd.md",
306
307
  "front_end/models/issues_manager/descriptions/mixedContent.md",
307
308
  "front_end/models/issues_manager/descriptions/sharedArrayBuffer.md",
@@ -343,7 +344,6 @@ grd_files_release_sources = [
343
344
  "front_end/panels/changes/changes-meta.js",
344
345
  "front_end/panels/changes/changes.js",
345
346
  "front_end/panels/changes/changes_module.js",
346
- "front_end/panels/console/components/components.js",
347
347
  "front_end/panels/console/console-legacy.js",
348
348
  "front_end/panels/console/console-meta.js",
349
349
  "front_end/panels/console/console.js",
@@ -460,6 +460,20 @@ grd_files_release_sources = [
460
460
  "front_end/third_party/acorn-loose/acorn-loose.js",
461
461
  "front_end/third_party/acorn/acorn.js",
462
462
  "front_end/third_party/chromium/client-variations/client-variations.js",
463
+ "front_end/third_party/codemirror.next/chunk/codemirror.js",
464
+ "front_end/third_party/codemirror.next/chunk/cpp.js",
465
+ "front_end/third_party/codemirror.next/chunk/css.js",
466
+ "front_end/third_party/codemirror.next/chunk/html.js",
467
+ "front_end/third_party/codemirror.next/chunk/java.js",
468
+ "front_end/third_party/codemirror.next/chunk/javascript.js",
469
+ "front_end/third_party/codemirror.next/chunk/json.js",
470
+ "front_end/third_party/codemirror.next/chunk/legacy.js",
471
+ "front_end/third_party/codemirror.next/chunk/markdown.js",
472
+ "front_end/third_party/codemirror.next/chunk/php.js",
473
+ "front_end/third_party/codemirror.next/chunk/python.js",
474
+ "front_end/third_party/codemirror.next/chunk/wast.js",
475
+ "front_end/third_party/codemirror.next/chunk/xml.js",
476
+ "front_end/third_party/codemirror.next/codemirror.next.js",
463
477
  "front_end/third_party/codemirror/codemirror.js",
464
478
  "front_end/third_party/diff/diff-legacy.js",
465
479
  "front_end/third_party/diff/diff.js",
@@ -471,6 +485,7 @@ grd_files_release_sources = [
471
485
  "front_end/third_party/marked/marked.js",
472
486
  "front_end/third_party/wasmparser/wasmparser.js",
473
487
  "front_end/ui/components/adorners/adorners.js",
488
+ "front_end/ui/components/code_highlighter/code_highlighter.js",
474
489
  "front_end/ui/components/data_grid/data_grid.js",
475
490
  "front_end/ui/components/expandable_list/expandable_list.js",
476
491
  "front_end/ui/components/helpers/helpers.js",
@@ -484,6 +499,8 @@ grd_files_release_sources = [
484
499
  "front_end/ui/components/report_view/report_view.js",
485
500
  "front_end/ui/components/request_link_icon/request_link_icon.js",
486
501
  "front_end/ui/components/survey_link/survey_link.js",
502
+ "front_end/ui/components/text_editor/text_editor.js",
503
+ "front_end/ui/components/text_prompt/text_prompt.js",
487
504
  "front_end/ui/components/tree_outline/tree_outline.js",
488
505
  "front_end/ui/legacy/components/color_picker/color_picker-legacy.js",
489
506
  "front_end/ui/legacy/components/color_picker/color_picker.js",
@@ -666,6 +683,7 @@ grd_files_debug_sources = [
666
683
  "front_end/entrypoints/inspector_main/RenderingOptions.js",
667
684
  "front_end/entrypoints/inspector_main/nodeIcon.css.js",
668
685
  "front_end/entrypoints/inspector_main/renderingOptions.css.js",
686
+ "front_end/entrypoints/lighthouse_worker/LighthouseService.js",
669
687
  "front_end/entrypoints/main/ExecutionContextSelector.js",
670
688
  "front_end/entrypoints/main/MainImpl.js",
671
689
  "front_end/entrypoints/main/SimpleApp.js",
@@ -718,6 +736,7 @@ grd_files_debug_sources = [
718
736
  "front_end/models/issues_manager/CorsIssue.js",
719
737
  "front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.js",
720
738
  "front_end/models/issues_manager/DeprecationIssue.js",
739
+ "front_end/models/issues_manager/GenericIssue.js",
721
740
  "front_end/models/issues_manager/HeavyAdIssue.js",
722
741
  "front_end/models/issues_manager/Issue.js",
723
742
  "front_end/models/issues_manager/IssueResolver.js",
@@ -866,8 +885,6 @@ grd_files_debug_sources = [
866
885
  "front_end/panels/console/ConsoleView.js",
867
886
  "front_end/panels/console/ConsoleViewMessage.js",
868
887
  "front_end/panels/console/ConsoleViewport.js",
869
- "front_end/panels/console/components/SidebarDeprecation.js",
870
- "front_end/panels/console/components/sidebarDeprecation.css.js",
871
888
  "front_end/panels/console/consoleContextSelector.css.js",
872
889
  "front_end/panels/console/consolePinPane.css.js",
873
890
  "front_end/panels/console/consolePrompt.css.js",
@@ -999,8 +1016,10 @@ grd_files_debug_sources = [
999
1016
  "front_end/panels/issues/CSPViolationsView.js",
1000
1017
  "front_end/panels/issues/ComboBoxOfCheckBoxes.js",
1001
1018
  "front_end/panels/issues/CorsIssueDetailsView.js",
1019
+ "front_end/panels/issues/GenericIssueDetailsView.js",
1002
1020
  "front_end/panels/issues/HiddenIssuesRow.js",
1003
1021
  "front_end/panels/issues/IssueAggregator.js",
1022
+ "front_end/panels/issues/IssueKindView.js",
1004
1023
  "front_end/panels/issues/IssueRevealer.js",
1005
1024
  "front_end/panels/issues/IssueView.js",
1006
1025
  "front_end/panels/issues/IssuesPane.js",
@@ -1331,6 +1350,8 @@ grd_files_debug_sources = [
1331
1350
  "front_end/third_party/wasmparser/package/dist/esm/WasmParser.js",
1332
1351
  "front_end/ui/components/adorners/Adorner.js",
1333
1352
  "front_end/ui/components/adorners/adorner.css.js",
1353
+ "front_end/ui/components/code_highlighter/CodeHighlighter.js",
1354
+ "front_end/ui/components/code_highlighter/codeHighlighter.css.js",
1334
1355
  "front_end/ui/components/data_grid/DataGrid.js",
1335
1356
  "front_end/ui/components/data_grid/DataGridContextMenuUtils.js",
1336
1357
  "front_end/ui/components/data_grid/DataGridController.js",
@@ -1395,6 +1416,11 @@ grd_files_debug_sources = [
1395
1416
  "front_end/ui/components/request_link_icon/requestLinkIcon.css.js",
1396
1417
  "front_end/ui/components/survey_link/SurveyLink.js",
1397
1418
  "front_end/ui/components/survey_link/surveyLink.css.js",
1419
+ "front_end/ui/components/text_editor/TextEditor.js",
1420
+ "front_end/ui/components/text_editor/config.js",
1421
+ "front_end/ui/components/text_editor/theme.js",
1422
+ "front_end/ui/components/text_prompt/TextPrompt.js",
1423
+ "front_end/ui/components/text_prompt/textPrompt.css.js",
1398
1424
  "front_end/ui/components/tree_outline/TreeOutline.js",
1399
1425
  "front_end/ui/components/tree_outline/TreeOutlineUtils.js",
1400
1426
  "front_end/ui/components/tree_outline/treeOutline.css.js",
@@ -95,6 +95,7 @@ devtools_svg_sources = [
95
95
  "ic_memory_16x16.svg",
96
96
  "ic_page_next_16x16_icon.svg",
97
97
  "ic_page_prev_16x16_icon.svg",
98
+ "ic_preview_feature.svg",
98
99
  "ic_redo_16x16_icon.svg",
99
100
  "ic_request_response.svg",
100
101
  "ic_response.svg",
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11 2H5V3H6.5V6.5L3.08638 11.4308C2.62722 12.094 3.10191 13 3.90857 13H12.0914C12.8981 13 13.3728 12.094 12.9136 11.4308L9.5 6.5V3H11V2Z" fill="black"/>
3
+ </svg>
@@ -888,9 +888,8 @@
888
888
 
889
889
  this.addSniffer(SDK.NetworkDispatcher.prototype, 'finishNetworkRequest', finishRequest);
890
890
 
891
- // Allow more time for this test as it needs to reload the inspected page.
892
- test.takeControl({slownessFactor: 10});
893
- test.evaluateInConsole_('window.location.reload(true);', function(resultText) {});
891
+ test.takeControl();
892
+ test.evaluateInConsole_('await fetch("/");', function(resultText) {});
894
893
  };
895
894
 
896
895
  TestSuite.prototype.testEmulateNetworkConditions = function() {
@@ -41,8 +41,6 @@ import {getLocalizedSettingsCategory, getRegisteredSettings, maybeRemoveSettingE
41
41
  let settingsInstance: Settings|undefined;
42
42
 
43
43
  export class Settings {
44
- readonly globalStorage: SettingsStorage;
45
- private readonly localStorage: SettingsStorage;
46
44
  private readonly sessionStorage: SettingsStorage;
47
45
  settingNameSet: Set<string>;
48
46
  orderValuesBySettingCategory: Map<SettingCategory, Set<number>>;
@@ -50,9 +48,9 @@ export class Settings {
50
48
  private registry: Map<string, Setting<unknown>>;
51
49
  readonly moduleSettings: Map<string, Setting<unknown>>;
52
50
 
53
- private constructor(globalStorage: SettingsStorage, localStorage: SettingsStorage) {
54
- this.globalStorage = globalStorage;
55
- this.localStorage = localStorage;
51
+ private constructor(
52
+ private readonly syncedStorage: SettingsStorage, readonly globalStorage: SettingsStorage,
53
+ private readonly localStorage: SettingsStorage) {
56
54
  this.sessionStorage = new SettingsStorage({});
57
55
 
58
56
  this.settingNameSet = new Set();
@@ -91,16 +89,17 @@ export class Settings {
91
89
 
92
90
  static instance(opts: {
93
91
  forceNew: boolean|null,
92
+ syncedStorage: SettingsStorage|null,
94
93
  globalStorage: SettingsStorage|null,
95
94
  localStorage: SettingsStorage|null,
96
- } = {forceNew: null, globalStorage: null, localStorage: null}): Settings {
97
- const {forceNew, globalStorage, localStorage} = opts;
95
+ } = {forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null}): Settings {
96
+ const {forceNew, syncedStorage, globalStorage, localStorage} = opts;
98
97
  if (!settingsInstance || forceNew) {
99
- if (!globalStorage || !localStorage) {
98
+ if (!syncedStorage || !globalStorage || !localStorage) {
100
99
  throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
101
100
  }
102
101
 
103
- settingsInstance = new Settings(globalStorage, localStorage);
102
+ settingsInstance = new Settings(syncedStorage, globalStorage, localStorage);
104
103
  }
105
104
 
106
105
  return settingsInstance;
@@ -270,29 +269,22 @@ function removeSetting(setting: Setting<unknown>): void {
270
269
  settings.getRegistry().delete(name);
271
270
  settings.moduleSettings.delete(name);
272
271
 
273
- setting.getStorage().remove(name);
272
+ setting.storage.remove(name);
274
273
  }
275
274
 
276
275
  export class Setting<V> {
277
- private nameInternal: string;
278
- private defaultValueInternal: V;
279
- private readonly eventSupport: ObjectWrapper<GenericEvents>;
280
- private storage: SettingsStorage;
281
276
  private titleFunction!: () => Platform.UIString.LocalizedString;
282
277
  private titleInternal!: string;
283
- private registration: SettingRegistration|null;
278
+ private registration: SettingRegistration|null = null;
284
279
  private requiresUserAction?: boolean;
285
280
  private value?: V;
286
281
  // TODO(crbug.com/1172300) Type cannot be inferred without changes to consumers. See above.
287
282
  private serializer: Serializer<unknown, V> = JSON;
288
283
  private hadUserAction?: boolean;
289
284
 
290
- constructor(name: string, defaultValue: V, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage) {
291
- this.nameInternal = name;
292
- this.defaultValueInternal = defaultValue;
293
- this.eventSupport = eventSupport;
294
- this.storage = storage;
295
- this.registration = null;
285
+ constructor(
286
+ readonly name: string, readonly defaultValue: V, private readonly eventSupport: ObjectWrapper<GenericEvents>,
287
+ readonly storage: SettingsStorage) {
296
288
  }
297
289
 
298
290
  setSerializer(serializer: Serializer<unknown, V>): void {
@@ -300,15 +292,11 @@ export class Setting<V> {
300
292
  }
301
293
 
302
294
  addChangeListener(listener: (arg0: EventTargetEvent<V>) => void, thisObject?: Object): EventDescriptor {
303
- return this.eventSupport.addEventListener(this.nameInternal, listener, thisObject);
295
+ return this.eventSupport.addEventListener(this.name, listener, thisObject);
304
296
  }
305
297
 
306
298
  removeChangeListener(listener: (arg0: EventTargetEvent<V>) => void, thisObject?: Object): void {
307
- this.eventSupport.removeEventListener(this.nameInternal, listener, thisObject);
308
- }
309
-
310
- get name(): string {
311
- return this.nameInternal;
299
+ this.eventSupport.removeEventListener(this.name, listener, thisObject);
312
300
  }
313
301
 
314
302
  title(): string {
@@ -337,19 +325,19 @@ export class Setting<V> {
337
325
 
338
326
  get(): V {
339
327
  if (this.requiresUserAction && !this.hadUserAction) {
340
- return this.defaultValueInternal;
328
+ return this.defaultValue;
341
329
  }
342
330
 
343
331
  if (typeof this.value !== 'undefined') {
344
332
  return this.value;
345
333
  }
346
334
 
347
- this.value = this.defaultValueInternal;
348
- if (this.storage.has(this.nameInternal)) {
335
+ this.value = this.defaultValue;
336
+ if (this.storage.has(this.name)) {
349
337
  try {
350
- this.value = this.serializer.parse(this.storage.get(this.nameInternal));
338
+ this.value = this.serializer.parse(this.storage.get(this.name));
351
339
  } catch (e) {
352
- this.storage.remove(this.nameInternal);
340
+ this.storage.remove(this.name);
353
341
  }
354
342
  }
355
343
  return this.value;
@@ -361,14 +349,14 @@ export class Setting<V> {
361
349
  try {
362
350
  const settingString = this.serializer.stringify(value);
363
351
  try {
364
- this.storage.set(this.nameInternal, settingString);
352
+ this.storage.set(this.name, settingString);
365
353
  } catch (e) {
366
- this.printSettingsSavingError(e.message, this.nameInternal, settingString);
354
+ this.printSettingsSavingError(e.message, this.name, settingString);
367
355
  }
368
356
  } catch (e) {
369
- Console.instance().error('Cannot stringify setting with name: ' + this.nameInternal + ', error: ' + e.message);
357
+ Console.instance().error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
370
358
  }
371
- this.eventSupport.dispatchEventToListeners(this.nameInternal, value);
359
+ this.eventSupport.dispatchEventToListeners(this.name, value);
372
360
  }
373
361
 
374
362
  setRegistration(registration: SettingRegistration): void {
@@ -427,19 +415,12 @@ export class Setting<V> {
427
415
  }
428
416
 
429
417
  private printSettingsSavingError(message: string, name: string, value: string): void {
430
- const errorMessage = 'Error saving setting with name: ' + this.nameInternal + ', value length: ' + value.length +
431
- '. Error: ' + message;
418
+ const errorMessage =
419
+ 'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
432
420
  console.error(errorMessage);
433
421
  Console.instance().error(errorMessage);
434
422
  this.storage.dumpSizes();
435
423
  }
436
- defaultValue(): V {
437
- return this.defaultValueInternal;
438
- }
439
-
440
- getStorage(): SettingsStorage {
441
- return this.storage;
442
- }
443
424
  }
444
425
 
445
426
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
@@ -546,7 +546,6 @@ export const DevtoolsExperiments: {
546
546
  'backgroundServicesPushMessaging': 6,
547
547
  'blackboxJSFramesOnTimeline': 7,
548
548
  'cssOverview': 8,
549
- 'emptySourceMapAutoStepping': 9,
550
549
  'inputEventsOnTimelineOverview': 10,
551
550
  'liveHeapProfile': 11,
552
551
  'protocolMonitor': 13,
@@ -577,7 +576,8 @@ export const DevtoolsExperiments: {
577
576
  'hideIssuesFeature': 48,
578
577
  'reportingApiDebugging': 49,
579
578
  'syncSettings': 50,
580
- '__lastValidEnumPosition': 50,
579
+ 'groupAndHideIssuesByKind': 51,
580
+ '__lastValidEnumPosition': 51,
581
581
  };
582
582
 
583
583
  export const IssueExpanded: {
@@ -1334,18 +1334,30 @@
1334
1334
  "models/issues_manager/DeprecationIssue.ts | userAgentReduction": {
1335
1335
  "message": "User-Agent String Reduction"
1336
1336
  },
1337
+ "models/issues_manager/GenericIssue.ts | crossOriginPortalPostMessage": {
1338
+ "message": "Portals - Same-origin communication channels"
1339
+ },
1337
1340
  "models/issues_manager/HeavyAdIssue.ts | handlingHeavyAdInterventions": {
1338
1341
  "message": "Handling Heavy Ad Interventions"
1339
1342
  },
1340
1343
  "models/issues_manager/Issue.ts | breakingChangeIssue": {
1341
1344
  "message": "A breaking change issue: the page may stop working in an upcoming version of Chrome"
1342
1345
  },
1346
+ "models/issues_manager/Issue.ts | breakingChanges": {
1347
+ "message": "Breaking Changes"
1348
+ },
1343
1349
  "models/issues_manager/Issue.ts | improvementIssue": {
1344
1350
  "message": "An improvement issue: there is an opportunity to improve the page"
1345
1351
  },
1352
+ "models/issues_manager/Issue.ts | improvements": {
1353
+ "message": "Improvements"
1354
+ },
1346
1355
  "models/issues_manager/Issue.ts | pageErrorIssue": {
1347
1356
  "message": "A page error issue: the page is not working correctly"
1348
1357
  },
1358
+ "models/issues_manager/Issue.ts | pageErrors": {
1359
+ "message": "Page Errors"
1360
+ },
1349
1361
  "models/issues_manager/LowTextContrastIssue.ts | colorAndContrastAccessibility": {
1350
1362
  "message": "Color and contrast accessibility"
1351
1363
  },
@@ -3299,12 +3311,6 @@
3299
3311
  "panels/console_counters/WarningErrorCounter.ts | sWarnings": {
3300
3312
  "message": "{n, plural, =1 {# warning} other {# warnings}}"
3301
3313
  },
3302
- "panels/console/components/SidebarDeprecation.ts | deprecationNotice": {
3303
- "message": "This sidebar will be removed in a future version of Chrome. If you have feedback, please let us know via the"
3304
- },
3305
- "panels/console/components/SidebarDeprecation.ts | issueTrackerLinkText": {
3306
- "message": "issue tracker"
3307
- },
3308
3314
  "panels/console/console-meta.ts | autocompleteFromHistory": {
3309
3315
  "message": "Autocomplete from history"
3310
3316
  },
@@ -3986,6 +3992,9 @@
3986
3992
  "panels/elements/components/ElementsBreadcrumbsUtils.ts | text": {
3987
3993
  "message": "(text)"
3988
3994
  },
3995
+ "panels/elements/components/LayoutPane.ts | chooseElementOverlayColor": {
3996
+ "message": "Choose the overlay color for this element"
3997
+ },
3989
3998
  "panels/elements/components/LayoutPane.ts | flexbox": {
3990
3999
  "message": "Flexbox"
3991
4000
  },
@@ -4976,6 +4985,12 @@
4976
4985
  "panels/issues/CSPViolationsView.ts | filter": {
4977
4986
  "message": "Filter"
4978
4987
  },
4988
+ "panels/issues/GenericIssueDetailsView.ts | frameId": {
4989
+ "message": "Frame"
4990
+ },
4991
+ "panels/issues/GenericIssueDetailsView.ts | nResources": {
4992
+ "message": "{n, plural, =1 {# resource} other {# resources}}"
4993
+ },
4979
4994
  "panels/issues/HiddenIssuesRow.ts | hiddenIssues": {
4980
4995
  "message": "Hidden issues"
4981
4996
  },
@@ -5006,12 +5021,21 @@
5006
5021
  "panels/issues/IssuesPane.ts | crossOriginEmbedderPolicy": {
5007
5022
  "message": "Cross Origin Embedder Policy"
5008
5023
  },
5024
+ "panels/issues/IssuesPane.ts | generic": {
5025
+ "message": "Generic"
5026
+ },
5009
5027
  "panels/issues/IssuesPane.ts | groupByCategory": {
5010
5028
  "message": "Group by category"
5011
5029
  },
5030
+ "panels/issues/IssuesPane.ts | groupByKind": {
5031
+ "message": "Group by kind"
5032
+ },
5012
5033
  "panels/issues/IssuesPane.ts | groupDisplayedIssuesUnder": {
5013
5034
  "message": "Group displayed issues under associated categories"
5014
5035
  },
5036
+ "panels/issues/IssuesPane.ts | groupDisplayedIssuesUnderKind": {
5037
+ "message": "Group displayed issues as Page errors, Breaking changes and Improvements"
5038
+ },
5015
5039
  "panels/issues/IssuesPane.ts | heavyAds": {
5016
5040
  "message": "Heavy Ads"
5017
5041
  },
@@ -8651,8 +8675,11 @@
8651
8675
  "panels/snippets/SnippetsQuickOpen.ts | noSnippetsFound": {
8652
8676
  "message": "No snippets found."
8653
8677
  },
8654
- "panels/snippets/SnippetsQuickOpen.ts | runSnippet": {
8655
- "message": "Run snippet"
8678
+ "panels/snippets/SnippetsQuickOpen.ts | run": {
8679
+ "message": "Run"
8680
+ },
8681
+ "panels/snippets/SnippetsQuickOpen.ts | snippet": {
8682
+ "message": "Snippet"
8656
8683
  },
8657
8684
  "panels/sources/AddSourceMapURLDialog.ts | add": {
8658
8685
  "message": "Add"
@@ -9146,18 +9173,21 @@
9146
9173
  "panels/sources/sources-meta.ts | evaluateSelectedTextInConsole": {
9147
9174
  "message": "Evaluate selected text in console"
9148
9175
  },
9176
+ "panels/sources/sources-meta.ts | file": {
9177
+ "message": "File"
9178
+ },
9149
9179
  "panels/sources/sources-meta.ts | filesystem": {
9150
9180
  "message": "Filesystem"
9151
9181
  },
9182
+ "panels/sources/sources-meta.ts | goTo": {
9183
+ "message": "Go to"
9184
+ },
9152
9185
  "panels/sources/sources-meta.ts | goToAFunctionDeclarationruleSet": {
9153
9186
  "message": "Go to a function declaration/rule set"
9154
9187
  },
9155
9188
  "panels/sources/sources-meta.ts | goToLine": {
9156
9189
  "message": "Go to line"
9157
9190
  },
9158
- "panels/sources/sources-meta.ts | goToSymbol": {
9159
- "message": "Go to symbol"
9160
- },
9161
9191
  "panels/sources/sources-meta.ts | incrementCssUnitBy": {
9162
9192
  "message": "Increment CSS unit by {PH1}"
9163
9193
  },
@@ -9167,14 +9197,17 @@
9167
9197
  "panels/sources/sources-meta.ts | jumpToPreviousEditingLocation": {
9168
9198
  "message": "Jump to previous editing location"
9169
9199
  },
9200
+ "panels/sources/sources-meta.ts | line": {
9201
+ "message": "Line"
9202
+ },
9170
9203
  "panels/sources/sources-meta.ts | nextCallFrame": {
9171
9204
  "message": "Next call frame"
9172
9205
  },
9173
9206
  "panels/sources/sources-meta.ts | none": {
9174
9207
  "message": "None"
9175
9208
  },
9176
- "panels/sources/sources-meta.ts | openFile": {
9177
- "message": "Open file"
9209
+ "panels/sources/sources-meta.ts | open": {
9210
+ "message": "Open"
9178
9211
  },
9179
9212
  "panels/sources/sources-meta.ts | pauseScriptExecution": {
9180
9213
  "message": "Pause script execution"
@@ -9266,6 +9299,9 @@
9266
9299
  "panels/sources/sources-meta.ts | switchFile": {
9267
9300
  "message": "Switch file"
9268
9301
  },
9302
+ "panels/sources/sources-meta.ts | symbol": {
9303
+ "message": "Symbol"
9304
+ },
9269
9305
  "panels/sources/sources-meta.ts | threads": {
9270
9306
  "message": "Threads"
9271
9307
  },
@@ -11000,6 +11036,9 @@
11000
11036
  "ui/components/survey_link/SurveyLink.ts | thankYouForYourFeedback": {
11001
11037
  "message": "Thank you for your feedback"
11002
11038
  },
11039
+ "ui/components/text_editor/config.ts | codeEditor": {
11040
+ "message": "Code editor"
11041
+ },
11003
11042
  "ui/legacy/components/color_picker/ContrastDetails.ts | aa": {
11004
11043
  "message": "AA"
11005
11044
  },
@@ -11417,14 +11456,17 @@
11417
11456
  "ui/legacy/components/perf_ui/PieChart.ts | total": {
11418
11457
  "message": "Total"
11419
11458
  },
11459
+ "ui/legacy/components/quick_open/CommandMenu.ts | command": {
11460
+ "message": "Command"
11461
+ },
11420
11462
  "ui/legacy/components/quick_open/CommandMenu.ts | noCommandsFound": {
11421
11463
  "message": "No commands found"
11422
11464
  },
11423
11465
  "ui/legacy/components/quick_open/CommandMenu.ts | oneOrMoreSettingsHaveChanged": {
11424
11466
  "message": "One or more settings have changed which requires a reload to take effect."
11425
11467
  },
11426
- "ui/legacy/components/quick_open/CommandMenu.ts | runCommand": {
11427
- "message": "Run Command"
11468
+ "ui/legacy/components/quick_open/CommandMenu.ts | run": {
11469
+ "message": "Run"
11428
11470
  },
11429
11471
  "ui/legacy/components/quick_open/FilteredListWidget.ts | noResultsFound": {
11430
11472
  "message": "No results found"
@@ -11777,6 +11819,9 @@
11777
11819
  "ui/legacy/TabbedPane.ts | moreTabs": {
11778
11820
  "message": "More tabs"
11779
11821
  },
11822
+ "ui/legacy/TabbedPane.ts | previewFeature": {
11823
+ "message": "Preview feature"
11824
+ },
11780
11825
  "ui/legacy/TargetCrashedScreen.ts | devtoolsWasDisconnectedFromThe": {
11781
11826
  "message": "DevTools was disconnected from the page."
11782
11827
  },