chrome-devtools-frontend 1.0.946351 → 1.0.948359

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 (217) hide show
  1. package/.eslintrc.js +1 -0
  2. package/config/gni/all_devtools_files.gni +1 -15
  3. package/config/gni/devtools_grd_files.gni +9 -15
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/.eslintrc.js +6 -1
  6. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  8. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  9. package/front_end/core/host/UserMetrics.ts +1 -22
  10. package/front_end/core/i18n/locales/en-US.json +38 -29
  11. package/front_end/core/i18n/locales/en-XL.json +38 -29
  12. package/front_end/core/platform/platform.ts +0 -2
  13. package/front_end/core/platform/string-utilities.ts +14 -1
  14. package/front_end/core/platform/utilities.ts +0 -29
  15. package/front_end/core/root/Runtime.ts +4 -211
  16. package/front_end/core/sdk/AccessibilityModel.ts +0 -2
  17. package/front_end/core/sdk/CSSProperty.ts +0 -2
  18. package/front_end/core/sdk/CSSRule.ts +0 -2
  19. package/front_end/core/sdk/Cookie.ts +0 -25
  20. package/front_end/core/sdk/EmulationModel.ts +0 -2
  21. package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
  22. package/front_end/core/sdk/NetworkManager.ts +0 -3
  23. package/front_end/core/sdk/Resource.ts +0 -3
  24. package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
  25. package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
  26. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  27. package/front_end/devtools_compatibility.js +1 -1
  28. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  29. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  30. package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
  31. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +0 -1
  33. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
  34. package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
  35. package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
  36. package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
  37. package/front_end/entrypoints/node_app/node_app.ts +79 -0
  38. package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
  39. package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +3 -2
  40. package/front_end/generated/InspectorBackendCommands.js +5 -1
  41. package/front_end/generated/protocol.d.ts +12 -0
  42. package/front_end/legacy/legacy-defs.d.ts +0 -4
  43. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  44. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  45. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
  46. package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
  47. package/front_end/models/emulation/DeviceModeModel.ts +0 -2
  48. package/front_end/models/issues_manager/CorsIssue.ts +17 -9
  49. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  50. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  51. package/front_end/panels/animation/AnimationTimeline.ts +0 -2
  52. package/front_end/panels/animation/AnimationUI.ts +0 -2
  53. package/front_end/panels/application/BackForwardCacheStrings.ts +2 -5
  54. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  55. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  56. package/front_end/panels/application/application-legacy.ts +0 -3
  57. package/front_end/panels/application/application-meta.ts +0 -13
  58. package/front_end/panels/application/backForwardCacheView.css +44 -6
  59. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  60. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  61. package/front_end/panels/application/components/StackTrace.ts +1 -1
  62. package/front_end/panels/coverage/CoverageView.ts +1 -1
  63. package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
  64. package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
  65. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
  66. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  67. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  68. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  69. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
  70. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  71. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  72. package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
  73. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  74. package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
  75. package/front_end/panels/issues/CorsIssueDetailsView.ts +18 -2
  76. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
  77. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  78. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  79. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  80. package/front_end/panels/search/SearchView.ts +24 -4
  81. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  82. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
  83. package/front_end/panels/sources/CSSPlugin.ts +3 -0
  84. package/front_end/panels/sources/CoveragePlugin.ts +2 -0
  85. package/front_end/panels/sources/DebuggerPlugin.ts +29 -5
  86. package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
  87. package/front_end/panels/sources/ProfilePlugin.ts +3 -0
  88. package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
  89. package/front_end/panels/timeline/TimelineTreeView.ts +3 -1
  90. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  91. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
  92. package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
  93. package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
  94. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
  95. package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
  96. package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
  97. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
  98. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
  99. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
  100. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
  101. package/front_end/third_party/codemirror.next/package.json +10 -9
  102. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
  103. package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
  104. package/front_end/third_party/lighthouse/locales/ar.json +0 -3
  105. package/front_end/third_party/lighthouse/locales/bg.json +17 -20
  106. package/front_end/third_party/lighthouse/locales/ca.json +0 -3
  107. package/front_end/third_party/lighthouse/locales/cs.json +0 -3
  108. package/front_end/third_party/lighthouse/locales/da.json +16 -19
  109. package/front_end/third_party/lighthouse/locales/de.json +0 -3
  110. package/front_end/third_party/lighthouse/locales/el.json +0 -3
  111. package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
  112. package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
  113. package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
  114. package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
  115. package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
  116. package/front_end/third_party/lighthouse/locales/es.json +0 -3
  117. package/front_end/third_party/lighthouse/locales/fi.json +16 -19
  118. package/front_end/third_party/lighthouse/locales/fil.json +33 -36
  119. package/front_end/third_party/lighthouse/locales/fr.json +16 -19
  120. package/front_end/third_party/lighthouse/locales/he.json +16 -19
  121. package/front_end/third_party/lighthouse/locales/hi.json +0 -3
  122. package/front_end/third_party/lighthouse/locales/hr.json +16 -19
  123. package/front_end/third_party/lighthouse/locales/hu.json +16 -19
  124. package/front_end/third_party/lighthouse/locales/id.json +16 -19
  125. package/front_end/third_party/lighthouse/locales/it.json +37 -40
  126. package/front_end/third_party/lighthouse/locales/ja.json +16 -19
  127. package/front_end/third_party/lighthouse/locales/ko.json +16 -19
  128. package/front_end/third_party/lighthouse/locales/lt.json +17 -20
  129. package/front_end/third_party/lighthouse/locales/lv.json +0 -3
  130. package/front_end/third_party/lighthouse/locales/nl.json +16 -19
  131. package/front_end/third_party/lighthouse/locales/no.json +17 -20
  132. package/front_end/third_party/lighthouse/locales/pl.json +16 -19
  133. package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
  134. package/front_end/third_party/lighthouse/locales/pt.json +16 -19
  135. package/front_end/third_party/lighthouse/locales/ro.json +0 -3
  136. package/front_end/third_party/lighthouse/locales/ru.json +16 -19
  137. package/front_end/third_party/lighthouse/locales/sk.json +0 -3
  138. package/front_end/third_party/lighthouse/locales/sl.json +0 -3
  139. package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
  140. package/front_end/third_party/lighthouse/locales/sr.json +16 -19
  141. package/front_end/third_party/lighthouse/locales/sv.json +17 -20
  142. package/front_end/third_party/lighthouse/locales/ta.json +0 -3
  143. package/front_end/third_party/lighthouse/locales/te.json +0 -3
  144. package/front_end/third_party/lighthouse/locales/th.json +0 -3
  145. package/front_end/third_party/lighthouse/locales/tr.json +0 -3
  146. package/front_end/third_party/lighthouse/locales/uk.json +17 -20
  147. package/front_end/third_party/lighthouse/locales/vi.json +0 -3
  148. package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
  149. package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
  150. package/front_end/third_party/lighthouse/locales/zh.json +0 -3
  151. package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
  152. package/front_end/third_party/lighthouse/report/bundle.js +36 -7
  153. package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
  154. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  155. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  156. package/front_end/ui/components/helpers/helpers.ts +0 -2
  157. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  158. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  159. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  160. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  161. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  162. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  163. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  164. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  165. package/front_end/ui/components/report_view/reportSection.css +20 -0
  166. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  167. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  168. package/front_end/ui/components/text_editor/config.ts +9 -7
  169. package/front_end/ui/components/text_editor/javascript.ts +15 -11
  170. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  171. package/front_end/ui/legacy/GlassPane.ts +1 -1
  172. package/front_end/ui/legacy/InspectorView.ts +10 -0
  173. package/front_end/ui/legacy/SearchableView.ts +2 -1
  174. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  175. package/front_end/ui/legacy/Widget.ts +1 -1
  176. package/front_end/ui/legacy/XWidget.ts +0 -5
  177. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  178. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  179. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -32
  180. package/front_end/ui/legacy/themeColors.css +1 -1
  181. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  182. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  183. package/inspector_overlay/main.ts +2 -12
  184. package/package.json +2 -4
  185. package/scripts/build/build_inspector_overlay.py +15 -1
  186. package/scripts/build/rjsmin.py +84 -115
  187. package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
  188. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  189. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  190. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  191. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
  192. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  193. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  194. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
  195. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -5
  196. package/front_end/entrypoints/inspector/inspector.json +0 -4
  197. package/front_end/entrypoints/js_app/js_app.js +0 -12
  198. package/front_end/entrypoints/js_app/js_app.json +0 -3
  199. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
  200. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
  201. package/front_end/entrypoints/node_app/node_app.js +0 -16
  202. package/front_end/entrypoints/node_app/node_app.json +0 -3
  203. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
  204. package/front_end/entrypoints/node_main/node_main.ts +0 -11
  205. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  206. package/front_end/entrypoints/startup/startup.ts +0 -9
  207. package/front_end/entrypoints/worker_app/worker_app.json +0 -3
  208. package/front_end/panels/lighthouse/module.json +0 -6
  209. package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
  210. package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
  211. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
  212. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  213. package/scripts/build/build_release_applications.py +0 -216
  214. package/scripts/build/modular_build.py +0 -184
  215. package/scripts/check_gn.js +0 -119
  216. package/scripts/json_validator/module.schema.json +0 -19
  217. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -450,7 +450,7 @@ export const createSearchRegex = function(query: string, caseSensitive: boolean,
450
450
  }
451
451
 
452
452
  if (!regexObject) {
453
- regexObject = self.createPlainTextSearchRegex(query, regexFlags);
453
+ regexObject = createPlainTextSearchRegex(query, regexFlags);
454
454
  }
455
455
 
456
456
  return regexObject;
@@ -602,3 +602,16 @@ export const findUnclosedCssQuote = function(str: string): string {
602
602
  }
603
603
  return unmatchedQuote;
604
604
  };
605
+
606
+ export const createPlainTextSearchRegex = function(query: string, flags?: string): RegExp {
607
+ // This should be kept the same as the one in StringUtil.cpp.
608
+ let regex = '';
609
+ for (let i = 0; i < query.length; ++i) {
610
+ const c = query.charAt(i);
611
+ if (regexSpecialCharacters().indexOf(c) !== -1) {
612
+ regex += '\\';
613
+ }
614
+ regex += c;
615
+ }
616
+ return new RegExp(regex, flags || '');
617
+ };
@@ -31,35 +31,6 @@
31
31
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
32
  */
33
33
 
34
- /* The long term goal here is to remove all functions in this file and
35
- * replace them with ES Module functions rather than prototype
36
- * extensions but in the mean time if an old func in here depends on one
37
- * that has been migrated, it will need to be imported.
38
- */
39
-
40
- import {caseInsensetiveComparator, regexSpecialCharacters, sprintf} from './string-utilities.js';
41
-
42
- // Still used in the test runners that can't use ES modules :(
43
- String.sprintf = sprintf;
44
-
45
- // @ts-ignore https://crbug.com/1050549
46
- String.regexSpecialCharacters = regexSpecialCharacters;
47
- // @ts-ignore https://crbug.com/1050549
48
- String.caseInsensetiveComparator = caseInsensetiveComparator;
49
-
50
- self.createPlainTextSearchRegex = function(query: string, flags?: string): RegExp {
51
- // This should be kept the same as the one in StringUtil.cpp.
52
- let regex = '';
53
- for (let i = 0; i < query.length; ++i) {
54
- const c = query.charAt(i);
55
- if (regexSpecialCharacters().indexOf(c) !== -1) {
56
- regex += '\\';
57
- }
58
- regex += c;
59
- }
60
- return new RegExp(regex, flags || '');
61
- };
62
-
63
34
  export function runOnWindowLoad(callback: () => void): void {
64
35
  function windowLoaded(): void {
65
36
  window.removeEventListener('DOMContentLoaded', windowLoaded, false);
@@ -7,9 +7,6 @@ const originalAssert = console.assert;
7
7
 
8
8
  const queryParamsObject = new URLSearchParams(location.search);
9
9
 
10
- // The following variable are initialized all the way at the bottom of this file
11
- let importScriptPathPrefix: string;
12
-
13
10
  let runtimePlatform = '';
14
11
 
15
12
  let runtimeInstance: Runtime|undefined;
@@ -32,66 +29,16 @@ export function getRemoteBase(location: string = self.location.toString()): {
32
29
  return {base: `${url.origin}/remote/serve_file/${version[1]}/`, version: version[1]};
33
30
  }
34
31
 
35
- export const mappingForLayoutTests = new Map<string, string>([
36
- ['panels/animation', 'animation'],
37
- ['panels/browser_debugger', 'browser_debugger'],
38
- ['panels/changes', 'changes'],
39
- ['panels/console', 'console'],
40
- ['panels/elements', 'elements'],
41
- ['panels/emulation', 'emulation'],
42
- ['panels/mobile_throttling', 'mobile_throttling'],
43
- ['panels/network', 'network'],
44
- ['panels/profiler', 'profiler'],
45
- ['panels/application', 'resources'],
46
- ['panels/search', 'search'],
47
- ['panels/sources', 'sources'],
48
- ['panels/snippets', 'snippets'],
49
- ['panels/settings', 'settings'],
50
- ['panels/timeline', 'timeline'],
51
- ['panels/web_audio', 'web_audio'],
52
- ['models/persistence', 'persistence'],
53
- ['models/workspace_diff', 'workspace_diff'],
54
- ['entrypoints/main', 'main'],
55
- ['third_party/diff', 'diff'],
56
- ['ui/legacy/components/inline_editor', 'inline_editor'],
57
- ['ui/legacy/components/data_grid', 'data_grid'],
58
- ['ui/legacy/components/perf_ui', 'perf_ui'],
59
- ['ui/legacy/components/source_frame', 'source_frame'],
60
- ['ui/legacy/components/color_picker', 'color_picker'],
61
- ['ui/legacy/components/cookie_table', 'cookie_table'],
62
- ['ui/legacy/components/quick_open', 'quick_open'],
63
- ['ui/legacy/components/utils', 'components'],
64
- ]);
65
-
66
32
  export class Runtime {
67
- readonly #modules: Module[];
68
- modulesMap: {
69
- [x: string]: Module,
70
- };
71
- readonly #descriptorsMap: {
72
- [x: string]: ModuleDescriptor,
73
- };
74
- private constructor(descriptors: ModuleDescriptor[]) {
75
- this.#modules = [];
76
- this.modulesMap = {};
77
- this.#descriptorsMap = {};
78
-
79
- for (const descriptor of descriptors) {
80
- this.registerModule(descriptor);
81
- }
33
+ private constructor() {
82
34
  }
83
35
 
84
36
  static instance(opts: {
85
37
  forceNew: boolean|null,
86
- moduleDescriptors: Array<ModuleDescriptor>|null,
87
- }|undefined = {forceNew: null, moduleDescriptors: null}): Runtime {
88
- const {forceNew, moduleDescriptors} = opts;
38
+ }|undefined = {forceNew: null}): Runtime {
39
+ const {forceNew} = opts;
89
40
  if (!runtimeInstance || forceNew) {
90
- if (!moduleDescriptors) {
91
- throw new Error(`Unable to create runtime: moduleDescriptors must be provided: ${new Error().stack}`);
92
- }
93
-
94
- runtimeInstance = new Runtime(moduleDescriptors);
41
+ runtimeInstance = new Runtime();
95
42
  }
96
43
 
97
44
  return runtimeInstance;
@@ -202,51 +149,11 @@ export class Runtime {
202
149
  return '\n/*# sourceURL=' + sourceURL + ' */';
203
150
  }
204
151
 
205
- module(moduleName: string): Module {
206
- return this.modulesMap[moduleName];
207
- }
208
-
209
- private registerModule(descriptor: ModuleDescriptor): void {
210
- const module = new Module(this, descriptor);
211
- this.#modules.push(module);
212
- this.modulesMap[descriptor['name']] = module;
213
- const mappedName = mappingForLayoutTests.get(descriptor['name']);
214
- if (mappedName !== undefined) {
215
- this.modulesMap[mappedName] = module;
216
- }
217
- }
218
-
219
- loadModulePromise(moduleName: string): Promise<boolean> {
220
- return this.modulesMap[moduleName].loadPromise();
221
- }
222
-
223
- loadAutoStartModules(moduleNames: string[]): Promise<boolean[]> {
224
- const promises = [];
225
- for (const moduleName of moduleNames) {
226
- promises.push(this.loadModulePromise(moduleName));
227
- }
228
- return Promise.all(promises);
229
- }
230
-
231
- getModulesMap(): {[x: string]: Module} {
232
- return this.modulesMap;
233
- }
234
-
235
152
  loadLegacyModule(modulePath: string): Promise<void> {
236
153
  return import(`../../${modulePath}`);
237
154
  }
238
155
  }
239
156
 
240
- export class ModuleDescriptor {
241
- name!: string;
242
- dependencies!: string[]|undefined;
243
- modules!: string[];
244
- resources!: string[];
245
- condition!: string|undefined;
246
- experiment!: string|null;
247
- constructor() {
248
- }
249
- }
250
157
  export interface Option {
251
158
  title: string;
252
159
  value: string|boolean;
@@ -254,92 +161,6 @@ export interface Option {
254
161
  text?: string;
255
162
  }
256
163
 
257
- function computeContainingFolderName(name: string): string {
258
- if (name.includes('/')) {
259
- return name.substring(name.lastIndexOf('/') + 1, name.length);
260
- }
261
- return name;
262
- }
263
-
264
- export class Module {
265
- readonly #manager: Runtime;
266
- readonly descriptor: ModuleDescriptor;
267
- readonly #nameInternal: string;
268
- #loadedForTest: boolean;
269
- #pendingLoadPromise?: Promise<boolean>;
270
- constructor(manager: Runtime, descriptor: ModuleDescriptor) {
271
- this.#manager = manager;
272
- this.descriptor = descriptor;
273
- this.#nameInternal = descriptor.name;
274
- this.#loadedForTest = false;
275
- }
276
-
277
- name(): string {
278
- return this.#nameInternal;
279
- }
280
-
281
- enabled(): boolean {
282
- return Runtime.isDescriptorEnabled(this.descriptor);
283
- }
284
-
285
- resource(name: string): string {
286
- const fullName = this.#nameInternal + '/' + name;
287
- const content = cachedResources.get(fullName);
288
- if (!content) {
289
- throw new Error(fullName + ' not preloaded. Check module.json');
290
- }
291
- return content;
292
- }
293
-
294
- loadPromise(): Promise<boolean> {
295
- if (!this.enabled()) {
296
- return Promise.reject(new Error('Module ' + this.#nameInternal + ' is not enabled'));
297
- }
298
-
299
- if (this.#pendingLoadPromise) {
300
- return this.#pendingLoadPromise;
301
- }
302
-
303
- const dependencies = this.descriptor.dependencies;
304
- const dependencyPromises = [];
305
- for (let i = 0; dependencies && i < dependencies.length; ++i) {
306
- dependencyPromises.push(this.#manager.getModulesMap()[dependencies[i]].loadPromise());
307
- }
308
-
309
- this.#pendingLoadPromise = Promise.all(dependencyPromises).then(this.loadModules.bind(this)).then(() => {
310
- this.#loadedForTest = true;
311
- return this.#loadedForTest;
312
- });
313
-
314
- return this.#pendingLoadPromise;
315
- }
316
-
317
- private async loadModules(): Promise<void> {
318
- const containingFolderName = computeContainingFolderName(this.#nameInternal);
319
-
320
- const moduleFileName = `${containingFolderName}_module.js`;
321
- const entrypointFileName = `${containingFolderName}.js`;
322
-
323
- // If a module has resources, they are part of the `_module.js` files that are generated
324
- // by `build_release_applications`. These need to be loaded before any other code is
325
- // loaded, to make sure that the resource content is properly cached in `cachedResources`.
326
- if (this.descriptor.modules && this.descriptor.modules.includes(moduleFileName)) {
327
- await import(`../../${this.#nameInternal}/${moduleFileName}`);
328
- }
329
-
330
- await import(`../../${this.#nameInternal}/${entrypointFileName}`);
331
- }
332
-
333
- private modularizeURL(resourceName: string): string {
334
- return Runtime.normalizePath(this.#nameInternal + '/' + resourceName);
335
- }
336
-
337
- fetchResource(resourceName: string): Promise<string> {
338
- const sourceURL = getResourceURL(this.modularizeURL(resourceName));
339
- return loadResourcePromise(sourceURL);
340
- }
341
- }
342
-
343
164
  export class ExperimentsSupport {
344
165
  #experiments: Experiment[];
345
166
  #experimentNames: Set<string>;
@@ -513,37 +334,9 @@ export function loadResourcePromise(url: string): Promise<string> {
513
334
  }
514
335
  }
515
336
 
516
- function getResourceURL(scriptName: string, base?: string): string {
517
- const sourceURL = (base || importScriptPathPrefix) + scriptName;
518
- const schemaIndex = sourceURL.indexOf('://') + 3;
519
- let pathIndex = sourceURL.indexOf('/', schemaIndex);
520
- if (pathIndex === -1) {
521
- pathIndex = sourceURL.length;
522
- }
523
- return sourceURL.substring(0, pathIndex) + Runtime.normalizePath(sourceURL.substring(pathIndex));
524
- }
525
-
526
- (function(): void {
527
- const baseUrl = self.location ? self.location.origin + self.location.pathname : '';
528
- importScriptPathPrefix = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
529
- })();
530
-
531
337
  // This must be constructed after the query parameters have been parsed.
532
338
  export const experiments = new ExperimentsSupport();
533
339
 
534
- export const cachedResources = new Map<string, string>();
535
-
536
- // Only exported for LightHouse, which uses it in `report-generator.js`.
537
- // Do not use this global in DevTools' implementation.
538
- // TODO(crbug.com/1127292): remove this global
539
- // @ts-ignore
540
- globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE = cachedResources;
541
-
542
- export let appStartedPromiseCallback: () => void;
543
- export const appStarted = new Promise<void>(fulfill => {
544
- appStartedPromiseCallback = fulfill;
545
- });
546
-
547
340
  // TODO(crbug.com/1167717): Make this a const enum again
548
341
  // eslint-disable-next-line rulesdir/const_enum
549
342
  export enum ExperimentName {
@@ -27,7 +27,6 @@ export interface CoreOrProtocolAxProperty {
27
27
 
28
28
  export class AccessibilityNode {
29
29
  readonly #accessibilityModelInternal: AccessibilityModel;
30
- readonly #agent: ProtocolProxyApi.AccessibilityApi;
31
30
  readonly #idInternal: Protocol.Accessibility.AXNodeId;
32
31
  readonly #backendDOMNodeIdInternal: Protocol.DOM.BackendNodeId|null;
33
32
  readonly #deferredDOMNodeInternal: DeferredDOMNode|null;
@@ -44,7 +43,6 @@ export class AccessibilityNode {
44
43
 
45
44
  constructor(accessibilityModel: AccessibilityModel, payload: Protocol.Accessibility.AXNode) {
46
45
  this.#accessibilityModelInternal = accessibilityModel;
47
- this.#agent = accessibilityModel.getAgent();
48
46
 
49
47
  this.#idInternal = payload.nodeId;
50
48
  accessibilityModel.setAXNodeForAXId(this.#idInternal, this);
@@ -27,7 +27,6 @@ export class CSSProperty {
27
27
  #active: boolean;
28
28
  #nameRangeInternal: TextUtils.TextRange.TextRange|null;
29
29
  #valueRangeInternal: TextUtils.TextRange.TextRange|null;
30
- readonly #invalidProperty: string|null;
31
30
  #invalidString?: Common.UIString.LocalizedString;
32
31
 
33
32
  constructor(
@@ -46,7 +45,6 @@ export class CSSProperty {
46
45
  this.#active = true;
47
46
  this.#nameRangeInternal = null;
48
47
  this.#valueRangeInternal = null;
49
- this.#invalidProperty = null;
50
48
  }
51
49
 
52
50
  static parsePayload(ownerStyle: CSSStyleDeclaration, index: number, payload: Protocol.CSS.CSSProperty): CSSProperty {
@@ -203,11 +203,9 @@ export class CSSStyleRule extends CSSRule {
203
203
  }
204
204
 
205
205
  export class CSSKeyframesRule {
206
- readonly #cssModel: CSSModel;
207
206
  readonly #animationName: CSSValue;
208
207
  readonly #keyframesInternal: CSSKeyframeRule[];
209
208
  constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSKeyframesRule) {
210
- this.#cssModel = cssModel;
211
209
  this.#animationName = new CSSValue(payload.animationName);
212
210
  this.#keyframesInternal = payload.keyframes.map(keyframeRule => new CSSKeyframeRule(cssModel, keyframeRule));
213
211
  }
@@ -263,28 +263,3 @@ export enum Attributes {
263
263
  Priority = 'priority',
264
264
  PartitionKey = 'partitionKey',
265
265
  }
266
-
267
- /**
268
- * A `CookieReference` uniquely identifies a cookie by the triple (#name,domain,#path). Additionally, a context may be
269
- * included to make it clear which site under Application>Cookies should be opened when revealing a `CookieReference`.
270
- */
271
- export class CookieReference {
272
- readonly #name: string;
273
- readonly #domainInternal: string;
274
- readonly #path: string;
275
- readonly #contextUrlInternal: string|undefined;
276
- constructor(name: string, domain: string, path: string, contextUrl: string|undefined) {
277
- this.#name = name;
278
- this.#domainInternal = domain;
279
- this.#path = path;
280
- this.#contextUrlInternal = contextUrl;
281
- }
282
-
283
- domain(): string {
284
- return this.#domainInternal;
285
- }
286
-
287
- contextUrl(): string|undefined {
288
- return this.#contextUrlInternal;
289
- }
290
- }
@@ -15,7 +15,6 @@ import {SDKModel} from './SDKModel.js';
15
15
 
16
16
  export class EmulationModel extends SDKModel<void> {
17
17
  readonly #emulationAgent: ProtocolProxyApi.EmulationApi;
18
- readonly #pageAgent: ProtocolProxyApi.PageApi;
19
18
  readonly #deviceOrientationAgent: ProtocolProxyApi.DeviceOrientationApi;
20
19
  #cssModel: CSSModel|null;
21
20
  readonly #overlayModelInternal: OverlayModel|null;
@@ -31,7 +30,6 @@ export class EmulationModel extends SDKModel<void> {
31
30
  constructor(target: Target) {
32
31
  super(target);
33
32
  this.#emulationAgent = target.emulationAgent();
34
- this.#pageAgent = target.pageAgent();
35
33
  this.#deviceOrientationAgent = target.deviceOrientationAgent();
36
34
  this.#cssModel = target.model(CSSModel);
37
35
  this.#overlayModelInternal = target.model(OverlayModel);
@@ -15,7 +15,6 @@ import {SDKModel} from './SDKModel.js';
15
15
  export class HeapProfilerModel extends SDKModel<EventTypes> {
16
16
  #enabled: boolean;
17
17
  readonly #heapProfilerAgent: ProtocolProxyApi.HeapProfilerApi;
18
- readonly #memoryAgent: ProtocolProxyApi.MemoryApi;
19
18
  readonly #runtimeModelInternal: RuntimeModel;
20
19
  #samplingProfilerDepth: number;
21
20
 
@@ -24,7 +23,6 @@ export class HeapProfilerModel extends SDKModel<EventTypes> {
24
23
  target.registerHeapProfilerDispatcher(new HeapProfilerDispatcher(this));
25
24
  this.#enabled = false;
26
25
  this.#heapProfilerAgent = target.heapProfilerAgent();
27
- this.#memoryAgent = target.memoryAgent();
28
26
  this.#runtimeModelInternal = (target.model(RuntimeModel) as RuntimeModel);
29
27
  this.#samplingProfilerDepth = 0;
30
28
  }
@@ -1575,7 +1575,6 @@ class ExtraInfoBuilder {
1575
1575
  #requestExtraInfos: (ExtraRequestInfo|null)[];
1576
1576
  #responseExtraInfos: (ExtraResponseInfo|null)[];
1577
1577
  #finishedInternal: boolean;
1578
- #hasExtraInfo: boolean;
1579
1578
  #webBundleInfo: WebBundleInfo|null;
1580
1579
  #webBundleInnerRequestInfo: WebBundleInnerRequestInfo|null;
1581
1580
 
@@ -1584,7 +1583,6 @@ class ExtraInfoBuilder {
1584
1583
  this.#requestExtraInfos = [];
1585
1584
  this.#responseExtraInfos = [];
1586
1585
  this.#finishedInternal = false;
1587
- this.#hasExtraInfo = false;
1588
1586
  this.#webBundleInfo = null;
1589
1587
  this.#webBundleInnerRequestInfo = null;
1590
1588
  }
@@ -1595,7 +1593,6 @@ class ExtraInfoBuilder {
1595
1593
  }
1596
1594
 
1597
1595
  addRequestExtraInfo(info: ExtraRequestInfo): void {
1598
- this.#hasExtraInfo = true;
1599
1596
  this.#requestExtraInfos.push(info);
1600
1597
  this.sync(this.#requestExtraInfos.length - 1);
1601
1598
  }
@@ -52,7 +52,6 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
52
52
  #lastModifiedInternal: Date|null;
53
53
  readonly #contentSizeInternal: number|null;
54
54
  #contentInternal!: string|null;
55
- #contentLoadError!: string|null;
56
55
  #contentEncodedInternal!: boolean;
57
56
  readonly #pendingContentCallbacks: ((arg0: Object|null) => void)[];
58
57
  #parsedURLInternal?: Common.ParsedURL.ParsedURL;
@@ -245,12 +244,10 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
245
244
  {frameId: this.frameId as Protocol.Page.FrameId, url: this.url});
246
245
  const protocolError = response.getError();
247
246
  if (protocolError) {
248
- this.#contentLoadError = protocolError;
249
247
  this.#contentInternal = null;
250
248
  loadResult = {content: null, error: protocolError, isEncoded: false};
251
249
  } else {
252
250
  this.#contentInternal = response.content;
253
- this.#contentLoadError = null;
254
251
  loadResult = {content: response.content, isEncoded: response.base64Encoded};
255
252
  }
256
253
  this.#contentEncodedInternal = response.base64Encoded;
@@ -604,7 +604,6 @@ export class ResourceTreeFrame {
604
604
  #urlInternal: string;
605
605
  #domainAndRegistryInternal: string;
606
606
  #securityOriginInternal: string|null;
607
- #mimeType: string|null;
608
607
  #unreachableUrlInternal: string;
609
608
  #adFrameStatusInternal?: Protocol.Page.AdFrameStatus;
610
609
  #secureContextType: Protocol.Page.SecureContextType|null;
@@ -632,7 +631,6 @@ export class ResourceTreeFrame {
632
631
  this.#urlInternal = (payload && payload.url) || '';
633
632
  this.#domainAndRegistryInternal = (payload && payload.domainAndRegistry) || '';
634
633
  this.#securityOriginInternal = payload && payload.securityOrigin;
635
- this.#mimeType = payload && payload.mimeType;
636
634
  this.#unreachableUrlInternal = (payload && payload.unreachableUrl) || '';
637
635
  this.#adFrameStatusInternal = payload?.adFrameStatus;
638
636
  this.#secureContextType = payload && payload.secureContextType;
@@ -685,7 +683,6 @@ export class ResourceTreeFrame {
685
683
  this.#urlInternal = framePayload.url;
686
684
  this.#domainAndRegistryInternal = framePayload.domainAndRegistry;
687
685
  this.#securityOriginInternal = framePayload.securityOrigin;
688
- this.#mimeType = framePayload.mimeType;
689
686
  this.#unreachableUrlInternal = framePayload.unreachableUrl || '';
690
687
  this.#adFrameStatusInternal = framePayload?.adFrameStatus;
691
688
  this.#secureContextType = framePayload.secureContextType;
@@ -98,7 +98,6 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
98
98
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
99
99
 
100
100
  export class ServiceWorkerManager extends SDKModel<EventTypes> {
101
- readonly #lastAnonymousTargetId: number;
102
101
  readonly #agent: ProtocolProxyApi.ServiceWorkerApi;
103
102
  readonly #registrationsInternal: Map<string, ServiceWorkerRegistration>;
104
103
  #enabled: boolean;
@@ -111,7 +110,6 @@ export class ServiceWorkerManager extends SDKModel<EventTypes> {
111
110
  constructor(target: Target) {
112
111
  super(target);
113
112
  target.registerServiceWorkerDispatcher(new ServiceWorkerDispatcher(this));
114
- this.#lastAnonymousTargetId = 0;
115
113
  this.#agent = target.serviceWorkerAgent();
116
114
  this.#registrationsInternal = new Map();
117
115
  this.#enabled = false;
@@ -73,9 +73,6 @@ SDK.ConsoleMessage.FrontendMessageSource = SDKModule.ConsoleModel.FrontendMessag
73
73
  /** @constructor */
74
74
  SDK.Cookie = SDKModule.Cookie.Cookie;
75
75
 
76
- /** @constructor */
77
- SDK.CookieReference = SDKModule.Cookie.CookieReference;
78
-
79
76
  /** @constructor */
80
77
  SDK.CookieParser = SDKModule.CookieParser.CookieParser;
81
78
 
@@ -389,7 +389,6 @@
389
389
  ExperimentEnabledAtLaunch: 'DevTools.ExperimentEnabledAtLaunch',
390
390
  ExperimentEnabled: 'DevTools.ExperimentEnabled',
391
391
  ExperimentDisabled: 'DevTools.ExperimentDisabled',
392
- CssEditorOpened: 'DevTools.CssEditorOpened',
393
392
  DeveloperResourceLoaded: 'DevTools.DeveloperResourceLoaded',
394
393
  DeveloperResourceScheme: 'DevTools.DeveloperResourceScheme',
395
394
  LinearMemoryInspectorRevealedFrom: 'DevTools.LinearMemoryInspector.RevealedFrom',
@@ -401,6 +400,7 @@
401
400
  RecordingReplayFinished: 'DevTools.RecordingReplayFinished',
402
401
  RecordingReplayStarted: 'DevTools.RecordingReplayStarted',
403
402
  RecordingToggled: 'DevTools.RecordingToggled',
403
+ SyncSetting: 'DevTools.SyncSetting',
404
404
  };
405
405
 
406
406
  /**
@@ -1,7 +1,7 @@
1
- // Copyright 2021 The Chromium Authors. All rights reserved.
1
+ // Copyright 2018 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
-
4
+ import '../shell/shell.js';
5
5
  import '../../panels/css_overview/css_overview-meta.js';
6
6
  import '../../panels/elements/elements-meta.js';
7
7
  import '../../panels/browser_debugger/browser_debugger-meta.js';
@@ -25,3 +25,10 @@ import '../../panels/timeline/timeline-meta.js';
25
25
  import '../../panels/web_audio/web_audio-meta.js';
26
26
  import '../../panels/webauthn/webauthn-meta.js';
27
27
  import '../../panels/layer_viewer/layer_viewer-meta.js';
28
+
29
+ import * as Root from '../../core/root/root.js';
30
+ import * as Main from '../main/main.js';
31
+
32
+ // @ts-ignore Exposed for legacy layout tests
33
+ self.runtime = Root.Runtime.Runtime.instance({forceNew: true});
34
+ new Main.MainImpl.MainImpl();
@@ -909,7 +909,8 @@ export abstract class HeapSnapshot {
909
909
  return matchedStringIndexes;
910
910
  }
911
911
 
912
- const regexp = searchConfig.isRegex ? new RegExp(query) : createPlainTextSearchRegex(query, 'i');
912
+ const regexp =
913
+ searchConfig.isRegex ? new RegExp(query) : Platform.StringUtilities.createPlainTextSearchRegex(query, 'i');
913
914
 
914
915
  function filterRegexp(matchedStringIndexes: Set<number>, string: string, index: number): Set<number> {
915
916
  if (regexp.test(string)) {
@@ -3,6 +3,3 @@
3
3
  // found in the LICENSE file.
4
4
  import '../devtools_app/devtools_app.js';
5
5
  import '../../panels/screencast/screencast-meta.js';
6
- import * as Startup from '../startup/startup.js';
7
-
8
- Startup.RuntimeInstantiator.startApplication('inspector');
@@ -1,12 +1,15 @@
1
1
  // Copyright 2018 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
+ import '../shell/shell.js';
5
+ import '../../panels/js_profiler/js_profiler-meta.js';
4
6
 
5
7
  import * as Common from '../../core/common/common.js';
6
8
  import * as Host from '../../core/host/host.js';
7
9
  import * as i18n from '../../core/i18n/i18n.js';
8
10
  import * as SDK from '../../core/sdk/sdk.js';
9
11
  import * as Components from '../../ui/legacy/components/utils/utils.js';
12
+ import * as Main from '../main/main.js';
10
13
 
11
14
  const UIStrings = {
12
15
  /**
@@ -15,7 +18,7 @@ const UIStrings = {
15
18
  main: 'Main',
16
19
  };
17
20
 
18
- const str_ = i18n.i18n.registerUIStrings('entrypoints/js_app/JsMain.ts', UIStrings);
21
+ const str_ = i18n.i18n.registerUIStrings('entrypoints/js_app/js_app.ts', UIStrings);
19
22
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
20
23
 
21
24
  let jsMainImplInstance: JsMainImpl;
@@ -41,3 +44,4 @@ export class JsMainImpl implements Common.Runnable.Runnable {
41
44
  }
42
45
 
43
46
  Common.Runnable.registerEarlyInitializationRunnable(JsMainImpl.instance);
47
+ new Main.MainImpl.MainImpl();
@@ -139,7 +139,6 @@ export class MainImpl {
139
139
 
140
140
  private async loaded(): Promise<void> {
141
141
  console.timeStamp('Main._loaded');
142
- await Root.Runtime.appStarted;
143
142
  Root.Runtime.Runtime.setPlatform(Host.Platform.platform());
144
143
  const prefs = await new Promise<{[key: string]: string}>(resolve => {
145
144
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.getPreferences(resolve);
@@ -4,7 +4,5 @@
4
4
  import '../shell/shell.js';
5
5
 
6
6
  import * as Main from '../main/main.js';
7
- import * as Startup from '../startup/startup.js';
8
7
 
9
8
  new Main.MainImpl.MainImpl();
10
- Startup.RuntimeInstantiator.startApplication('ndb_app');
@@ -32,7 +32,7 @@ const UIStrings = {
32
32
  */
33
33
  networkAddressEgLocalhost: 'Network address (e.g. localhost:9229)',
34
34
  };
35
- const str_ = i18n.i18n.registerUIStrings('entrypoints/node_main/NodeConnectionsPanel.ts', UIStrings);
35
+ const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/NodeConnectionsPanel.ts', UIStrings);
36
36
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
37
37
 
38
38
  let nodeConnectionsPanelInstance: NodeConnectionsPanel;