chrome-devtools-frontend 1.0.923319 → 1.0.925171

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 (313) hide show
  1. package/config/gni/all_devtools_files.gni +0 -1
  2. package/config/gni/devtools_grd_files.gni +1 -3
  3. package/config/gni/devtools_image_files.gni +1 -1
  4. package/front_end/Images/src/copy_icon.svg +79 -0
  5. package/front_end/core/common/EventTarget.ts +22 -27
  6. package/front_end/core/common/Object.ts +28 -26
  7. package/front_end/core/common/Settings.ts +9 -8
  8. package/front_end/core/i18n/locales/en-US.json +18 -39
  9. package/front_end/core/i18n/locales/en-XL.json +18 -39
  10. package/front_end/core/platform/string-utilities.ts +4 -3
  11. package/front_end/core/sdk/EmulationModel.ts +1 -1
  12. package/front_end/core/sdk/NetworkManager.ts +1 -2
  13. package/front_end/core/sdk/ResourceTreeModel.ts +2 -3
  14. package/front_end/core/sdk/RuntimeModel.ts +2 -3
  15. package/front_end/core/sdk/SourceMap.ts +74 -31
  16. package/front_end/core/sdk/TargetManager.ts +9 -8
  17. package/front_end/core/sdk/TracingManager.ts +1 -1
  18. package/front_end/entrypoints/main/MainImpl.ts +1 -1
  19. package/front_end/entrypoints/node_main/NodeMain.ts +1 -1
  20. package/front_end/generated/InspectorBackendCommands.js +9 -5
  21. package/front_end/generated/protocol-mapping.d.ts +1 -0
  22. package/front_end/generated/protocol-proxy-api.d.ts +1 -0
  23. package/front_end/generated/protocol.d.ts +13 -2
  24. package/front_end/legacy_test_runner/application_test_runner/application_test_runner.js +0 -1
  25. package/front_end/models/bindings/CompilerScriptMapping.ts +24 -6
  26. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +30 -30
  27. package/front_end/models/extensions/ExtensionServer.ts +10 -13
  28. package/front_end/models/workspace/WorkspaceImpl.ts +1 -1
  29. package/front_end/models/workspace_diff/WorkspaceDiff.ts +24 -20
  30. package/front_end/panels/animation/AnimationModel.ts +6 -1
  31. package/front_end/panels/animation/AnimationTimeline.ts +2 -2
  32. package/front_end/panels/application/AppManifestView.ts +58 -20
  33. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -59
  34. package/front_end/panels/application/ApplicationPanelSidebar.ts +15 -163
  35. package/front_end/panels/application/BackgroundServiceModel.ts +6 -1
  36. package/front_end/panels/application/BackgroundServiceView.ts +4 -4
  37. package/front_end/panels/application/DatabaseModel.ts +6 -1
  38. package/front_end/panels/application/DatabaseTableView.ts +1 -1
  39. package/front_end/panels/application/IndexedDBModel.ts +9 -1
  40. package/front_end/panels/application/IndexedDBViews.ts +6 -7
  41. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  42. package/front_end/panels/application/ServiceWorkersView.ts +3 -3
  43. package/front_end/panels/application/StorageItemsView.ts +2 -3
  44. package/front_end/panels/application/StorageView.ts +0 -13
  45. package/front_end/panels/application/appManifestView.css +8 -0
  46. package/front_end/panels/application/application-legacy.ts +0 -3
  47. package/front_end/panels/application/application.ts +0 -4
  48. package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +1 -1
  49. package/front_end/panels/console/ConsolePinPane.ts +1 -2
  50. package/front_end/panels/console/ConsoleSidebar.ts +2 -2
  51. package/front_end/panels/console/ConsoleView.ts +7 -6
  52. package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
  53. package/front_end/panels/coverage/CoverageModel.ts +9 -3
  54. package/front_end/panels/coverage/CoverageView.ts +3 -2
  55. package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
  56. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
  57. package/front_end/panels/elements/ComputedStyleWidget.ts +2 -2
  58. package/front_end/panels/elements/ElementsPanel.ts +3 -3
  59. package/front_end/panels/elements/StylePropertyTreeElement.ts +14 -4
  60. package/front_end/panels/elements/StylesSidebarPane.ts +4 -2
  61. package/front_end/panels/input/InputModel.ts +1 -1
  62. package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +2 -4
  63. package/front_end/panels/issues/HiddenIssuesRow.ts +7 -12
  64. package/front_end/panels/layers/LayerTreeModel.ts +6 -1
  65. package/front_end/panels/layers/LayersPanel.ts +3 -4
  66. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -0
  67. package/front_end/panels/media/MainView.ts +22 -19
  68. package/front_end/panels/media/MediaModel.ts +15 -7
  69. package/front_end/panels/media/PlayerMessagesView.ts +2 -4
  70. package/front_end/panels/network/NetworkPanel.ts +6 -6
  71. package/front_end/panels/network/RequestHeadersView.ts +7 -0
  72. package/front_end/panels/network/networkLogView.css +5 -0
  73. package/front_end/panels/profiler/HeapProfileView.ts +14 -4
  74. package/front_end/panels/profiler/HeapSnapshotView.ts +54 -22
  75. package/front_end/panels/profiler/LiveHeapProfileView.ts +2 -2
  76. package/front_end/panels/profiler/ProfileHeader.ts +11 -2
  77. package/front_end/panels/profiler/ProfileView.ts +3 -3
  78. package/front_end/panels/profiler/ProfilesPanel.ts +7 -6
  79. package/front_end/panels/screencast/InputModel.ts +1 -1
  80. package/front_end/panels/screencast/ScreencastView.ts +1 -1
  81. package/front_end/panels/security/SecurityModel.ts +5 -1
  82. package/front_end/panels/security/SecurityPanel.ts +1 -2
  83. package/front_end/panels/sensors/SensorsView.ts +3 -2
  84. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +6 -3
  85. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  86. package/front_end/panels/sources/DebuggerPlugin.ts +6 -4
  87. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +1 -1
  88. package/front_end/panels/sources/ScriptFormatterEditorAction.ts +1 -1
  89. package/front_end/panels/sources/SourcesPanel.ts +2 -2
  90. package/front_end/panels/timeline/TimelineFlameChartView.ts +5 -8
  91. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -2
  92. package/front_end/panels/web_audio/AudioContextSelector.ts +4 -6
  93. package/front_end/panels/web_audio/WebAudioModel.ts +19 -1
  94. package/front_end/panels/web_audio/WebAudioView.ts +28 -22
  95. package/front_end/panels/web_audio/graph_visualizer/graph_visualizer.ts +0 -7
  96. package/front_end/panels/web_audio/web_audio.ts +1 -23
  97. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +598 -595
  98. package/front_end/third_party/lighthouse/locales/en-US.json +6 -0
  99. package/front_end/third_party/lighthouse/locales/en-XL.json +6 -0
  100. package/front_end/third_party/lighthouse/report/bundle.d.ts +25 -4
  101. package/front_end/third_party/lighthouse/report/bundle.js +111 -22
  102. package/front_end/third_party/lighthouse/report-assets/report.css +120 -12
  103. package/front_end/third_party/lighthouse/report-assets/report.js +10 -10
  104. package/front_end/third_party/puppeteer/README.chromium +1 -1
  105. package/front_end/third_party/puppeteer/package/CHANGELOG.md +66 -0
  106. package/front_end/third_party/puppeteer/package/README.md +34 -13
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +5 -5
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +18 -2
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +8 -3
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +2 -2
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +2 -2
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +22 -6
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js +14 -7
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +1 -0
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +10 -6
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.js +120 -0
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -1
  128. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  130. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +2 -2
  131. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  132. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +62 -3
  133. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  134. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +131 -3
  135. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +40 -0
  137. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts.map +1 -1
  138. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js +76 -0
  139. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js.map +1 -1
  140. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +53 -2
  141. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  142. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +82 -13
  143. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +2 -1
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +14 -2
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts +5 -0
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -1
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -1
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +1053 -29
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +1114 -22
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -1
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js +17 -6
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.d.ts +1 -0
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.d.ts.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.js +6 -1
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.js.map +1 -1
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.d.ts +21 -5
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.js +47 -28
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/helper.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/global.d.ts +17 -0
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/global.d.ts.map +1 -0
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/global.js +3 -0
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/global.js.map +1 -0
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js +9 -10
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +5 -2
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +10 -2
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +83 -6
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js +7 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +2 -2
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.d.ts.map +1 -1
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js +17 -3
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js.map +1 -1
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  194. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +5 -5
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +18 -2
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +8 -3
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +2 -2
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +2 -2
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +22 -6
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +14 -7
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +1 -0
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +10 -6
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +120 -0
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +2 -2
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +62 -3
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +131 -3
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +40 -0
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +76 -0
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js.map +1 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +53 -2
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +82 -13
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +2 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +14 -2
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +5 -0
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -1
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js.map +1 -1
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +1053 -29
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1115 -23
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +17 -6
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts +1 -0
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js +4 -0
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +21 -5
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +32 -13
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js.map +1 -1
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/global.d.ts +17 -0
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/global.d.ts.map +1 -0
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/global.js +2 -0
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/global.js.map +1 -0
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +9 -10
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +5 -2
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +10 -2
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +83 -6
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +7 -1
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +1 -1
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +2 -2
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +17 -3
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/types.d.ts +1382 -19726
  280. package/front_end/third_party/puppeteer/package/package.json +9 -6
  281. package/front_end/third_party/wasmparser/README.chromium +2 -2
  282. package/front_end/third_party/wasmparser/package/CHANGELOG.md +13 -0
  283. package/front_end/third_party/wasmparser/package/dist/cjs/WasmDis.js +50 -10
  284. package/front_end/third_party/wasmparser/package/dist/cjs/WasmDis.js.map +1 -1
  285. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.d.ts +21 -4
  286. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +76 -8
  287. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
  288. package/front_end/third_party/wasmparser/package/dist/esm/WasmDis.js +50 -10
  289. package/front_end/third_party/wasmparser/package/dist/esm/WasmDis.js.map +1 -1
  290. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.d.ts +21 -4
  291. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +76 -8
  292. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
  293. package/front_end/third_party/wasmparser/package/package.json +1 -1
  294. package/front_end/third_party/wasmparser/package/src/WasmDis.ts +47 -10
  295. package/front_end/third_party/wasmparser/package/src/WasmParser.ts +75 -5
  296. package/front_end/ui/components/icon_button/iconButton.css +4 -0
  297. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +2 -6
  298. package/front_end/ui/legacy/FilterBar.ts +1 -1
  299. package/front_end/ui/legacy/GlassPane.ts +1 -3
  300. package/front_end/ui/legacy/SplitWidget.ts +1 -1
  301. package/front_end/ui/legacy/UIUtils.ts +3 -4
  302. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +3 -3
  303. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -1
  304. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +6 -2
  305. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  306. package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +1 -1
  307. package/front_end/ui/legacy/reportView.css +1 -0
  308. package/package.json +1 -1
  309. package/scripts/build/rollup.config.js +0 -5
  310. package/front_end/Images/src/exclamation_mark_circle_icon.svg +0 -65
  311. package/front_end/legacy_test_runner/application_test_runner/AppcacheTestRunner.js +0 -220
  312. package/front_end/panels/application/ApplicationCacheItemsView.ts +0 -335
  313. package/front_end/panels/application/ApplicationCacheModel.ts +0 -206
@@ -1,220 +0,0 @@
1
- // Copyright 2017 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- /**
6
- * @fileoverview using private properties isn't a Closure violation in tests.
7
- */
8
-
9
- self.ApplicationTestRunner = self.ApplicationTestRunner || {};
10
-
11
- ApplicationTestRunner.createAndNavigateIFrame = function(url, callback) {
12
- TestRunner.addSniffer(SDK.ResourceTreeModel.prototype, 'frameNavigated', frameNavigated);
13
- TestRunner.evaluateInPageAnonymously('createAndNavigateIFrame(unescape(\'' + escape(url) + '\'))');
14
-
15
- function frameNavigated(frame) {
16
- callback(frame.id);
17
- }
18
- };
19
-
20
- ApplicationTestRunner.navigateIFrame = function(frameId, url, callback) {
21
- const frame = TestRunner.resourceTreeModel.frameForId(frameId);
22
- TestRunner.evaluateInPageAnonymously(
23
- 'navigateIFrame(unescape(\'' + escape(frame.name) + '\'), unescape(\'' + escape(url) + '\'))');
24
- TestRunner.addSniffer(SDK.ResourceTreeModel.prototype, 'frameNavigated', frameNavigated);
25
-
26
- function frameNavigated(frame) {
27
- callback(frame.id);
28
- }
29
- };
30
-
31
- ApplicationTestRunner.removeIFrame = function(frameId, callback) {
32
- const frame = TestRunner.resourceTreeModel.frameForId(frameId);
33
- TestRunner.evaluateInPageAnonymously('removeIFrame(unescape(\'' + escape(frame.name) + '\'))');
34
- TestRunner.addSniffer(SDK.ResourceTreeModel.prototype, 'frameDetached', frameDetached);
35
-
36
- function frameDetached(frame) {
37
- callback(frame.id);
38
- }
39
- };
40
-
41
- ApplicationTestRunner.swapFrameCache = function(frameId) {
42
- const frame = TestRunner.resourceTreeModel.frameForId(frameId);
43
- TestRunner.evaluateInPageAnonymously('swapFrameCache(unescape(\'' + escape(frame.name) + '\'))');
44
- };
45
-
46
- ApplicationTestRunner.dumpApplicationCache = function() {
47
- ApplicationTestRunner.dumpApplicationCacheTree();
48
- ApplicationTestRunner.dumpApplicationCacheModel();
49
- TestRunner.addResult('');
50
- };
51
-
52
- ApplicationTestRunner.dumpApplicationCacheTree = function() {
53
- TestRunner.addResult('Dumping application cache tree:');
54
- const applicationCacheTreeElement = UI.panels.resources.sidebar.applicationCacheListTreeElement;
55
-
56
- if (!applicationCacheTreeElement.childCount()) {
57
- TestRunner.addResult(' (empty)');
58
- return;
59
- }
60
-
61
- for (let i = 0; i < applicationCacheTreeElement.childCount(); ++i) {
62
- const manifestTreeElement = applicationCacheTreeElement.childAt(i);
63
- TestRunner.addResult(' Manifest URL: ' + manifestTreeElement.manifestURL);
64
-
65
- if (!manifestTreeElement.childCount()) {
66
- TestRunner.addResult(' (no frames)');
67
- continue;
68
- }
69
-
70
- for (let j = 0; j < manifestTreeElement.childCount(); ++j) {
71
- const frameTreeElement = manifestTreeElement.childAt(j);
72
- TestRunner.addResult(' Frame: ' + frameTreeElement.title);
73
- }
74
- }
75
- };
76
-
77
- ApplicationTestRunner.frameIdToString = function(frameId) {
78
- if (!ApplicationTestRunner.framesByFrameId) {
79
- ApplicationTestRunner.framesByFrameId = {};
80
- }
81
-
82
- let frame = TestRunner.resourceTreeModel.frameForId(frameId);
83
-
84
- if (!frame) {
85
- frame = ApplicationTestRunner.framesByFrameId[frameId];
86
- }
87
-
88
- ApplicationTestRunner.framesByFrameId[frameId] = frame;
89
- return frame.name;
90
- };
91
-
92
- ApplicationTestRunner.applicationCacheStatusToString = function(status) {
93
- const statusInformation = {};
94
- statusInformation[applicationCache.UNCACHED] = 'UNCACHED';
95
- statusInformation[applicationCache.IDLE] = 'IDLE';
96
- statusInformation[applicationCache.CHECKING] = 'CHECKING';
97
- statusInformation[applicationCache.DOWNLOADING] = 'DOWNLOADING';
98
- statusInformation[applicationCache.UPDATEREADY] = 'UPDATEREADY';
99
- statusInformation[applicationCache.OBSOLETE] = 'OBSOLETE';
100
- return statusInformation[status] || statusInformation[applicationCache.UNCACHED];
101
- };
102
-
103
- ApplicationTestRunner.dumpApplicationCacheModel = function() {
104
- TestRunner.addResult('Dumping application cache model:');
105
- const model = UI.panels.resources.sidebar.applicationCacheModel;
106
- const frameIds = [];
107
-
108
- for (const frameId in model.manifestURLsByFrame) {
109
- frameIds.push(frameId);
110
- }
111
-
112
- function compareFunc(a, b) {
113
- return ApplicationTestRunner.frameIdToString(a).localeCompare(ApplicationTestRunner.frameIdToString(b));
114
- }
115
-
116
- frameIds.sort(compareFunc);
117
-
118
- if (!frameIds.length) {
119
- TestRunner.addResult(' (empty)');
120
- return;
121
- }
122
-
123
- for (let i = 0; i < frameIds.length; ++i) {
124
- const frameId = frameIds[i];
125
- const manifestURL = model.frameManifestURL(frameId);
126
- const status = model.frameManifestStatus(frameId);
127
- TestRunner.addResult(' Frame: ' + ApplicationTestRunner.frameIdToString(frameId));
128
- TestRunner.addResult(' manifest url: ' + manifestURL);
129
- TestRunner.addResult(' status: ' + ApplicationTestRunner.applicationCacheStatusToString(status));
130
- }
131
- };
132
-
133
- ApplicationTestRunner.waitForFrameManifestURLAndStatus = function(frameId, manifestURL, status, callback) {
134
- const frameManifestStatus = UI.panels.resources.sidebar.applicationCacheModel.frameManifestStatus(frameId);
135
- const frameManifestURL = UI.panels.resources.sidebar.applicationCacheModel.frameManifestURL(frameId);
136
-
137
- if (frameManifestStatus === status && frameManifestURL.indexOf(manifestURL) !== -1) {
138
- callback();
139
- return;
140
- }
141
-
142
- const handler =
143
- ApplicationTestRunner.waitForFrameManifestURLAndStatus.bind(this, frameId, manifestURL, status, callback);
144
- TestRunner.addSniffer(Resources.ApplicationCacheModel.prototype, 'frameManifestUpdated', handler);
145
- };
146
-
147
- ApplicationTestRunner.startApplicationCacheStatusesRecording = function() {
148
- if (ApplicationTestRunner.applicationCacheStatusesRecords) {
149
- ApplicationTestRunner.applicationCacheStatusesRecords = {};
150
- return;
151
- }
152
-
153
- ApplicationTestRunner.applicationCacheStatusesRecords = {};
154
-
155
- function addRecord(frameId, manifestURL, status) {
156
- const record = {};
157
- record.manifestURL = manifestURL;
158
- record.status = status;
159
-
160
- if (!ApplicationTestRunner.applicationCacheStatusesRecords[frameId]) {
161
- ApplicationTestRunner.applicationCacheStatusesRecords[frameId] = [];
162
- }
163
-
164
- ApplicationTestRunner.applicationCacheStatusesRecords[frameId].push(record);
165
-
166
- if (ApplicationTestRunner.awaitedFrameStatusEventsCount &&
167
- ApplicationTestRunner.awaitedFrameStatusEventsCount[frameId]) {
168
- ApplicationTestRunner.awaitedFrameStatusEventsCount[frameId].count--;
169
-
170
- if (!ApplicationTestRunner.awaitedFrameStatusEventsCount[frameId].count) {
171
- ApplicationTestRunner.awaitedFrameStatusEventsCount[frameId].callback();
172
- }
173
- }
174
- }
175
-
176
- TestRunner.addSniffer(Resources.ApplicationCacheModel.prototype, 'frameManifestUpdated', addRecord, true);
177
- };
178
-
179
- ApplicationTestRunner.ensureFrameStatusEventsReceived = function(frameId, count, callback) {
180
- const records = ApplicationTestRunner.applicationCacheStatusesRecords[frameId] || [];
181
- const eventsLeft = count - records.length;
182
-
183
- if (!eventsLeft) {
184
- callback();
185
- return;
186
- }
187
-
188
- if (!ApplicationTestRunner.awaitedFrameStatusEventsCount) {
189
- ApplicationTestRunner.awaitedFrameStatusEventsCount = {};
190
- }
191
-
192
- ApplicationTestRunner.awaitedFrameStatusEventsCount[frameId] = {count: eventsLeft, callback: callback};
193
- };
194
-
195
- TestRunner.deprecatedInitAsync(`
196
- let framesCount = 0;
197
-
198
- function createAndNavigateIFrame(url) {
199
- let iframe = document.createElement('iframe');
200
- iframe.src = url;
201
- iframe.name = 'frame' + ++framesCount;
202
- iframe.id = iframe.name;
203
- document.body.appendChild(iframe);
204
- }
205
-
206
- function removeIFrame(name) {
207
- let iframe = document.querySelector('#' + name);
208
- iframe.parentElement.removeChild(iframe);
209
- }
210
-
211
- function navigateIFrame(name, url) {
212
- let iframe = document.querySelector('#' + name);
213
- iframe.src = url;
214
- }
215
-
216
- function swapFrameCache(name) {
217
- let iframe = document.querySelector('#' + name);
218
- iframe.contentWindow.applicationCache.swapCache();
219
- }
220
- `);
@@ -1,335 +0,0 @@
1
- // Copyright 2021 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- /*
6
- * Copyright (C) 2010 Apple Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions
10
- * are met:
11
- * 1. Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * 2. Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- *
17
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
18
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
21
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27
- * THE POSSIBILITY OF SUCH DAMAGE.
28
- */
29
-
30
- import type * as Common from '../../core/common/common.js';
31
- import * as i18n from '../../core/i18n/i18n.js';
32
- import * as Platform from '../../core/platform/platform.js';
33
- import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
34
- import * as UI from '../../ui/legacy/legacy.js';
35
- import type * as Protocol from '../../generated/protocol.js';
36
-
37
- import type {ApplicationCacheModel} from './ApplicationCacheModel.js';
38
- import {CHECKING, DOWNLOADING, IDLE, OBSOLETE, UNCACHED, UPDATEREADY} from './ApplicationCacheModel.js';
39
-
40
- const UIStrings = {
41
- /**
42
- *@description Text in Application Cache Items View of the Application panel
43
- */
44
- appcache: 'AppCache',
45
- /**
46
- *@description Text to delete something
47
- */
48
- deleteString: 'Delete',
49
- /**
50
- *@description Text in Application Cache Items View of the Application panel
51
- */
52
- noApplicationCacheInformation: 'No Application Cache information available.',
53
- /**
54
- *@description Text to indicate the network connectivity is online
55
- */
56
- online: 'Online',
57
- /**
58
- *@description Text to indicate the network connectivity is offline
59
- */
60
- offline: 'Offline',
61
- /**
62
- *@description Text that refers to the resources of the web page
63
- */
64
- resource: 'Resource',
65
- /**
66
- *@description Text that refers to some types
67
- */
68
- typeString: 'Type',
69
- /**
70
- *@description Text for the size of something
71
- */
72
- sizeString: 'Size',
73
- /**
74
- *@description Text in Application Panel Sidebar of the Application panel
75
- */
76
- applicationCache: 'Application Cache',
77
- };
78
- const str_ = i18n.i18n.registerUIStrings('panels/application/ApplicationCacheItemsView.ts', UIStrings);
79
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
80
- export class ApplicationCacheItemsView extends UI.View.SimpleView {
81
- private readonly model: ApplicationCacheModel;
82
- private readonly deleteButton: UI.Toolbar.ToolbarButton;
83
- private connectivityIcon: UI.UIUtils.DevToolsIconLabel;
84
- private statusIcon: UI.UIUtils.DevToolsIconLabel;
85
- private readonly frameId: Protocol.Page.FrameId;
86
- private readonly emptyWidget: UI.EmptyWidget.EmptyWidget;
87
- private readonly nodeResources:
88
- WeakMap<DataGrid.DataGrid.DataGridNode<unknown>, Protocol.ApplicationCache.ApplicationCacheResource>;
89
- private viewDirty?: boolean;
90
- private status?: number;
91
- private manifest?: string;
92
- private creationTime?: number;
93
- private updateTime?: number;
94
- private size?: number;
95
- private resources?: Protocol.ApplicationCache.ApplicationCacheResource[];
96
- private dataGrid?: DataGrid.DataGrid.DataGridImpl<unknown>;
97
-
98
- constructor(model: ApplicationCacheModel, frameId: Protocol.Page.FrameId) {
99
- super(i18nString(UIStrings.appcache));
100
-
101
- this.model = model;
102
-
103
- this.element.classList.add('storage-view', 'table');
104
-
105
- this.deleteButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.deleteString), 'largeicon-delete');
106
- this.deleteButton.setVisible(false);
107
- this.deleteButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this.deleteButtonClicked, this);
108
- this.connectivityIcon = (document.createElement('span', {is: 'dt-icon-label'}) as UI.UIUtils.DevToolsIconLabel);
109
- this.connectivityIcon.style.margin = '0 2px 0 5px';
110
- this.statusIcon = (document.createElement('span', {is: 'dt-icon-label'}) as UI.UIUtils.DevToolsIconLabel);
111
- this.statusIcon.style.margin = '0 2px 0 5px';
112
-
113
- this.frameId = frameId;
114
-
115
- this.emptyWidget = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noApplicationCacheInformation));
116
- this.emptyWidget.show(this.element);
117
-
118
- this.markDirty();
119
-
120
- const status = this.model.frameManifestStatus(frameId);
121
- this.updateStatus(status);
122
- this.updateNetworkState(this.model.onLine);
123
- (this.deleteButton.element as HTMLElement).style.display = 'none';
124
-
125
- this.nodeResources = new WeakMap();
126
- }
127
-
128
- async toolbarItems(): Promise<UI.Toolbar.ToolbarItem[]> {
129
- return [
130
- this.deleteButton,
131
- new UI.Toolbar.ToolbarItem(this.connectivityIcon),
132
- new UI.Toolbar.ToolbarSeparator(),
133
- new UI.Toolbar.ToolbarItem(this.statusIcon),
134
- ];
135
- }
136
-
137
- wasShown(): void {
138
- this.maybeUpdate();
139
- }
140
-
141
- willHide(): void {
142
- this.deleteButton.setVisible(false);
143
- }
144
-
145
- private maybeUpdate(): void {
146
- if (!this.isShowing() || !this.viewDirty) {
147
- return;
148
- }
149
-
150
- this.update();
151
- this.viewDirty = false;
152
- }
153
-
154
- private markDirty(): void {
155
- this.viewDirty = true;
156
- }
157
-
158
- updateStatus(status: number): void {
159
- const oldStatus = this.status;
160
- this.status = status;
161
-
162
- const statusInformation = new Map([
163
- // We should never have UNCACHED status, since we remove frames with UNCACHED application cache status from the tree.
164
- [UNCACHED, {type: 'smallicon-red-ball', text: 'UNCACHED'}],
165
- [IDLE, {type: 'smallicon-green-ball', text: 'IDLE'}],
166
- [CHECKING, {type: 'smallicon-orange-ball', text: 'CHECKING'}],
167
- [DOWNLOADING, {type: 'smallicon-orange-ball', text: 'DOWNLOADING'}],
168
- [UPDATEREADY, {type: 'smallicon-green-ball', text: 'UPDATEREADY'}],
169
- [OBSOLETE, {type: 'smallicon-red-ball', text: 'OBSOLETE'}],
170
- ]);
171
- const info = statusInformation.get(status) || statusInformation.get(UNCACHED);
172
- if (info) {
173
- this.statusIcon.type = info.type;
174
- this.statusIcon.textContent = info.text;
175
- }
176
-
177
- if (this.isShowing() && this.status === IDLE && (oldStatus === UPDATEREADY || !this.resources)) {
178
- this.markDirty();
179
- }
180
- this.maybeUpdate();
181
- }
182
-
183
- updateNetworkState(isNowOnline: boolean): void {
184
- if (isNowOnline) {
185
- this.connectivityIcon.type = 'smallicon-green-ball';
186
- this.connectivityIcon.textContent = i18nString(UIStrings.online);
187
- } else {
188
- this.connectivityIcon.type = 'smallicon-red-ball';
189
- this.connectivityIcon.textContent = i18nString(UIStrings.offline);
190
- }
191
- }
192
-
193
- private async update(): Promise<void> {
194
- const applicationCache = await this.model.requestApplicationCache(this.frameId);
195
-
196
- if (!applicationCache || !applicationCache.manifestURL) {
197
- delete this.manifest;
198
- delete this.creationTime;
199
- delete this.updateTime;
200
- delete this.size;
201
- delete this.resources;
202
-
203
- this.emptyWidget.show(this.element);
204
- this.deleteButton.setVisible(false);
205
- if (this.dataGrid) {
206
- this.dataGrid.element.classList.add('hidden');
207
- }
208
- return;
209
- }
210
- // FIXME: are these variables needed anywhere else?
211
- this.manifest = applicationCache.manifestURL;
212
- this.creationTime = applicationCache.creationTime;
213
- this.updateTime = applicationCache.updateTime;
214
- this.size = applicationCache.size;
215
- this.resources = applicationCache.resources;
216
-
217
- if (!this.dataGrid) {
218
- this.createDataGrid();
219
- }
220
-
221
- this.populateDataGrid();
222
- if (this.dataGrid) {
223
- this.dataGrid.autoSizeColumns(20, 80);
224
- this.dataGrid.element.classList.remove('hidden');
225
- }
226
- this.emptyWidget.detach();
227
- this.deleteButton.setVisible(true);
228
-
229
- // FIXME: For Chrome, put creationTime and updateTime somewhere.
230
- // NOTE: localizedString has not yet been added.
231
- // i18nString("(%s) Created: %s Updated: %s", this.size, this.creationTime, this.updateTime);
232
- }
233
-
234
- private createDataGrid(): void {
235
- const columns = ([
236
- {id: 'resource', title: i18nString(UIStrings.resource), sort: DataGrid.DataGrid.Order.Ascending, sortable: true},
237
- {id: 'type', title: i18nString(UIStrings.typeString), sortable: true},
238
- {id: 'size', title: i18nString(UIStrings.sizeString), align: DataGrid.DataGrid.Align.Right, sortable: true},
239
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
240
- const parameters: DataGrid.DataGrid.Parameters = {
241
- displayName: i18nString(UIStrings.applicationCache),
242
- columns,
243
- editCallback: undefined,
244
- deleteCallback: undefined,
245
- refreshCallback: undefined,
246
- };
247
- this.dataGrid = new DataGrid.DataGrid.DataGridImpl(parameters);
248
- this.dataGrid.setStriped(true);
249
- this.dataGrid.asWidget().show(this.element);
250
- this.dataGrid.addEventListener(DataGrid.DataGrid.Events.SortingChanged, this.populateDataGrid, this);
251
- }
252
-
253
- private populateDataGrid(): void {
254
- if (!this.dataGrid) {
255
- return;
256
- }
257
- const selectedResource: Protocol.ApplicationCache.ApplicationCacheResource|null =
258
- (this.dataGrid.selectedNode ? this.nodeResources.get(this.dataGrid.selectedNode) : null) || null;
259
- const sortDirection = this.dataGrid.isSortOrderAscending() ? 1 : -1;
260
-
261
- function numberCompare(
262
- field: keyof Platform.TypeScriptUtilities
263
- .PickFieldsThatExtend<Protocol.ApplicationCache.ApplicationCacheResource, number>,
264
- resource1: Protocol.ApplicationCache.ApplicationCacheResource,
265
- resource2: Protocol.ApplicationCache.ApplicationCacheResource): number {
266
- return sortDirection * (resource1[field] - resource2[field]);
267
- }
268
-
269
- function localeCompare(
270
- field: keyof Platform.TypeScriptUtilities
271
- .PickFieldsThatExtend<Protocol.ApplicationCache.ApplicationCacheResource, string>,
272
- resource1: Protocol.ApplicationCache.ApplicationCacheResource,
273
- resource2: Protocol.ApplicationCache.ApplicationCacheResource): number {
274
- return sortDirection * resource1[field].localeCompare(resource2[field]);
275
- }
276
-
277
- let comparator = null;
278
- switch (this.dataGrid.sortColumnId()) {
279
- case 'resource':
280
- comparator = localeCompare.bind(null, 'url');
281
- break;
282
- case 'type':
283
- comparator = localeCompare.bind(null, 'type');
284
- break;
285
- case 'size':
286
- comparator = numberCompare.bind(null, 'size');
287
- break;
288
- }
289
-
290
- this.dataGrid.rootNode().removeChildren();
291
- if (!this.resources) {
292
- return;
293
- }
294
- if (comparator) {
295
- this.resources.sort(comparator);
296
- }
297
-
298
- let nodeToSelect;
299
- for (let i = 0; i < this.resources.length; ++i) {
300
- const resource = this.resources[i];
301
- const data = {
302
- resource: resource.url,
303
- type: resource.type,
304
- size: Platform.NumberUtilities.bytesToString(resource.size),
305
- };
306
- const node = new DataGrid.DataGrid.DataGridNode(data);
307
- this.nodeResources.set(node, resource);
308
- node.selectable = true;
309
- this.dataGrid.rootNode().appendChild(node);
310
- if (resource === selectedResource) {
311
- nodeToSelect = node;
312
- nodeToSelect.selected = true;
313
- }
314
- }
315
-
316
- if (!nodeToSelect && this.dataGrid.rootNode().children.length) {
317
- this.dataGrid.rootNode().children[0].selected = true;
318
- }
319
- }
320
-
321
- private deleteButtonClicked(_event: Common.EventTarget.EventTargetEvent): void {
322
- if (!this.dataGrid || !this.dataGrid.selectedNode) {
323
- return;
324
- }
325
-
326
- // FIXME: Delete Button semantics are not yet defined. (Delete a single, or all?)
327
- this.deleteCallback(this.dataGrid.selectedNode);
328
- }
329
-
330
- private deleteCallback(_node: DataGrid.DataGrid.DataGridNode<unknown>): void {
331
- // FIXME: Should we delete a single (selected) resource or all resources?
332
- // ProtocolClient.inspectorBackend.deleteCachedResource(...)
333
- // this.update();
334
- }
335
- }