devtools-tracing 1.0.0

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 (397) hide show
  1. package/generate.ts +643 -0
  2. package/index.ts +16 -0
  3. package/lib/front_end/core/common/App.ts +7 -0
  4. package/lib/front_end/core/common/AppProvider.ts +32 -0
  5. package/lib/front_end/core/common/Base64.ts +47 -0
  6. package/lib/front_end/core/common/CharacterIdMap.ts +30 -0
  7. package/lib/front_end/core/common/Color.ts +2506 -0
  8. package/lib/front_end/core/common/ColorConverter.ts +402 -0
  9. package/lib/front_end/core/common/ColorUtils.ts +252 -0
  10. package/lib/front_end/core/common/Console.ts +114 -0
  11. package/lib/front_end/core/common/Debouncer.ts +15 -0
  12. package/lib/front_end/core/common/EventTarget.ts +52 -0
  13. package/lib/front_end/core/common/Gzip.ts +74 -0
  14. package/lib/front_end/core/common/JavaScriptMetaData.ts +29 -0
  15. package/lib/front_end/core/common/Lazy.ts +31 -0
  16. package/lib/front_end/core/common/Linkifier.ts +55 -0
  17. package/lib/front_end/core/common/MapWithDefault.ts +26 -0
  18. package/lib/front_end/core/common/Mutex.ts +55 -0
  19. package/lib/front_end/core/common/Object.ts +145 -0
  20. package/lib/front_end/core/common/ParsedURL.ts +554 -0
  21. package/lib/front_end/core/common/Progress.ts +180 -0
  22. package/lib/front_end/core/common/QueryParamHandler.ts +7 -0
  23. package/lib/front_end/core/common/ResolverBase.ts +85 -0
  24. package/lib/front_end/core/common/ResourceType.ts +588 -0
  25. package/lib/front_end/core/common/ReturnToPanel.ts +17 -0
  26. package/lib/front_end/core/common/Revealer.ts +192 -0
  27. package/lib/front_end/core/common/Runnable.ts +41 -0
  28. package/lib/front_end/core/common/SegmentedRange.ts +87 -0
  29. package/lib/front_end/core/common/SettingRegistration.ts +339 -0
  30. package/lib/front_end/core/common/Settings.ts +1497 -0
  31. package/lib/front_end/core/common/SimpleHistoryManager.ts +124 -0
  32. package/lib/front_end/core/common/StringOutputStream.ts +26 -0
  33. package/lib/front_end/core/common/TextDictionary.ts +48 -0
  34. package/lib/front_end/core/common/Throttler.ts +99 -0
  35. package/lib/front_end/core/common/Trie.ts +152 -0
  36. package/lib/front_end/core/common/Worker.ts +60 -0
  37. package/lib/front_end/core/common/common.ts +81 -0
  38. package/lib/front_end/core/host/AidaClient.ts +733 -0
  39. package/lib/front_end/core/host/GdpClient.ts +316 -0
  40. package/lib/front_end/core/host/InspectorFrontendHost.ts +648 -0
  41. package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +551 -0
  42. package/lib/front_end/core/host/Platform.ts +76 -0
  43. package/lib/front_end/core/host/ResourceLoader.ts +282 -0
  44. package/lib/front_end/core/host/UserMetrics.ts +1230 -0
  45. package/lib/front_end/core/host/host.ts +23 -0
  46. package/lib/front_end/core/i18n/ByteUtilities.ts +82 -0
  47. package/lib/front_end/core/i18n/DevToolsLocale.ts +87 -0
  48. package/lib/front_end/core/i18n/NumberFormatter.ts +82 -0
  49. package/lib/front_end/core/i18n/i18n.ts +17 -0
  50. package/lib/front_end/core/i18n/i18nImpl.ts +204 -0
  51. package/lib/front_end/core/i18n/i18nTypes.ts +10 -0
  52. package/lib/front_end/core/i18n/locales.js +14 -0
  53. package/lib/front_end/core/i18n/time-utilities.ts +174 -0
  54. package/lib/front_end/core/platform/ArrayUtilities.ts +271 -0
  55. package/lib/front_end/core/platform/Brand.ts +23 -0
  56. package/lib/front_end/core/platform/Constructor.ts +10 -0
  57. package/lib/front_end/core/platform/DOMUtilities.ts +138 -0
  58. package/lib/front_end/core/platform/DateUtilities.ts +15 -0
  59. package/lib/front_end/core/platform/DevToolsPath.ts +53 -0
  60. package/lib/front_end/core/platform/KeyboardUtilities.ts +38 -0
  61. package/lib/front_end/core/platform/MapUtilities.ts +95 -0
  62. package/lib/front_end/core/platform/MimeType.ts +175 -0
  63. package/lib/front_end/core/platform/NumberUtilities.ts +80 -0
  64. package/lib/front_end/core/platform/StringUtilities.ts +588 -0
  65. package/lib/front_end/core/platform/Timing.ts +17 -0
  66. package/lib/front_end/core/platform/TypedArrayUtilities.ts +189 -0
  67. package/lib/front_end/core/platform/TypescriptUtilities.ts +86 -0
  68. package/lib/front_end/core/platform/UIString.ts +39 -0
  69. package/lib/front_end/core/platform/UserVisibleError.ts +28 -0
  70. package/lib/front_end/core/platform/platform.ts +45 -0
  71. package/lib/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
  72. package/lib/front_end/core/protocol_client/InspectorBackend.ts +1050 -0
  73. package/lib/front_end/core/protocol_client/NodeURL.ts +42 -0
  74. package/lib/front_end/core/protocol_client/protocol_client.ts +13 -0
  75. package/lib/front_end/core/root/Runtime.ts +609 -0
  76. package/lib/front_end/core/root/root.ts +6 -0
  77. package/lib/front_end/core/sdk/AccessibilityModel.ts +353 -0
  78. package/lib/front_end/core/sdk/AnimationModel.ts +1041 -0
  79. package/lib/front_end/core/sdk/AutofillModel.ts +184 -0
  80. package/lib/front_end/core/sdk/CPUProfilerModel.ts +148 -0
  81. package/lib/front_end/core/sdk/CPUThrottlingManager.ts +282 -0
  82. package/lib/front_end/core/sdk/CSSContainerQuery.ts +139 -0
  83. package/lib/front_end/core/sdk/CSSFontFace.ts +40 -0
  84. package/lib/front_end/core/sdk/CSSLayer.ts +30 -0
  85. package/lib/front_end/core/sdk/CSSMatchedStyles.ts +1646 -0
  86. package/lib/front_end/core/sdk/CSSMedia.ts +121 -0
  87. package/lib/front_end/core/sdk/CSSMetadata.ts +1647 -0
  88. package/lib/front_end/core/sdk/CSSModel.ts +1128 -0
  89. package/lib/front_end/core/sdk/CSSProperty.ts +384 -0
  90. package/lib/front_end/core/sdk/CSSPropertyParser.ts +681 -0
  91. package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +1395 -0
  92. package/lib/front_end/core/sdk/CSSQuery.ts +72 -0
  93. package/lib/front_end/core/sdk/CSSRule.ts +465 -0
  94. package/lib/front_end/core/sdk/CSSScope.ts +30 -0
  95. package/lib/front_end/core/sdk/CSSStartingStyle.ts +29 -0
  96. package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +313 -0
  97. package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +196 -0
  98. package/lib/front_end/core/sdk/CSSSupports.ts +33 -0
  99. package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +64 -0
  100. package/lib/front_end/core/sdk/ChildTargetManager.ts +314 -0
  101. package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +62 -0
  102. package/lib/front_end/core/sdk/Connections.ts +293 -0
  103. package/lib/front_end/core/sdk/ConsoleModel.ts +808 -0
  104. package/lib/front_end/core/sdk/ConsoleModelTypes.ts +15 -0
  105. package/lib/front_end/core/sdk/Cookie.ts +319 -0
  106. package/lib/front_end/core/sdk/CookieModel.ts +239 -0
  107. package/lib/front_end/core/sdk/CookieParser.ts +185 -0
  108. package/lib/front_end/core/sdk/DOMDebuggerModel.ts +787 -0
  109. package/lib/front_end/core/sdk/DOMModel.ts +1961 -0
  110. package/lib/front_end/core/sdk/DebuggerModel.ts +1605 -0
  111. package/lib/front_end/core/sdk/EmulationModel.ts +648 -0
  112. package/lib/front_end/core/sdk/EnhancedTracesParser.ts +515 -0
  113. package/lib/front_end/core/sdk/EventBreakpointsModel.ts +183 -0
  114. package/lib/front_end/core/sdk/FrameAssociated.ts +11 -0
  115. package/lib/front_end/core/sdk/FrameManager.ts +259 -0
  116. package/lib/front_end/core/sdk/HeapProfilerModel.ts +225 -0
  117. package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +77 -0
  118. package/lib/front_end/core/sdk/IOModel.ts +91 -0
  119. package/lib/front_end/core/sdk/IsolateManager.ts +257 -0
  120. package/lib/front_end/core/sdk/IssuesModel.ts +70 -0
  121. package/lib/front_end/core/sdk/LayerTreeBase.ts +169 -0
  122. package/lib/front_end/core/sdk/LogModel.ts +56 -0
  123. package/lib/front_end/core/sdk/NetworkManager.ts +2823 -0
  124. package/lib/front_end/core/sdk/NetworkRequest.ts +2253 -0
  125. package/lib/front_end/core/sdk/OverlayColorGenerator.ts +52 -0
  126. package/lib/front_end/core/sdk/OverlayModel.ts +1011 -0
  127. package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +522 -0
  128. package/lib/front_end/core/sdk/PageLoad.ts +35 -0
  129. package/lib/front_end/core/sdk/PageResourceLoader.ts +435 -0
  130. package/lib/front_end/core/sdk/PaintProfiler.ts +110 -0
  131. package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +84 -0
  132. package/lib/front_end/core/sdk/PreloadingModel.ts +863 -0
  133. package/lib/front_end/core/sdk/RehydratingConnection.ts +386 -0
  134. package/lib/front_end/core/sdk/RehydratingObject.ts +66 -0
  135. package/lib/front_end/core/sdk/RemoteObject.ts +1160 -0
  136. package/lib/front_end/core/sdk/Resource.ts +232 -0
  137. package/lib/front_end/core/sdk/ResourceTreeModel.ts +1160 -0
  138. package/lib/front_end/core/sdk/RuntimeModel.ts +732 -0
  139. package/lib/front_end/core/sdk/SDKModel.ts +65 -0
  140. package/lib/front_end/core/sdk/ScopeTreeCache.ts +45 -0
  141. package/lib/front_end/core/sdk/ScreenCaptureModel.ts +255 -0
  142. package/lib/front_end/core/sdk/Script.ts +534 -0
  143. package/lib/front_end/core/sdk/SecurityOriginManager.ts +76 -0
  144. package/lib/front_end/core/sdk/ServerSentEvents.ts +80 -0
  145. package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +122 -0
  146. package/lib/front_end/core/sdk/ServerTiming.ts +260 -0
  147. package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +377 -0
  148. package/lib/front_end/core/sdk/ServiceWorkerManager.ts +605 -0
  149. package/lib/front_end/core/sdk/SourceMap.ts +867 -0
  150. package/lib/front_end/core/sdk/SourceMapCache.ts +54 -0
  151. package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +156 -0
  152. package/lib/front_end/core/sdk/SourceMapManager.ts +239 -0
  153. package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +189 -0
  154. package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +508 -0
  155. package/lib/front_end/core/sdk/StorageBucketsModel.ts +204 -0
  156. package/lib/front_end/core/sdk/StorageKeyManager.ts +98 -0
  157. package/lib/front_end/core/sdk/Target.ts +332 -0
  158. package/lib/front_end/core/sdk/TargetManager.ts +453 -0
  159. package/lib/front_end/core/sdk/TraceObject.ts +61 -0
  160. package/lib/front_end/core/sdk/WebAuthnModel.ts +104 -0
  161. package/lib/front_end/core/sdk/sdk.ts +174 -0
  162. package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +59 -0
  163. package/lib/front_end/generated/InspectorBackendCommands.js +1617 -0
  164. package/lib/front_end/generated/SupportedCSSProperties.js +7512 -0
  165. package/lib/front_end/generated/protocol-proxy-api.d.ts +5022 -0
  166. package/lib/front_end/generated/protocol.ts +22014 -0
  167. package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +571 -0
  168. package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +103 -0
  169. package/lib/front_end/models/cpu_profile/cpu_profile.ts +11 -0
  170. package/lib/front_end/models/formatter/FormatterWorkerPool.ts +219 -0
  171. package/lib/front_end/models/formatter/ScriptFormatter.ts +112 -0
  172. package/lib/front_end/models/formatter/formatter.ts +8 -0
  173. package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +37 -0
  174. package/lib/front_end/models/text_utils/ContentData.ts +199 -0
  175. package/lib/front_end/models/text_utils/ContentProvider.ts +68 -0
  176. package/lib/front_end/models/text_utils/StaticContentProvider.ts +49 -0
  177. package/lib/front_end/models/text_utils/StreamingContentData.ts +108 -0
  178. package/lib/front_end/models/text_utils/Text.ts +90 -0
  179. package/lib/front_end/models/text_utils/TextCursor.ts +44 -0
  180. package/lib/front_end/models/text_utils/TextRange.ts +266 -0
  181. package/lib/front_end/models/text_utils/TextUtils.ts +401 -0
  182. package/lib/front_end/models/text_utils/WasmDisassembly.ts +87 -0
  183. package/lib/front_end/models/text_utils/text_utils.ts +27 -0
  184. package/lib/front_end/models/trace/EntityMapper.ts +141 -0
  185. package/lib/front_end/models/trace/EventsSerializer.ts +101 -0
  186. package/lib/front_end/models/trace/LanternComputationData.ts +438 -0
  187. package/lib/front_end/models/trace/ModelImpl.ts +236 -0
  188. package/lib/front_end/models/trace/Name.ts +136 -0
  189. package/lib/front_end/models/trace/Processor.ts +652 -0
  190. package/lib/front_end/models/trace/Styles.ts +1138 -0
  191. package/lib/front_end/models/trace/extras/FilmStrip.ts +78 -0
  192. package/lib/front_end/models/trace/extras/MainThreadActivity.ts +86 -0
  193. package/lib/front_end/models/trace/extras/ScriptDuplication.ts +236 -0
  194. package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +203 -0
  195. package/lib/front_end/models/trace/extras/ThirdParties.ts +164 -0
  196. package/lib/front_end/models/trace/extras/TraceFilter.ts +62 -0
  197. package/lib/front_end/models/trace/extras/TraceTree.ts +701 -0
  198. package/lib/front_end/models/trace/extras/extras.ts +11 -0
  199. package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +128 -0
  200. package/lib/front_end/models/trace/handlers/AnimationHandler.ts +36 -0
  201. package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +239 -0
  202. package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +183 -0
  203. package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +31 -0
  204. package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +306 -0
  205. package/lib/front_end/models/trace/handlers/FlowsHandler.ts +175 -0
  206. package/lib/front_end/models/trace/handlers/FramesHandler.ts +571 -0
  207. package/lib/front_end/models/trace/handlers/GPUHandler.ts +50 -0
  208. package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +183 -0
  209. package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +193 -0
  210. package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +168 -0
  211. package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +109 -0
  212. package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +35 -0
  213. package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +123 -0
  214. package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +573 -0
  215. package/lib/front_end/models/trace/handlers/MemoryHandler.ts +31 -0
  216. package/lib/front_end/models/trace/handlers/MetaHandler.ts +525 -0
  217. package/lib/front_end/models/trace/handlers/ModelHandlers.ts +34 -0
  218. package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +672 -0
  219. package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +52 -0
  220. package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +460 -0
  221. package/lib/front_end/models/trace/handlers/RendererHandler.ts +428 -0
  222. package/lib/front_end/models/trace/handlers/SamplesHandler.ts +271 -0
  223. package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +122 -0
  224. package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +336 -0
  225. package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +110 -0
  226. package/lib/front_end/models/trace/handlers/Threads.ts +139 -0
  227. package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +400 -0
  228. package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +233 -0
  229. package/lib/front_end/models/trace/handlers/WarningsHandler.ts +162 -0
  230. package/lib/front_end/models/trace/handlers/WorkersHandler.ts +45 -0
  231. package/lib/front_end/models/trace/handlers/handlers.ts +8 -0
  232. package/lib/front_end/models/trace/handlers/helpers.ts +196 -0
  233. package/lib/front_end/models/trace/handlers/types.ts +75 -0
  234. package/lib/front_end/models/trace/helpers/Extensions.ts +54 -0
  235. package/lib/front_end/models/trace/helpers/Network.ts +129 -0
  236. package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +544 -0
  237. package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +87 -0
  238. package/lib/front_end/models/trace/helpers/Timing.ts +248 -0
  239. package/lib/front_end/models/trace/helpers/Trace.ts +928 -0
  240. package/lib/front_end/models/trace/helpers/TreeHelpers.ts +320 -0
  241. package/lib/front_end/models/trace/helpers/helpers.ts +11 -0
  242. package/lib/front_end/models/trace/insights/CLSCulprits.ts +668 -0
  243. package/lib/front_end/models/trace/insights/Cache.ts +269 -0
  244. package/lib/front_end/models/trace/insights/Common.ts +453 -0
  245. package/lib/front_end/models/trace/insights/DOMSize.ts +223 -0
  246. package/lib/front_end/models/trace/insights/DocumentLatency.ts +319 -0
  247. package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +126 -0
  248. package/lib/front_end/models/trace/insights/FontDisplay.ts +119 -0
  249. package/lib/front_end/models/trace/insights/ForcedReflow.ts +220 -0
  250. package/lib/front_end/models/trace/insights/INPBreakdown.ts +171 -0
  251. package/lib/front_end/models/trace/insights/ImageDelivery.ts +348 -0
  252. package/lib/front_end/models/trace/insights/LCPBreakdown.ts +268 -0
  253. package/lib/front_end/models/trace/insights/LCPDiscovery.ts +237 -0
  254. package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +138 -0
  255. package/lib/front_end/models/trace/insights/Models.ts +22 -0
  256. package/lib/front_end/models/trace/insights/ModernHTTP.ts +257 -0
  257. package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +726 -0
  258. package/lib/front_end/models/trace/insights/RenderBlocking.ts +257 -0
  259. package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +175 -0
  260. package/lib/front_end/models/trace/insights/Statistics.ts +101 -0
  261. package/lib/front_end/models/trace/insights/ThirdParties.ts +130 -0
  262. package/lib/front_end/models/trace/insights/Viewport.ts +138 -0
  263. package/lib/front_end/models/trace/insights/insights.ts +10 -0
  264. package/lib/front_end/models/trace/insights/types.ts +157 -0
  265. package/lib/front_end/models/trace/lantern/core/LanternError.ts +7 -0
  266. package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +619 -0
  267. package/lib/front_end/models/trace/lantern/core/core.ts +6 -0
  268. package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +345 -0
  269. package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +80 -0
  270. package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +101 -0
  271. package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +636 -0
  272. package/lib/front_end/models/trace/lantern/graph/graph.ts +8 -0
  273. package/lib/front_end/models/trace/lantern/lantern.ts +17 -0
  274. package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +187 -0
  275. package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +88 -0
  276. package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +92 -0
  277. package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +72 -0
  278. package/lib/front_end/models/trace/lantern/metrics/Metric.ts +126 -0
  279. package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +126 -0
  280. package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +82 -0
  281. package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +112 -0
  282. package/lib/front_end/models/trace/lantern/metrics/metrics.ts +12 -0
  283. package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +150 -0
  284. package/lib/front_end/models/trace/lantern/simulation/Constants.ts +46 -0
  285. package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +61 -0
  286. package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +196 -0
  287. package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +556 -0
  288. package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +192 -0
  289. package/lib/front_end/models/trace/lantern/simulation/simulation.ts +10 -0
  290. package/lib/front_end/models/trace/lantern/types/Lantern.ts +220 -0
  291. package/lib/front_end/models/trace/lantern/types/types.ts +5 -0
  292. package/lib/front_end/models/trace/trace.ts +33 -0
  293. package/lib/front_end/models/trace/types/Configuration.ts +110 -0
  294. package/lib/front_end/models/trace/types/Extensions.ts +136 -0
  295. package/lib/front_end/models/trace/types/File.ts +281 -0
  296. package/lib/front_end/models/trace/types/Overlays.ts +138 -0
  297. package/lib/front_end/models/trace/types/Timing.ts +30 -0
  298. package/lib/front_end/models/trace/types/TraceEvents.ts +3277 -0
  299. package/lib/front_end/models/trace/types/types.ts +10 -0
  300. package/lib/front_end/third_party/i18n/LICENSE +202 -0
  301. package/lib/front_end/third_party/i18n/README.chromium +15 -0
  302. package/lib/front_end/third_party/i18n/i18n-impl.ts +61 -0
  303. package/lib/front_end/third_party/i18n/i18n.ts +11 -0
  304. package/lib/front_end/third_party/i18n/localized-string-set.ts +129 -0
  305. package/lib/front_end/third_party/intl-messageformat/LICENSE +33 -0
  306. package/lib/front_end/third_party/intl-messageformat/README.chromium +24 -0
  307. package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +16 -0
  308. package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +6 -0
  309. package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +33 -0
  310. package/lib/front_end/third_party/intl-messageformat/package/README.md +3 -0
  311. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +6 -0
  312. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +1 -0
  313. package/lib/front_end/third_party/intl-messageformat/package/index.js +13 -0
  314. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +5 -0
  315. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +1710 -0
  316. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +1815 -0
  317. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +6 -0
  318. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +1 -0
  319. package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +10 -0
  320. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +34 -0
  321. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +1 -0
  322. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +229 -0
  323. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +28 -0
  324. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +1 -0
  325. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +48 -0
  326. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +34 -0
  327. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +1 -0
  328. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +179 -0
  329. package/lib/front_end/third_party/intl-messageformat/package/package.json +42 -0
  330. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +34 -0
  331. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +1 -0
  332. package/lib/front_end/third_party/intl-messageformat/package/src/core.js +230 -0
  333. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +28 -0
  334. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +1 -0
  335. package/lib/front_end/third_party/intl-messageformat/package/src/error.js +51 -0
  336. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +34 -0
  337. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +1 -0
  338. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +182 -0
  339. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +79 -0
  340. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +15 -0
  341. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +153 -0
  342. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +139 -0
  343. package/lib/front_end/third_party/legacy-javascript/LICENSE +202 -0
  344. package/lib/front_end/third_party/legacy-javascript/README.chromium +13 -0
  345. package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +8 -0
  346. package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +3 -0
  347. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
  348. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +943 -0
  349. package/lib/front_end/third_party/legacy-javascript/package.json +8 -0
  350. package/lib/front_end/third_party/legacy-javascript/rebuild.sh +9 -0
  351. package/lib/front_end/third_party/third-party-web/LICENSE +20 -0
  352. package/lib/front_end/third_party/third-party-web/README.chromium +13 -0
  353. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
  354. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +149 -0
  355. package/lib/front_end/third_party/third-party-web/package/LICENSE +20 -0
  356. package/lib/front_end/third_party/third-party-web/package/README.md +929 -0
  357. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -0
  358. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -0
  359. package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -0
  360. package/lib/front_end/third_party/third-party-web/package/dist/entities.json +1 -0
  361. package/lib/front_end/third_party/third-party-web/package/facades.md +46 -0
  362. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +1 -0
  363. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +1 -0
  364. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +1 -0
  365. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +1 -0
  366. package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +1006 -0
  367. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +139 -0
  368. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +44 -0
  369. package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +27 -0
  370. package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +34 -0
  371. package/lib/front_end/third_party/third-party-web/package/lib/index.js +3 -0
  372. package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +246 -0
  373. package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +36 -0
  374. package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +9 -0
  375. package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +5 -0
  376. package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +151 -0
  377. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +1 -0
  378. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +1 -0
  379. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +1 -0
  380. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +14 -0
  381. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +1 -0
  382. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +3 -0
  383. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +1 -0
  384. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +3 -0
  385. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +1 -0
  386. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +3 -0
  387. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
  388. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +3 -0
  389. package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +1 -0
  390. package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +1 -0
  391. package/lib/front_end/third_party/third-party-web/package/package.json +46 -0
  392. package/lib/front_end/third_party/third-party-web/package.json +8 -0
  393. package/lib/front_end/third_party/third-party-web/rebuild.sh +13 -0
  394. package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +8 -0
  395. package/lib/front_end/third_party/third-party-web/third-party-web.ts +3 -0
  396. package/package.json +24 -0
  397. package/patches/chrome-devtools-frontend+1.0.1533544.patch +187 -0
@@ -0,0 +1,588 @@
1
+ // Copyright 2021 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ /*
6
+ * Copyright (C) 2012 Google Inc. All rights reserved.
7
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted provided that the following conditions
11
+ * are met:
12
+ *
13
+ * 1. Redistributions of source code must retain the above copyright
14
+ * notice, this list of conditions and the following disclaimer.
15
+ * 2. Redistributions in binary form must reproduce the above copyright
16
+ * notice, this list of conditions and the following disclaimer in the
17
+ * documentation and/or other materials provided with the distribution.
18
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
19
+ * its contributors may be used to endorse or promote products derived
20
+ * from this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
23
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
26
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+
34
+ import * as i18n from '../i18n/i18n.js';
35
+ import type * as Platform from '../platform/platform.js';
36
+
37
+ import {ParsedURL} from './ParsedURL.js';
38
+
39
+ const UIStrings = {
40
+ /**
41
+ * @description Text that appears in a tooltip the fetch and xhr resource types filter.
42
+ */
43
+ fetchAndXHR: '`Fetch` and `XHR`',
44
+ /**
45
+ * @description Text that appears in a tooltip for the JavaScript types filter.
46
+ */
47
+ javascript: 'JavaScript',
48
+ /**
49
+ * @description Text that appears on a button for the JavaScript resource type filter.
50
+ */
51
+ js: 'JS',
52
+ /**
53
+ * @description Text that appears on a button for the css resource type filter.
54
+ */
55
+ css: 'CSS',
56
+ /**
57
+ * @description Text that appears on a button for the image resource type filter.
58
+ */
59
+ img: 'Img',
60
+ /**
61
+ * @description Text that appears on a button for the media resource type filter.
62
+ */
63
+ media: 'Media',
64
+ /**
65
+ * @description Text that appears on a button for the font resource type filter.
66
+ */
67
+ font: 'Font',
68
+ /**
69
+ * @description Text that appears on a button for the document resource type filter.
70
+ */
71
+ doc: 'Doc',
72
+ /**
73
+ * @description Text that appears on a button for the websocket, webtransport, directsocket resource type filter.
74
+ */
75
+ socketShort: 'Socket',
76
+ /**
77
+ * @description Text that appears in a tooltip for the WebAssembly types filter.
78
+ */
79
+ webassembly: 'WebAssembly',
80
+ /**
81
+ * @description Text that appears on a button for the WebAssembly resource type filter.
82
+ */
83
+ wasm: 'Wasm',
84
+ /**
85
+ * @description Text that appears on a button for the manifest resource type filter.
86
+ */
87
+ manifest: 'Manifest',
88
+ /**
89
+ * @description Text for other types of items
90
+ */
91
+ other: 'Other',
92
+ /**
93
+ * @description Name of a network resource type
94
+ */
95
+ document: 'Document',
96
+ /**
97
+ * @description Name of a network resource type
98
+ */
99
+ stylesheet: 'Stylesheet',
100
+ /**
101
+ * @description Text in Image View of the Sources panel
102
+ */
103
+ image: 'Image',
104
+ /**
105
+ * @description Label for a group of JavaScript files
106
+ */
107
+ script: 'Script',
108
+ /**
109
+ * @description Name of a network resource type
110
+ */
111
+ texttrack: 'TextTrack',
112
+ /**
113
+ * @description Name of a network resource type
114
+ */
115
+ fetch: 'Fetch',
116
+ /**
117
+ * @description Name of a network resource type
118
+ */
119
+ eventsource: 'EventSource',
120
+ /**
121
+ * @description Name of a network resource type
122
+ */
123
+ websocket: 'WebSocket',
124
+ /**
125
+ * @description Name of a network resource type
126
+ */
127
+ webtransport: 'WebTransport',
128
+ /**
129
+ * @description Name of a network resource type
130
+ */
131
+ directsocket: 'DirectSocket',
132
+ /**
133
+ * @description Name of a network resource type
134
+ */
135
+ signedexchange: 'SignedExchange',
136
+ /**
137
+ * @description Name of a network resource type
138
+ */
139
+ ping: 'Ping',
140
+ /**
141
+ * @description Name of a network resource type
142
+ */
143
+ cspviolationreport: 'CSPViolationReport',
144
+ /**
145
+ * @description Name of a network initiator type
146
+ */
147
+ preflight: 'Preflight',
148
+ /**
149
+ * @description Name of a network initiator type for FedCM requests
150
+ */
151
+ fedcm: 'FedCM',
152
+ } as const;
153
+
154
+ const str_ = i18n.i18n.registerUIStrings('core/common/ResourceType.ts', UIStrings);
155
+ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
156
+
157
+ export class ResourceType {
158
+ readonly #name: string;
159
+ readonly #title: () => Platform.UIString.LocalizedString;
160
+ readonly #category: ResourceCategory;
161
+ readonly #isTextType: boolean;
162
+
163
+ constructor(
164
+ name: string, title: () => Platform.UIString.LocalizedString, category: ResourceCategory, isTextType: boolean) {
165
+ this.#name = name;
166
+ this.#title = title;
167
+ this.#category = category;
168
+ this.#isTextType = isTextType;
169
+ }
170
+
171
+ static fromMimeType(mimeType: string|null): ResourceType {
172
+ if (!mimeType) {
173
+ return resourceTypes.Other;
174
+ }
175
+ if (mimeType.startsWith('text/html')) {
176
+ return resourceTypes.Document;
177
+ }
178
+ if (mimeType.startsWith('text/css')) {
179
+ return resourceTypes.Stylesheet;
180
+ }
181
+ if (mimeType.startsWith('image/')) {
182
+ return resourceTypes.Image;
183
+ }
184
+ if (mimeType.startsWith('text/')) {
185
+ return resourceTypes.Script;
186
+ }
187
+
188
+ if (mimeType.includes('font')) {
189
+ return resourceTypes.Font;
190
+ }
191
+ if (mimeType.includes('script')) {
192
+ return resourceTypes.Script;
193
+ }
194
+ if (mimeType.includes('octet')) {
195
+ return resourceTypes.Other;
196
+ }
197
+ if (mimeType.includes('application')) {
198
+ return resourceTypes.Script;
199
+ }
200
+
201
+ return resourceTypes.Other;
202
+ }
203
+
204
+ static fromMimeTypeOverride(mimeType: string|null): ResourceType|null {
205
+ if (mimeType === 'application/manifest+json') {
206
+ return resourceTypes.Manifest;
207
+ }
208
+ if (mimeType === 'application/wasm') {
209
+ return resourceTypes.Wasm;
210
+ }
211
+
212
+ return null;
213
+ }
214
+
215
+ static fromURL(url: string): ResourceType|null {
216
+ return resourceTypeByExtension.get(ParsedURL.extractExtension(url)) || null;
217
+ }
218
+
219
+ static fromName(name: string): ResourceType|null {
220
+ for (const resourceType of Object.values(resourceTypes)) {
221
+ if (resourceType.name() === name) {
222
+ return resourceType;
223
+ }
224
+ }
225
+ return null;
226
+ }
227
+
228
+ static mimeFromURL(url: Platform.DevToolsPath.UrlString): string|undefined {
229
+ if (url.startsWith('snippet://') || url.startsWith('debugger://')) {
230
+ return 'text/javascript';
231
+ }
232
+ const name = ParsedURL.extractName(url);
233
+ if (mimeTypeByName.has(name)) {
234
+ return mimeTypeByName.get(name);
235
+ }
236
+
237
+ let ext = ParsedURL.extractExtension(url).toLowerCase();
238
+ if (ext === 'html' && name.endsWith('.component.html')) {
239
+ ext = 'component.html';
240
+ }
241
+ return mimeTypeByExtension.get(ext);
242
+ }
243
+
244
+ static mimeFromExtension(ext: string): string|undefined {
245
+ return mimeTypeByExtension.get(ext);
246
+ }
247
+
248
+ static simplifyContentType(contentType: string): string {
249
+ const regex = new RegExp('^application(.*json$|\/json\+.*)');
250
+ return regex.test(contentType) ? 'application/json' : contentType;
251
+ }
252
+
253
+ /**
254
+ * Adds suffixes iff the mimeType is 'text/javascript' to denote whether the JS is minified or from
255
+ * a source map.
256
+ */
257
+ static mediaTypeForMetrics(
258
+ mimeType: string, isFromSourceMap: boolean, isMinified: boolean, isSnippet: boolean,
259
+ isDebugger: boolean): string {
260
+ if (mimeType !== 'text/javascript') {
261
+ return mimeType;
262
+ }
263
+
264
+ if (isFromSourceMap) {
265
+ // SourceMap has precedence as that is a known fact, whereas minification is a heuristic we
266
+ // apply to the JS content.
267
+ return 'text/javascript+sourcemapped';
268
+ }
269
+ if (isMinified) {
270
+ return 'text/javascript+minified';
271
+ }
272
+ if (isSnippet) {
273
+ return 'text/javascript+snippet';
274
+ }
275
+ if (isDebugger) {
276
+ return 'text/javascript+eval';
277
+ }
278
+ return 'text/javascript+plain';
279
+ }
280
+
281
+ name(): string {
282
+ return this.#name;
283
+ }
284
+
285
+ title(): string {
286
+ return this.#title();
287
+ }
288
+
289
+ category(): ResourceCategory {
290
+ return this.#category;
291
+ }
292
+
293
+ isTextType(): boolean {
294
+ return this.#isTextType;
295
+ }
296
+
297
+ isScript(): boolean {
298
+ return this.#name === 'script' || this.#name === 'sm-script';
299
+ }
300
+
301
+ hasScripts(): boolean {
302
+ return this.isScript() || this.isDocument();
303
+ }
304
+
305
+ isStyleSheet(): boolean {
306
+ return this.#name === 'stylesheet' || this.#name === 'sm-stylesheet';
307
+ }
308
+
309
+ hasStyleSheets(): boolean {
310
+ return this.isStyleSheet() || this.isDocument();
311
+ }
312
+
313
+ isDocument(): boolean {
314
+ return this.#name === 'document';
315
+ }
316
+
317
+ isDocumentOrScriptOrStyleSheet(): boolean {
318
+ return this.isDocument() || this.isScript() || this.isStyleSheet();
319
+ }
320
+
321
+ isFont(): boolean {
322
+ return this.#name === 'font';
323
+ }
324
+
325
+ isImage(): boolean {
326
+ return this.#name === 'image';
327
+ }
328
+
329
+ isFromSourceMap(): boolean {
330
+ return this.#name.startsWith('sm-');
331
+ }
332
+
333
+ toString(): string {
334
+ return this.#name;
335
+ }
336
+
337
+ canonicalMimeType(): string {
338
+ if (this.isDocument()) {
339
+ return 'text/html';
340
+ }
341
+ if (this.isScript()) {
342
+ return 'text/javascript';
343
+ }
344
+ if (this.isStyleSheet()) {
345
+ return 'text/css';
346
+ }
347
+ return '';
348
+ }
349
+ }
350
+
351
+ export class ResourceCategory {
352
+ readonly name: string;
353
+ title: () => Platform.UIString.LocalizedString;
354
+ shortTitle: () => Platform.UIString.LocalizedString;
355
+ constructor(
356
+ name: string, title: () => Platform.UIString.LocalizedString,
357
+ shortTitle: () => Platform.UIString.LocalizedString) {
358
+ this.name = name;
359
+ this.title = title;
360
+ this.shortTitle = shortTitle;
361
+ }
362
+ }
363
+
364
+ export const resourceCategories = {
365
+ XHR: new ResourceCategory(
366
+ 'Fetch and XHR', i18nLazyString(UIStrings.fetchAndXHR), i18n.i18n.lockedLazyString('Fetch/XHR')),
367
+ Document: new ResourceCategory(UIStrings.document, i18nLazyString(UIStrings.document), i18nLazyString(UIStrings.doc)),
368
+ Stylesheet: new ResourceCategory(UIStrings.css, i18nLazyString(UIStrings.css), i18nLazyString(UIStrings.css)),
369
+ Script:
370
+ new ResourceCategory(UIStrings.javascript, i18nLazyString(UIStrings.javascript), i18nLazyString(UIStrings.js)),
371
+ Font: new ResourceCategory(UIStrings.font, i18nLazyString(UIStrings.font), i18nLazyString(UIStrings.font)),
372
+ Image: new ResourceCategory(UIStrings.image, i18nLazyString(UIStrings.image), i18nLazyString(UIStrings.img)),
373
+ Media: new ResourceCategory(UIStrings.media, i18nLazyString(UIStrings.media), i18nLazyString(UIStrings.media)),
374
+ Manifest:
375
+ new ResourceCategory(UIStrings.manifest, i18nLazyString(UIStrings.manifest), i18nLazyString(UIStrings.manifest)),
376
+ Socket: new ResourceCategory(
377
+ 'Socket', i18n.i18n.lockedLazyString('WebSocket | WebTransport | DirectSocket'),
378
+ i18nLazyString(UIStrings.socketShort)),
379
+ Wasm: new ResourceCategory(
380
+ UIStrings.webassembly, i18nLazyString(UIStrings.webassembly), i18nLazyString(UIStrings.wasm)),
381
+ Other: new ResourceCategory(UIStrings.other, i18nLazyString(UIStrings.other), i18nLazyString(UIStrings.other)),
382
+ };
383
+
384
+ /**
385
+ * This enum is a superset of all types defined in WebCore::InspectorPageAgent::resourceTypeJson
386
+ * For DevTools-only types that are based on MIME-types that are backed by other request types
387
+ * (for example Wasm that is based on Fetch), additional types are added here.
388
+ * For these types, make sure to update `fromMimeTypeOverride` to implement the custom logic.
389
+ */
390
+ export const resourceTypes = {
391
+ Document: new ResourceType('document', i18nLazyString(UIStrings.document), resourceCategories.Document, true),
392
+ Stylesheet: new ResourceType('stylesheet', i18nLazyString(UIStrings.stylesheet), resourceCategories.Stylesheet, true),
393
+ Image: new ResourceType('image', i18nLazyString(UIStrings.image), resourceCategories.Image, false),
394
+ Media: new ResourceType('media', i18nLazyString(UIStrings.media), resourceCategories.Media, false),
395
+ Font: new ResourceType('font', i18nLazyString(UIStrings.font), resourceCategories.Font, false),
396
+ Script: new ResourceType('script', i18nLazyString(UIStrings.script), resourceCategories.Script, true),
397
+ TextTrack: new ResourceType('texttrack', i18nLazyString(UIStrings.texttrack), resourceCategories.Other, true),
398
+ XHR: new ResourceType('xhr', i18n.i18n.lockedLazyString('XHR'), resourceCategories.XHR, true),
399
+ Fetch: new ResourceType('fetch', i18nLazyString(UIStrings.fetch), resourceCategories.XHR, true),
400
+ Prefetch: new ResourceType('prefetch', i18n.i18n.lockedLazyString('Prefetch'), resourceCategories.Document, true),
401
+ EventSource: new ResourceType('eventsource', i18nLazyString(UIStrings.eventsource), resourceCategories.XHR, true),
402
+ WebSocket: new ResourceType('websocket', i18nLazyString(UIStrings.websocket), resourceCategories.Socket, false),
403
+ WebTransport:
404
+ new ResourceType('webtransport', i18nLazyString(UIStrings.webtransport), resourceCategories.Socket, false),
405
+ DirectSocket:
406
+ new ResourceType('directsocket', i18nLazyString(UIStrings.directsocket), resourceCategories.Socket, false),
407
+ Wasm: new ResourceType('wasm', i18nLazyString(UIStrings.wasm), resourceCategories.Wasm, false),
408
+ Manifest: new ResourceType('manifest', i18nLazyString(UIStrings.manifest), resourceCategories.Manifest, true),
409
+ SignedExchange:
410
+ new ResourceType('signed-exchange', i18nLazyString(UIStrings.signedexchange), resourceCategories.Other, false),
411
+ Ping: new ResourceType('ping', i18nLazyString(UIStrings.ping), resourceCategories.Other, false),
412
+ CSPViolationReport: new ResourceType(
413
+ 'csp-violation-report', i18nLazyString(UIStrings.cspviolationreport), resourceCategories.Other, false),
414
+ Other: new ResourceType('other', i18nLazyString(UIStrings.other), resourceCategories.Other, false),
415
+ Preflight: new ResourceType('preflight', i18nLazyString(UIStrings.preflight), resourceCategories.Other, true),
416
+ SourceMapScript: new ResourceType('sm-script', i18nLazyString(UIStrings.script), resourceCategories.Script, true),
417
+ SourceMapStyleSheet:
418
+ new ResourceType('sm-stylesheet', i18nLazyString(UIStrings.stylesheet), resourceCategories.Stylesheet, true),
419
+ FedCM: new ResourceType('fedcm', i18nLazyString(UIStrings.fedcm), resourceCategories.Other, false),
420
+ } as const;
421
+
422
+ const mimeTypeByName = new Map([
423
+ // CoffeeScript
424
+ ['Cakefile', 'text/x-coffeescript'],
425
+ ]);
426
+
427
+ // clang-format off
428
+ export const resourceTypeByExtension = new Map([
429
+ ['js', resourceTypes.Script],
430
+ ['mjs', resourceTypes.Script],
431
+
432
+ ['css', resourceTypes.Stylesheet],
433
+ ['xsl', resourceTypes.Stylesheet],
434
+
435
+ ['avif', resourceTypes.Image],
436
+ ['bmp', resourceTypes.Image],
437
+ ['gif', resourceTypes.Image],
438
+ ['ico', resourceTypes.Image],
439
+ ['jpeg', resourceTypes.Image],
440
+ ['jpg', resourceTypes.Image],
441
+ ['jxl', resourceTypes.Image],
442
+ ['png', resourceTypes.Image],
443
+ ['svg', resourceTypes.Image],
444
+ ['tif', resourceTypes.Image],
445
+ ['tiff', resourceTypes.Image],
446
+
447
+ ['vue', resourceTypes.Document],
448
+
449
+ ['webmanifest', resourceTypes.Manifest],
450
+
451
+ ['webp', resourceTypes.Media],
452
+
453
+ ['otf', resourceTypes.Font],
454
+ ['ttc', resourceTypes.Font],
455
+ ['ttf', resourceTypes.Font],
456
+ ['woff', resourceTypes.Font],
457
+ ['woff2', resourceTypes.Font],
458
+
459
+ ['wasm', resourceTypes.Wasm],
460
+ ]);
461
+ // clang-format on
462
+
463
+ export const mimeTypeByExtension = new Map([
464
+ // Web extensions
465
+ ['js', 'text/javascript'],
466
+ ['mjs', 'text/javascript'],
467
+ ['css', 'text/css'],
468
+ ['html', 'text/html'],
469
+ ['htm', 'text/html'],
470
+ ['xml', 'application/xml'],
471
+ ['xsl', 'application/xml'],
472
+ ['wasm', 'application/wasm'],
473
+ ['webmanifest', 'application/manifest+json'],
474
+
475
+ // HTML Embedded Scripts, ASP], JSP
476
+ ['asp', 'application/x-aspx'],
477
+ ['aspx', 'application/x-aspx'],
478
+ ['jsp', 'application/x-jsp'],
479
+
480
+ // C/C++
481
+ ['c', 'text/x-c++src'],
482
+ ['cc', 'text/x-c++src'],
483
+ ['cpp', 'text/x-c++src'],
484
+ ['h', 'text/x-c++src'],
485
+ ['m', 'text/x-c++src'],
486
+ ['mm', 'text/x-c++src'],
487
+
488
+ // CoffeeScript
489
+ ['coffee', 'text/x-coffeescript'],
490
+
491
+ // Dart
492
+ ['dart', 'application/vnd.dart'],
493
+
494
+ // TypeScript
495
+ ['ts', 'text/typescript'],
496
+ ['tsx', 'text/typescript-jsx'],
497
+
498
+ // JSON
499
+ ['json', 'application/json'],
500
+ ['gyp', 'application/json'],
501
+ ['gypi', 'application/json'],
502
+ ['map', 'application/json'],
503
+
504
+ // C#
505
+ ['cs', 'text/x-csharp'],
506
+
507
+ // Go
508
+ ['go', 'text/x-go'],
509
+
510
+ // Java
511
+ ['java', 'text/x-java'],
512
+
513
+ // Kotlin
514
+ ['kt', 'text/x-kotlin'],
515
+
516
+ // Scala
517
+ ['scala', 'text/x-scala'],
518
+
519
+ // Less
520
+ ['less', 'text/x-less'],
521
+
522
+ // PHP
523
+ ['php', 'application/x-httpd-php'],
524
+ ['phtml', 'application/x-httpd-php'],
525
+
526
+ // Python
527
+ ['py', 'text/x-python'],
528
+
529
+ // Shell
530
+ ['sh', 'text/x-sh'],
531
+
532
+ // Google Stylesheets (GSS)
533
+ ['gss', 'text/x-gss'],
534
+
535
+ // SASS (.sass & .scss)
536
+ ['sass', 'text/x-sass'],
537
+ ['scss', 'text/x-scss'],
538
+
539
+ // Video Text Tracks.
540
+ ['vtt', 'text/vtt'],
541
+
542
+ // LiveScript
543
+ ['ls', 'text/x-livescript'],
544
+
545
+ // Markdown
546
+ ['md', 'text/markdown'],
547
+
548
+ // ClojureScript
549
+ ['cljs', 'text/x-clojure'],
550
+ ['cljc', 'text/x-clojure'],
551
+ ['cljx', 'text/x-clojure'],
552
+
553
+ // Stylus
554
+ ['styl', 'text/x-styl'],
555
+
556
+ // JSX
557
+ ['jsx', 'text/jsx'],
558
+
559
+ // Image
560
+ ['avif', 'image/avif'],
561
+ ['bmp', 'image/bmp'],
562
+ ['gif', 'image/gif'],
563
+ ['ico', 'image/ico'],
564
+ ['jpeg', 'image/jpeg'],
565
+ ['jpg', 'image/jpeg'],
566
+ ['jxl', 'image/jxl'],
567
+ ['png', 'image/png'],
568
+ ['svg', 'image/svg+xml'],
569
+ ['tif', 'image/tif'],
570
+ ['tiff', 'image/tiff'],
571
+ ['webp', 'image/webp'],
572
+
573
+ // Font
574
+ ['otf', 'font/otf'],
575
+ ['ttc', 'font/collection'],
576
+ ['ttf', 'font/ttf'],
577
+ ['woff', 'font/woff'],
578
+ ['woff2', 'font/woff2'],
579
+
580
+ // Angular
581
+ ['component.html', 'text/x.angular'],
582
+
583
+ // Svelte
584
+ ['svelte', 'text/x.svelte'],
585
+
586
+ // Vue
587
+ ['vue', 'text/x.vue'],
588
+ ]);
@@ -0,0 +1,17 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ /**
6
+ * Set instance of this class as flavor to mark what panel triggered the
7
+ * 'elements.toggle-element-search' action if it was not the elements panel.
8
+ * This will cause specified panel to be made visible instead of the elements
9
+ * panel after the inspection is done.
10
+ **/
11
+ export class ReturnToPanelFlavor {
12
+ readonly viewId: string;
13
+
14
+ constructor(viewId: string) {
15
+ this.viewId = viewId;
16
+ }
17
+ }