devtools-tracing 1.1.0 → 1.2.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 (528) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +28854 -0
  4. package/package.json +10 -8
  5. package/generate.ts +0 -649
  6. package/index.ts +0 -17
  7. package/lib/extension-api/ExtensionAPI.d.ts +0 -357
  8. package/lib/front_end/core/common/App.ts +0 -7
  9. package/lib/front_end/core/common/AppProvider.ts +0 -32
  10. package/lib/front_end/core/common/Base64.ts +0 -47
  11. package/lib/front_end/core/common/CharacterIdMap.ts +0 -30
  12. package/lib/front_end/core/common/Color.ts +0 -2506
  13. package/lib/front_end/core/common/ColorConverter.ts +0 -402
  14. package/lib/front_end/core/common/ColorUtils.ts +0 -252
  15. package/lib/front_end/core/common/Console.ts +0 -114
  16. package/lib/front_end/core/common/Debouncer.ts +0 -15
  17. package/lib/front_end/core/common/EventTarget.ts +0 -52
  18. package/lib/front_end/core/common/Gzip.ts +0 -74
  19. package/lib/front_end/core/common/JavaScriptMetaData.ts +0 -29
  20. package/lib/front_end/core/common/Lazy.ts +0 -31
  21. package/lib/front_end/core/common/Linkifier.ts +0 -55
  22. package/lib/front_end/core/common/MapWithDefault.ts +0 -26
  23. package/lib/front_end/core/common/Mutex.ts +0 -55
  24. package/lib/front_end/core/common/Object.ts +0 -145
  25. package/lib/front_end/core/common/ParsedURL.ts +0 -554
  26. package/lib/front_end/core/common/Progress.ts +0 -180
  27. package/lib/front_end/core/common/QueryParamHandler.ts +0 -7
  28. package/lib/front_end/core/common/ResolverBase.ts +0 -85
  29. package/lib/front_end/core/common/ResourceType.ts +0 -588
  30. package/lib/front_end/core/common/ReturnToPanel.ts +0 -17
  31. package/lib/front_end/core/common/Revealer.ts +0 -192
  32. package/lib/front_end/core/common/Runnable.ts +0 -41
  33. package/lib/front_end/core/common/SegmentedRange.ts +0 -87
  34. package/lib/front_end/core/common/SettingRegistration.ts +0 -339
  35. package/lib/front_end/core/common/Settings.ts +0 -1497
  36. package/lib/front_end/core/common/SimpleHistoryManager.ts +0 -124
  37. package/lib/front_end/core/common/StringOutputStream.ts +0 -26
  38. package/lib/front_end/core/common/TextDictionary.ts +0 -48
  39. package/lib/front_end/core/common/Throttler.ts +0 -99
  40. package/lib/front_end/core/common/Trie.ts +0 -152
  41. package/lib/front_end/core/common/Worker.ts +0 -60
  42. package/lib/front_end/core/common/common.ts +0 -81
  43. package/lib/front_end/core/host/AidaClient.ts +0 -733
  44. package/lib/front_end/core/host/GdpClient.ts +0 -316
  45. package/lib/front_end/core/host/InspectorFrontendHost.ts +0 -648
  46. package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +0 -551
  47. package/lib/front_end/core/host/Platform.ts +0 -76
  48. package/lib/front_end/core/host/ResourceLoader.ts +0 -282
  49. package/lib/front_end/core/host/UserMetrics.ts +0 -1230
  50. package/lib/front_end/core/host/host.ts +0 -23
  51. package/lib/front_end/core/i18n/ByteUtilities.ts +0 -82
  52. package/lib/front_end/core/i18n/DevToolsLocale.ts +0 -87
  53. package/lib/front_end/core/i18n/NumberFormatter.ts +0 -82
  54. package/lib/front_end/core/i18n/i18n.ts +0 -17
  55. package/lib/front_end/core/i18n/i18nImpl.ts +0 -204
  56. package/lib/front_end/core/i18n/i18nTypes.ts +0 -10
  57. package/lib/front_end/core/i18n/locales.js +0 -14
  58. package/lib/front_end/core/i18n/time-utilities.ts +0 -174
  59. package/lib/front_end/core/platform/ArrayUtilities.ts +0 -271
  60. package/lib/front_end/core/platform/Brand.ts +0 -23
  61. package/lib/front_end/core/platform/Constructor.ts +0 -10
  62. package/lib/front_end/core/platform/DOMUtilities.ts +0 -138
  63. package/lib/front_end/core/platform/DateUtilities.ts +0 -15
  64. package/lib/front_end/core/platform/DevToolsPath.ts +0 -53
  65. package/lib/front_end/core/platform/KeyboardUtilities.ts +0 -38
  66. package/lib/front_end/core/platform/MapUtilities.ts +0 -95
  67. package/lib/front_end/core/platform/MimeType.ts +0 -175
  68. package/lib/front_end/core/platform/NumberUtilities.ts +0 -80
  69. package/lib/front_end/core/platform/StringUtilities.ts +0 -588
  70. package/lib/front_end/core/platform/Timing.ts +0 -17
  71. package/lib/front_end/core/platform/TypedArrayUtilities.ts +0 -189
  72. package/lib/front_end/core/platform/TypescriptUtilities.ts +0 -86
  73. package/lib/front_end/core/platform/UIString.ts +0 -39
  74. package/lib/front_end/core/platform/UserVisibleError.ts +0 -28
  75. package/lib/front_end/core/platform/platform.ts +0 -45
  76. package/lib/front_end/core/protocol_client/ConnectionTransport.ts +0 -26
  77. package/lib/front_end/core/protocol_client/InspectorBackend.ts +0 -1050
  78. package/lib/front_end/core/protocol_client/NodeURL.ts +0 -42
  79. package/lib/front_end/core/protocol_client/protocol_client.ts +0 -13
  80. package/lib/front_end/core/root/Runtime.ts +0 -609
  81. package/lib/front_end/core/root/root.ts +0 -6
  82. package/lib/front_end/core/sdk/AccessibilityModel.ts +0 -353
  83. package/lib/front_end/core/sdk/AnimationModel.ts +0 -1041
  84. package/lib/front_end/core/sdk/AutofillModel.ts +0 -184
  85. package/lib/front_end/core/sdk/CPUProfilerModel.ts +0 -148
  86. package/lib/front_end/core/sdk/CPUThrottlingManager.ts +0 -282
  87. package/lib/front_end/core/sdk/CSSContainerQuery.ts +0 -139
  88. package/lib/front_end/core/sdk/CSSFontFace.ts +0 -40
  89. package/lib/front_end/core/sdk/CSSLayer.ts +0 -30
  90. package/lib/front_end/core/sdk/CSSMatchedStyles.ts +0 -1646
  91. package/lib/front_end/core/sdk/CSSMedia.ts +0 -121
  92. package/lib/front_end/core/sdk/CSSMetadata.ts +0 -1647
  93. package/lib/front_end/core/sdk/CSSModel.ts +0 -1128
  94. package/lib/front_end/core/sdk/CSSProperty.ts +0 -384
  95. package/lib/front_end/core/sdk/CSSPropertyParser.ts +0 -681
  96. package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +0 -1395
  97. package/lib/front_end/core/sdk/CSSQuery.ts +0 -72
  98. package/lib/front_end/core/sdk/CSSRule.ts +0 -465
  99. package/lib/front_end/core/sdk/CSSScope.ts +0 -30
  100. package/lib/front_end/core/sdk/CSSStartingStyle.ts +0 -29
  101. package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +0 -313
  102. package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +0 -196
  103. package/lib/front_end/core/sdk/CSSSupports.ts +0 -33
  104. package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +0 -64
  105. package/lib/front_end/core/sdk/ChildTargetManager.ts +0 -314
  106. package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +0 -62
  107. package/lib/front_end/core/sdk/Connections.ts +0 -293
  108. package/lib/front_end/core/sdk/ConsoleModel.ts +0 -808
  109. package/lib/front_end/core/sdk/ConsoleModelTypes.ts +0 -15
  110. package/lib/front_end/core/sdk/Cookie.ts +0 -319
  111. package/lib/front_end/core/sdk/CookieModel.ts +0 -239
  112. package/lib/front_end/core/sdk/CookieParser.ts +0 -185
  113. package/lib/front_end/core/sdk/DOMDebuggerModel.ts +0 -787
  114. package/lib/front_end/core/sdk/DOMModel.ts +0 -1961
  115. package/lib/front_end/core/sdk/DebuggerModel.ts +0 -1605
  116. package/lib/front_end/core/sdk/EmulationModel.ts +0 -648
  117. package/lib/front_end/core/sdk/EnhancedTracesParser.ts +0 -515
  118. package/lib/front_end/core/sdk/EventBreakpointsModel.ts +0 -183
  119. package/lib/front_end/core/sdk/FrameAssociated.ts +0 -11
  120. package/lib/front_end/core/sdk/FrameManager.ts +0 -259
  121. package/lib/front_end/core/sdk/HeapProfilerModel.ts +0 -225
  122. package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +0 -77
  123. package/lib/front_end/core/sdk/IOModel.ts +0 -91
  124. package/lib/front_end/core/sdk/IsolateManager.ts +0 -257
  125. package/lib/front_end/core/sdk/IssuesModel.ts +0 -70
  126. package/lib/front_end/core/sdk/LayerTreeBase.ts +0 -169
  127. package/lib/front_end/core/sdk/LogModel.ts +0 -56
  128. package/lib/front_end/core/sdk/NetworkManager.ts +0 -2823
  129. package/lib/front_end/core/sdk/NetworkRequest.ts +0 -2253
  130. package/lib/front_end/core/sdk/OverlayColorGenerator.ts +0 -52
  131. package/lib/front_end/core/sdk/OverlayModel.ts +0 -1011
  132. package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -522
  133. package/lib/front_end/core/sdk/PageLoad.ts +0 -35
  134. package/lib/front_end/core/sdk/PageResourceLoader.ts +0 -435
  135. package/lib/front_end/core/sdk/PaintProfiler.ts +0 -110
  136. package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +0 -84
  137. package/lib/front_end/core/sdk/PreloadingModel.ts +0 -863
  138. package/lib/front_end/core/sdk/RehydratingConnection.ts +0 -386
  139. package/lib/front_end/core/sdk/RehydratingObject.ts +0 -66
  140. package/lib/front_end/core/sdk/RemoteObject.ts +0 -1160
  141. package/lib/front_end/core/sdk/Resource.ts +0 -232
  142. package/lib/front_end/core/sdk/ResourceTreeModel.ts +0 -1160
  143. package/lib/front_end/core/sdk/RuntimeModel.ts +0 -732
  144. package/lib/front_end/core/sdk/SDKModel.ts +0 -65
  145. package/lib/front_end/core/sdk/ScopeTreeCache.ts +0 -45
  146. package/lib/front_end/core/sdk/ScreenCaptureModel.ts +0 -255
  147. package/lib/front_end/core/sdk/Script.ts +0 -534
  148. package/lib/front_end/core/sdk/SecurityOriginManager.ts +0 -76
  149. package/lib/front_end/core/sdk/ServerSentEvents.ts +0 -80
  150. package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +0 -122
  151. package/lib/front_end/core/sdk/ServerTiming.ts +0 -260
  152. package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -377
  153. package/lib/front_end/core/sdk/ServiceWorkerManager.ts +0 -605
  154. package/lib/front_end/core/sdk/SourceMap.ts +0 -867
  155. package/lib/front_end/core/sdk/SourceMapCache.ts +0 -54
  156. package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +0 -156
  157. package/lib/front_end/core/sdk/SourceMapManager.ts +0 -239
  158. package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +0 -189
  159. package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +0 -508
  160. package/lib/front_end/core/sdk/StorageBucketsModel.ts +0 -204
  161. package/lib/front_end/core/sdk/StorageKeyManager.ts +0 -98
  162. package/lib/front_end/core/sdk/Target.ts +0 -332
  163. package/lib/front_end/core/sdk/TargetManager.ts +0 -453
  164. package/lib/front_end/core/sdk/TraceObject.ts +0 -61
  165. package/lib/front_end/core/sdk/WebAuthnModel.ts +0 -104
  166. package/lib/front_end/core/sdk/sdk.ts +0 -174
  167. package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -59
  168. package/lib/front_end/generated/InspectorBackendCommands.js +0 -1617
  169. package/lib/front_end/generated/SupportedCSSProperties.js +0 -7512
  170. package/lib/front_end/generated/protocol-proxy-api.d.ts +0 -5022
  171. package/lib/front_end/generated/protocol.ts +0 -22014
  172. package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -318
  173. package/lib/front_end/models/bindings/CompilerScriptMapping.ts +0 -536
  174. package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +0 -187
  175. package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1197
  176. package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -733
  177. package/lib/front_end/models/bindings/DefaultScriptMapping.ts +0 -141
  178. package/lib/front_end/models/bindings/FileUtils.ts +0 -228
  179. package/lib/front_end/models/bindings/LiveLocation.ts +0 -81
  180. package/lib/front_end/models/bindings/NetworkProject.ts +0 -157
  181. package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +0 -312
  182. package/lib/front_end/models/bindings/ResourceMapping.ts +0 -539
  183. package/lib/front_end/models/bindings/ResourceScriptMapping.ts +0 -491
  184. package/lib/front_end/models/bindings/ResourceUtils.ts +0 -103
  185. package/lib/front_end/models/bindings/SASSSourceMapping.ts +0 -222
  186. package/lib/front_end/models/bindings/StylesSourceMapping.ts +0 -316
  187. package/lib/front_end/models/bindings/TempFile.ts +0 -67
  188. package/lib/front_end/models/bindings/bindings.ts +0 -39
  189. package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +0 -571
  190. package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +0 -103
  191. package/lib/front_end/models/cpu_profile/cpu_profile.ts +0 -11
  192. package/lib/front_end/models/formatter/FormatterWorkerPool.ts +0 -219
  193. package/lib/front_end/models/formatter/ScriptFormatter.ts +0 -112
  194. package/lib/front_end/models/formatter/formatter.ts +0 -8
  195. package/lib/front_end/models/source_map_scopes/NamesResolver.ts +0 -765
  196. package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +0 -84
  197. package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +0 -11
  198. package/lib/front_end/models/stack_trace/StackTrace.ts +0 -53
  199. package/lib/front_end/models/stack_trace/StackTraceImpl.ts +0 -85
  200. package/lib/front_end/models/stack_trace/StackTraceModel.ts +0 -128
  201. package/lib/front_end/models/stack_trace/Trie.ts +0 -163
  202. package/lib/front_end/models/stack_trace/stack_trace.ts +0 -9
  203. package/lib/front_end/models/stack_trace/stack_trace_impl.ts +0 -13
  204. package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +0 -37
  205. package/lib/front_end/models/text_utils/ContentData.ts +0 -199
  206. package/lib/front_end/models/text_utils/ContentProvider.ts +0 -68
  207. package/lib/front_end/models/text_utils/StaticContentProvider.ts +0 -49
  208. package/lib/front_end/models/text_utils/StreamingContentData.ts +0 -108
  209. package/lib/front_end/models/text_utils/Text.ts +0 -90
  210. package/lib/front_end/models/text_utils/TextCursor.ts +0 -44
  211. package/lib/front_end/models/text_utils/TextRange.ts +0 -266
  212. package/lib/front_end/models/text_utils/TextUtils.ts +0 -401
  213. package/lib/front_end/models/text_utils/WasmDisassembly.ts +0 -87
  214. package/lib/front_end/models/text_utils/text_utils.ts +0 -27
  215. package/lib/front_end/models/trace/EntityMapper.ts +0 -141
  216. package/lib/front_end/models/trace/EventsSerializer.ts +0 -101
  217. package/lib/front_end/models/trace/LanternComputationData.ts +0 -438
  218. package/lib/front_end/models/trace/ModelImpl.ts +0 -236
  219. package/lib/front_end/models/trace/Name.ts +0 -136
  220. package/lib/front_end/models/trace/Processor.ts +0 -652
  221. package/lib/front_end/models/trace/Styles.ts +0 -1138
  222. package/lib/front_end/models/trace/extras/FilmStrip.ts +0 -78
  223. package/lib/front_end/models/trace/extras/MainThreadActivity.ts +0 -86
  224. package/lib/front_end/models/trace/extras/ScriptDuplication.ts +0 -236
  225. package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +0 -203
  226. package/lib/front_end/models/trace/extras/ThirdParties.ts +0 -164
  227. package/lib/front_end/models/trace/extras/TraceFilter.ts +0 -62
  228. package/lib/front_end/models/trace/extras/TraceTree.ts +0 -701
  229. package/lib/front_end/models/trace/extras/extras.ts +0 -11
  230. package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +0 -128
  231. package/lib/front_end/models/trace/handlers/AnimationHandler.ts +0 -36
  232. package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +0 -239
  233. package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
  234. package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +0 -31
  235. package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -306
  236. package/lib/front_end/models/trace/handlers/FlowsHandler.ts +0 -175
  237. package/lib/front_end/models/trace/handlers/FramesHandler.ts +0 -571
  238. package/lib/front_end/models/trace/handlers/GPUHandler.ts +0 -50
  239. package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +0 -183
  240. package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -193
  241. package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -168
  242. package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +0 -109
  243. package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +0 -35
  244. package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +0 -123
  245. package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +0 -573
  246. package/lib/front_end/models/trace/handlers/MemoryHandler.ts +0 -31
  247. package/lib/front_end/models/trace/handlers/MetaHandler.ts +0 -525
  248. package/lib/front_end/models/trace/handlers/ModelHandlers.ts +0 -34
  249. package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +0 -672
  250. package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +0 -52
  251. package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +0 -460
  252. package/lib/front_end/models/trace/handlers/RendererHandler.ts +0 -428
  253. package/lib/front_end/models/trace/handlers/SamplesHandler.ts +0 -271
  254. package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +0 -122
  255. package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +0 -336
  256. package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +0 -110
  257. package/lib/front_end/models/trace/handlers/Threads.ts +0 -139
  258. package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +0 -400
  259. package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -233
  260. package/lib/front_end/models/trace/handlers/WarningsHandler.ts +0 -162
  261. package/lib/front_end/models/trace/handlers/WorkersHandler.ts +0 -45
  262. package/lib/front_end/models/trace/handlers/handlers.ts +0 -8
  263. package/lib/front_end/models/trace/handlers/helpers.ts +0 -196
  264. package/lib/front_end/models/trace/handlers/types.ts +0 -75
  265. package/lib/front_end/models/trace/helpers/Extensions.ts +0 -54
  266. package/lib/front_end/models/trace/helpers/Network.ts +0 -129
  267. package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +0 -544
  268. package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +0 -87
  269. package/lib/front_end/models/trace/helpers/Timing.ts +0 -248
  270. package/lib/front_end/models/trace/helpers/Trace.ts +0 -928
  271. package/lib/front_end/models/trace/helpers/TreeHelpers.ts +0 -320
  272. package/lib/front_end/models/trace/helpers/helpers.ts +0 -11
  273. package/lib/front_end/models/trace/insights/CLSCulprits.ts +0 -668
  274. package/lib/front_end/models/trace/insights/Cache.ts +0 -269
  275. package/lib/front_end/models/trace/insights/Common.ts +0 -453
  276. package/lib/front_end/models/trace/insights/DOMSize.ts +0 -223
  277. package/lib/front_end/models/trace/insights/DocumentLatency.ts +0 -319
  278. package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +0 -126
  279. package/lib/front_end/models/trace/insights/FontDisplay.ts +0 -119
  280. package/lib/front_end/models/trace/insights/ForcedReflow.ts +0 -220
  281. package/lib/front_end/models/trace/insights/INPBreakdown.ts +0 -171
  282. package/lib/front_end/models/trace/insights/ImageDelivery.ts +0 -348
  283. package/lib/front_end/models/trace/insights/LCPBreakdown.ts +0 -268
  284. package/lib/front_end/models/trace/insights/LCPDiscovery.ts +0 -237
  285. package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +0 -138
  286. package/lib/front_end/models/trace/insights/Models.ts +0 -22
  287. package/lib/front_end/models/trace/insights/ModernHTTP.ts +0 -257
  288. package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +0 -726
  289. package/lib/front_end/models/trace/insights/RenderBlocking.ts +0 -257
  290. package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +0 -175
  291. package/lib/front_end/models/trace/insights/Statistics.ts +0 -101
  292. package/lib/front_end/models/trace/insights/ThirdParties.ts +0 -130
  293. package/lib/front_end/models/trace/insights/Viewport.ts +0 -138
  294. package/lib/front_end/models/trace/insights/insights.ts +0 -10
  295. package/lib/front_end/models/trace/insights/types.ts +0 -157
  296. package/lib/front_end/models/trace/lantern/core/LanternError.ts +0 -7
  297. package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +0 -619
  298. package/lib/front_end/models/trace/lantern/core/core.ts +0 -6
  299. package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +0 -345
  300. package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +0 -80
  301. package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +0 -101
  302. package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +0 -636
  303. package/lib/front_end/models/trace/lantern/graph/graph.ts +0 -8
  304. package/lib/front_end/models/trace/lantern/lantern.ts +0 -17
  305. package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +0 -187
  306. package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +0 -88
  307. package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +0 -92
  308. package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +0 -72
  309. package/lib/front_end/models/trace/lantern/metrics/Metric.ts +0 -126
  310. package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +0 -126
  311. package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +0 -82
  312. package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +0 -112
  313. package/lib/front_end/models/trace/lantern/metrics/metrics.ts +0 -12
  314. package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +0 -150
  315. package/lib/front_end/models/trace/lantern/simulation/Constants.ts +0 -46
  316. package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +0 -61
  317. package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +0 -196
  318. package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +0 -556
  319. package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +0 -192
  320. package/lib/front_end/models/trace/lantern/simulation/simulation.ts +0 -10
  321. package/lib/front_end/models/trace/lantern/types/Lantern.ts +0 -220
  322. package/lib/front_end/models/trace/lantern/types/types.ts +0 -5
  323. package/lib/front_end/models/trace/trace.ts +0 -33
  324. package/lib/front_end/models/trace/types/Configuration.ts +0 -110
  325. package/lib/front_end/models/trace/types/Extensions.ts +0 -136
  326. package/lib/front_end/models/trace/types/File.ts +0 -281
  327. package/lib/front_end/models/trace/types/Overlays.ts +0 -138
  328. package/lib/front_end/models/trace/types/Timing.ts +0 -30
  329. package/lib/front_end/models/trace/types/TraceEvents.ts +0 -3277
  330. package/lib/front_end/models/trace/types/types.ts +0 -10
  331. package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +0 -240
  332. package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +0 -5
  333. package/lib/front_end/models/workspace/FileManager.ts +0 -97
  334. package/lib/front_end/models/workspace/IgnoreListManager.ts +0 -628
  335. package/lib/front_end/models/workspace/SearchConfig.ts +0 -149
  336. package/lib/front_end/models/workspace/UISourceCode.ts +0 -698
  337. package/lib/front_end/models/workspace/WorkspaceImpl.ts +0 -339
  338. package/lib/front_end/models/workspace/workspace.ts +0 -17
  339. package/lib/front_end/panels/timeline/TimelineUIUtils.ts +0 -1029
  340. package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +0 -49
  341. package/lib/front_end/panels/timeline/extensions/extensions.ts +0 -9
  342. package/lib/front_end/third_party/codemirror.next/LICENSE +0 -21
  343. package/lib/front_end/third_party/codemirror.next/README.chromium +0 -30
  344. package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
  345. package/lib/front_end/third_party/codemirror.next/bundle.ts +0 -135
  346. package/lib/front_end/third_party/codemirror.next/chunk/angular.js +0 -2
  347. package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +0 -1
  348. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +0 -2
  349. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +0 -1
  350. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +0 -2
  351. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +0 -1
  352. package/lib/front_end/third_party/codemirror.next/chunk/css.js +0 -2
  353. package/lib/front_end/third_party/codemirror.next/chunk/html.js +0 -4
  354. package/lib/front_end/third_party/codemirror.next/chunk/java.js +0 -2
  355. package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +0 -1
  356. package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +0 -2
  357. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +0 -2
  358. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +0 -1
  359. package/lib/front_end/third_party/codemirror.next/chunk/less.js +0 -2
  360. package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +0 -1
  361. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +0 -2
  362. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +0 -1
  363. package/lib/front_end/third_party/codemirror.next/chunk/php.js +0 -2
  364. package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +0 -1
  365. package/lib/front_end/third_party/codemirror.next/chunk/python.js +0 -2
  366. package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +0 -1
  367. package/lib/front_end/third_party/codemirror.next/chunk/sass.js +0 -2
  368. package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +0 -1
  369. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +0 -2
  370. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +0 -1
  371. package/lib/front_end/third_party/codemirror.next/chunk/vue.js +0 -2
  372. package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +0 -1
  373. package/lib/front_end/third_party/codemirror.next/chunk/wast.js +0 -2
  374. package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +0 -1
  375. package/lib/front_end/third_party/codemirror.next/chunk/xml.js +0 -2
  376. package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +0 -1
  377. package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +0 -8057
  378. package/lib/front_end/third_party/codemirror.next/codemirror.next.js +0 -2
  379. package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +0 -1
  380. package/lib/front_end/third_party/codemirror.next/package.json +0 -43
  381. package/lib/front_end/third_party/codemirror.next/rebuild.sh +0 -6
  382. package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +0 -49
  383. package/lib/front_end/third_party/i18n/LICENSE +0 -202
  384. package/lib/front_end/third_party/i18n/README.chromium +0 -15
  385. package/lib/front_end/third_party/i18n/i18n-impl.ts +0 -61
  386. package/lib/front_end/third_party/i18n/i18n.ts +0 -11
  387. package/lib/front_end/third_party/i18n/localized-string-set.ts +0 -129
  388. package/lib/front_end/third_party/intl-messageformat/LICENSE +0 -33
  389. package/lib/front_end/third_party/intl-messageformat/README.chromium +0 -24
  390. package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
  391. package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +0 -6
  392. package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +0 -33
  393. package/lib/front_end/third_party/intl-messageformat/package/README.md +0 -3
  394. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +0 -6
  395. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +0 -1
  396. package/lib/front_end/third_party/intl-messageformat/package/index.js +0 -13
  397. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +0 -5
  398. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +0 -1710
  399. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +0 -1815
  400. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +0 -6
  401. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +0 -1
  402. package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +0 -10
  403. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +0 -34
  404. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +0 -1
  405. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +0 -229
  406. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +0 -28
  407. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +0 -1
  408. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +0 -48
  409. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +0 -34
  410. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +0 -1
  411. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +0 -179
  412. package/lib/front_end/third_party/intl-messageformat/package/package.json +0 -42
  413. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +0 -34
  414. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +0 -1
  415. package/lib/front_end/third_party/intl-messageformat/package/src/core.js +0 -230
  416. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +0 -28
  417. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +0 -1
  418. package/lib/front_end/third_party/intl-messageformat/package/src/error.js +0 -51
  419. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +0 -34
  420. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +0 -1
  421. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +0 -182
  422. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +0 -79
  423. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +0 -15
  424. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +0 -153
  425. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +0 -139
  426. package/lib/front_end/third_party/legacy-javascript/LICENSE +0 -202
  427. package/lib/front_end/third_party/legacy-javascript/README.chromium +0 -13
  428. package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
  429. package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +0 -3
  430. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +0 -18
  431. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +0 -943
  432. package/lib/front_end/third_party/legacy-javascript/package.json +0 -8
  433. package/lib/front_end/third_party/legacy-javascript/rebuild.sh +0 -9
  434. package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +0 -26
  435. package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +0 -31
  436. package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -33
  437. package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -26
  438. package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +0 -64
  439. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -62
  440. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +0 -1
  441. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -37
  442. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -1
  443. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -29
  444. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -1
  445. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -8
  446. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -1
  447. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -6
  448. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -1
  449. package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +0 -21
  450. package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +0 -14
  451. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +0 -196
  452. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +0 -1
  453. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +0 -262
  454. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -235
  455. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -1
  456. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -359
  457. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -39
  458. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -1
  459. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -53
  460. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -438
  461. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -1
  462. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -539
  463. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -23
  464. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -1
  465. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -35
  466. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -257
  467. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -1
  468. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -348
  469. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -8
  470. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -1
  471. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -20
  472. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  473. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -184
  474. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -9
  475. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -1
  476. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -12
  477. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -82
  478. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -1
  479. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -99
  480. package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +0 -5
  481. package/lib/front_end/third_party/third-party-web/LICENSE +0 -20
  482. package/lib/front_end/third_party/third-party-web/README.chromium +0 -13
  483. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
  484. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +0 -149
  485. package/lib/front_end/third_party/third-party-web/package/LICENSE +0 -20
  486. package/lib/front_end/third_party/third-party-web/package/README.md +0 -929
  487. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +0 -1
  488. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +0 -1
  489. package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +0 -1
  490. package/lib/front_end/third_party/third-party-web/package/dist/entities.json +0 -1
  491. package/lib/front_end/third_party/third-party-web/package/facades.md +0 -46
  492. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +0 -1
  493. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +0 -1
  494. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +0 -1
  495. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +0 -1
  496. package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +0 -1006
  497. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +0 -139
  498. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +0 -44
  499. package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +0 -27
  500. package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +0 -34
  501. package/lib/front_end/third_party/third-party-web/package/lib/index.js +0 -3
  502. package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +0 -246
  503. package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +0 -36
  504. package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +0 -9
  505. package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +0 -5
  506. package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +0 -151
  507. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +0 -1
  508. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +0 -1
  509. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +0 -1
  510. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +0 -14
  511. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +0 -1
  512. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +0 -3
  513. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +0 -1
  514. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +0 -3
  515. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +0 -1
  516. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +0 -3
  517. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
  518. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +0 -3
  519. package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +0 -1
  520. package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +0 -1
  521. package/lib/front_end/third_party/third-party-web/package/package.json +0 -46
  522. package/lib/front_end/third_party/third-party-web/package.json +0 -8
  523. package/lib/front_end/third_party/third-party-web/rebuild.sh +0 -13
  524. package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
  525. package/lib/front_end/third_party/third-party-web/third-party-web.ts +0 -3
  526. package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +0 -222
  527. package/lib/front_end/ui/legacy/theme_support/theme_support.ts +0 -5
  528. package/patches/chrome-devtools-frontend+1.0.1533544.patch +0 -1716
@@ -1,2253 +0,0 @@
1
- // Copyright 2012 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
- import * as Protocol from '../../generated/protocol.js';
6
- import * as TextUtils from '../../models/text_utils/text_utils.js';
7
- import * as Common from '../common/common.js';
8
- import * as i18n from '../i18n/i18n.js';
9
- import * as Platform from '../platform/platform.js';
10
-
11
- import {Attribute, type Cookie} from './Cookie.js';
12
- import {CookieModel} from './CookieModel.js';
13
- import {CookieParser} from './CookieParser.js';
14
- import * as HttpReasonPhraseStrings from './HttpReasonPhraseStrings.js';
15
- import {
16
- Events as NetworkManagerEvents,
17
- NetworkManager,
18
- } from './NetworkManager.js';
19
- import {ServerSentEvents} from './ServerSentEvents.js';
20
- import {ServerTiming} from './ServerTiming.js';
21
- import {Type} from './Target.js';
22
-
23
- // clang-format off
24
- const UIStrings = {
25
- /**
26
- * @description Text in Network Request
27
- */
28
- binary: '(binary)',
29
- /**
30
- * @description Tooltip to explain why a cookie was blocked
31
- */
32
- secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure.',
33
- /**
34
- * @description Tooltip to explain why a cookie was blocked
35
- */
36
- notOnPath: 'This cookie was blocked because its path was not an exact match for or a superdirectory of the request url\'s path.',
37
- /**
38
- * @description Tooltip to explain why a cookie was blocked
39
- */
40
- domainMismatch: 'This cookie was blocked because neither did the request URL\'s domain exactly match the cookie\'s domain, nor was the request URL\'s domain a subdomain of the cookie\'s Domain attribute value.',
41
- /**
42
- * @description Tooltip to explain why a cookie was blocked
43
- */
44
- sameSiteStrict: 'This cookie was blocked because it had the "`SameSite=Strict`" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites.',
45
- /**
46
- * @description Tooltip to explain why a cookie was blocked
47
- */
48
- sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation.',
49
- /**
50
- * @description Tooltip to explain why a cookie was blocked
51
- */
52
- sameSiteUnspecifiedTreatedAsLax: 'This cookie didn\'t specify a "`SameSite`" attribute when it was stored and was defaulted to "SameSite=Lax," and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',
53
- /**
54
- * @description Tooltip to explain why a cookie was blocked
55
- */
56
- sameSiteNoneInsecure: 'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "Secure". Cookies without SameSite restrictions must be marked "Secure" and sent over a secure connection.',
57
- /**
58
- * @description Tooltip to explain why a cookie was blocked
59
- */
60
- userPreferences: 'This cookie was blocked due to user preferences.',
61
- /**
62
- * @description Tooltip to explain why a cookie was blocked
63
- */
64
- thirdPartyPhaseout: 'This cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.',
65
- /**
66
- * @description Tooltip to explain why a cookie was blocked
67
- */
68
- unknownError: 'An unknown error was encountered when trying to send this cookie.',
69
- /**
70
- * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
71
- */
72
- schemefulSameSiteStrict: 'This cookie was blocked because it had the "`SameSite=Strict`" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site.',
73
- /**
74
- * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
75
- */
76
- schemefulSameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',
77
- /**
78
- * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
79
- */
80
- schemefulSameSiteUnspecifiedTreatedAsLax: 'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',
81
- /**
82
- * @description Tooltip to explain why a cookie was blocked due to SameParty
83
- */
84
- samePartyFromCrossPartyContext: 'This cookie was blocked because it had the "`SameParty`" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource\'s URL and the domains of the resource\'s enclosing frames/documents are neither owners nor members in the same First-Party Set.',
85
- /**
86
- * @description Tooltip to explain why a cookie was blocked due to exceeding the maximum size
87
- */
88
- nameValuePairExceedsMaxSize: 'This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters.',
89
- /**
90
- * @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
91
- */
92
- thisSetcookieWasBlockedDueToUser: 'This attempt to set a cookie via a `Set-Cookie` header was blocked due to user preferences.',
93
- /**
94
- * @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
95
- */
96
- thisSetcookieWasBlockedDueThirdPartyPhaseout: 'Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.',
97
- /**
98
- * @description Tooltip to explain why an attempt to set a cookie via `Set-Cookie` HTTP header on a request's response was blocked.
99
- */
100
- thisSetcookieHadInvalidSyntax: 'This `Set-Cookie` header had invalid syntax.',
101
- /**
102
- * @description Tooltip to explain why a cookie was blocked
103
- */
104
- thisSetcookieHadADisallowedCharacter: 'This `Set-Cookie` header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value).',
105
- /**
106
- * @description Tooltip to explain why a cookie was blocked
107
- */
108
- theSchemeOfThisConnectionIsNot: 'The scheme of this connection is not allowed to store cookies.',
109
- /**
110
- * @description Tooltip to explain why a cookie was blocked
111
- */
112
- anUnknownErrorWasEncounteredWhenTrying: 'An unknown error was encountered when trying to store this cookie.',
113
- /**
114
- * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
115
- * @example {SameSite=Strict} PH1
116
- */
117
- thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',
118
- /**
119
- * @description Tooltip to explain why a cookie was blocked due to Schemeful Same-Site
120
- */
121
- thisSetcookieDidntSpecifyASamesite: 'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',
122
- /**
123
- * @description Tooltip to explain why a cookie was blocked due to SameParty
124
- */
125
- thisSetcookieWasBlockedBecauseItHadTheSameparty: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource\'s URL and the domains of the resource\'s enclosing frames/documents are neither owners nor members in the same First-Party Set.',
126
- /**
127
- * @description Tooltip to explain why a cookie was blocked due to SameParty
128
- */
129
- thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',
130
- /**
131
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
132
- */
133
- blockedReasonSecureOnly: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "Secure" attribute but was not received over a secure connection.',
134
- /**
135
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
136
- * @example {SameSite=Strict} PH1
137
- */
138
- blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation.',
139
- /**
140
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
141
- */
142
- blockedReasonSameSiteUnspecifiedTreatedAsLax: 'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax,`" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The `Set-Cookie` had to have been set with "`SameSite=None`" to enable cross-site usage.',
143
- /**
144
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
145
- */
146
- blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameSite=None`" attribute but did not have the "Secure" attribute, which is required in order to use "`SameSite=None`".',
147
- /**
148
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
149
- */
150
- blockedReasonOverwriteSecure: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.',
151
- /**
152
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
153
- */
154
- blockedReasonInvalidDomain: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because its Domain attribute was invalid with regards to the current host url.',
155
- /**
156
- * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
157
- */
158
- blockedReasonInvalidPrefix: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',
159
- /**
160
- * @description Tooltip to explain why a cookie was blocked when the size of the #name plus the size of the value exceeds the max size.
161
- */
162
- thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize: 'This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.',
163
- /**
164
- * @description Text in Network Manager
165
- * @example {https://example.com} PH1
166
- */
167
- setcookieHeaderIsIgnoredIn: 'Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters.',
168
- /**
169
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
170
- */
171
- exemptionReasonUserSetting: 'This cookie is allowed by user preference.',
172
- /**
173
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
174
- */
175
- exemptionReasonTPCDMetadata: 'This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/dt-grace.',
176
- /**
177
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
178
- */
179
- exemptionReasonTPCDDeprecationTrial: 'This cookie is allowed by third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.',
180
- /**
181
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
182
- */
183
- exemptionReasonTopLevelTPCDDeprecationTrial: 'This cookie is allowed by top-level third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.',
184
- /**
185
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
186
- */
187
- exemptionReasonTPCDHeuristics: 'This cookie is allowed by third-party cookie heuristics. Learn more: goo.gle/hbe',
188
- /**
189
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
190
- */
191
- exemptionReasonEnterprisePolicy: 'This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc',
192
- /**
193
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
194
- */
195
- exemptionReasonStorageAccessAPI: 'This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa',
196
- /**
197
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
198
- */
199
- exemptionReasonTopLevelStorageAccessAPI: 'This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top',
200
- /**
201
- * @description Tooltip to explain why the cookie should have been blocked by third-party cookie phaseout but is exempted.
202
- */
203
- exemptionReasonScheme: 'This cookie is allowed by the top-level url scheme',
204
- } as const;
205
- // clang-format on
206
-
207
- const str_ = i18n.i18n.registerUIStrings('core/sdk/NetworkRequest.ts', UIStrings);
208
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
209
-
210
- export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
211
- TextUtils.ContentProvider.StreamingContentProvider {
212
- #requestId: string;
213
- #backendRequestId?: Protocol.Network.RequestId;
214
- readonly #documentURL: Platform.DevToolsPath.UrlString;
215
- readonly #frameId: Protocol.Page.FrameId|null;
216
- readonly #loaderId: Protocol.Network.LoaderId|null;
217
- readonly #hasUserGesture: boolean|undefined;
218
- readonly #initiator: Protocol.Network.Initiator|null|undefined;
219
- #redirectSource: NetworkRequest|null = null;
220
- #preflightRequest: NetworkRequest|null = null;
221
- #preflightInitiatorRequest: NetworkRequest|null = null;
222
- #isRedirect = false;
223
- #redirectDestination: NetworkRequest|null = null;
224
- #issueTime = -1;
225
- #startTime = -1;
226
- #endTime = -1;
227
- #blockedReason: Protocol.Network.BlockedReason|undefined = undefined;
228
- #corsErrorStatus: Protocol.Network.CorsErrorStatus|undefined = undefined;
229
- statusCode = 0;
230
- statusText = '';
231
- requestMethod = '';
232
- requestTime = 0;
233
- protocol = '';
234
- alternateProtocolUsage: Protocol.Network.AlternateProtocolUsage|undefined = undefined;
235
- mixedContentType: Protocol.Security.MixedContentType = Protocol.Security.MixedContentType.None;
236
- #initialPriority: Protocol.Network.ResourcePriority|null = null;
237
- #currentPriority: Protocol.Network.ResourcePriority|null = null;
238
- #signedExchangeInfo: Protocol.Network.SignedExchangeInfo|null = null;
239
- #resourceType: Common.ResourceType.ResourceType = Common.ResourceType.resourceTypes.Other;
240
- #contentData: Promise<TextUtils.ContentData.ContentDataOrError>|null = null;
241
- #streamingContentData: Promise<TextUtils.StreamingContentData.StreamingContentDataOrError>|null = null;
242
- readonly #frames: WebSocketFrame[] = [];
243
- #responseHeaderValues: Record<string, string|undefined> = {};
244
- #responseHeadersText = '';
245
- #originalResponseHeaders: Protocol.Fetch.HeaderEntry[] = [];
246
- #sortedOriginalResponseHeaders?: NameValue[];
247
-
248
- // This field is only used when intercepting and overriding requests, because
249
- // in that case 'this.responseHeaders' does not contain 'set-cookie' headers.
250
- #setCookieHeaders: Protocol.Fetch.HeaderEntry[] = [];
251
-
252
- #requestHeaders: NameValue[] = [];
253
- #requestHeaderValues: Record<string, string|undefined> = {};
254
- #remoteAddress = '';
255
- #remoteAddressSpace: Protocol.Network.IPAddressSpace = Protocol.Network.IPAddressSpace.Unknown;
256
- #referrerPolicy: Protocol.Network.RequestReferrerPolicy|null = null;
257
- #securityState: Protocol.Security.SecurityState = Protocol.Security.SecurityState.Unknown;
258
- #securityDetails: Protocol.Network.SecurityDetails|null = null;
259
- connectionId = '0';
260
- connectionReused = false;
261
- hasNetworkData = false;
262
- #formParametersPromise: Promise<NameValue[]|null>|null = null;
263
- #requestFormDataPromise: Promise<string|null>|null = Promise.resolve(null);
264
- #hasExtraRequestInfo = false;
265
- #hasExtraResponseInfo = false;
266
- #blockedRequestCookies: BlockedCookieWithReason[] = [];
267
- #includedRequestCookies: IncludedCookieWithReason[] = [];
268
- #blockedResponseCookies: BlockedSetCookieWithReason[] = [];
269
- #exemptedResponseCookies: ExemptedSetCookieWithReason[] = [];
270
- #responseCookiesPartitionKey: Protocol.Network.CookiePartitionKey|null = null;
271
- #responseCookiesPartitionKeyOpaque: boolean|null = null;
272
- #siteHasCookieInOtherPartition = false;
273
- localizedFailDescription: string|null = null;
274
- #url!: Platform.DevToolsPath.UrlString;
275
- #responseReceivedTime!: number;
276
- #transferSize!: number;
277
- #finished!: boolean;
278
- #failed!: boolean;
279
- #canceled!: boolean;
280
- #preserved!: boolean;
281
- #mimeType!: string;
282
- #charset!: string;
283
- #parsedURL!: Common.ParsedURL.ParsedURL;
284
- #name!: string|undefined;
285
- #path!: string|undefined;
286
- #clientSecurityState!:|Protocol.Network.ClientSecurityState|undefined;
287
- #trustTokenParams!: Protocol.Network.TrustTokenParams|undefined;
288
- #trustTokenOperationDoneEvent!:|Protocol.Network.TrustTokenOperationDoneEvent|undefined;
289
- #responseCacheStorageCacheName?: string;
290
- #serviceWorkerResponseSource?: Protocol.Network.ServiceWorkerResponseSource;
291
- #wallIssueTime?: number;
292
- #responseRetrievalTime?: Date;
293
- #resourceSize?: number;
294
- #fromMemoryCache?: boolean;
295
- #fromDiskCache?: boolean;
296
- #fromPrefetchCache?: boolean;
297
- #fromEarlyHints?: boolean;
298
- #fetchedViaServiceWorker?: boolean;
299
- #serviceWorkerRouterInfo?: Protocol.Network.ServiceWorkerRouterInfo;
300
- #timing?: Protocol.Network.ResourceTiming;
301
- #requestHeadersText?: string;
302
- #responseHeaders?: NameValue[];
303
- #earlyHintsHeaders?: NameValue[];
304
- #sortedResponseHeaders?: NameValue[];
305
- #responseCookies?: Cookie[];
306
- #serverTimings?: ServerTiming[]|null;
307
- #queryString?: string|null;
308
- #parsedQueryParameters?: NameValue[];
309
- #contentDataProvider?: () => Promise<TextUtils.ContentData.ContentDataOrError>;
310
- #isSameSite: boolean|null = null;
311
- #wasIntercepted = false;
312
- #associatedData = new Map<string, object>();
313
- #hasOverriddenContent = false;
314
- #hasThirdPartyCookiePhaseoutIssue = false;
315
- #serverSentEvents?: ServerSentEvents;
316
- responseReceivedPromise?: Promise<void>;
317
- responseReceivedPromiseResolve?: () => void;
318
- directSocketInfo?: DirectSocketInfo;
319
- readonly #directSocketChunks: DirectSocketChunk[] = [];
320
- #isIpProtectionUsed: boolean;
321
- #isAdRelated: boolean;
322
- #appliedNetworkConditionsId?: string;
323
-
324
- constructor(
325
- requestId: string,
326
- backendRequestId: Protocol.Network.RequestId|undefined,
327
- url: Platform.DevToolsPath.UrlString,
328
- documentURL: Platform.DevToolsPath.UrlString,
329
- frameId: Protocol.Page.FrameId|null,
330
- loaderId: Protocol.Network.LoaderId|null,
331
- initiator: Protocol.Network.Initiator|null,
332
- hasUserGesture?: boolean,
333
- ) {
334
- super();
335
-
336
- this.#requestId = requestId;
337
- this.#backendRequestId = backendRequestId;
338
- this.setUrl(url);
339
- this.#documentURL = documentURL;
340
- this.#frameId = frameId;
341
- this.#loaderId = loaderId;
342
- this.#initiator = initiator;
343
- this.#hasUserGesture = hasUserGesture;
344
- this.#isIpProtectionUsed = false;
345
- this.#isAdRelated = false;
346
- }
347
-
348
- static create(
349
- backendRequestId: Protocol.Network.RequestId,
350
- url: Platform.DevToolsPath.UrlString,
351
- documentURL: Platform.DevToolsPath.UrlString,
352
- frameId: Protocol.Page.FrameId|null,
353
- loaderId: Protocol.Network.LoaderId|null,
354
- initiator: Protocol.Network.Initiator|null,
355
- hasUserGesture?: boolean,
356
- ): NetworkRequest {
357
- return new NetworkRequest(
358
- backendRequestId,
359
- backendRequestId,
360
- url,
361
- documentURL,
362
- frameId,
363
- loaderId,
364
- initiator,
365
- hasUserGesture,
366
- );
367
- }
368
-
369
- static createForSocket(
370
- backendRequestId: Protocol.Network.RequestId,
371
- requestURL: Platform.DevToolsPath.UrlString,
372
- initiator?: Protocol.Network.Initiator,
373
- ): NetworkRequest {
374
- return new NetworkRequest(
375
- backendRequestId,
376
- backendRequestId,
377
- requestURL,
378
- Platform.DevToolsPath.EmptyUrlString,
379
- null,
380
- null,
381
- initiator || null,
382
- );
383
- }
384
-
385
- static createWithoutBackendRequest(
386
- requestId: string,
387
- url: Platform.DevToolsPath.UrlString,
388
- documentURL: Platform.DevToolsPath.UrlString,
389
- initiator: Protocol.Network.Initiator|null,
390
- ): NetworkRequest {
391
- return new NetworkRequest(
392
- requestId,
393
- undefined,
394
- url,
395
- documentURL,
396
- null,
397
- null,
398
- initiator,
399
- );
400
- }
401
-
402
- identityCompare(other: NetworkRequest): number {
403
- const thisId = this.requestId();
404
- const thatId = other.requestId();
405
- if (thisId > thatId) {
406
- return 1;
407
- }
408
- if (thisId < thatId) {
409
- return -1;
410
- }
411
- return 0;
412
- }
413
-
414
- requestId(): string {
415
- return this.#requestId;
416
- }
417
-
418
- backendRequestId(): Protocol.Network.RequestId|undefined {
419
- return this.#backendRequestId;
420
- }
421
-
422
- url(): Platform.DevToolsPath.UrlString {
423
- return this.#url;
424
- }
425
-
426
- isBlobRequest(): boolean {
427
- return Common.ParsedURL.schemeIs(this.#url, 'blob:');
428
- }
429
-
430
- setUrl(x: Platform.DevToolsPath.UrlString): void {
431
- if (this.#url === x) {
432
- return;
433
- }
434
-
435
- this.#url = x;
436
- this.#parsedURL = new Common.ParsedURL.ParsedURL(x);
437
- this.#queryString = undefined;
438
- this.#parsedQueryParameters = undefined;
439
- this.#name = undefined;
440
- this.#path = undefined;
441
- }
442
-
443
- get documentURL(): Platform.DevToolsPath.UrlString {
444
- return this.#documentURL;
445
- }
446
-
447
- get parsedURL(): Common.ParsedURL.ParsedURL {
448
- return this.#parsedURL;
449
- }
450
-
451
- get frameId(): Protocol.Page.FrameId|null {
452
- return this.#frameId;
453
- }
454
-
455
- get loaderId(): Protocol.Network.LoaderId|null {
456
- return this.#loaderId;
457
- }
458
-
459
- get appliedNetworkConditionsId(): string|undefined {
460
- return this.#appliedNetworkConditionsId;
461
- }
462
-
463
- setRemoteAddress(ip: string, port: number): void {
464
- this.#remoteAddress = ip + ':' + port;
465
- this.dispatchEventToListeners(Events.REMOTE_ADDRESS_CHANGED, this);
466
- }
467
-
468
- remoteAddress(): string {
469
- return this.#remoteAddress;
470
- }
471
-
472
- remoteAddressSpace(): Protocol.Network.IPAddressSpace {
473
- return this.#remoteAddressSpace;
474
- }
475
-
476
- /**
477
- * The cache #name of the CacheStorage from where the response is served via
478
- * the ServiceWorker.
479
- */
480
- getResponseCacheStorageCacheName(): string|undefined {
481
- return this.#responseCacheStorageCacheName;
482
- }
483
-
484
- setResponseCacheStorageCacheName(x: string): void {
485
- this.#responseCacheStorageCacheName = x;
486
- }
487
-
488
- serviceWorkerResponseSource():|Protocol.Network.ServiceWorkerResponseSource|undefined {
489
- return this.#serviceWorkerResponseSource;
490
- }
491
-
492
- setServiceWorkerResponseSource(
493
- serviceWorkerResponseSource: Protocol.Network.ServiceWorkerResponseSource,
494
- ): void {
495
- this.#serviceWorkerResponseSource = serviceWorkerResponseSource;
496
- }
497
-
498
- setReferrerPolicy(
499
- referrerPolicy: Protocol.Network.RequestReferrerPolicy,
500
- ): void {
501
- this.#referrerPolicy = referrerPolicy;
502
- }
503
-
504
- referrerPolicy(): Protocol.Network.RequestReferrerPolicy|null {
505
- return this.#referrerPolicy;
506
- }
507
-
508
- securityState(): Protocol.Security.SecurityState {
509
- return this.#securityState;
510
- }
511
-
512
- setSecurityState(securityState: Protocol.Security.SecurityState): void {
513
- this.#securityState = securityState;
514
- }
515
-
516
- securityDetails(): Protocol.Network.SecurityDetails|null {
517
- return this.#securityDetails;
518
- }
519
-
520
- securityOrigin(): string {
521
- return this.#parsedURL.securityOrigin();
522
- }
523
-
524
- setSecurityDetails(securityDetails: Protocol.Network.SecurityDetails): void {
525
- this.#securityDetails = securityDetails;
526
- }
527
-
528
- get startTime(): number {
529
- return this.#startTime || -1;
530
- }
531
-
532
- setIssueTime(monotonicTime: number, wallTime: number): void {
533
- this.#issueTime = monotonicTime;
534
- this.#wallIssueTime = wallTime;
535
- this.#startTime = monotonicTime;
536
- }
537
-
538
- issueTime(): number {
539
- return this.#issueTime;
540
- }
541
-
542
- pseudoWallTime(monotonicTime: number): number {
543
- return this.#wallIssueTime ? this.#wallIssueTime - this.#issueTime + monotonicTime : monotonicTime;
544
- }
545
-
546
- get responseReceivedTime(): number {
547
- return this.#responseReceivedTime || -1;
548
- }
549
-
550
- set responseReceivedTime(x: number) {
551
- this.#responseReceivedTime = x;
552
- }
553
-
554
- /**
555
- * The time at which the returned response was generated. For cached
556
- * responses, this is the last time the cache entry was validated.
557
- */
558
- getResponseRetrievalTime(): Date|undefined {
559
- return this.#responseRetrievalTime;
560
- }
561
-
562
- setResponseRetrievalTime(x: Date): void {
563
- this.#responseRetrievalTime = x;
564
- }
565
-
566
- get endTime(): number {
567
- return this.#endTime || -1;
568
- }
569
-
570
- set endTime(x: number) {
571
- if (this.timing?.requestTime) {
572
- // Check against accurate responseReceivedTime.
573
- this.#endTime = Math.max(x, this.responseReceivedTime);
574
- } else {
575
- // Prefer endTime since it might be from the network stack.
576
- this.#endTime = x;
577
- if (this.#responseReceivedTime > x) {
578
- this.#responseReceivedTime = x;
579
- }
580
- }
581
- this.dispatchEventToListeners(Events.TIMING_CHANGED, this);
582
- }
583
-
584
- get duration(): number {
585
- if (this.#endTime === -1 || this.#startTime === -1) {
586
- return -1;
587
- }
588
- return this.#endTime - this.#startTime;
589
- }
590
-
591
- get latency(): number {
592
- if (this.#responseReceivedTime === -1 || this.#startTime === -1) {
593
- return -1;
594
- }
595
- return this.#responseReceivedTime - this.#startTime;
596
- }
597
-
598
- get resourceSize(): number {
599
- return this.#resourceSize || 0;
600
- }
601
-
602
- set resourceSize(x: number) {
603
- this.#resourceSize = x;
604
- }
605
-
606
- get transferSize(): number {
607
- return this.#transferSize || 0;
608
- }
609
-
610
- increaseTransferSize(x: number): void {
611
- this.#transferSize = (this.#transferSize || 0) + x;
612
- }
613
-
614
- setTransferSize(x: number): void {
615
- this.#transferSize = x;
616
- }
617
-
618
- get finished(): boolean {
619
- return this.#finished;
620
- }
621
-
622
- set finished(x: boolean) {
623
- if (this.#finished === x) {
624
- return;
625
- }
626
-
627
- this.#finished = x;
628
-
629
- if (x) {
630
- this.dispatchEventToListeners(Events.FINISHED_LOADING, this);
631
- }
632
- }
633
-
634
- get failed(): boolean {
635
- return this.#failed;
636
- }
637
-
638
- set failed(x: boolean) {
639
- this.#failed = x;
640
- }
641
-
642
- get canceled(): boolean {
643
- return this.#canceled;
644
- }
645
-
646
- set canceled(x: boolean) {
647
- this.#canceled = x;
648
- }
649
-
650
- get preserved(): boolean {
651
- return this.#preserved;
652
- }
653
-
654
- set preserved(x: boolean) {
655
- this.#preserved = x;
656
- }
657
-
658
- blockedReason(): Protocol.Network.BlockedReason|undefined {
659
- return this.#blockedReason;
660
- }
661
-
662
- setBlockedReason(reason: Protocol.Network.BlockedReason): void {
663
- this.#blockedReason = reason;
664
- }
665
-
666
- corsErrorStatus(): Protocol.Network.CorsErrorStatus|undefined {
667
- return this.#corsErrorStatus;
668
- }
669
-
670
- setCorsErrorStatus(corsErrorStatus: Protocol.Network.CorsErrorStatus): void {
671
- this.#corsErrorStatus = corsErrorStatus;
672
- }
673
-
674
- wasBlocked(): boolean {
675
- return Boolean(this.#blockedReason);
676
- }
677
-
678
- cached(): boolean {
679
- return ((Boolean(this.#fromMemoryCache) || Boolean(this.#fromDiskCache)) && !this.#transferSize);
680
- }
681
-
682
- cachedInMemory(): boolean {
683
- return Boolean(this.#fromMemoryCache) && !this.#transferSize;
684
- }
685
-
686
- fromPrefetchCache(): boolean {
687
- return Boolean(this.#fromPrefetchCache);
688
- }
689
-
690
- setFromMemoryCache(): void {
691
- this.#fromMemoryCache = true;
692
- this.#timing = undefined;
693
- }
694
-
695
- get fromDiskCache(): boolean|undefined {
696
- return this.#fromDiskCache;
697
- }
698
-
699
- setFromDiskCache(): void {
700
- this.#fromDiskCache = true;
701
- }
702
-
703
- setFromPrefetchCache(): void {
704
- this.#fromPrefetchCache = true;
705
- }
706
-
707
- fromEarlyHints(): boolean {
708
- return Boolean(this.#fromEarlyHints);
709
- }
710
-
711
- setFromEarlyHints(): void {
712
- this.#fromEarlyHints = true;
713
- }
714
-
715
- /**
716
- * Returns true if the request was intercepted by a service worker and it
717
- * provided its own response.
718
- */
719
- get fetchedViaServiceWorker(): boolean {
720
- return Boolean(this.#fetchedViaServiceWorker);
721
- }
722
-
723
- set fetchedViaServiceWorker(x: boolean) {
724
- this.#fetchedViaServiceWorker = x;
725
- }
726
-
727
- get serviceWorkerRouterInfo():|Protocol.Network.ServiceWorkerRouterInfo|undefined {
728
- return this.#serviceWorkerRouterInfo;
729
- }
730
-
731
- set serviceWorkerRouterInfo(x: Protocol.Network.ServiceWorkerRouterInfo) {
732
- this.#serviceWorkerRouterInfo = x;
733
- }
734
-
735
- /**
736
- * Returns true if the request was matched to a route when using the
737
- * ServiceWorker static routing API.
738
- */
739
- hasMatchingServiceWorkerRouter(): boolean {
740
- // See definitions in `browser_protocol.pdl` for justification.
741
- return (
742
- this.#serviceWorkerRouterInfo !== undefined && this.serviceWorkerRouterInfo?.matchedSourceType !== undefined);
743
- }
744
-
745
- /**
746
- * Returns true if the request was sent by a service worker.
747
- */
748
- initiatedByServiceWorker(): boolean {
749
- const networkManager = NetworkManager.forRequest(this);
750
- if (!networkManager) {
751
- return false;
752
- }
753
- return networkManager.target().type() === Type.ServiceWorker;
754
- }
755
-
756
- get timing(): Protocol.Network.ResourceTiming|undefined {
757
- return this.#timing;
758
- }
759
-
760
- set timing(timingInfo: Protocol.Network.ResourceTiming|undefined) {
761
- if (!timingInfo || this.#fromMemoryCache) {
762
- return;
763
- }
764
- // Take startTime and responseReceivedTime from timing data for better accuracy.
765
- // Timing's requestTime is a baseline in seconds, rest of the numbers there are ticks in millis.
766
- this.#startTime = timingInfo.requestTime;
767
- const headersReceivedTime = timingInfo.requestTime + timingInfo.receiveHeadersEnd / 1000.0;
768
- if ((this.#responseReceivedTime || -1) < 0 || this.#responseReceivedTime > headersReceivedTime) {
769
- this.#responseReceivedTime = headersReceivedTime;
770
- }
771
- if (this.#startTime > this.#responseReceivedTime) {
772
- this.#responseReceivedTime = this.#startTime;
773
- }
774
-
775
- this.#timing = timingInfo;
776
- this.dispatchEventToListeners(Events.TIMING_CHANGED, this);
777
- }
778
-
779
- private setConnectTimingFromExtraInfo(
780
- connectTiming: Protocol.Network.ConnectTiming,
781
- ): void {
782
- this.#startTime = connectTiming.requestTime;
783
- this.dispatchEventToListeners(Events.TIMING_CHANGED, this);
784
- }
785
-
786
- get mimeType(): string {
787
- return this.#mimeType;
788
- }
789
-
790
- set mimeType(x: string) {
791
- this.#mimeType = x;
792
- if (x === Platform.MimeType.MimeType.EVENTSTREAM && !this.#serverSentEvents) {
793
- const parseFromStreamedData = this.resourceType() !== Common.ResourceType.resourceTypes.EventSource;
794
- this.#serverSentEvents = new ServerSentEvents(
795
- this,
796
- parseFromStreamedData,
797
- );
798
- }
799
- }
800
-
801
- get displayName(): string {
802
- return this.#parsedURL.displayName;
803
- }
804
-
805
- name(): string {
806
- if (this.#name) {
807
- return this.#name;
808
- }
809
- this.parseNameAndPathFromURL();
810
- return this.#name as string;
811
- }
812
-
813
- path(): string {
814
- if (this.#path) {
815
- return this.#path;
816
- }
817
- this.parseNameAndPathFromURL();
818
- return this.#path as string;
819
- }
820
-
821
- private parseNameAndPathFromURL(): void {
822
- if (this.#parsedURL.isDataURL()) {
823
- this.#name = this.#parsedURL.dataURLDisplayName();
824
- this.#path = '';
825
- } else if (this.#parsedURL.isBlobURL()) {
826
- this.#name = this.#parsedURL.url;
827
- this.#path = '';
828
- } else if (this.#parsedURL.isAboutBlank()) {
829
- this.#name = this.#parsedURL.url;
830
- this.#path = '';
831
- } else {
832
- this.#path = this.#parsedURL.host + this.#parsedURL.folderPathComponents;
833
-
834
- const networkManager = NetworkManager.forRequest(this);
835
- const inspectedURL = networkManager ? Common.ParsedURL.ParsedURL.fromString(
836
- networkManager.target().inspectedURL(),
837
- ) :
838
- null;
839
- this.#path = Platform.StringUtilities.trimURL(
840
- this.#path,
841
- inspectedURL ? inspectedURL.host : '',
842
- );
843
- if (this.#parsedURL.lastPathComponent || this.#parsedURL.queryParams) {
844
- this.#name =
845
- this.#parsedURL.lastPathComponent + (this.#parsedURL.queryParams ? '?' + this.#parsedURL.queryParams : '');
846
- } else if (this.#parsedURL.folderPathComponents) {
847
- this.#name = this.#parsedURL.folderPathComponents.substring(
848
- this.#parsedURL.folderPathComponents.lastIndexOf('/') + 1,
849
- ) +
850
- '/';
851
- this.#path = this.#path.substring(
852
- 0,
853
- this.#path.lastIndexOf('/'),
854
- );
855
- } else {
856
- this.#name = this.#parsedURL.host;
857
- this.#path = '';
858
- }
859
- }
860
- }
861
-
862
- get folder(): string {
863
- let path: string = this.#parsedURL.path;
864
- const indexOfQuery = path.indexOf('?');
865
- if (indexOfQuery !== -1) {
866
- path = path.substring(0, indexOfQuery);
867
- }
868
- const lastSlashIndex = path.lastIndexOf('/');
869
- return lastSlashIndex !== -1 ? path.substring(0, lastSlashIndex) : '';
870
- }
871
-
872
- get pathname(): string {
873
- return this.#parsedURL.path;
874
- }
875
-
876
- resourceType(): Common.ResourceType.ResourceType {
877
- return this.#resourceType;
878
- }
879
-
880
- setResourceType(resourceType: Common.ResourceType.ResourceType): void {
881
- this.#resourceType = resourceType;
882
- }
883
-
884
- get domain(): string {
885
- return this.#parsedURL.host;
886
- }
887
-
888
- get scheme(): string {
889
- return this.#parsedURL.scheme;
890
- }
891
-
892
- getInferredStatusText(): string {
893
- return (this.statusText || HttpReasonPhraseStrings.getStatusText(this.statusCode));
894
- }
895
-
896
- redirectSource(): NetworkRequest|null {
897
- return this.#redirectSource;
898
- }
899
-
900
- setRedirectSource(originatingRequest: NetworkRequest|null): void {
901
- this.#redirectSource = originatingRequest;
902
- }
903
-
904
- preflightRequest(): NetworkRequest|null {
905
- return this.#preflightRequest;
906
- }
907
-
908
- setPreflightRequest(preflightRequest: NetworkRequest|null): void {
909
- this.#preflightRequest = preflightRequest;
910
- }
911
-
912
- preflightInitiatorRequest(): NetworkRequest|null {
913
- return this.#preflightInitiatorRequest;
914
- }
915
-
916
- setPreflightInitiatorRequest(
917
- preflightInitiatorRequest: NetworkRequest|null,
918
- ): void {
919
- this.#preflightInitiatorRequest = preflightInitiatorRequest;
920
- }
921
-
922
- isPreflightRequest(): boolean {
923
- return (
924
- this.#initiator !== null && this.#initiator !== undefined &&
925
- this.#initiator.type === Protocol.Network.InitiatorType.Preflight);
926
- }
927
-
928
- redirectDestination(): NetworkRequest|null {
929
- return this.#redirectDestination;
930
- }
931
-
932
- setRedirectDestination(redirectDestination: NetworkRequest|null): void {
933
- this.#redirectDestination = redirectDestination;
934
- }
935
-
936
- requestHeaders(): NameValue[] {
937
- return this.#requestHeaders;
938
- }
939
-
940
- setRequestHeaders(headers: NameValue[]): void {
941
- this.#requestHeaders = headers;
942
-
943
- this.dispatchEventToListeners(Events.REQUEST_HEADERS_CHANGED);
944
- }
945
-
946
- requestHeadersText(): string|undefined {
947
- return this.#requestHeadersText;
948
- }
949
-
950
- setRequestHeadersText(text: string): void {
951
- this.#requestHeadersText = text;
952
-
953
- this.dispatchEventToListeners(Events.REQUEST_HEADERS_CHANGED);
954
- }
955
-
956
- requestHeaderValue(headerName: string): string|undefined {
957
- if (this.#requestHeaderValues[headerName]) {
958
- return this.#requestHeaderValues[headerName];
959
- }
960
- this.#requestHeaderValues[headerName] = this.computeHeaderValue(
961
- this.requestHeaders(),
962
- headerName,
963
- );
964
- return this.#requestHeaderValues[headerName];
965
- }
966
-
967
- requestFormData(): Promise<string|null> {
968
- if (!this.#requestFormDataPromise) {
969
- this.#requestFormDataPromise = NetworkManager.requestPostData(this);
970
- }
971
- return this.#requestFormDataPromise;
972
- }
973
-
974
- setRequestFormData(hasData: boolean, data: string|null): void {
975
- this.#requestFormDataPromise = hasData && data === null ? null : Promise.resolve(data);
976
- this.#formParametersPromise = null;
977
- }
978
-
979
- private filteredProtocolName(): string {
980
- const protocol = this.protocol.toLowerCase();
981
- if (protocol === 'h2') {
982
- return 'http/2.0';
983
- }
984
- return protocol.replace(/^http\/2(\.0)?\+/, 'http/2.0+');
985
- }
986
-
987
- requestHttpVersion(): string {
988
- const headersText = this.requestHeadersText();
989
- if (!headersText) {
990
- const version = this.requestHeaderValue('version') || this.requestHeaderValue(':version');
991
- if (version) {
992
- return version;
993
- }
994
- return this.filteredProtocolName();
995
- }
996
- const firstLine = headersText.split(/\r\n/)[0];
997
- const match = firstLine.match(/(HTTP\/\d+\.\d+)$/);
998
- return match ? match[1] : 'HTTP/0.9';
999
- }
1000
-
1001
- get responseHeaders(): NameValue[] {
1002
- return this.#responseHeaders || [];
1003
- }
1004
-
1005
- set responseHeaders(x: NameValue[]) {
1006
- this.#responseHeaders = x;
1007
- this.#sortedResponseHeaders = undefined;
1008
- this.#serverTimings = undefined;
1009
- this.#responseCookies = undefined;
1010
- this.#responseHeaderValues = {};
1011
-
1012
- this.dispatchEventToListeners(Events.RESPONSE_HEADERS_CHANGED);
1013
- }
1014
-
1015
- get earlyHintsHeaders(): NameValue[] {
1016
- return this.#earlyHintsHeaders || [];
1017
- }
1018
-
1019
- set earlyHintsHeaders(x: NameValue[]) {
1020
- this.#earlyHintsHeaders = x;
1021
- }
1022
-
1023
- get originalResponseHeaders(): Protocol.Fetch.HeaderEntry[] {
1024
- return this.#originalResponseHeaders;
1025
- }
1026
-
1027
- set originalResponseHeaders(headers: Protocol.Fetch.HeaderEntry[]) {
1028
- this.#originalResponseHeaders = headers;
1029
- this.#sortedOriginalResponseHeaders = undefined;
1030
- }
1031
-
1032
- get setCookieHeaders(): Protocol.Fetch.HeaderEntry[] {
1033
- return this.#setCookieHeaders;
1034
- }
1035
-
1036
- set setCookieHeaders(headers: Protocol.Fetch.HeaderEntry[]) {
1037
- this.#setCookieHeaders = headers;
1038
- }
1039
-
1040
- get responseHeadersText(): string {
1041
- return this.#responseHeadersText;
1042
- }
1043
-
1044
- set responseHeadersText(x: string) {
1045
- this.#responseHeadersText = x;
1046
-
1047
- this.dispatchEventToListeners(Events.RESPONSE_HEADERS_CHANGED);
1048
- }
1049
-
1050
- get sortedResponseHeaders(): NameValue[] {
1051
- if (this.#sortedResponseHeaders !== undefined) {
1052
- return this.#sortedResponseHeaders;
1053
- }
1054
-
1055
- this.#sortedResponseHeaders = this.responseHeaders.slice();
1056
- return this.#sortedResponseHeaders.sort(function(a, b) {
1057
- return Platform.StringUtilities.compare(
1058
- a.name.toLowerCase(),
1059
- b.name.toLowerCase(),
1060
- );
1061
- });
1062
- }
1063
-
1064
- get sortedOriginalResponseHeaders(): NameValue[] {
1065
- if (this.#sortedOriginalResponseHeaders !== undefined) {
1066
- return this.#sortedOriginalResponseHeaders;
1067
- }
1068
-
1069
- this.#sortedOriginalResponseHeaders = this.originalResponseHeaders.slice();
1070
- return this.#sortedOriginalResponseHeaders.sort(function(a, b) {
1071
- return Platform.StringUtilities.compare(
1072
- a.name.toLowerCase(),
1073
- b.name.toLowerCase(),
1074
- );
1075
- });
1076
- }
1077
-
1078
- get overrideTypes(): OverrideType[] {
1079
- const types: OverrideType[] = [];
1080
-
1081
- if (this.hasOverriddenContent) {
1082
- types.push('content');
1083
- }
1084
-
1085
- if (this.hasOverriddenHeaders()) {
1086
- types.push('headers');
1087
- }
1088
-
1089
- return types;
1090
- }
1091
-
1092
- get hasOverriddenContent(): boolean {
1093
- return this.#hasOverriddenContent;
1094
- }
1095
-
1096
- set hasOverriddenContent(value: boolean) {
1097
- this.#hasOverriddenContent = value;
1098
- }
1099
-
1100
- #deduplicateHeaders(sortedHeaders: NameValue[]): NameValue[] {
1101
- const dedupedHeaders: NameValue[] = [];
1102
- for (const header of sortedHeaders) {
1103
- if (dedupedHeaders.length && dedupedHeaders[dedupedHeaders.length - 1].name === header.name) {
1104
- dedupedHeaders[dedupedHeaders.length - 1].value += `, ${header.value}`;
1105
- } else {
1106
- dedupedHeaders.push({name: header.name, value: header.value});
1107
- }
1108
- }
1109
- return dedupedHeaders;
1110
- }
1111
-
1112
- hasOverriddenHeaders(): boolean {
1113
- if (!this.#originalResponseHeaders.length) {
1114
- return false;
1115
- }
1116
- const responseHeaders = this.#deduplicateHeaders(
1117
- this.sortedResponseHeaders,
1118
- );
1119
- const originalResponseHeaders = this.#deduplicateHeaders(
1120
- this.sortedOriginalResponseHeaders,
1121
- );
1122
- if (responseHeaders.length !== originalResponseHeaders.length) {
1123
- return true;
1124
- }
1125
- for (let i = 0; i < responseHeaders.length; i++) {
1126
- if (responseHeaders[i].name.toLowerCase() !== originalResponseHeaders[i].name.toLowerCase()) {
1127
- return true;
1128
- }
1129
- if (responseHeaders[i].value !== originalResponseHeaders[i].value) {
1130
- return true;
1131
- }
1132
- }
1133
- return false;
1134
- }
1135
-
1136
- responseHeaderValue(headerName: string): string|undefined {
1137
- if (headerName in this.#responseHeaderValues) {
1138
- return this.#responseHeaderValues[headerName];
1139
- }
1140
- this.#responseHeaderValues[headerName] = this.computeHeaderValue(
1141
- this.responseHeaders,
1142
- headerName,
1143
- );
1144
- return this.#responseHeaderValues[headerName];
1145
- }
1146
-
1147
- wasIntercepted(): boolean {
1148
- return this.#wasIntercepted;
1149
- }
1150
-
1151
- setWasIntercepted(wasIntercepted: boolean): void {
1152
- this.#wasIntercepted = wasIntercepted;
1153
- }
1154
-
1155
- setEarlyHintsHeaders(headers: NameValue[]): void {
1156
- this.earlyHintsHeaders = headers;
1157
- }
1158
-
1159
- get responseCookies(): Cookie[] {
1160
- if (!this.#responseCookies) {
1161
- this.#responseCookies = CookieParser.parseSetCookie(
1162
- this.responseHeaderValue('Set-Cookie'),
1163
- this.domain,
1164
- ) ||
1165
- [];
1166
- if (this.#responseCookiesPartitionKey) {
1167
- for (const cookie of this.#responseCookies) {
1168
- if (cookie.partitioned()) {
1169
- cookie.setPartitionKey(
1170
- this.#responseCookiesPartitionKey.topLevelSite,
1171
- this.#responseCookiesPartitionKey.hasCrossSiteAncestor,
1172
- );
1173
- }
1174
- }
1175
- } else if (this.#responseCookiesPartitionKeyOpaque) {
1176
- for (const cookie of this.#responseCookies) {
1177
- // Do not check cookie.partitioned() since most opaque partitions
1178
- // are fenced/credentialless frames partitioned by default.
1179
- cookie.setPartitionKeyOpaque();
1180
- }
1181
- }
1182
- }
1183
- return this.#responseCookies;
1184
- }
1185
-
1186
- set responseCookies(responseCookies: Cookie[]) {
1187
- this.#responseCookies = responseCookies;
1188
- }
1189
-
1190
- responseLastModified(): string|undefined {
1191
- return this.responseHeaderValue('last-modified');
1192
- }
1193
-
1194
- allCookiesIncludingBlockedOnes(): Cookie[] {
1195
- return [
1196
- ...this.includedRequestCookies().map(
1197
- includedRequestCookie => includedRequestCookie.cookie,
1198
- ),
1199
- ...this.responseCookies,
1200
- ...this.blockedRequestCookies().map(
1201
- blockedRequestCookie => blockedRequestCookie.cookie,
1202
- ),
1203
- ...this.blockedResponseCookies().map(
1204
- blockedResponseCookie => blockedResponseCookie.cookie,
1205
- ),
1206
- ].filter(v => !!v);
1207
- }
1208
-
1209
- get serverTimings(): ServerTiming[]|null {
1210
- if (typeof this.#serverTimings === 'undefined') {
1211
- this.#serverTimings = ServerTiming.parseHeaders(
1212
- this.responseHeaders,
1213
- );
1214
- }
1215
- return this.#serverTimings;
1216
- }
1217
-
1218
- queryString(): string|null {
1219
- if (this.#queryString !== undefined) {
1220
- return this.#queryString;
1221
- }
1222
-
1223
- let queryString: string|null = null;
1224
- const url = this.url();
1225
- const questionMarkPosition = url.indexOf('?');
1226
- if (questionMarkPosition !== -1) {
1227
- queryString = url.substring(questionMarkPosition + 1);
1228
- const hashSignPosition = queryString.indexOf('#');
1229
- if (hashSignPosition !== -1) {
1230
- queryString = queryString.substring(0, hashSignPosition);
1231
- }
1232
- }
1233
- this.#queryString = queryString;
1234
- return this.#queryString;
1235
- }
1236
-
1237
- get queryParameters(): NameValue[]|null {
1238
- if (this.#parsedQueryParameters) {
1239
- return this.#parsedQueryParameters;
1240
- }
1241
- const queryString = this.queryString();
1242
- if (!queryString) {
1243
- return null;
1244
- }
1245
- this.#parsedQueryParameters = this.parseParameters(queryString);
1246
- return this.#parsedQueryParameters;
1247
- }
1248
-
1249
- private async parseFormParameters(): Promise<NameValue[]|null> {
1250
- const requestContentType = this.requestContentType();
1251
-
1252
- if (!requestContentType) {
1253
- return null;
1254
- }
1255
-
1256
- // Handling application/#x-www-form-urlencoded request bodies.
1257
- if (requestContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) {
1258
- const formData = await this.requestFormData();
1259
- if (!formData) {
1260
- return null;
1261
- }
1262
-
1263
- return this.parseParameters(formData);
1264
- }
1265
-
1266
- // Handling multipart/form-data request bodies.
1267
- const multipartDetails = requestContentType.match(
1268
- /^multipart\/form-data\s*;\s*boundary\s*=\s*(\S+)\s*$/,
1269
- );
1270
-
1271
- if (!multipartDetails) {
1272
- return null;
1273
- }
1274
-
1275
- const boundary = multipartDetails[1];
1276
- if (!boundary) {
1277
- return null;
1278
- }
1279
-
1280
- const formData = await this.requestFormData();
1281
- if (!formData) {
1282
- return null;
1283
- }
1284
-
1285
- return this.parseMultipartFormDataParameters(formData, boundary);
1286
- }
1287
-
1288
- formParameters(): Promise<NameValue[]|null> {
1289
- if (!this.#formParametersPromise) {
1290
- this.#formParametersPromise = this.parseFormParameters();
1291
- }
1292
- return this.#formParametersPromise;
1293
- }
1294
-
1295
- responseHttpVersion(): string {
1296
- const headersText = this.#responseHeadersText;
1297
- if (!headersText) {
1298
- const version = this.responseHeaderValue('version') || this.responseHeaderValue(':version');
1299
- if (version) {
1300
- return version;
1301
- }
1302
- return this.filteredProtocolName();
1303
- }
1304
- const firstLine = headersText.split(/\r\n/)[0];
1305
- const match = firstLine.match(/^(HTTP\/\d+\.\d+)/);
1306
- return match ? match[1] : 'HTTP/0.9';
1307
- }
1308
-
1309
- private parseParameters(queryString: string): NameValue[] {
1310
- function parseNameValue(pair: string): {name: string, value: string} {
1311
- const position = pair.indexOf('=');
1312
- if (position === -1) {
1313
- return {name: pair, value: ''};
1314
- }
1315
- return {
1316
- name: pair.substring(0, position),
1317
- value: pair.substring(position + 1),
1318
- };
1319
- }
1320
- return queryString.split('&').map(parseNameValue);
1321
- }
1322
-
1323
- /**
1324
- * Parses multipart/form-data; boundary=boundaryString request bodies -
1325
- * --boundaryString
1326
- * Content-Disposition: form-data; #name="field-#name"; filename="r.gif"
1327
- * Content-Type: application/octet-stream
1328
- *
1329
- * optionalValue
1330
- * --boundaryString
1331
- * Content-Disposition: form-data; #name="field-#name-2"
1332
- *
1333
- * optionalValue2
1334
- * --boundaryString--
1335
- */
1336
- private parseMultipartFormDataParameters(
1337
- data: string,
1338
- boundary: string,
1339
- ): NameValue[] {
1340
- const sanitizedBoundary = Platform.StringUtilities.escapeForRegExp(boundary);
1341
- const keyValuePattern = new RegExp(
1342
- // Header with an optional file #name.
1343
- '^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?' +
1344
- // Optional secondary header with the content type.
1345
- '(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?' +
1346
- // Padding.
1347
- '\\r\\n\\r\\n' +
1348
- // Value
1349
- '(.*)' +
1350
- // Padding.
1351
- '\\r\\n$',
1352
- 'is',
1353
- );
1354
- const fields = data.split(
1355
- new RegExp(`--${sanitizedBoundary}(?:--\s*$)?`, 'g'),
1356
- );
1357
- return fields.reduce(parseMultipartField, []);
1358
-
1359
- function parseMultipartField(
1360
- result: NameValue[],
1361
- field: string,
1362
- ): NameValue[] {
1363
- const [match, name, filename, contentType, value] = field.match(keyValuePattern) || [];
1364
-
1365
- if (!match) {
1366
- return result;
1367
- }
1368
-
1369
- const processedValue = filename || contentType ? i18nString(UIStrings.binary) : value;
1370
- result.push({name, value: processedValue});
1371
-
1372
- return result;
1373
- }
1374
- }
1375
-
1376
- private computeHeaderValue(
1377
- headers: NameValue[],
1378
- headerName: string,
1379
- ): string|undefined {
1380
- headerName = headerName.toLowerCase();
1381
-
1382
- const values = [];
1383
- for (let i = 0; i < headers.length; ++i) {
1384
- if (headers[i].name.toLowerCase() === headerName) {
1385
- values.push(headers[i].value);
1386
- }
1387
- }
1388
- if (!values.length) {
1389
- return undefined;
1390
- }
1391
- // Set-Cookie #values should be separated by '\n', not comma, otherwise cookies could not be parsed.
1392
- if (headerName === 'set-cookie') {
1393
- return values.join('\n');
1394
- }
1395
- return values.join(', ');
1396
- }
1397
-
1398
- requestContentData(): Promise<TextUtils.ContentData.ContentDataOrError> {
1399
- if (this.#contentData) {
1400
- return this.#contentData;
1401
- }
1402
- if (this.#contentDataProvider) {
1403
- this.#contentData = this.#contentDataProvider();
1404
- } else {
1405
- this.#contentData = NetworkManager.requestContentData(this);
1406
- }
1407
- return this.#contentData;
1408
- }
1409
-
1410
- setContentDataProvider(
1411
- dataProvider: () => Promise<TextUtils.ContentData.ContentDataOrError>,
1412
- ): void {
1413
- console.assert(
1414
- !this.#contentData,
1415
- 'contentData can only be set once.',
1416
- );
1417
- this.#contentDataProvider = dataProvider;
1418
- }
1419
-
1420
- requestStreamingContent(): Promise<TextUtils.StreamingContentData.StreamingContentDataOrError> {
1421
- if (this.#streamingContentData) {
1422
- return this.#streamingContentData;
1423
- }
1424
-
1425
- const contentPromise = this.finished ? this.requestContentData() : NetworkManager.streamResponseBody(this);
1426
- this.#streamingContentData = contentPromise.then(contentData => {
1427
- if (TextUtils.ContentData.ContentData.isError(contentData)) {
1428
- return contentData;
1429
- }
1430
- // Note that this is save: "streamResponseBody()" always creates base64-based ContentData and
1431
- // for "contentData()" we'll never call "addChunk".
1432
- return TextUtils.StreamingContentData.StreamingContentData.from(
1433
- contentData,
1434
- );
1435
- });
1436
-
1437
- return this.#streamingContentData;
1438
- }
1439
-
1440
- contentURL(): Platform.DevToolsPath.UrlString {
1441
- return this.#url;
1442
- }
1443
-
1444
- contentType(): Common.ResourceType.ResourceType {
1445
- return this.#resourceType;
1446
- }
1447
-
1448
- async searchInContent(
1449
- query: string,
1450
- caseSensitive: boolean,
1451
- isRegex: boolean,
1452
- ): Promise<TextUtils.ContentProvider.SearchMatch[]> {
1453
- if (!this.#contentDataProvider) {
1454
- return await NetworkManager.searchInRequest(
1455
- this,
1456
- query,
1457
- caseSensitive,
1458
- isRegex,
1459
- );
1460
- }
1461
-
1462
- const contentData = await this.requestContentData();
1463
- if (TextUtils.ContentData.ContentData.isError(contentData) || !contentData.isTextContent) {
1464
- return [];
1465
- }
1466
- return TextUtils.TextUtils.performSearchInContentData(
1467
- contentData,
1468
- query,
1469
- caseSensitive,
1470
- isRegex,
1471
- );
1472
- }
1473
-
1474
- requestContentType(): string|undefined {
1475
- return this.requestHeaderValue('Content-Type');
1476
- }
1477
-
1478
- hasErrorStatusCode(): boolean {
1479
- return this.statusCode >= 400;
1480
- }
1481
-
1482
- setInitialPriority(priority: Protocol.Network.ResourcePriority): void {
1483
- this.#initialPriority = priority;
1484
- }
1485
-
1486
- initialPriority(): Protocol.Network.ResourcePriority|null {
1487
- return this.#initialPriority;
1488
- }
1489
-
1490
- setPriority(priority: Protocol.Network.ResourcePriority): void {
1491
- this.#currentPriority = priority;
1492
- }
1493
-
1494
- priority(): Protocol.Network.ResourcePriority|null {
1495
- return this.#currentPriority || this.#initialPriority || null;
1496
- }
1497
-
1498
- setSignedExchangeInfo(info: Protocol.Network.SignedExchangeInfo): void {
1499
- this.#signedExchangeInfo = info;
1500
- }
1501
-
1502
- signedExchangeInfo(): Protocol.Network.SignedExchangeInfo|null {
1503
- return this.#signedExchangeInfo;
1504
- }
1505
-
1506
- async populateImageSource(image: HTMLImageElement): Promise<void> {
1507
- const contentData = await this.requestContentData();
1508
- if (TextUtils.ContentData.ContentData.isError(contentData)) {
1509
- return;
1510
- }
1511
- let imageSrc = contentData.asDataUrl();
1512
- if (imageSrc === null && !this.#failed) {
1513
- const cacheControl = this.responseHeaderValue('cache-control') || '';
1514
- if (!cacheControl.includes('no-cache')) {
1515
- imageSrc = this.#url;
1516
- }
1517
- }
1518
- if (imageSrc !== null) {
1519
- image.src = imageSrc;
1520
- }
1521
- }
1522
-
1523
- initiator(): Protocol.Network.Initiator|null {
1524
- return this.#initiator || null;
1525
- }
1526
-
1527
- hasUserGesture(): boolean|null {
1528
- return this.#hasUserGesture ?? null;
1529
- }
1530
-
1531
- frames(): WebSocketFrame[] {
1532
- return this.#frames;
1533
- }
1534
-
1535
- addProtocolFrameError(errorMessage: string, time: number): void {
1536
- this.addFrame({
1537
- type: WebSocketFrameType.Error,
1538
- text: errorMessage,
1539
- time: this.pseudoWallTime(time),
1540
- opCode: -1,
1541
- mask: false,
1542
- });
1543
- }
1544
-
1545
- addProtocolFrame(
1546
- response: Protocol.Network.WebSocketFrame,
1547
- time: number,
1548
- sent: boolean,
1549
- ): void {
1550
- const type = sent ? WebSocketFrameType.Send : WebSocketFrameType.Receive;
1551
- this.addFrame({
1552
- type,
1553
- text: response.payloadData,
1554
- time: this.pseudoWallTime(time),
1555
- opCode: response.opcode,
1556
- mask: response.mask,
1557
- });
1558
- }
1559
-
1560
- addFrame(frame: WebSocketFrame): void {
1561
- this.#frames.push(frame);
1562
- this.dispatchEventToListeners(Events.WEBSOCKET_FRAME_ADDED, frame);
1563
- }
1564
-
1565
- directSocketChunks(): DirectSocketChunk[] {
1566
- return this.#directSocketChunks;
1567
- }
1568
-
1569
- addDirectSocketChunk(chunk: DirectSocketChunk): void {
1570
- this.#directSocketChunks.push(chunk);
1571
- this.dispatchEventToListeners(Events.DIRECTSOCKET_CHUNK_ADDED, chunk);
1572
- }
1573
-
1574
- eventSourceMessages(): readonly EventSourceMessage[] {
1575
- return this.#serverSentEvents?.eventSourceMessages ?? [];
1576
- }
1577
-
1578
- addEventSourceMessage(
1579
- time: number,
1580
- eventName: string,
1581
- eventId: string,
1582
- data: string,
1583
- ): void {
1584
- this.#serverSentEvents?.onProtocolEventSourceMessageReceived(
1585
- eventName,
1586
- data,
1587
- eventId,
1588
- this.pseudoWallTime(time),
1589
- );
1590
- }
1591
-
1592
- markAsRedirect(redirectCount: number): void {
1593
- this.#isRedirect = true;
1594
- this.#requestId = `${this.#backendRequestId}:redirected.${redirectCount}`;
1595
- }
1596
-
1597
- isRedirect(): boolean {
1598
- return this.#isRedirect;
1599
- }
1600
-
1601
- setRequestIdForTest(requestId: Protocol.Network.RequestId): void {
1602
- this.#backendRequestId = requestId;
1603
- this.#requestId = requestId;
1604
- }
1605
-
1606
- charset(): string|null {
1607
- return this.#charset ?? null;
1608
- }
1609
-
1610
- setCharset(charset: string): void {
1611
- this.#charset = charset;
1612
- }
1613
-
1614
- addExtraRequestInfo(extraRequestInfo: ExtraRequestInfo): void {
1615
- this.#blockedRequestCookies = extraRequestInfo.blockedRequestCookies;
1616
- this.setIncludedRequestCookies(extraRequestInfo.includedRequestCookies);
1617
- this.setRequestHeaders(extraRequestInfo.requestHeaders);
1618
- this.#hasExtraRequestInfo = true;
1619
- this.setRequestHeadersText(''); // Mark request headers as non-provisional
1620
- this.#clientSecurityState = extraRequestInfo.clientSecurityState;
1621
- this.#appliedNetworkConditionsId = extraRequestInfo.appliedNetworkConditionsId;
1622
- if (extraRequestInfo.connectTiming) {
1623
- this.setConnectTimingFromExtraInfo(extraRequestInfo.connectTiming);
1624
- }
1625
- this.#siteHasCookieInOtherPartition = extraRequestInfo.siteHasCookieInOtherPartition ?? false;
1626
-
1627
- this.#hasThirdPartyCookiePhaseoutIssue = this.#blockedRequestCookies.some(
1628
- item => item.blockedReasons.includes(
1629
- Protocol.Network.CookieBlockedReason.ThirdPartyPhaseout,
1630
- ),
1631
- );
1632
- }
1633
-
1634
- hasExtraRequestInfo(): boolean {
1635
- return this.#hasExtraRequestInfo;
1636
- }
1637
-
1638
- blockedRequestCookies(): BlockedCookieWithReason[] {
1639
- return this.#blockedRequestCookies;
1640
- }
1641
-
1642
- setIncludedRequestCookies(includedRequestCookies: IncludedCookieWithReason[]): void {
1643
- this.#includedRequestCookies = includedRequestCookies;
1644
- }
1645
-
1646
- includedRequestCookies(): IncludedCookieWithReason[] {
1647
- return this.#includedRequestCookies;
1648
- }
1649
-
1650
- hasRequestCookies(): boolean {
1651
- return (this.#includedRequestCookies.length > 0 || this.#blockedRequestCookies.length > 0);
1652
- }
1653
-
1654
- siteHasCookieInOtherPartition(): boolean {
1655
- return this.#siteHasCookieInOtherPartition;
1656
- }
1657
-
1658
- // Parse the status text from the first line of the response headers text.
1659
- // See net::HttpResponseHeaders::GetStatusText.
1660
- static parseStatusTextFromResponseHeadersText(
1661
- responseHeadersText: string,
1662
- ): string {
1663
- const firstLineParts = responseHeadersText.split('\r')[0].split(' ');
1664
- return firstLineParts.slice(2).join(' ');
1665
- }
1666
-
1667
- addExtraResponseInfo(extraResponseInfo: ExtraResponseInfo): void {
1668
- this.#blockedResponseCookies = extraResponseInfo.blockedResponseCookies;
1669
- if (extraResponseInfo.exemptedResponseCookies) {
1670
- this.#exemptedResponseCookies = extraResponseInfo.exemptedResponseCookies;
1671
- }
1672
- this.#responseCookiesPartitionKey =
1673
- extraResponseInfo.cookiePartitionKey ? extraResponseInfo.cookiePartitionKey : null;
1674
- this.#responseCookiesPartitionKeyOpaque = extraResponseInfo.cookiePartitionKeyOpaque || null;
1675
- this.responseHeaders = extraResponseInfo.responseHeaders;
1676
- // We store a copy of the headers we initially received, so that after
1677
- // potential header overrides, we can compare actual with original headers.
1678
- this.originalResponseHeaders = extraResponseInfo.responseHeaders.map(
1679
- headerEntry => ({...headerEntry}),
1680
- );
1681
-
1682
- if (extraResponseInfo.responseHeadersText) {
1683
- this.responseHeadersText = extraResponseInfo.responseHeadersText;
1684
-
1685
- if (!this.requestHeadersText()) {
1686
- // Generate request headers text from raw headers in extra request info because
1687
- // Network.requestWillBeSentExtraInfo doesn't include headers text.
1688
- let requestHeadersText = `${this.requestMethod} ${this.parsedURL.path}`;
1689
- if (this.parsedURL.queryParams) {
1690
- requestHeadersText += `?${this.parsedURL.queryParams}`;
1691
- }
1692
- requestHeadersText += ' HTTP/1.1\r\n';
1693
-
1694
- for (const {name, value} of this.requestHeaders()) {
1695
- requestHeadersText += `${name}: ${value}\r\n`;
1696
- }
1697
- this.setRequestHeadersText(requestHeadersText);
1698
- }
1699
-
1700
- this.statusText = NetworkRequest.parseStatusTextFromResponseHeadersText(
1701
- extraResponseInfo.responseHeadersText,
1702
- );
1703
- }
1704
- this.#remoteAddressSpace = extraResponseInfo.resourceIPAddressSpace;
1705
-
1706
- if (extraResponseInfo.statusCode) {
1707
- this.statusCode = extraResponseInfo.statusCode;
1708
- }
1709
-
1710
- this.#hasExtraResponseInfo = true;
1711
-
1712
- // TODO(crbug.com/1252463) Explore replacing this with a DevTools Issue.
1713
- const networkManager = NetworkManager.forRequest(this);
1714
- if (!networkManager) {
1715
- return;
1716
- }
1717
- for (const blockedCookie of this.#blockedResponseCookies) {
1718
- if (blockedCookie.blockedReasons.includes(
1719
- Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize,
1720
- )) {
1721
- const message = i18nString(UIStrings.setcookieHeaderIsIgnoredIn, {
1722
- PH1: this.url(),
1723
- });
1724
- networkManager.dispatchEventToListeners(
1725
- NetworkManagerEvents.MessageGenerated,
1726
- {message, requestId: this.#requestId, warning: true},
1727
- );
1728
- }
1729
- }
1730
-
1731
- const cookieModel = networkManager.target().model(CookieModel);
1732
- if (!cookieModel) {
1733
- return;
1734
- }
1735
- for (const exemptedCookie of this.#exemptedResponseCookies) {
1736
- cookieModel.removeBlockedCookie(exemptedCookie.cookie);
1737
- }
1738
- for (const blockedCookie of this.#blockedResponseCookies) {
1739
- const cookie = blockedCookie.cookie;
1740
- if (!cookie) {
1741
- continue;
1742
- }
1743
- if (blockedCookie.blockedReasons.includes(
1744
- Protocol.Network.SetCookieBlockedReason.ThirdPartyPhaseout,
1745
- )) {
1746
- this.#hasThirdPartyCookiePhaseoutIssue = true;
1747
- }
1748
- cookieModel.addBlockedCookie(
1749
- cookie,
1750
- blockedCookie.blockedReasons.map(blockedReason => ({
1751
- attribute: setCookieBlockedReasonToAttribute(blockedReason),
1752
- uiString: setCookieBlockedReasonToUiString(blockedReason),
1753
- })),
1754
- );
1755
- }
1756
- }
1757
-
1758
- hasExtraResponseInfo(): boolean {
1759
- return this.#hasExtraResponseInfo;
1760
- }
1761
-
1762
- blockedResponseCookies(): BlockedSetCookieWithReason[] {
1763
- return this.#blockedResponseCookies;
1764
- }
1765
-
1766
- exemptedResponseCookies(): ExemptedSetCookieWithReason[] {
1767
- return this.#exemptedResponseCookies;
1768
- }
1769
-
1770
- nonBlockedResponseCookies(): Cookie[] {
1771
- const blockedCookieLines: Array<string|null> = this.blockedResponseCookies().map(
1772
- blockedCookie => blockedCookie.cookieLine,
1773
- );
1774
- // Use array and remove 1 by 1 to handle the (potential) case of multiple
1775
- // identical cookies, only some of which are blocked.
1776
- const responseCookies = this.responseCookies.filter(cookie => {
1777
- const index = blockedCookieLines.indexOf(cookie.getCookieLine());
1778
- if (index !== -1) {
1779
- blockedCookieLines[index] = null;
1780
- return false;
1781
- }
1782
- return true;
1783
- });
1784
- return responseCookies;
1785
- }
1786
-
1787
- responseCookiesPartitionKey(): Protocol.Network.CookiePartitionKey|null {
1788
- return this.#responseCookiesPartitionKey;
1789
- }
1790
-
1791
- responseCookiesPartitionKeyOpaque(): boolean|null {
1792
- return this.#responseCookiesPartitionKeyOpaque;
1793
- }
1794
-
1795
- redirectSourceSignedExchangeInfoHasNoErrors(): boolean {
1796
- return (
1797
- this.#redirectSource !== null && this.#redirectSource.#signedExchangeInfo !== null &&
1798
- !this.#redirectSource.#signedExchangeInfo.errors);
1799
- }
1800
-
1801
- clientSecurityState(): Protocol.Network.ClientSecurityState|undefined {
1802
- return this.#clientSecurityState;
1803
- }
1804
-
1805
- setTrustTokenParams(
1806
- trustTokenParams: Protocol.Network.TrustTokenParams,
1807
- ): void {
1808
- this.#trustTokenParams = trustTokenParams;
1809
- }
1810
-
1811
- trustTokenParams(): Protocol.Network.TrustTokenParams|undefined {
1812
- return this.#trustTokenParams;
1813
- }
1814
-
1815
- setTrustTokenOperationDoneEvent(
1816
- doneEvent: Protocol.Network.TrustTokenOperationDoneEvent,
1817
- ): void {
1818
- this.#trustTokenOperationDoneEvent = doneEvent;
1819
-
1820
- this.dispatchEventToListeners(Events.TRUST_TOKEN_RESULT_ADDED);
1821
- }
1822
-
1823
- trustTokenOperationDoneEvent():|Protocol.Network.TrustTokenOperationDoneEvent|undefined {
1824
- return this.#trustTokenOperationDoneEvent;
1825
- }
1826
-
1827
- setIsSameSite(isSameSite: boolean): void {
1828
- this.#isSameSite = isSameSite;
1829
- }
1830
-
1831
- isSameSite(): boolean|null {
1832
- return this.#isSameSite;
1833
- }
1834
-
1835
- setIsIpProtectionUsed(isIpProtectionUsed: boolean): void {
1836
- this.#isIpProtectionUsed = isIpProtectionUsed;
1837
- }
1838
-
1839
- isIpProtectionUsed(): boolean|null {
1840
- return this.#isIpProtectionUsed;
1841
- }
1842
-
1843
- setIsAdRelated(isAdRelated: boolean): void {
1844
- this.#isAdRelated = isAdRelated;
1845
- }
1846
-
1847
- isAdRelated(): boolean {
1848
- return this.#isAdRelated;
1849
- }
1850
-
1851
- getAssociatedData(key: string): object|null {
1852
- return this.#associatedData.get(key) || null;
1853
- }
1854
-
1855
- setAssociatedData(key: string, data: object): void {
1856
- this.#associatedData.set(key, data);
1857
- }
1858
-
1859
- deleteAssociatedData(key: string): void {
1860
- this.#associatedData.delete(key);
1861
- }
1862
-
1863
- hasThirdPartyCookiePhaseoutIssue(): boolean {
1864
- return this.#hasThirdPartyCookiePhaseoutIssue;
1865
- }
1866
-
1867
- addDataReceivedEvent({
1868
- timestamp,
1869
- dataLength,
1870
- encodedDataLength,
1871
- data,
1872
- }: Protocol.Network.DataReceivedEvent): void {
1873
- this.resourceSize += dataLength;
1874
- if (encodedDataLength !== -1) {
1875
- this.increaseTransferSize(encodedDataLength);
1876
- }
1877
- this.endTime = timestamp;
1878
- if (data) {
1879
- void this.#streamingContentData?.then(contentData => {
1880
- if (!TextUtils.StreamingContentData.isError(contentData)) {
1881
- contentData.addChunk(data);
1882
- }
1883
- });
1884
- }
1885
- }
1886
-
1887
- waitForResponseReceived(): Promise<void> {
1888
- if (this.responseReceivedPromise) {
1889
- return this.responseReceivedPromise;
1890
- }
1891
- const {promise, resolve} = Promise.withResolvers<void>();
1892
- this.responseReceivedPromise = promise;
1893
- this.responseReceivedPromiseResolve = resolve;
1894
- return this.responseReceivedPromise;
1895
- }
1896
- }
1897
-
1898
- export enum Events {
1899
- FINISHED_LOADING = 'FinishedLoading',
1900
- TIMING_CHANGED = 'TimingChanged',
1901
- REMOTE_ADDRESS_CHANGED = 'RemoteAddressChanged',
1902
- REQUEST_HEADERS_CHANGED = 'RequestHeadersChanged',
1903
- RESPONSE_HEADERS_CHANGED = 'ResponseHeadersChanged',
1904
- WEBSOCKET_FRAME_ADDED = 'WebsocketFrameAdded',
1905
- DIRECTSOCKET_CHUNK_ADDED = 'DirectsocketChunkAdded',
1906
- EVENT_SOURCE_MESSAGE_ADDED = 'EventSourceMessageAdded',
1907
- TRUST_TOKEN_RESULT_ADDED = 'TrustTokenResultAdded',
1908
- }
1909
-
1910
- export interface EventTypes {
1911
- [Events.FINISHED_LOADING]: NetworkRequest;
1912
- [Events.TIMING_CHANGED]: NetworkRequest;
1913
- [Events.REMOTE_ADDRESS_CHANGED]: NetworkRequest;
1914
- [Events.REQUEST_HEADERS_CHANGED]: void;
1915
- [Events.RESPONSE_HEADERS_CHANGED]: void;
1916
- [Events.WEBSOCKET_FRAME_ADDED]: WebSocketFrame;
1917
- [Events.DIRECTSOCKET_CHUNK_ADDED]: DirectSocketChunk;
1918
- [Events.DIRECTSOCKET_CHUNK_ADDED]: DirectSocketChunk;
1919
- [Events.EVENT_SOURCE_MESSAGE_ADDED]: EventSourceMessage;
1920
- [Events.TRUST_TOKEN_RESULT_ADDED]: void;
1921
- }
1922
-
1923
- export const enum InitiatorType {
1924
- OTHER = 'other',
1925
- PARSER = 'parser',
1926
- REDIRECT = 'redirect',
1927
- SCRIPT = 'script',
1928
- PRELOAD = 'preload',
1929
- SIGNED_EXCHANGE = 'signedExchange',
1930
- PREFLIGHT = 'preflight',
1931
- }
1932
-
1933
- export enum WebSocketFrameType {
1934
- /* eslint-disable @typescript-eslint/naming-convention -- Used by web_tests. */
1935
- Send = 'send',
1936
- Receive = 'receive',
1937
- Error = 'error',
1938
- /* eslint-enable @typescript-eslint/naming-convention */
1939
- }
1940
-
1941
- export const cookieExemptionReasonToUiString = function(
1942
- exemptionReason: Protocol.Network.CookieExemptionReason,
1943
- ): string {
1944
- switch (exemptionReason) {
1945
- case Protocol.Network.CookieExemptionReason.UserSetting:
1946
- return i18nString(UIStrings.exemptionReasonUserSetting);
1947
- case Protocol.Network.CookieExemptionReason.TPCDMetadata:
1948
- return i18nString(UIStrings.exemptionReasonTPCDMetadata);
1949
- case Protocol.Network.CookieExemptionReason.TopLevelTPCDDeprecationTrial:
1950
- return i18nString(UIStrings.exemptionReasonTopLevelTPCDDeprecationTrial);
1951
- case Protocol.Network.CookieExemptionReason.TPCDDeprecationTrial:
1952
- return i18nString(UIStrings.exemptionReasonTPCDDeprecationTrial);
1953
- case Protocol.Network.CookieExemptionReason.TPCDHeuristics:
1954
- return i18nString(UIStrings.exemptionReasonTPCDHeuristics);
1955
- case Protocol.Network.CookieExemptionReason.EnterprisePolicy:
1956
- return i18nString(UIStrings.exemptionReasonEnterprisePolicy);
1957
- case Protocol.Network.CookieExemptionReason.StorageAccess:
1958
- return i18nString(UIStrings.exemptionReasonStorageAccessAPI);
1959
- case Protocol.Network.CookieExemptionReason.TopLevelStorageAccess:
1960
- return i18nString(UIStrings.exemptionReasonTopLevelStorageAccessAPI);
1961
- case Protocol.Network.CookieExemptionReason.Scheme:
1962
- return i18nString(UIStrings.exemptionReasonScheme);
1963
- }
1964
- return '';
1965
- };
1966
-
1967
- export const cookieBlockedReasonToUiString = function(
1968
- blockedReason: Protocol.Network.CookieBlockedReason,
1969
- ): string {
1970
- switch (blockedReason) {
1971
- case Protocol.Network.CookieBlockedReason.SecureOnly:
1972
- return i18nString(UIStrings.secureOnly);
1973
- case Protocol.Network.CookieBlockedReason.NotOnPath:
1974
- return i18nString(UIStrings.notOnPath);
1975
- case Protocol.Network.CookieBlockedReason.DomainMismatch:
1976
- return i18nString(UIStrings.domainMismatch);
1977
- case Protocol.Network.CookieBlockedReason.SameSiteStrict:
1978
- return i18nString(UIStrings.sameSiteStrict);
1979
- case Protocol.Network.CookieBlockedReason.SameSiteLax:
1980
- return i18nString(UIStrings.sameSiteLax);
1981
- case Protocol.Network.CookieBlockedReason.SameSiteUnspecifiedTreatedAsLax:
1982
- return i18nString(UIStrings.sameSiteUnspecifiedTreatedAsLax);
1983
- case Protocol.Network.CookieBlockedReason.SameSiteNoneInsecure:
1984
- return i18nString(UIStrings.sameSiteNoneInsecure);
1985
- case Protocol.Network.CookieBlockedReason.UserPreferences:
1986
- return i18nString(UIStrings.userPreferences);
1987
- case Protocol.Network.CookieBlockedReason.UnknownError:
1988
- return i18nString(UIStrings.unknownError);
1989
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteStrict:
1990
- return i18nString(UIStrings.schemefulSameSiteStrict);
1991
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteLax:
1992
- return i18nString(UIStrings.schemefulSameSiteLax);
1993
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
1994
- return i18nString(UIStrings.schemefulSameSiteUnspecifiedTreatedAsLax);
1995
- case Protocol.Network.CookieBlockedReason.SamePartyFromCrossPartyContext:
1996
- return i18nString(UIStrings.samePartyFromCrossPartyContext);
1997
- case Protocol.Network.CookieBlockedReason.NameValuePairExceedsMaxSize:
1998
- return i18nString(UIStrings.nameValuePairExceedsMaxSize);
1999
- case Protocol.Network.CookieBlockedReason.ThirdPartyPhaseout:
2000
- return i18nString(UIStrings.thirdPartyPhaseout);
2001
- }
2002
- return '';
2003
- };
2004
-
2005
- export const setCookieBlockedReasonToUiString = function(
2006
- blockedReason: Protocol.Network.SetCookieBlockedReason,
2007
- ): string {
2008
- switch (blockedReason) {
2009
- case Protocol.Network.SetCookieBlockedReason.SecureOnly:
2010
- return i18nString(UIStrings.blockedReasonSecureOnly);
2011
- case Protocol.Network.SetCookieBlockedReason.SameSiteStrict:
2012
- return i18nString(UIStrings.blockedReasonSameSiteStrictLax, {
2013
- PH1: 'SameSite=Strict',
2014
- });
2015
- case Protocol.Network.SetCookieBlockedReason.SameSiteLax:
2016
- return i18nString(UIStrings.blockedReasonSameSiteStrictLax, {
2017
- PH1: 'SameSite=Lax',
2018
- });
2019
- case Protocol.Network.SetCookieBlockedReason.SameSiteUnspecifiedTreatedAsLax:
2020
- return i18nString(UIStrings.blockedReasonSameSiteUnspecifiedTreatedAsLax);
2021
- case Protocol.Network.SetCookieBlockedReason.SameSiteNoneInsecure:
2022
- return i18nString(UIStrings.blockedReasonSameSiteNoneInsecure);
2023
- case Protocol.Network.SetCookieBlockedReason.UserPreferences:
2024
- return i18nString(UIStrings.thisSetcookieWasBlockedDueToUser);
2025
- case Protocol.Network.SetCookieBlockedReason.SyntaxError:
2026
- return i18nString(UIStrings.thisSetcookieHadInvalidSyntax);
2027
- case Protocol.Network.SetCookieBlockedReason.SchemeNotSupported:
2028
- return i18nString(UIStrings.theSchemeOfThisConnectionIsNot);
2029
- case Protocol.Network.SetCookieBlockedReason.OverwriteSecure:
2030
- return i18nString(UIStrings.blockedReasonOverwriteSecure);
2031
- case Protocol.Network.SetCookieBlockedReason.InvalidDomain:
2032
- return i18nString(UIStrings.blockedReasonInvalidDomain);
2033
- case Protocol.Network.SetCookieBlockedReason.InvalidPrefix:
2034
- return i18nString(UIStrings.blockedReasonInvalidPrefix);
2035
- case Protocol.Network.SetCookieBlockedReason.UnknownError:
2036
- return i18nString(UIStrings.anUnknownErrorWasEncounteredWhenTrying);
2037
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteStrict:
2038
- return i18nString(
2039
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,
2040
- {PH1: 'SameSite=Strict'},
2041
- );
2042
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteLax:
2043
- return i18nString(
2044
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,
2045
- {PH1: 'SameSite=Lax'},
2046
- );
2047
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
2048
- return i18nString(UIStrings.thisSetcookieDidntSpecifyASamesite);
2049
- case Protocol.Network.SetCookieBlockedReason.SamePartyFromCrossPartyContext:
2050
- return i18nString(
2051
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSameparty,
2052
- );
2053
- case Protocol.Network.SetCookieBlockedReason.SamePartyConflictsWithOtherAttributes:
2054
- return i18nString(
2055
- UIStrings.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute,
2056
- );
2057
- case Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize:
2058
- return i18nString(
2059
- UIStrings.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize,
2060
- );
2061
- case Protocol.Network.SetCookieBlockedReason.DisallowedCharacter:
2062
- return i18nString(UIStrings.thisSetcookieHadADisallowedCharacter);
2063
- case Protocol.Network.SetCookieBlockedReason.ThirdPartyPhaseout:
2064
- return i18nString(UIStrings.thisSetcookieWasBlockedDueThirdPartyPhaseout);
2065
- }
2066
- return '';
2067
- };
2068
-
2069
- export const cookieBlockedReasonToAttribute = function(
2070
- blockedReason: Protocol.Network.CookieBlockedReason,
2071
- ): Attribute|null {
2072
- switch (blockedReason) {
2073
- case Protocol.Network.CookieBlockedReason.SecureOnly:
2074
- return Attribute.SECURE;
2075
- case Protocol.Network.CookieBlockedReason.NotOnPath:
2076
- return Attribute.PATH;
2077
- case Protocol.Network.CookieBlockedReason.DomainMismatch:
2078
- return Attribute.DOMAIN;
2079
- case Protocol.Network.CookieBlockedReason.SameSiteStrict:
2080
- case Protocol.Network.CookieBlockedReason.SameSiteLax:
2081
- case Protocol.Network.CookieBlockedReason.SameSiteUnspecifiedTreatedAsLax:
2082
- case Protocol.Network.CookieBlockedReason.SameSiteNoneInsecure:
2083
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteStrict:
2084
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteLax:
2085
- case Protocol.Network.CookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
2086
- return Attribute.SAME_SITE;
2087
- case Protocol.Network.CookieBlockedReason.SamePartyFromCrossPartyContext:
2088
- case Protocol.Network.CookieBlockedReason.NameValuePairExceedsMaxSize:
2089
- case Protocol.Network.CookieBlockedReason.UserPreferences:
2090
- case Protocol.Network.CookieBlockedReason.ThirdPartyPhaseout:
2091
- case Protocol.Network.CookieBlockedReason.UnknownError:
2092
- return null;
2093
- }
2094
- return null;
2095
- };
2096
-
2097
- export const setCookieBlockedReasonToAttribute = function(
2098
- blockedReason: Protocol.Network.SetCookieBlockedReason,
2099
- ): Attribute|null {
2100
- switch (blockedReason) {
2101
- case Protocol.Network.SetCookieBlockedReason.SecureOnly:
2102
- case Protocol.Network.SetCookieBlockedReason.OverwriteSecure:
2103
- return Attribute.SECURE;
2104
- case Protocol.Network.SetCookieBlockedReason.SameSiteStrict:
2105
- case Protocol.Network.SetCookieBlockedReason.SameSiteLax:
2106
- case Protocol.Network.SetCookieBlockedReason.SameSiteUnspecifiedTreatedAsLax:
2107
- case Protocol.Network.SetCookieBlockedReason.SameSiteNoneInsecure:
2108
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteStrict:
2109
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteLax:
2110
- case Protocol.Network.SetCookieBlockedReason.SchemefulSameSiteUnspecifiedTreatedAsLax:
2111
- return Attribute.SAME_SITE;
2112
- case Protocol.Network.SetCookieBlockedReason.InvalidDomain:
2113
- return Attribute.DOMAIN;
2114
- case Protocol.Network.SetCookieBlockedReason.InvalidPrefix:
2115
- return Attribute.NAME;
2116
- case Protocol.Network.SetCookieBlockedReason.SamePartyConflictsWithOtherAttributes:
2117
- case Protocol.Network.SetCookieBlockedReason.SamePartyFromCrossPartyContext:
2118
- case Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize:
2119
- case Protocol.Network.SetCookieBlockedReason.UserPreferences:
2120
- case Protocol.Network.SetCookieBlockedReason.ThirdPartyPhaseout:
2121
- case Protocol.Network.SetCookieBlockedReason.SyntaxError:
2122
- case Protocol.Network.SetCookieBlockedReason.SchemeNotSupported:
2123
- case Protocol.Network.SetCookieBlockedReason.UnknownError:
2124
- case Protocol.Network.SetCookieBlockedReason.DisallowedCharacter:
2125
- return null;
2126
- }
2127
- return null;
2128
- };
2129
-
2130
- export interface NameValue {
2131
- name: string;
2132
- value: string;
2133
- }
2134
-
2135
- export interface WebSocketFrame {
2136
- type: WebSocketFrameType;
2137
- time: number;
2138
- text: string;
2139
- opCode: number;
2140
- mask: boolean;
2141
- }
2142
-
2143
- export interface BlockedSetCookieWithReason {
2144
- blockedReasons: Protocol.Network.SetCookieBlockedReason[];
2145
- cookieLine: string;
2146
- cookie: Cookie|null;
2147
- }
2148
-
2149
- export interface BlockedCookieWithReason {
2150
- cookie: Cookie;
2151
- blockedReasons: Protocol.Network.CookieBlockedReason[];
2152
- }
2153
-
2154
- export interface IncludedCookieWithReason {
2155
- cookie: Cookie;
2156
- exemptionReason: Protocol.Network.CookieExemptionReason|undefined;
2157
- }
2158
-
2159
- export interface ExemptedSetCookieWithReason {
2160
- cookie: Cookie;
2161
- cookieLine: string;
2162
- exemptionReason: Protocol.Network.CookieExemptionReason;
2163
- }
2164
-
2165
- export interface EventSourceMessage {
2166
- time: number;
2167
- eventName: string;
2168
- eventId: string;
2169
- data: string;
2170
- }
2171
-
2172
- export interface ExtraRequestInfo {
2173
- blockedRequestCookies: Array<{blockedReasons: Protocol.Network.CookieBlockedReason[], cookie: Cookie}>;
2174
- requestHeaders: NameValue[];
2175
- includedRequestCookies: IncludedCookieWithReason[];
2176
- clientSecurityState?: Protocol.Network.ClientSecurityState;
2177
- connectTiming: Protocol.Network.ConnectTiming;
2178
- siteHasCookieInOtherPartition?: boolean;
2179
- appliedNetworkConditionsId?: string;
2180
- }
2181
-
2182
- export interface ExtraResponseInfo {
2183
- blockedResponseCookies:
2184
- Array<{blockedReasons: Protocol.Network.SetCookieBlockedReason[], cookieLine: string, cookie: Cookie|null}>;
2185
- responseHeaders: NameValue[];
2186
- responseHeadersText?: string;
2187
- resourceIPAddressSpace: Protocol.Network.IPAddressSpace;
2188
- statusCode: number|undefined;
2189
- cookiePartitionKey?: Protocol.Network.CookiePartitionKey;
2190
- cookiePartitionKeyOpaque: boolean|undefined;
2191
- exemptedResponseCookies:|
2192
- Array<{cookie: Cookie, cookieLine: string, exemptionReason: Protocol.Network.CookieExemptionReason}>|undefined;
2193
- }
2194
-
2195
- export interface EarlyHintsInfo {
2196
- responseHeaders: NameValue[];
2197
- }
2198
-
2199
- export type OverrideType = 'content'|'headers';
2200
-
2201
- export enum DirectSocketType {
2202
- TCP = 1,
2203
- UDP_BOUND = 2,
2204
- UDP_CONNECTED = 3,
2205
- }
2206
-
2207
- export enum DirectSocketStatus {
2208
- OPENING = 1,
2209
- OPEN = 2,
2210
- CLOSED = 3,
2211
- ABORTED = 4,
2212
- }
2213
-
2214
- export interface DirectSocketCreateOptions {
2215
- remoteAddr?: string;
2216
- remotePort?: number;
2217
- localAddr?: string;
2218
- localPort?: number;
2219
- noDelay?: boolean;
2220
- keepAliveDelay?: number;
2221
- sendBufferSize?: number;
2222
- receiveBufferSize?: number;
2223
- dnsQueryType?: Protocol.Network.DirectSocketDnsQueryType;
2224
- }
2225
-
2226
- export interface DirectSocketOpenInfo {
2227
- remoteAddr?: string;
2228
- remotePort?: number;
2229
- localAddr?: string;
2230
- localPort?: number;
2231
- }
2232
-
2233
- export interface DirectSocketInfo {
2234
- type: DirectSocketType;
2235
- status: DirectSocketStatus;
2236
- errorMessage?: string;
2237
- createOptions: DirectSocketCreateOptions;
2238
- openInfo?: DirectSocketOpenInfo;
2239
- }
2240
-
2241
- export interface DirectSocketChunk {
2242
- data: string;
2243
- type: DirectSocketChunkType;
2244
- timestamp: number;
2245
- // Only for bound udp socket.
2246
- remoteAddress?: string;
2247
- remotePort?: number;
2248
- }
2249
-
2250
- export enum DirectSocketChunkType {
2251
- SEND = 'send',
2252
- RECEIVE = 'receive',
2253
- }