chrome-devtools-frontend 1.0.1036501 → 1.0.1038113

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 (386) hide show
  1. package/config/gni/devtools_grd_files.gni +9 -2
  2. package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
  3. package/front_end/core/sdk/NetworkManager.ts +21 -5
  4. package/front_end/core/sdk/NetworkRequest.ts +10 -0
  5. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  6. package/front_end/panels/elements/ElementsTreeOutline.ts +3 -3
  7. package/front_end/panels/elements/TopLayerContainer.ts +14 -13
  8. package/front_end/panels/media/PlayerPropertiesView.ts +43 -11
  9. package/front_end/panels/media/playerPropertiesView.css +22 -3
  10. package/front_end/panels/sources/NavigatorView.ts +12 -3
  11. package/front_end/panels/sources/components/BreakpointsView.ts +11 -16
  12. package/front_end/panels/sources/components/breakpointsView.css +21 -13
  13. package/front_end/panels/timeline/TimelineLoader.ts +1 -1
  14. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +244 -244
  15. package/front_end/third_party/lighthouse/locales/en-US.json +2 -2
  16. package/front_end/third_party/lighthouse/locales/en-XL.json +2 -2
  17. package/front_end/third_party/puppeteer/package/README.md +20 -0
  18. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.d.ts +3 -3
  19. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.js +4 -4
  20. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.js.map +1 -1
  21. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  22. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +10 -8
  23. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  24. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +19 -6
  25. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
  26. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +23 -10
  27. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
  28. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  29. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +3 -2
  30. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  31. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
  32. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js +35 -20
  33. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js.map +1 -1
  34. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +9 -2
  35. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
  36. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +19 -7
  37. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js.map +1 -1
  38. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +5 -4
  39. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
  40. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js +6 -5
  41. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
  42. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts +1 -0
  43. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts.map +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js +1 -0
  45. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js.map +1 -1
  46. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +2 -0
  47. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts.map +1 -1
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.js +3 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.js.map +1 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts +168 -131
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js +208 -206
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js.map +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +1 -0
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +1 -0
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts +2 -2
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +2 -2
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +74 -75
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts.map +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js +82 -97
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js.map +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +16 -8
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts.map +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.js +17 -9
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.js.map +1 -1
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts +2 -1
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js +3 -2
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js.map +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts +634 -0
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts.map +1 -0
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js +713 -0
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js.map +1 -0
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +9 -679
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +77 -803
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +11 -10
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +11 -10
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +2 -2
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +1 -1
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +34 -13
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js +35 -14
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{DOMWorld.d.ts → IsolatedWorld.d.ts} +58 -13
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.d.ts.map +1 -0
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{DOMWorld.js → IsolatedWorld.js} +124 -151
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.js.map +1 -0
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +40 -58
  96. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  97. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +53 -76
  98. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +2 -1
  100. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +23 -6
  102. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +17 -17
  104. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
  106. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +8 -8
  107. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts +2 -0
  109. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +395 -296
  112. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +398 -313
  114. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +14 -7
  116. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js +14 -7
  118. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -1
  119. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +38 -17
  120. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js +49 -31
  122. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +1 -1
  124. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js +7 -3
  126. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.d.ts +1 -0
  128. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js +4 -2
  130. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +8 -4
  132. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts.map +1 -1
  133. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js +8 -4
  134. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js.map +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts +1 -34
  136. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts.map +1 -1
  137. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +5 -53
  138. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
  139. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +3 -0
  140. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -0
  141. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +6 -0
  142. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -0
  143. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  144. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  145. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.d.ts.map +1 -1
  146. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js +2 -2
  147. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js.map +1 -1
  148. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts +28 -0
  149. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts.map +1 -0
  150. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js +148 -0
  151. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js.map +1 -0
  152. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +2 -0
  153. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts.map +1 -0
  154. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js +18 -0
  155. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js.map +1 -0
  156. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts +3 -1
  157. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  158. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js +4 -2
  159. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
  160. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  161. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +4 -3
  162. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -2
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js +2 -2
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js +1 -1
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +3 -1
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +3 -1
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts +3 -2
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js +3 -2
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts +25 -0
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts.map +1 -0
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js +78 -0
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js.map +1 -0
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.d.ts +17 -0
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.d.ts.map +1 -0
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.js +22 -0
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.js.map +1 -0
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/{common → util}/assert.d.ts +0 -0
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/assert.d.ts.map +1 -0
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/{common → util}/assert.js +0 -0
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/assert.js.map +1 -0
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts +2 -0
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts.map +1 -0
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js +19 -0
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js.map +1 -0
  195. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +3 -3
  196. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +4 -4
  197. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
  199. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +10 -8
  200. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  201. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +19 -6
  202. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +23 -10
  204. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
  206. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -2
  207. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  208. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js +36 -21
  210. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +9 -2
  212. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +19 -7
  214. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js.map +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +5 -4
  216. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +6 -5
  218. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js.map +1 -1
  219. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +1 -0
  220. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -1
  221. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +1 -0
  222. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js.map +1 -1
  223. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +2 -0
  224. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -1
  225. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +3 -1
  226. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts +168 -131
  228. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts.map +1 -1
  229. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js +208 -206
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js.map +1 -1
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +1 -0
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +1 -0
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +2 -2
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +2 -2
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +74 -75
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -1
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +83 -98
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js.map +1 -1
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +16 -8
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +17 -9
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js.map +1 -1
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts +2 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js +3 -2
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js.map +1 -1
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts +634 -0
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts.map +1 -0
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js +709 -0
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js.map +1 -0
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +9 -679
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +72 -797
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +11 -10
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +11 -10
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +2 -2
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +34 -13
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -1
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +35 -14
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js.map +1 -1
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{DOMWorld.d.ts → IsolatedWorld.d.ts} +58 -13
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.d.ts.map +1 -0
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{DOMWorld.js → IsolatedWorld.js} +123 -150
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.js.map +1 -0
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +40 -58
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +54 -77
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +2 -1
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +24 -7
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +17 -17
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +8 -8
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +2 -0
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js.map +1 -1
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +395 -296
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +398 -313
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +14 -7
  293. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -1
  294. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +14 -7
  295. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js.map +1 -1
  296. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +38 -17
  297. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -1
  298. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +49 -31
  299. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js.map +1 -1
  300. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +1 -1
  301. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -1
  302. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +7 -3
  303. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js.map +1 -1
  304. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +1 -0
  305. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -1
  306. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +4 -2
  307. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js.map +1 -1
  308. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +8 -4
  309. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -1
  310. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +8 -4
  311. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js.map +1 -1
  312. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts +1 -34
  313. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts.map +1 -1
  314. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +3 -48
  315. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
  316. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +3 -0
  317. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -0
  318. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +3 -0
  319. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -0
  320. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  321. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  322. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.d.ts.map +1 -1
  323. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js +2 -2
  324. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js.map +1 -1
  325. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts +28 -0
  326. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts.map +1 -0
  327. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js +142 -0
  328. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js.map +1 -0
  329. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +2 -0
  330. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts.map +1 -0
  331. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js +2 -0
  332. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js.map +1 -0
  333. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +3 -1
  334. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
  335. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +4 -2
  336. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
  337. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
  338. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +3 -2
  339. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
  340. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  341. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -2
  342. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  343. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
  344. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js +2 -2
  345. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js.map +1 -1
  346. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -1
  347. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js.map +1 -1
  348. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +3 -1
  349. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -1
  350. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +3 -1
  351. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +1 -1
  352. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts +3 -2
  353. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts.map +1 -1
  354. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js +3 -2
  355. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js.map +1 -1
  356. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts +25 -0
  357. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts.map +1 -0
  358. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js +73 -0
  359. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js.map +1 -0
  360. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.d.ts +17 -0
  361. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.d.ts.map +1 -0
  362. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.js +17 -0
  363. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.js.map +1 -0
  364. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/{common → util}/assert.d.ts +0 -0
  365. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/assert.d.ts.map +1 -0
  366. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/{common → util}/assert.js +0 -0
  367. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/assert.js.map +1 -0
  368. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts +2 -0
  369. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts.map +1 -0
  370. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js +15 -0
  371. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js.map +1 -0
  372. package/front_end/third_party/puppeteer/package/lib/types.d.ts +1069 -878
  373. package/front_end/third_party/puppeteer/package/package.json +32 -28
  374. package/front_end/third_party/puppeteer/package/typescript-if-required.js +1 -1
  375. package/front_end/third_party/puppeteer/puppeteer.ts +1 -1
  376. package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
  377. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  378. package/package.json +1 -1
  379. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +0 -1
  380. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +0 -1
  381. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.d.ts.map +0 -1
  382. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.js.map +0 -1
  383. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +0 -1
  384. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +0 -1
  385. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +0 -1
  386. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js.map +0 -1
@@ -15,10 +15,10 @@
15
15
  */
16
16
  import { Protocol } from 'devtools-protocol';
17
17
  import { CDPSession } from './Connection.js';
18
- import { EvaluateFunc, HandleFor, HandleOr } from './types.js';
18
+ import type { ElementHandle } from './ElementHandle.js';
19
19
  import { ExecutionContext } from './ExecutionContext.js';
20
20
  import { MouseButton } from './Input.js';
21
- import type { ElementHandle } from './ElementHandle.js';
21
+ import { EvaluateFunc, HandleFor, HandleOr } from './types.js';
22
22
  declare const __JSHandleSymbol: unique symbol;
23
23
  /**
24
24
  * @public
@@ -45,21 +45,24 @@ export interface BoundingBox extends Point {
45
45
  height: number;
46
46
  }
47
47
  /**
48
- * Represents an in-page JavaScript object. JSHandles can be created with the
49
- * {@link Page.evaluateHandle | page.evaluateHandle} method.
48
+ * Represents a reference to a JavaScript object. Instances can be created using
49
+ * {@link Page.evaluateHandle}.
50
+ *
51
+ * Handles prevent the referenced JavaScript object from being garbage-collected
52
+ * unless the handle is purposely {@link JSHandle.dispose | disposed}. JSHandles
53
+ * are auto-disposed when their associated frame is navigated away or the parent
54
+ * context gets destroyed.
55
+ *
56
+ * Handles can be used as arguments for any evaluation function such as
57
+ * {@link Page.$eval}, {@link Page.evaluate}, and {@link Page.evaluateHandle}.
58
+ * They are resolved to their referenced object.
50
59
  *
51
60
  * @example
61
+ *
52
62
  * ```ts
53
63
  * const windowHandle = await page.evaluateHandle(() => window);
54
64
  * ```
55
65
  *
56
- * JSHandle prevents the referenced JavaScript object from being garbage-collected
57
- * unless the handle is {@link JSHandle.dispose | disposed}. JSHandles are auto-
58
- * disposed when their origin frame gets navigated or the parent context gets destroyed.
59
- *
60
- * JSHandle instances can be used as arguments for {@link Page.$eval},
61
- * {@link Page.evaluate}, and {@link Page.evaluateHandle}.
62
- *
63
66
  * @public
64
67
  */
65
68
  export declare class JSHandle<T = unknown> {
@@ -71,55 +74,32 @@ export declare class JSHandle<T = unknown> {
71
74
  /**
72
75
  * @internal
73
76
  */
74
- get _client(): CDPSession;
77
+ get client(): CDPSession;
75
78
  /**
76
79
  * @internal
77
80
  */
78
- get _disposed(): boolean;
79
- /**
80
- * @internal
81
- */
82
- get _remoteObject(): Protocol.Runtime.RemoteObject;
83
- /**
84
- * @internal
85
- */
86
- get _context(): ExecutionContext;
81
+ get disposed(): boolean;
87
82
  /**
88
83
  * @internal
89
84
  */
90
85
  constructor(context: ExecutionContext, client: CDPSession, remoteObject: Protocol.Runtime.RemoteObject);
91
- /** Returns the execution context the handle belongs to.
86
+ /**
87
+ * @returns The execution context the handle belongs to.
92
88
  */
93
89
  executionContext(): ExecutionContext;
94
90
  /**
95
- * This method passes this handle as the first argument to `pageFunction`. If
96
- * `pageFunction` returns a Promise, then `handle.evaluate` would wait for the
97
- * promise to resolve and return its value.
91
+ * Evaluates the given function with the current handle as its first argument.
98
92
  *
99
- * @example
100
- * ```ts
101
- * const tweetHandle = await page.$('.tweet .retweets');
102
- * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');
103
- * ```
93
+ * @see {@link ExecutionContext.evaluate} for more details.
104
94
  */
105
95
  evaluate<Params extends unknown[], Func extends EvaluateFunc<[this, ...Params]> = EvaluateFunc<[
106
96
  this,
107
97
  ...Params
108
98
  ]>>(pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;
109
99
  /**
110
- * This method passes this handle as the first argument to `pageFunction`.
111
- *
112
- * @remarks
100
+ * Evaluates the given function with the current handle as its first argument.
113
101
  *
114
- * The only difference between `jsHandle.evaluate` and
115
- * `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns an
116
- * in-page object (JSHandle).
117
- *
118
- * If the function passed to `jsHandle.evaluateHandle` returns a Promise, then
119
- * `evaluateHandle.evaluateHandle` waits for the promise to resolve and
120
- * returns its value.
121
- *
122
- * See {@link Page.evaluateHandle} for more details.
102
+ * @see {@link ExecutionContext.evaluateHandle} for more details.
123
103
  */
124
104
  evaluateHandle<Params extends unknown[], Func extends EvaluateFunc<[this, ...Params]> = EvaluateFunc<[
125
105
  this,
@@ -131,51 +111,53 @@ export declare class JSHandle<T = unknown> {
131
111
  getProperty<K extends keyof T>(propertyName: HandleOr<K>): Promise<HandleFor<T[K]>>;
132
112
  getProperty(propertyName: string): Promise<JSHandle<unknown>>;
133
113
  /**
134
- * The method returns a map with property names as keys and JSHandle instances
135
- * for the property values.
114
+ * Gets a map of handles representing the properties of the current handle.
136
115
  *
137
116
  * @example
117
+ *
138
118
  * ```ts
139
119
  * const listHandle = await page.evaluateHandle(() => document.body.children);
140
120
  * const properties = await listHandle.getProperties();
141
121
  * const children = [];
142
122
  * for (const property of properties.values()) {
143
123
  * const element = property.asElement();
144
- * if (element)
124
+ * if (element) {
145
125
  * children.push(element);
126
+ * }
146
127
  * }
147
128
  * children; // holds elementHandles to all children of document.body
148
129
  * ```
149
130
  */
150
131
  getProperties(): Promise<Map<string, JSHandle>>;
151
132
  /**
152
- * @returns Returns a JSON representation of the object.If the object has a
153
- * `toJSON` function, it will not be called.
154
- * @remarks
133
+ * @returns A vanilla object representing the serializable portions of the
134
+ * referenced object.
135
+ * @throws Throws if the object cannot be serialized due to circularity.
155
136
  *
156
- * The JSON is generated by running {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify | JSON.stringify}
157
- * on the object in page and consequent {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse} in puppeteer.
158
- * **NOTE** The method throws if the referenced object is not stringifiable.
137
+ * @remarks
138
+ * If the object has a `toJSON` function, it **will not** be called.
159
139
  */
160
- jsonValue<T = unknown>(): Promise<T>;
140
+ jsonValue(): Promise<T>;
161
141
  /**
162
- * @returns Either `null` or the object handle itself, if the object
163
- * handle is an instance of {@link ElementHandle}.
142
+ * @returns Either `null` or the handle itself if the handle is an
143
+ * instance of {@link ElementHandle}.
164
144
  */
165
145
  asElement(): ElementHandle<Node> | null;
166
146
  /**
167
- * Stops referencing the element handle, and resolves when the object handle is
168
- * successfully disposed of.
147
+ * Releases the object referenced by the handle for garbage collection.
169
148
  */
170
149
  dispose(): Promise<void>;
171
150
  /**
172
151
  * Returns a string representation of the JSHandle.
173
152
  *
174
- * @remarks Useful during debugging.
153
+ * @remarks
154
+ * Useful during debugging.
175
155
  */
176
156
  toString(): string;
177
157
  /**
178
- * Provides access to [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject) backing this JSHandle.
158
+ * Provides access to the
159
+ * [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject)
160
+ * backing this handle.
179
161
  */
180
162
  remoteObject(): Protocol.Runtime.RemoteObject;
181
163
  }
@@ -1 +1 @@
1
- {"version":3,"file":"JSHandle.d.ts","sourceRoot":"","sources":["../../../../src/common/JSHandle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtD,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK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,CAAC;IAa7B;;;OAGG;IACH,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI;IAIvC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;;;;OAKG;IACH,QAAQ,IAAI,MAAM;IAQlB;;;;OAIG;IACH,YAAY,IAAI,QAAQ,CAAC,OAAO,CAAC,YAAY;CAG9C;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX"}
@@ -28,24 +28,27 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
28
28
  var _JSHandle_client, _JSHandle_disposed, _JSHandle_context, _JSHandle_remoteObject;
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.JSHandle = void 0;
31
- const assert_js_1 = require("./assert.js");
31
+ const assert_js_1 = require("../util/assert.js");
32
32
  const util_js_1 = require("./util.js");
33
33
  /**
34
- * Represents an in-page JavaScript object. JSHandles can be created with the
35
- * {@link Page.evaluateHandle | page.evaluateHandle} method.
34
+ * Represents a reference to a JavaScript object. Instances can be created using
35
+ * {@link Page.evaluateHandle}.
36
+ *
37
+ * Handles prevent the referenced JavaScript object from being garbage-collected
38
+ * unless the handle is purposely {@link JSHandle.dispose | disposed}. JSHandles
39
+ * are auto-disposed when their associated frame is navigated away or the parent
40
+ * context gets destroyed.
41
+ *
42
+ * Handles can be used as arguments for any evaluation function such as
43
+ * {@link Page.$eval}, {@link Page.evaluate}, and {@link Page.evaluateHandle}.
44
+ * They are resolved to their referenced object.
36
45
  *
37
46
  * @example
47
+ *
38
48
  * ```ts
39
49
  * const windowHandle = await page.evaluateHandle(() => window);
40
50
  * ```
41
51
  *
42
- * JSHandle prevents the referenced JavaScript object from being garbage-collected
43
- * unless the handle is {@link JSHandle.dispose | disposed}. JSHandles are auto-
44
- * disposed when their origin frame gets navigated or the parent context gets destroyed.
45
- *
46
- * JSHandle instances can be used as arguments for {@link Page.$eval},
47
- * {@link Page.evaluate}, and {@link Page.evaluateHandle}.
48
- *
49
52
  * @public
50
53
  */
51
54
  class JSHandle {
@@ -64,88 +67,64 @@ class JSHandle {
64
67
  /**
65
68
  * @internal
66
69
  */
67
- get _client() {
70
+ get client() {
68
71
  return __classPrivateFieldGet(this, _JSHandle_client, "f");
69
72
  }
70
73
  /**
71
74
  * @internal
72
75
  */
73
- get _disposed() {
76
+ get disposed() {
74
77
  return __classPrivateFieldGet(this, _JSHandle_disposed, "f");
75
78
  }
76
79
  /**
77
- * @internal
78
- */
79
- get _remoteObject() {
80
- return __classPrivateFieldGet(this, _JSHandle_remoteObject, "f");
81
- }
82
- /**
83
- * @internal
84
- */
85
- get _context() {
86
- return __classPrivateFieldGet(this, _JSHandle_context, "f");
87
- }
88
- /** Returns the execution context the handle belongs to.
80
+ * @returns The execution context the handle belongs to.
89
81
  */
90
82
  executionContext() {
91
83
  return __classPrivateFieldGet(this, _JSHandle_context, "f");
92
84
  }
93
85
  /**
94
- * This method passes this handle as the first argument to `pageFunction`. If
95
- * `pageFunction` returns a Promise, then `handle.evaluate` would wait for the
96
- * promise to resolve and return its value.
86
+ * Evaluates the given function with the current handle as its first argument.
97
87
  *
98
- * @example
99
- * ```ts
100
- * const tweetHandle = await page.$('.tweet .retweets');
101
- * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');
102
- * ```
88
+ * @see {@link ExecutionContext.evaluate} for more details.
103
89
  */
104
90
  async evaluate(pageFunction, ...args) {
105
91
  return await this.executionContext().evaluate(pageFunction, this, ...args);
106
92
  }
107
93
  /**
108
- * This method passes this handle as the first argument to `pageFunction`.
109
- *
110
- * @remarks
111
- *
112
- * The only difference between `jsHandle.evaluate` and
113
- * `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns an
114
- * in-page object (JSHandle).
115
- *
116
- * If the function passed to `jsHandle.evaluateHandle` returns a Promise, then
117
- * `evaluateHandle.evaluateHandle` waits for the promise to resolve and
118
- * returns its value.
94
+ * Evaluates the given function with the current handle as its first argument.
119
95
  *
120
- * See {@link Page.evaluateHandle} for more details.
96
+ * @see {@link ExecutionContext.evaluateHandle} for more details.
121
97
  */
122
98
  async evaluateHandle(pageFunction, ...args) {
123
99
  return await this.executionContext().evaluateHandle(pageFunction, this, ...args);
124
100
  }
125
101
  async getProperty(propertyName) {
126
- return await this.evaluateHandle((object, propertyName) => {
102
+ return this.evaluateHandle((object, propertyName) => {
127
103
  return object[propertyName];
128
104
  }, propertyName);
129
105
  }
130
106
  /**
131
- * The method returns a map with property names as keys and JSHandle instances
132
- * for the property values.
107
+ * Gets a map of handles representing the properties of the current handle.
133
108
  *
134
109
  * @example
110
+ *
135
111
  * ```ts
136
112
  * const listHandle = await page.evaluateHandle(() => document.body.children);
137
113
  * const properties = await listHandle.getProperties();
138
114
  * const children = [];
139
115
  * for (const property of properties.values()) {
140
116
  * const element = property.asElement();
141
- * if (element)
117
+ * if (element) {
142
118
  * children.push(element);
119
+ * }
143
120
  * }
144
121
  * children; // holds elementHandles to all children of document.body
145
122
  * ```
146
123
  */
147
124
  async getProperties() {
148
125
  (0, assert_js_1.assert)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId);
126
+ // We use Runtime.getProperties rather than iterative building because the
127
+ // iterative approach might create a distorted snapshot.
149
128
  const response = await __classPrivateFieldGet(this, _JSHandle_client, "f").send('Runtime.getProperties', {
150
129
  objectId: __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId,
151
130
  ownProperties: true,
@@ -160,39 +139,34 @@ class JSHandle {
160
139
  return result;
161
140
  }
162
141
  /**
163
- * @returns Returns a JSON representation of the object.If the object has a
164
- * `toJSON` function, it will not be called.
165
- * @remarks
142
+ * @returns A vanilla object representing the serializable portions of the
143
+ * referenced object.
144
+ * @throws Throws if the object cannot be serialized due to circularity.
166
145
  *
167
- * The JSON is generated by running {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify | JSON.stringify}
168
- * on the object in page and consequent {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse} in puppeteer.
169
- * **NOTE** The method throws if the referenced object is not stringifiable.
146
+ * @remarks
147
+ * If the object has a `toJSON` function, it **will not** be called.
170
148
  */
171
149
  async jsonValue() {
172
- if (__classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId) {
173
- const response = await __classPrivateFieldGet(this, _JSHandle_client, "f").send('Runtime.callFunctionOn', {
174
- functionDeclaration: 'function() { return this; }',
175
- objectId: __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId,
176
- returnByValue: true,
177
- awaitPromise: true,
178
- });
179
- return (0, util_js_1.valueFromRemoteObject)(response.result);
150
+ if (!__classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId) {
151
+ return (0, util_js_1.valueFromRemoteObject)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f"));
180
152
  }
181
- return (0, util_js_1.valueFromRemoteObject)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f"));
153
+ const value = await this.evaluate(object => {
154
+ return object;
155
+ });
156
+ if (value === undefined) {
157
+ throw new Error('Could not serialize referenced object');
158
+ }
159
+ return value;
182
160
  }
183
161
  /**
184
- * @returns Either `null` or the object handle itself, if the object
185
- * handle is an instance of {@link ElementHandle}.
162
+ * @returns Either `null` or the handle itself if the handle is an
163
+ * instance of {@link ElementHandle}.
186
164
  */
187
165
  asElement() {
188
- /* This always returns null, but subclasses can override this and return an
189
- ElementHandle.
190
- */
191
166
  return null;
192
167
  }
193
168
  /**
194
- * Stops referencing the element handle, and resolves when the object handle is
195
- * successfully disposed of.
169
+ * Releases the object referenced by the handle for garbage collection.
196
170
  */
197
171
  async dispose() {
198
172
  if (__classPrivateFieldGet(this, _JSHandle_disposed, "f")) {
@@ -204,17 +178,20 @@ class JSHandle {
204
178
  /**
205
179
  * Returns a string representation of the JSHandle.
206
180
  *
207
- * @remarks Useful during debugging.
181
+ * @remarks
182
+ * Useful during debugging.
208
183
  */
209
184
  toString() {
210
- if (__classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId) {
211
- const type = __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").subtype || __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").type;
212
- return 'JSHandle@' + type;
185
+ if (!__classPrivateFieldGet(this, _JSHandle_remoteObject, "f").objectId) {
186
+ return 'JSHandle:' + (0, util_js_1.valueFromRemoteObject)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f"));
213
187
  }
214
- return 'JSHandle:' + (0, util_js_1.valueFromRemoteObject)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f"));
188
+ const type = __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").subtype || __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").type;
189
+ return 'JSHandle@' + type;
215
190
  }
216
191
  /**
217
- * Provides access to [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject) backing this JSHandle.
192
+ * Provides access to the
193
+ * [Protocol.Runtime.RemoteObject](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject)
194
+ * backing this handle.
218
195
  */
219
196
  remoteObject() {
220
197
  return __classPrivateFieldGet(this, _JSHandle_remoteObject, "f");
@@ -1 +1 @@
1
- {"version":3,"file":"JSHandle.js","sourceRoot":"","sources":["../../../../src/common/JSHandle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;AAGH,2CAAmC;AAKnC,uCAA+E;AA+B/E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAQ;IAuCnB;;OAEG;IACH,YACE,OAAyB,EACzB,MAAkB,EAClB,YAA2C;QAvC7C,mCAAoB;QACpB,6BAAY,KAAK,EAAC;QAClB,oCAA2B;QAC3B,yCAA6C;QAsC3C,uBAAA,IAAI,qBAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,oBAAW,MAAM,MAAA,CAAC;QACtB,uBAAA,IAAI,0BAAiB,YAAY,MAAA,CAAC;IACpC,CAAC;IAvCD;;OAEG;IACH,IAAI,OAAO;QACT,OAAO,uBAAA,IAAI,wBAAQ,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,uBAAA,IAAI,0BAAU,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACf,OAAO,uBAAA,IAAI,8BAAc,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,uBAAA,IAAI,yBAAS,CAAC;IACvB,CAAC;IAeD;OACG;IACH,gBAAgB;QACd,OAAO,uBAAA,IAAI,yBAAS,CAAC;IACvB,CAAC;IAED;;;;;;;;;;OAUG;IAEH,KAAK,CAAC,QAAQ,CAMZ,YAA2B,EAC3B,GAAG,IAAY;QAIf,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,cAAc,CAM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A,IAAI,8BAAc,CAAC,CAAC;IACxD,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACN,IAAI,CAAC,uBAAA,IAAI,8BAAc,CAAC,QAAQ,EAAE;YAChC,OAAO,WAAW,GAAG,IAAA,+BAAqB,EAAC,uBAAA,IAAI,8BAAc,CAAC,CAAC;SAChE;QACD,MAAM,IAAI,GAAG,uBAAA,IAAI,8BAAc,CAAC,OAAO,IAAI,uBAAA,IAAI,8BAAc,CAAC,IAAI,CAAC;QACnE,OAAO,WAAW,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,uBAAA,IAAI,8BAAc,CAAC;IAC5B,CAAC;CACF;AAxMD,4BAwMC"}
@@ -14,7 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { TimeoutError } from './Errors.js';
17
- import { FrameManager, Frame } from './FrameManager.js';
17
+ import { FrameManager } from './FrameManager.js';
18
+ import { Frame } from './Frame.js';
18
19
  import { HTTPResponse } from './HTTPResponse.js';
19
20
  /**
20
21
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleWatcher.d.ts","sourceRoot":"","sources":["../../../../src/common/LifecycleWatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAG/C;;GAEG;AACH,oBAAY,uBAAuB,GAC/B,MAAM,GACN,kBAAkB,GAClB,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,oBAAY,sBAAsB,GAC9B,MAAM,GACN,kBAAkB,GAClB,aAAa,GACb,mBAAmB,CAAC;AAcxB;;GAEG;AACH,qBAAa,gBAAgB;;gBAsCzB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,EACZ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,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,2BAA2B,IAAI,OAAO,CAAC,KAAK,GAAG,YAAY,GAAG,SAAS,CAAC;IAyExE,OAAO,IAAI,IAAI;CAIhB"}
@@ -25,11 +25,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
25
25
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
26
26
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
27
27
  };
28
- var _LifecycleWatcher_instances, _LifecycleWatcher_expectedLifecycle, _LifecycleWatcher_frameManager, _LifecycleWatcher_frame, _LifecycleWatcher_timeout, _LifecycleWatcher_navigationRequest, _LifecycleWatcher_eventListeners, _LifecycleWatcher_initialLoaderId, _LifecycleWatcher_sameDocumentNavigationCompleteCallback, _LifecycleWatcher_sameDocumentNavigationPromise, _LifecycleWatcher_lifecycleCallback, _LifecycleWatcher_lifecyclePromise, _LifecycleWatcher_newDocumentNavigationCompleteCallback, _LifecycleWatcher_newDocumentNavigationPromise, _LifecycleWatcher_terminationCallback, _LifecycleWatcher_terminationPromise, _LifecycleWatcher_timeoutPromise, _LifecycleWatcher_maximumTimer, _LifecycleWatcher_hasSameDocumentNavigation, _LifecycleWatcher_swapped, _LifecycleWatcher_onRequest, _LifecycleWatcher_onFrameDetached, _LifecycleWatcher_terminate, _LifecycleWatcher_createTimeoutPromise, _LifecycleWatcher_navigatedWithinDocument, _LifecycleWatcher_navigated, _LifecycleWatcher_frameSwapped, _LifecycleWatcher_checkLifecycleComplete;
28
+ var _LifecycleWatcher_instances, _LifecycleWatcher_expectedLifecycle, _LifecycleWatcher_frameManager, _LifecycleWatcher_frame, _LifecycleWatcher_timeout, _LifecycleWatcher_navigationRequest, _LifecycleWatcher_eventListeners, _LifecycleWatcher_initialLoaderId, _LifecycleWatcher_sameDocumentNavigationCompleteCallback, _LifecycleWatcher_sameDocumentNavigationPromise, _LifecycleWatcher_lifecycleCallback, _LifecycleWatcher_lifecyclePromise, _LifecycleWatcher_newDocumentNavigationCompleteCallback, _LifecycleWatcher_newDocumentNavigationPromise, _LifecycleWatcher_terminationCallback, _LifecycleWatcher_terminationPromise, _LifecycleWatcher_timeoutPromise, _LifecycleWatcher_maximumTimer, _LifecycleWatcher_hasSameDocumentNavigation, _LifecycleWatcher_swapped, _LifecycleWatcher_navigationResponseReceived, _LifecycleWatcher_onRequest, _LifecycleWatcher_onResponse, _LifecycleWatcher_onFrameDetached, _LifecycleWatcher_terminate, _LifecycleWatcher_createTimeoutPromise, _LifecycleWatcher_navigatedWithinDocument, _LifecycleWatcher_navigated, _LifecycleWatcher_frameSwapped, _LifecycleWatcher_checkLifecycleComplete;
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.LifecycleWatcher = void 0;
31
- const assert_js_1 = require("./assert.js");
31
+ const assert_js_1 = require("../util/assert.js");
32
32
  const util_js_1 = require("./util.js");
33
+ const DeferredPromise_js_1 = require("../util/DeferredPromise.js");
33
34
  const Errors_js_1 = require("./Errors.js");
34
35
  const FrameManager_js_1 = require("./FrameManager.js");
35
36
  const NetworkManager_js_1 = require("./NetworkManager.js");
@@ -74,6 +75,7 @@ class LifecycleWatcher {
74
75
  _LifecycleWatcher_maximumTimer.set(this, void 0);
75
76
  _LifecycleWatcher_hasSameDocumentNavigation.set(this, void 0);
76
77
  _LifecycleWatcher_swapped.set(this, void 0);
78
+ _LifecycleWatcher_navigationResponseReceived.set(this, void 0);
77
79
  if (Array.isArray(waitUntil)) {
78
80
  waitUntil = waitUntil.slice();
79
81
  }
@@ -90,19 +92,22 @@ class LifecycleWatcher {
90
92
  __classPrivateFieldSet(this, _LifecycleWatcher_frame, frame, "f");
91
93
  __classPrivateFieldSet(this, _LifecycleWatcher_timeout, timeout, "f");
92
94
  __classPrivateFieldSet(this, _LifecycleWatcher_eventListeners, [
93
- (0, util_js_1.addEventListener)(frameManager._client, Connection_js_1.CDPSessionEmittedEvents.Disconnected, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_terminate).bind(this, new Error('Navigation failed because browser has disconnected!'))),
95
+ (0, util_js_1.addEventListener)(frameManager.client, Connection_js_1.CDPSessionEmittedEvents.Disconnected, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_terminate).bind(this, new Error('Navigation failed because browser has disconnected!'))),
94
96
  (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f"), FrameManager_js_1.FrameManagerEmittedEvents.LifecycleEvent, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_checkLifecycleComplete).bind(this)),
95
97
  (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f"), FrameManager_js_1.FrameManagerEmittedEvents.FrameNavigatedWithinDocument, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_navigatedWithinDocument).bind(this)),
96
98
  (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f"), FrameManager_js_1.FrameManagerEmittedEvents.FrameNavigated, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_navigated).bind(this)),
97
99
  (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f"), FrameManager_js_1.FrameManagerEmittedEvents.FrameSwapped, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_frameSwapped).bind(this)),
98
100
  (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f"), FrameManager_js_1.FrameManagerEmittedEvents.FrameDetached, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_onFrameDetached).bind(this)),
99
- (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f").networkManager(), NetworkManager_js_1.NetworkManagerEmittedEvents.Request, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_onRequest).bind(this)),
101
+ (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f").networkManager, NetworkManager_js_1.NetworkManagerEmittedEvents.Request, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_onRequest).bind(this)),
102
+ (0, util_js_1.addEventListener)(__classPrivateFieldGet(this, _LifecycleWatcher_frameManager, "f").networkManager, NetworkManager_js_1.NetworkManagerEmittedEvents.Response, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_onResponse).bind(this)),
100
103
  ], "f");
101
104
  __classPrivateFieldSet(this, _LifecycleWatcher_timeoutPromise, __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_createTimeoutPromise).call(this), "f");
102
105
  __classPrivateFieldGet(this, _LifecycleWatcher_instances, "m", _LifecycleWatcher_checkLifecycleComplete).call(this);
103
106
  }
104
107
  async navigationResponse() {
105
- // We may need to wait for ExtraInfo events before the request is complete.
108
+ var _a;
109
+ // Continue with a possibly null response.
110
+ await ((_a = __classPrivateFieldGet(this, _LifecycleWatcher_navigationResponseReceived, "f")) === null || _a === void 0 ? void 0 : _a.catch(() => { }));
106
111
  return __classPrivateFieldGet(this, _LifecycleWatcher_navigationRequest, "f") ? __classPrivateFieldGet(this, _LifecycleWatcher_navigationRequest, "f").response() : null;
107
112
  }
108
113
  sameDocumentNavigationPromise() {
@@ -123,11 +128,23 @@ class LifecycleWatcher {
123
128
  }
124
129
  }
125
130
  exports.LifecycleWatcher = LifecycleWatcher;
126
- _LifecycleWatcher_expectedLifecycle = new WeakMap(), _LifecycleWatcher_frameManager = new WeakMap(), _LifecycleWatcher_frame = new WeakMap(), _LifecycleWatcher_timeout = new WeakMap(), _LifecycleWatcher_navigationRequest = new WeakMap(), _LifecycleWatcher_eventListeners = new WeakMap(), _LifecycleWatcher_initialLoaderId = new WeakMap(), _LifecycleWatcher_sameDocumentNavigationCompleteCallback = new WeakMap(), _LifecycleWatcher_sameDocumentNavigationPromise = new WeakMap(), _LifecycleWatcher_lifecycleCallback = new WeakMap(), _LifecycleWatcher_lifecyclePromise = new WeakMap(), _LifecycleWatcher_newDocumentNavigationCompleteCallback = new WeakMap(), _LifecycleWatcher_newDocumentNavigationPromise = new WeakMap(), _LifecycleWatcher_terminationCallback = new WeakMap(), _LifecycleWatcher_terminationPromise = new WeakMap(), _LifecycleWatcher_timeoutPromise = new WeakMap(), _LifecycleWatcher_maximumTimer = new WeakMap(), _LifecycleWatcher_hasSameDocumentNavigation = new WeakMap(), _LifecycleWatcher_swapped = new WeakMap(), _LifecycleWatcher_instances = new WeakSet(), _LifecycleWatcher_onRequest = function _LifecycleWatcher_onRequest(request) {
131
+ _LifecycleWatcher_expectedLifecycle = new WeakMap(), _LifecycleWatcher_frameManager = new WeakMap(), _LifecycleWatcher_frame = new WeakMap(), _LifecycleWatcher_timeout = new WeakMap(), _LifecycleWatcher_navigationRequest = new WeakMap(), _LifecycleWatcher_eventListeners = new WeakMap(), _LifecycleWatcher_initialLoaderId = new WeakMap(), _LifecycleWatcher_sameDocumentNavigationCompleteCallback = new WeakMap(), _LifecycleWatcher_sameDocumentNavigationPromise = new WeakMap(), _LifecycleWatcher_lifecycleCallback = new WeakMap(), _LifecycleWatcher_lifecyclePromise = new WeakMap(), _LifecycleWatcher_newDocumentNavigationCompleteCallback = new WeakMap(), _LifecycleWatcher_newDocumentNavigationPromise = new WeakMap(), _LifecycleWatcher_terminationCallback = new WeakMap(), _LifecycleWatcher_terminationPromise = new WeakMap(), _LifecycleWatcher_timeoutPromise = new WeakMap(), _LifecycleWatcher_maximumTimer = new WeakMap(), _LifecycleWatcher_hasSameDocumentNavigation = new WeakMap(), _LifecycleWatcher_swapped = new WeakMap(), _LifecycleWatcher_navigationResponseReceived = new WeakMap(), _LifecycleWatcher_instances = new WeakSet(), _LifecycleWatcher_onRequest = function _LifecycleWatcher_onRequest(request) {
132
+ var _a, _b;
127
133
  if (request.frame() !== __classPrivateFieldGet(this, _LifecycleWatcher_frame, "f") || !request.isNavigationRequest()) {
128
134
  return;
129
135
  }
130
136
  __classPrivateFieldSet(this, _LifecycleWatcher_navigationRequest, request, "f");
137
+ (_a = __classPrivateFieldGet(this, _LifecycleWatcher_navigationResponseReceived, "f")) === null || _a === void 0 ? void 0 : _a.reject(new Error('New navigation request was received'));
138
+ __classPrivateFieldSet(this, _LifecycleWatcher_navigationResponseReceived, (0, DeferredPromise_js_1.createDeferredPromise)(), "f");
139
+ if (request.response() !== null) {
140
+ (_b = __classPrivateFieldGet(this, _LifecycleWatcher_navigationResponseReceived, "f")) === null || _b === void 0 ? void 0 : _b.resolve();
141
+ }
142
+ }, _LifecycleWatcher_onResponse = function _LifecycleWatcher_onResponse(response) {
143
+ var _a, _b;
144
+ if (((_a = __classPrivateFieldGet(this, _LifecycleWatcher_navigationRequest, "f")) === null || _a === void 0 ? void 0 : _a._requestId) !== response.request()._requestId) {
145
+ return;
146
+ }
147
+ (_b = __classPrivateFieldGet(this, _LifecycleWatcher_navigationResponseReceived, "f")) === null || _b === void 0 ? void 0 : _b.resolve();
131
148
  }, _LifecycleWatcher_onFrameDetached = function _LifecycleWatcher_onFrameDetached(frame) {
132
149
  if (__classPrivateFieldGet(this, _LifecycleWatcher_frame, "f") === frame) {
133
150
  __classPrivateFieldGet(this, _LifecycleWatcher_terminationCallback, "f").call(null, new Error('Navigating frame was detached'));
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleWatcher.js","sourceRoot":"","sources":["../../../../src/common/LifecycleWatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;AAEH,2CAAmC;AACnC,uCAImB;AACnB,2CAAyC;AACzC,uDAI2B;AAG3B,2DAAgE;AAChE,mDAAwD;AAmBxD,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAG1C;IACA,CAAC,MAAM,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CAAC;AACjC,CAAC,2EAEa,KAAY;IACxB,IAAI,KAAK,KAAK,uBAAA,IAAI,+BAAO,EAAE;QACzB,OAAO;KACR;IACD,uBAAA,IAAI,6BAAY,IAAI,MAAA,CAAC;IACrB,uBAAA,IAAI,6EAAwB,MAA5B,IAAI,CAA0B,CAAC;AACjC,CAAC;IAGC,kCAAkC;IAClC,IAAI,CAAC,cAAc,CAAC,uBAAA,IAAI,+BAAO,EAAE,uBAAA,IAAI,2CAAmB,CAAC,EAAE;QACzD,OAAO;KACR;IACD,uBAAA,IAAI,2CAAmB,MAAvB,IAAI,CAAqB,CAAC;IAC1B,IAAI,uBAAA,IAAI,mDAA2B,EAAE;QACnC,uBAAA,IAAI,gEAAwC,MAA5C,IAAI,CAA0C,CAAC;KAChD;IACD,IAAI,uBAAA,IAAI,iCAAS,IAAI,uBAAA,IAAI,+BAAO,CAAC,SAAS,KAAK,uBAAA,IAAI,yCAAiB,EAAE;QACpE,uBAAA,IAAI,+DAAuC,MAA3C,IAAI,CAAyC,CAAC;KAC/C;IAED,SAAS,cAAc,CACrB,KAAY,EACZ,iBAA2C;QAE3C,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE;YACrC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,KAAK,CAAC;aACd;SACF;QACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;YACvC,IACE,KAAK,CAAC,kBAAkB;gBACxB,CAAC,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,EACzC;gBACA,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"LifecycleWatcher.js","sourceRoot":"","sources":["../../../../src/common/LifecycleWatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;AAEH,iDAAyC;AACzC,uCAIm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ACD,uBAAA,IAAI,2CAAmB,MAAvB,IAAI,CAAqB,CAAC;IAC1B,IAAI,uBAAA,IAAI,mDAA2B,EAAE;QACnC,uBAAA,IAAI,gEAAwC,MAA5C,IAAI,CAA0C,CAAC;KAChD;IACD,IAAI,uBAAA,IAAI,iCAAS,IAAI,uBAAA,IAAI,+BAAO,CAAC,SAAS,KAAK,uBAAA,IAAI,yCAAiB,EAAE;QACpE,uBAAA,IAAI,+DAAuC,MAA3C,IAAI,CAAyC,CAAC;KAC/C;IAED,SAAS,cAAc,CACrB,KAAY,EACZ,iBAA2C;QAE3C,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE;YACrC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,KAAK,CAAC;aACd;SACF;QACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;YACvC,IACE,KAAK,CAAC,kBAAkB;gBACxB,CAAC,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,EACzC;gBACA,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -14,14 +14,14 @@ exports.NetworkEventManager = void 0;
14
14
  */
15
15
  class NetworkEventManager {
16
16
  constructor() {
17
- /*
17
+ /**
18
18
  * There are four possible orders of events:
19
- * A. `_onRequestWillBeSent`
20
- * B. `_onRequestWillBeSent`, `_onRequestPaused`
21
- * C. `_onRequestPaused`, `_onRequestWillBeSent`
22
- * D. `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
23
- * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`
24
- * (see crbug.com/1196004)
19
+ * A. `_onRequestWillBeSent`
20
+ * B. `_onRequestWillBeSent`, `_onRequestPaused`
21
+ * C. `_onRequestPaused`, `_onRequestWillBeSent`
22
+ * D. `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
23
+ * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`
24
+ * (see crbug.com/1196004)
25
25
  *
26
26
  * For `_onRequest` we need the event from `_onRequestWillBeSent` and
27
27
  * optionally the `interceptionId` from `_onRequestPaused`.
@@ -35,16 +35,16 @@ class NetworkEventManager {
35
35
  *
36
36
  * Note that (chains of) redirect requests have the same `requestId` (!) as
37
37
  * the original request. We have to anticipate series of events like these:
38
- * A. `_onRequestWillBeSent`,
39
- * `_onRequestWillBeSent`, ...
40
- * B. `_onRequestWillBeSent`, `_onRequestPaused`,
41
- * `_onRequestWillBeSent`, `_onRequestPaused`, ...
42
- * C. `_onRequestWillBeSent`, `_onRequestPaused`,
43
- * `_onRequestPaused`, `_onRequestWillBeSent`, ...
44
- * D. `_onRequestPaused`, `_onRequestWillBeSent`,
45
- * `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
46
- * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`, ...
47
- * (see crbug.com/1196004)
38
+ * A. `_onRequestWillBeSent`,
39
+ * `_onRequestWillBeSent`, ...
40
+ * B. `_onRequestWillBeSent`, `_onRequestPaused`,
41
+ * `_onRequestWillBeSent`, `_onRequestPaused`, ...
42
+ * C. `_onRequestWillBeSent`, `_onRequestPaused`,
43
+ * `_onRequestPaused`, `_onRequestWillBeSent`, ...
44
+ * D. `_onRequestPaused`, `_onRequestWillBeSent`,
45
+ * `_onRequestPaused`, `_onRequestWillBeSent`, `_onRequestPaused`,
46
+ * `_onRequestWillBeSent`, `_onRequestPaused`, `_onRequestPaused`, ...
47
+ * (see crbug.com/1196004)
48
48
  */
49
49
  _NetworkEventManager_requestWillBeSentMap.set(this, new Map());
50
50
  _NetworkEventManager_requestPausedMap.set(this, new Map());