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
@@ -24,14 +24,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
24
24
  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");
25
25
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
26
26
  };
27
- var _FrameManager_instances, _FrameManager_page, _FrameManager_networkManager, _FrameManager_timeoutSettings, _FrameManager_frames, _FrameManager_contextIdToContext, _FrameManager_isolatedWorlds, _FrameManager_mainFrame, _FrameManager_client, _FrameManager_framesPendingTargetInit, _FrameManager_framesPendingAttachment, _FrameManager_onLifecycleEvent, _FrameManager_onFrameStartedLoading, _FrameManager_onFrameStoppedLoading, _FrameManager_handleFrameTree, _FrameManager_onFrameAttached, _FrameManager_onFrameNavigated, _FrameManager_onFrameNavigatedWithinDocument, _FrameManager_onFrameDetached, _FrameManager_onExecutionContextCreated, _FrameManager_onExecutionContextDestroyed, _FrameManager_onExecutionContextsCleared, _FrameManager_removeFramesRecursively, _Frame_parentFrame, _Frame_url, _Frame_detached, _Frame_client;
28
- import { assert } from './assert.js';
29
- import { DOMWorld } from './DOMWorld.js';
27
+ var _FrameManager_instances, _FrameManager_page, _FrameManager_networkManager, _FrameManager_timeoutSettings, _FrameManager_frames, _FrameManager_contextIdToContext, _FrameManager_isolatedWorlds, _FrameManager_mainFrame, _FrameManager_client, _FrameManager_framesPendingTargetInit, _FrameManager_framesPendingAttachment, _FrameManager_onLifecycleEvent, _FrameManager_onFrameStartedLoading, _FrameManager_onFrameStoppedLoading, _FrameManager_handleFrameTree, _FrameManager_onFrameAttached, _FrameManager_onFrameNavigated, _FrameManager_createIsolatedWorld, _FrameManager_onFrameNavigatedWithinDocument, _FrameManager_onFrameDetached, _FrameManager_onExecutionContextCreated, _FrameManager_onExecutionContextDestroyed, _FrameManager_onExecutionContextsCleared, _FrameManager_removeFramesRecursively;
28
+ import { assert } from '../util/assert.js';
29
+ import { createDeferredPromiseWithTimer, } from '../util/DeferredPromise.js';
30
+ import { isErrorLike } from '../util/ErrorLike.js';
30
31
  import { EventEmitter } from './EventEmitter.js';
31
32
  import { EVALUATION_SCRIPT_URL, ExecutionContext } from './ExecutionContext.js';
32
- import { LifecycleWatcher } from './LifecycleWatcher.js';
33
+ import { Frame } from './Frame.js';
34
+ import { MAIN_WORLD, PUPPETEER_WORLD } from './IsolatedWorld.js';
33
35
  import { NetworkManager } from './NetworkManager.js';
34
- import { createDeferredPromiseWithTimer, debugError, isErrorLike, } from './util.js';
36
+ import { debugError } from './util.js';
35
37
  const UTILITY_WORLD_NAME = '__puppeteer_utility_world__';
36
38
  /**
37
39
  * We use symbols to prevent external parties listening to these events.
@@ -50,6 +52,8 @@ export const FrameManagerEmittedEvents = {
50
52
  ExecutionContextDestroyed: Symbol('FrameManager.ExecutionContextDestroyed'),
51
53
  };
52
54
  /**
55
+ * A frame manager manages the frames for a given {@link Page | page}.
56
+ *
53
57
  * @internal
54
58
  */
55
59
  export class FrameManager extends EventEmitter {
@@ -79,16 +83,13 @@ export class FrameManager extends EventEmitter {
79
83
  __classPrivateFieldSet(this, _FrameManager_timeoutSettings, timeoutSettings, "f");
80
84
  this.setupEventListeners(__classPrivateFieldGet(this, _FrameManager_client, "f"));
81
85
  }
82
- /**
83
- * @internal
84
- */
85
- get _timeoutSettings() {
86
+ get timeoutSettings() {
86
87
  return __classPrivateFieldGet(this, _FrameManager_timeoutSettings, "f");
87
88
  }
88
- /**
89
- * @internal
90
- */
91
- get _client() {
89
+ get networkManager() {
90
+ return __classPrivateFieldGet(this, _FrameManager_networkManager, "f");
91
+ }
92
+ get client() {
92
93
  return __classPrivateFieldGet(this, _FrameManager_client, "f");
93
94
  }
94
95
  setupEventListeners(session) {
@@ -138,7 +139,7 @@ export class FrameManager extends EventEmitter {
138
139
  await Promise.all([
139
140
  client.send('Page.setLifecycleEventsEnabled', { enabled: true }),
140
141
  client.send('Runtime.enable').then(() => {
141
- return this._ensureIsolatedWorld(client, UTILITY_WORLD_NAME);
142
+ return __classPrivateFieldGet(this, _FrameManager_instances, "m", _FrameManager_createIsolatedWorld).call(this, client, UTILITY_WORLD_NAME);
142
143
  }),
143
144
  // TODO: Network manager is not aware of OOP iframes yet.
144
145
  client === __classPrivateFieldGet(this, _FrameManager_client, "f")
@@ -160,78 +161,37 @@ export class FrameManager extends EventEmitter {
160
161
  __classPrivateFieldGet(this, _FrameManager_framesPendingTargetInit, "f").delete(targetId);
161
162
  }
162
163
  }
163
- networkManager() {
164
- return __classPrivateFieldGet(this, _FrameManager_networkManager, "f");
164
+ executionContextById(contextId, session = __classPrivateFieldGet(this, _FrameManager_client, "f")) {
165
+ const key = `${session.id()}:${contextId}`;
166
+ const context = __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").get(key);
167
+ assert(context, 'INTERNAL ERROR: missing context with id = ' + contextId);
168
+ return context;
165
169
  }
166
- async navigateFrame(frame, url, options = {}) {
167
- assertNoLegacyNavigationOptions(options);
168
- const { referer = __classPrivateFieldGet(this, _FrameManager_networkManager, "f").extraHTTPHeaders()['referer'], waitUntil = ['load'], timeout = __classPrivateFieldGet(this, _FrameManager_timeoutSettings, "f").navigationTimeout(), } = options;
169
- let ensureNewDocumentNavigation = false;
170
- const watcher = new LifecycleWatcher(this, frame, waitUntil, timeout);
171
- let error = await Promise.race([
172
- navigate(__classPrivateFieldGet(this, _FrameManager_client, "f"), url, referer, frame._id),
173
- watcher.timeoutOrTerminationPromise(),
174
- ]);
175
- if (!error) {
176
- error = await Promise.race([
177
- watcher.timeoutOrTerminationPromise(),
178
- ensureNewDocumentNavigation
179
- ? watcher.newDocumentNavigationPromise()
180
- : watcher.sameDocumentNavigationPromise(),
181
- ]);
182
- }
183
- watcher.dispose();
184
- if (error) {
185
- throw error;
186
- }
187
- return await watcher.navigationResponse();
188
- async function navigate(client, url, referrer, frameId) {
189
- try {
190
- const response = await client.send('Page.navigate', {
191
- url,
192
- referrer,
193
- frameId,
194
- });
195
- ensureNewDocumentNavigation = !!response.loaderId;
196
- return response.errorText
197
- ? new Error(`${response.errorText} at ${url}`)
198
- : null;
199
- }
200
- catch (error) {
201
- if (isErrorLike(error)) {
202
- return error;
203
- }
204
- throw error;
205
- }
206
- }
170
+ page() {
171
+ return __classPrivateFieldGet(this, _FrameManager_page, "f");
207
172
  }
208
- async waitForFrameNavigation(frame, options = {}) {
209
- assertNoLegacyNavigationOptions(options);
210
- const { waitUntil = ['load'], timeout = __classPrivateFieldGet(this, _FrameManager_timeoutSettings, "f").navigationTimeout(), } = options;
211
- const watcher = new LifecycleWatcher(this, frame, waitUntil, timeout);
212
- const error = await Promise.race([
213
- watcher.timeoutOrTerminationPromise(),
214
- watcher.sameDocumentNavigationPromise(),
215
- watcher.newDocumentNavigationPromise(),
216
- ]);
217
- watcher.dispose();
218
- if (error) {
219
- throw error;
220
- }
221
- return await watcher.navigationResponse();
173
+ mainFrame() {
174
+ assert(__classPrivateFieldGet(this, _FrameManager_mainFrame, "f"), 'Requesting main frame too early!');
175
+ return __classPrivateFieldGet(this, _FrameManager_mainFrame, "f");
176
+ }
177
+ frames() {
178
+ return Array.from(__classPrivateFieldGet(this, _FrameManager_frames, "f").values());
179
+ }
180
+ frame(frameId) {
181
+ return __classPrivateFieldGet(this, _FrameManager_frames, "f").get(frameId) || null;
222
182
  }
223
- async onAttachedToTarget(target) {
183
+ onAttachedToTarget(target) {
224
184
  if (target._getTargetInfo().type !== 'iframe') {
225
185
  return;
226
186
  }
227
187
  const frame = __classPrivateFieldGet(this, _FrameManager_frames, "f").get(target._getTargetInfo().targetId);
228
188
  if (frame) {
229
- frame._updateClient(target._session());
189
+ frame.updateClient(target._session());
230
190
  }
231
191
  this.setupEventListeners(target._session());
232
192
  this.initialize(target._getTargetInfo().targetId, target._session());
233
193
  }
234
- async onDetachedFromTarget(target) {
194
+ onDetachedFromTarget(target) {
235
195
  const frame = __classPrivateFieldGet(this, _FrameManager_frames, "f").get(target._targetId);
236
196
  if (frame && frame.isOOPFrame()) {
237
197
  // When an OOP iframe is removed from the page, it
@@ -239,50 +199,6 @@ export class FrameManager extends EventEmitter {
239
199
  __classPrivateFieldGet(this, _FrameManager_instances, "m", _FrameManager_removeFramesRecursively).call(this, frame);
240
200
  }
241
201
  }
242
- page() {
243
- return __classPrivateFieldGet(this, _FrameManager_page, "f");
244
- }
245
- mainFrame() {
246
- assert(__classPrivateFieldGet(this, _FrameManager_mainFrame, "f"), 'Requesting main frame too early!');
247
- return __classPrivateFieldGet(this, _FrameManager_mainFrame, "f");
248
- }
249
- frames() {
250
- return Array.from(__classPrivateFieldGet(this, _FrameManager_frames, "f").values());
251
- }
252
- frame(frameId) {
253
- return __classPrivateFieldGet(this, _FrameManager_frames, "f").get(frameId) || null;
254
- }
255
- async _ensureIsolatedWorld(session, name) {
256
- const key = `${session.id()}:${name}`;
257
- if (__classPrivateFieldGet(this, _FrameManager_isolatedWorlds, "f").has(key)) {
258
- return;
259
- }
260
- __classPrivateFieldGet(this, _FrameManager_isolatedWorlds, "f").add(key);
261
- await session.send('Page.addScriptToEvaluateOnNewDocument', {
262
- source: `//# sourceURL=${EVALUATION_SCRIPT_URL}`,
263
- worldName: name,
264
- });
265
- // Frames might be removed before we send this.
266
- await Promise.all(this.frames()
267
- .filter(frame => {
268
- return frame._client() === session;
269
- })
270
- .map(frame => {
271
- return session
272
- .send('Page.createIsolatedWorld', {
273
- frameId: frame._id,
274
- worldName: name,
275
- grantUniveralAccess: true,
276
- })
277
- .catch(debugError);
278
- }));
279
- }
280
- executionContextById(contextId, session = __classPrivateFieldGet(this, _FrameManager_client, "f")) {
281
- const key = `${session.id()}:${contextId}`;
282
- const context = __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").get(key);
283
- assert(context, 'INTERNAL ERROR: missing context with id = ' + contextId);
284
- return context;
285
- }
286
202
  }
287
203
  _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap(), _FrameManager_timeoutSettings = new WeakMap(), _FrameManager_frames = new WeakMap(), _FrameManager_contextIdToContext = new WeakMap(), _FrameManager_isolatedWorlds = new WeakMap(), _FrameManager_mainFrame = new WeakMap(), _FrameManager_client = new WeakMap(), _FrameManager_framesPendingTargetInit = new WeakMap(), _FrameManager_framesPendingAttachment = new WeakMap(), _FrameManager_instances = new WeakSet(), _FrameManager_onLifecycleEvent = function _FrameManager_onLifecycleEvent(event) {
288
204
  const frame = __classPrivateFieldGet(this, _FrameManager_frames, "f").get(event.frameId);
@@ -322,7 +238,7 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
322
238
  // If an OOP iframes becomes a normal iframe again
323
239
  // it is first attached to the parent page before
324
240
  // the target is removed.
325
- frame._updateClient(session);
241
+ frame.updateClient(session);
326
242
  }
327
243
  return;
328
244
  }
@@ -336,11 +252,12 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
336
252
  if (parentFrame) {
337
253
  return complete(parentFrame);
338
254
  }
339
- if (__classPrivateFieldGet(this, _FrameManager_framesPendingTargetInit, "f").has(parentFrameId)) {
255
+ const frame = __classPrivateFieldGet(this, _FrameManager_framesPendingTargetInit, "f").get(parentFrameId);
256
+ if (frame) {
340
257
  if (!__classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").has(frameId)) {
341
258
  __classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").set(frameId, createDeferredPromiseWithTimer(`Waiting for frame ${frameId} to attach failed`));
342
259
  }
343
- __classPrivateFieldGet(this, _FrameManager_framesPendingTargetInit, "f").get(parentFrameId).promise.then(() => {
260
+ frame.then(() => {
344
261
  var _a;
345
262
  complete(__classPrivateFieldGet(this, _FrameManager_frames, "f").get(parentFrameId));
346
263
  (_a = __classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").get(frameId)) === null || _a === void 0 ? void 0 : _a.resolve();
@@ -380,14 +297,40 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
380
297
  frame._navigated(framePayload);
381
298
  this.emit(FrameManagerEmittedEvents.FrameNavigated, frame);
382
299
  };
383
- if (__classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").has(frameId)) {
384
- __classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").get(frameId).promise.then(() => {
300
+ const pendingFrame = __classPrivateFieldGet(this, _FrameManager_framesPendingAttachment, "f").get(frameId);
301
+ if (pendingFrame) {
302
+ pendingFrame.then(() => {
385
303
  complete(isMainFrame ? __classPrivateFieldGet(this, _FrameManager_mainFrame, "f") : __classPrivateFieldGet(this, _FrameManager_frames, "f").get(frameId));
386
304
  });
387
305
  }
388
306
  else {
389
307
  complete(frame);
390
308
  }
309
+ }, _FrameManager_createIsolatedWorld = async function _FrameManager_createIsolatedWorld(session, name) {
310
+ const key = `${session.id()}:${name}`;
311
+ if (__classPrivateFieldGet(this, _FrameManager_isolatedWorlds, "f").has(key)) {
312
+ return;
313
+ }
314
+ await session.send('Page.addScriptToEvaluateOnNewDocument', {
315
+ source: `//# sourceURL=${EVALUATION_SCRIPT_URL}`,
316
+ worldName: name,
317
+ });
318
+ await Promise.all(this.frames()
319
+ .filter(frame => {
320
+ return frame._client() === session;
321
+ })
322
+ .map(frame => {
323
+ // Frames might be removed before we send this, so we don't want to
324
+ // throw an error.
325
+ return session
326
+ .send('Page.createIsolatedWorld', {
327
+ frameId: frame._id,
328
+ worldName: name,
329
+ grantUniveralAccess: true,
330
+ })
331
+ .catch(debugError);
332
+ }));
333
+ __classPrivateFieldGet(this, _FrameManager_isolatedWorlds, "f").add(key);
391
334
  }, _FrameManager_onFrameNavigatedWithinDocument = function _FrameManager_onFrameNavigatedWithinDocument(frameId, url) {
392
335
  const frame = __classPrivateFieldGet(this, _FrameManager_frames, "f").get(frameId);
393
336
  if (!frame) {
@@ -420,19 +363,19 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
420
363
  return;
421
364
  }
422
365
  if (contextPayload.auxData && !!contextPayload.auxData['isDefault']) {
423
- world = frame._mainWorld;
366
+ world = frame.worlds[MAIN_WORLD];
424
367
  }
425
368
  else if (contextPayload.name === UTILITY_WORLD_NAME &&
426
- !frame._secondaryWorld._hasContext()) {
369
+ !frame.worlds[PUPPETEER_WORLD].hasContext()) {
427
370
  // In case of multiple sessions to the same target, there's a race between
428
371
  // connections so we might end up creating multiple isolated worlds.
429
372
  // We can use either.
430
- world = frame._secondaryWorld;
373
+ world = frame.worlds[PUPPETEER_WORLD];
431
374
  }
432
375
  }
433
376
  const context = new ExecutionContext((frame === null || frame === void 0 ? void 0 : frame._client()) || __classPrivateFieldGet(this, _FrameManager_client, "f"), contextPayload, world);
434
377
  if (world) {
435
- world._setContext(context);
378
+ world.setContext(context);
436
379
  }
437
380
  const key = `${session.id()}:${contextPayload.id}`;
438
381
  __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").set(key, context);
@@ -444,7 +387,7 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
444
387
  }
445
388
  __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").delete(key);
446
389
  if (context._world) {
447
- context._world._setContext(null);
390
+ context._world.clearContext();
448
391
  }
449
392
  }, _FrameManager_onExecutionContextsCleared = function _FrameManager_onExecutionContextsCleared(session) {
450
393
  for (const [key, context] of __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").entries()) {
@@ -454,7 +397,7 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
454
397
  continue;
455
398
  }
456
399
  if (context._world) {
457
- context._world._setContext(null);
400
+ context._world.clearContext();
458
401
  }
459
402
  __classPrivateFieldGet(this, _FrameManager_contextIdToContext, "f").delete(key);
460
403
  }
@@ -466,672 +409,4 @@ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap()
466
409
  __classPrivateFieldGet(this, _FrameManager_frames, "f").delete(frame._id);
467
410
  this.emit(FrameManagerEmittedEvents.FrameDetached, frame);
468
411
  };
469
- /**
470
- * At every point of time, page exposes its current frame tree via the
471
- * {@link Page.mainFrame | page.mainFrame} and
472
- * {@link Frame.childFrames | frame.childFrames} methods.
473
- *
474
- * @remarks
475
- *
476
- * `Frame` object lifecycles are controlled by three events that are all
477
- * dispatched on the page object:
478
- *
479
- * - {@link PageEmittedEvents.FrameAttached}
480
- *
481
- * - {@link PageEmittedEvents.FrameNavigated}
482
- *
483
- * - {@link PageEmittedEvents.FrameDetached}
484
- *
485
- * @Example
486
- * An example of dumping frame tree:
487
- *
488
- * ```ts
489
- * const puppeteer = require('puppeteer');
490
- *
491
- * (async () => {
492
- * const browser = await puppeteer.launch();
493
- * const page = await browser.newPage();
494
- * await page.goto('https://www.google.com/chrome/browser/canary.html');
495
- * dumpFrameTree(page.mainFrame(), '');
496
- * await browser.close();
497
- *
498
- * function dumpFrameTree(frame, indent) {
499
- * console.log(indent + frame.url());
500
- * for (const child of frame.childFrames()) {
501
- * dumpFrameTree(child, indent + ' ');
502
- * }
503
- * }
504
- * })();
505
- * ```
506
- *
507
- * @Example
508
- * An example of getting text from an iframe element:
509
- *
510
- * ```ts
511
- * const frame = page.frames().find(frame => frame.name() === 'myframe');
512
- * const text = await frame.$eval('.selector', element => element.textContent);
513
- * console.log(text);
514
- * ```
515
- *
516
- * @public
517
- */
518
- export class Frame {
519
- /**
520
- * @internal
521
- */
522
- constructor(frameManager, parentFrame, frameId, client) {
523
- _Frame_parentFrame.set(this, void 0);
524
- _Frame_url.set(this, '');
525
- _Frame_detached.set(this, false);
526
- _Frame_client.set(this, void 0);
527
- /**
528
- * @internal
529
- */
530
- this._loaderId = '';
531
- /**
532
- * @internal
533
- */
534
- this._hasStartedLoading = false;
535
- /**
536
- * @internal
537
- */
538
- this._lifecycleEvents = new Set();
539
- this._frameManager = frameManager;
540
- __classPrivateFieldSet(this, _Frame_parentFrame, parentFrame !== null && parentFrame !== void 0 ? parentFrame : null, "f");
541
- __classPrivateFieldSet(this, _Frame_url, '', "f");
542
- this._id = frameId;
543
- __classPrivateFieldSet(this, _Frame_detached, false, "f");
544
- this._loaderId = '';
545
- this._childFrames = new Set();
546
- if (__classPrivateFieldGet(this, _Frame_parentFrame, "f")) {
547
- __classPrivateFieldGet(this, _Frame_parentFrame, "f")._childFrames.add(this);
548
- }
549
- this._updateClient(client);
550
- }
551
- /**
552
- * @internal
553
- */
554
- _updateClient(client) {
555
- __classPrivateFieldSet(this, _Frame_client, client, "f");
556
- this._mainWorld = new DOMWorld(__classPrivateFieldGet(this, _Frame_client, "f"), this._frameManager, this, this._frameManager._timeoutSettings);
557
- this._secondaryWorld = new DOMWorld(__classPrivateFieldGet(this, _Frame_client, "f"), this._frameManager, this, this._frameManager._timeoutSettings);
558
- }
559
- /**
560
- * @returns a page associated with the frame.
561
- */
562
- page() {
563
- return this._frameManager.page();
564
- }
565
- /**
566
- * @remarks
567
- *
568
- * @returns `true` if the frame is an OOP frame, or `false` otherwise.
569
- */
570
- isOOPFrame() {
571
- return __classPrivateFieldGet(this, _Frame_client, "f") !== this._frameManager._client;
572
- }
573
- /**
574
- * @remarks
575
- *
576
- * `frame.goto` will throw an error if:
577
- * - there's an SSL error (e.g. in case of self-signed certificates).
578
- *
579
- * - target URL is invalid.
580
- *
581
- * - the `timeout` is exceeded during navigation.
582
- *
583
- * - the remote server does not respond or is unreachable.
584
- *
585
- * - the main resource failed to load.
586
- *
587
- * `frame.goto` will not throw an error when any valid HTTP status code is
588
- * returned by the remote server, including 404 "Not Found" and 500 "Internal
589
- * Server Error". The status code for such responses can be retrieved by
590
- * calling {@link HTTPResponse.status}.
591
- *
592
- * NOTE: `frame.goto` either throws an error or returns a main resource
593
- * response. The only exceptions are navigation to `about:blank` or
594
- * navigation to the same URL with a different hash, which would succeed and
595
- * return `null`.
596
- *
597
- * NOTE: Headless mode doesn't support navigation to a PDF document. See
598
- * the {@link https://bugs.chromium.org/p/chromium/issues/detail?id=761295 | upstream
599
- * issue}.
600
- *
601
- * @param url - the URL to navigate the frame to. This should include the
602
- * scheme, e.g. `https://`.
603
- * @param options - navigation options. `waitUntil` is useful to define when
604
- * the navigation should be considered successful - see the docs for
605
- * {@link PuppeteerLifeCycleEvent} for more details.
606
- *
607
- * @returns A promise which resolves to the main resource response. In case of
608
- * multiple redirects, the navigation will resolve with the response of the
609
- * last redirect.
610
- */
611
- async goto(url, options = {}) {
612
- return await this._frameManager.navigateFrame(this, url, options);
613
- }
614
- /**
615
- * @remarks
616
- *
617
- * This resolves when the frame navigates to a new URL. It is useful for when
618
- * you run code which will indirectly cause the frame to navigate. Consider
619
- * this example:
620
- *
621
- * ```ts
622
- * const [response] = await Promise.all([
623
- * // The navigation promise resolves after navigation has finished
624
- * frame.waitForNavigation(),
625
- * // Clicking the link will indirectly cause a navigation
626
- * frame.click('a.my-link'),
627
- * ]);
628
- * ```
629
- *
630
- * Usage of the {@link https://developer.mozilla.org/en-US/docs/Web/API/History_API | History API} to change the URL is considered a navigation.
631
- *
632
- * @param options - options to configure when the navigation is consided finished.
633
- * @returns a promise that resolves when the frame navigates to a new URL.
634
- */
635
- async waitForNavigation(options = {}) {
636
- return await this._frameManager.waitForFrameNavigation(this, options);
637
- }
638
- /**
639
- * @internal
640
- */
641
- _client() {
642
- return __classPrivateFieldGet(this, _Frame_client, "f");
643
- }
644
- /**
645
- * @returns a promise that resolves to the frame's default execution context.
646
- */
647
- executionContext() {
648
- return this._mainWorld.executionContext();
649
- }
650
- /**
651
- * @remarks
652
- *
653
- * The only difference between {@link Frame.evaluate} and
654
- * `frame.evaluateHandle` is that `evaluateHandle` will return the value
655
- * wrapped in an in-page object.
656
- *
657
- * This method behaves identically to {@link Page.evaluateHandle} except it's
658
- * run within the context of the `frame`, rather than the entire page.
659
- *
660
- * @param pageFunction - a function that is run within the frame
661
- * @param args - arguments to be passed to the pageFunction
662
- */
663
- async evaluateHandle(pageFunction, ...args) {
664
- return this._mainWorld.evaluateHandle(pageFunction, ...args);
665
- }
666
- /**
667
- * @remarks
668
- *
669
- * This method behaves identically to {@link Page.evaluate} except it's run
670
- * within the context of the `frame`, rather than the entire page.
671
- *
672
- * @param pageFunction - a function that is run within the frame
673
- * @param args - arguments to be passed to the pageFunction
674
- */
675
- async evaluate(pageFunction, ...args) {
676
- return this._mainWorld.evaluate(pageFunction, ...args);
677
- }
678
- /**
679
- * This method queries the frame for the given selector.
680
- *
681
- * @param selector - a selector to query for.
682
- * @returns A promise which resolves to an `ElementHandle` pointing at the
683
- * element, or `null` if it was not found.
684
- */
685
- async $(selector) {
686
- return this._mainWorld.$(selector);
687
- }
688
- /**
689
- * This runs `document.querySelectorAll` in the frame and returns the result.
690
- *
691
- * @param selector - a selector to search for
692
- * @returns An array of element handles pointing to the found frame elements.
693
- */
694
- async $$(selector) {
695
- return this._mainWorld.$$(selector);
696
- }
697
- /**
698
- * This method evaluates the given XPath expression and returns the results.
699
- *
700
- * @param expression - the XPath expression to evaluate.
701
- */
702
- async $x(expression) {
703
- return this._mainWorld.$x(expression);
704
- }
705
- /**
706
- * @remarks
707
- *
708
- * This method runs `document.querySelector` within
709
- * the frame and passes it as the first argument to `pageFunction`.
710
- *
711
- * If `pageFunction` returns a Promise, then `frame.$eval` would wait for
712
- * the promise to resolve and return its value.
713
- *
714
- * @example
715
- *
716
- * ```ts
717
- * const searchValue = await frame.$eval('#search', el => el.value);
718
- * ```
719
- *
720
- * @param selector - the selector to query for
721
- * @param pageFunction - the function to be evaluated in the frame's context
722
- * @param args - additional arguments to pass to `pageFunction`
723
- */
724
- async $eval(selector, pageFunction, ...args) {
725
- return this._mainWorld.$eval(selector, pageFunction, ...args);
726
- }
727
- /**
728
- * @remarks
729
- *
730
- * This method runs `Array.from(document.querySelectorAll(selector))` within
731
- * the frame and passes it as the first argument to `pageFunction`.
732
- *
733
- * If `pageFunction` returns a Promise, then `frame.$$eval` would wait for
734
- * the promise to resolve and return its value.
735
- *
736
- * @example
737
- *
738
- * ```ts
739
- * const divsCounts = await frame.$$eval('div', divs => divs.length);
740
- * ```
741
- *
742
- * @param selector - the selector to query for
743
- * @param pageFunction - the function to be evaluated in the frame's context
744
- * @param args - additional arguments to pass to `pageFunction`
745
- */
746
- async $$eval(selector, pageFunction, ...args) {
747
- return this._mainWorld.$$eval(selector, pageFunction, ...args);
748
- }
749
- /**
750
- * @returns the full HTML contents of the frame, including the doctype.
751
- */
752
- async content() {
753
- return this._secondaryWorld.content();
754
- }
755
- /**
756
- * Set the content of the frame.
757
- *
758
- * @param html - HTML markup to assign to the page.
759
- * @param options - options to configure how long before timing out and at
760
- * what point to consider the content setting successful.
761
- */
762
- async setContent(html, options = {}) {
763
- return this._secondaryWorld.setContent(html, options);
764
- }
765
- /**
766
- * @remarks
767
- *
768
- * If the name is empty, it returns the `id` attribute instead.
769
- *
770
- * Note: This value is calculated once when the frame is created, and will not
771
- * update if the attribute is changed later.
772
- *
773
- * @returns the frame's `name` attribute as specified in the tag.
774
- */
775
- name() {
776
- return this._name || '';
777
- }
778
- /**
779
- * @returns the frame's URL.
780
- */
781
- url() {
782
- return __classPrivateFieldGet(this, _Frame_url, "f");
783
- }
784
- /**
785
- * @returns the parent `Frame`, if any. Detached and main frames return `null`.
786
- */
787
- parentFrame() {
788
- return __classPrivateFieldGet(this, _Frame_parentFrame, "f");
789
- }
790
- /**
791
- * @returns an array of child frames.
792
- */
793
- childFrames() {
794
- return Array.from(this._childFrames);
795
- }
796
- /**
797
- * @returns `true` if the frame has been detached, or `false` otherwise.
798
- */
799
- isDetached() {
800
- return __classPrivateFieldGet(this, _Frame_detached, "f");
801
- }
802
- /**
803
- * Adds a `<script>` tag into the page with the desired url or content.
804
- *
805
- * @param options - configure the script to add to the page.
806
- *
807
- * @returns a promise that resolves to the added tag when the script's
808
- * `onload` event fires or when the script content was injected into the
809
- * frame.
810
- */
811
- async addScriptTag(options) {
812
- return this._mainWorld.addScriptTag(options);
813
- }
814
- /**
815
- * Adds a `<link rel="stylesheet">` tag into the page with the desired url or
816
- * a `<style type="text/css">` tag with the content.
817
- *
818
- * @param options - configure the CSS to add to the page.
819
- *
820
- * @returns a promise that resolves to the added tag when the stylesheets's
821
- * `onload` event fires or when the CSS content was injected into the
822
- * frame.
823
- */
824
- async addStyleTag(options) {
825
- return this._mainWorld.addStyleTag(options);
826
- }
827
- /**
828
- *
829
- * This method clicks the first element found that matches `selector`.
830
- *
831
- * @remarks
832
- *
833
- * This method scrolls the element into view if needed, and then uses
834
- * {@link Page.mouse} to click in the center of the element. If there's no
835
- * element matching `selector`, the method throws an error.
836
- *
837
- * Bear in mind that if `click()` triggers a navigation event and there's a
838
- * separate `page.waitForNavigation()` promise to be resolved, you may end up
839
- * with a race condition that yields unexpected results. The correct pattern
840
- * for click and wait for navigation is the following:
841
- *
842
- * ```javascript
843
- * const [response] = await Promise.all([
844
- * page.waitForNavigation(waitOptions),
845
- * frame.click(selector, clickOptions),
846
- * ]);
847
- * ```
848
- * @param selector - the selector to search for to click. If there are
849
- * multiple elements, the first will be clicked.
850
- */
851
- async click(selector, options = {}) {
852
- return this._secondaryWorld.click(selector, options);
853
- }
854
- /**
855
- * This method fetches an element with `selector` and focuses it.
856
- *
857
- * @remarks
858
- * If there's no element matching `selector`, the method throws an error.
859
- *
860
- * @param selector - the selector for the element to focus. If there are
861
- * multiple elements, the first will be focused.
862
- */
863
- async focus(selector) {
864
- return this._secondaryWorld.focus(selector);
865
- }
866
- /**
867
- * This method fetches an element with `selector`, scrolls it into view if
868
- * needed, and then uses {@link Page.mouse} to hover over the center of the
869
- * element.
870
- *
871
- * @remarks
872
- * If there's no element matching `selector`, the method throws an
873
- *
874
- * @param selector - the selector for the element to hover. If there are
875
- * multiple elements, the first will be hovered.
876
- */
877
- async hover(selector) {
878
- return this._secondaryWorld.hover(selector);
879
- }
880
- /**
881
- * Triggers a `change` and `input` event once all the provided options have
882
- * been selected.
883
- *
884
- * @remarks
885
- *
886
- * If there's no `<select>` element matching `selector`, the
887
- * method throws an error.
888
- *
889
- * @example
890
- * ```ts
891
- * frame.select('select#colors', 'blue'); // single selection
892
- * frame.select('select#colors', 'red', 'green', 'blue'); // multiple selections
893
- * ```
894
- *
895
- * @param selector - a selector to query the frame for
896
- * @param values - an array of values to select. If the `<select>` has the
897
- * `multiple` attribute, all values are considered, otherwise only the first
898
- * one is taken into account.
899
- * @returns the list of values that were successfully selected.
900
- */
901
- select(selector, ...values) {
902
- return this._secondaryWorld.select(selector, ...values);
903
- }
904
- /**
905
- * This method fetches an element with `selector`, scrolls it into view if
906
- * needed, and then uses {@link Page.touchscreen} to tap in the center of the
907
- * element.
908
- *
909
- * @remarks
910
- *
911
- * If there's no element matching `selector`, the method throws an error.
912
- *
913
- * @param selector - the selector to tap.
914
- * @returns a promise that resolves when the element has been tapped.
915
- */
916
- async tap(selector) {
917
- return this._secondaryWorld.tap(selector);
918
- }
919
- /**
920
- * Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character
921
- * in the text.
922
- *
923
- * @remarks
924
- * To press a special key, like `Control` or `ArrowDown`, use
925
- * {@link Keyboard.press}.
926
- *
927
- * @example
928
- * ```ts
929
- * await frame.type('#mytextarea', 'Hello'); // Types instantly
930
- * await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a user
931
- * ```
932
- *
933
- * @param selector - the selector for the element to type into. If there are
934
- * multiple the first will be used.
935
- * @param text - text to type into the element
936
- * @param options - takes one option, `delay`, which sets the time to wait
937
- * between key presses in milliseconds. Defaults to `0`.
938
- *
939
- * @returns a promise that resolves when the typing is complete.
940
- */
941
- async type(selector, text, options) {
942
- return this._mainWorld.type(selector, text, options);
943
- }
944
- /**
945
- * Causes your script to wait for the given number of milliseconds.
946
- *
947
- * @remarks
948
- * It's generally recommended to not wait for a number of seconds, but instead
949
- * use {@link Frame.waitForSelector}, {@link Frame.waitForXPath} or
950
- * {@link Frame.waitForFunction} to wait for exactly the conditions you want.
951
- *
952
- * @example
953
- *
954
- * Wait for 1 second:
955
- *
956
- * ```
957
- * await frame.waitForTimeout(1000);
958
- * ```
959
- *
960
- * @param milliseconds - the number of milliseconds to wait.
961
- */
962
- waitForTimeout(milliseconds) {
963
- return new Promise(resolve => {
964
- setTimeout(resolve, milliseconds);
965
- });
966
- }
967
- /**
968
- * @remarks
969
- *
970
- *
971
- * Wait for the `selector` to appear in page. If at the moment of calling the
972
- * method the `selector` already exists, the method will return immediately.
973
- * If the selector doesn't appear after the `timeout` milliseconds of waiting,
974
- * the function will throw.
975
- *
976
- * This method works across navigations.
977
- *
978
- * @example
979
- * ```ts
980
- * const puppeteer = require('puppeteer');
981
- *
982
- * (async () => {
983
- * const browser = await puppeteer.launch();
984
- * const page = await browser.newPage();
985
- * let currentURL;
986
- * page.mainFrame()
987
- * .waitForSelector('img')
988
- * .then(() => console.log('First URL with image: ' + currentURL));
989
- *
990
- * for (currentURL of ['https://example.com', 'https://google.com', 'https://bbc.com']) {
991
- * await page.goto(currentURL);
992
- * }
993
- * await browser.close();
994
- * })();
995
- * ```
996
- * @param selector - the selector to wait for.
997
- * @param options - options to define if the element should be visible and how
998
- * long to wait before timing out.
999
- * @returns a promise which resolves when an element matching the selector
1000
- * string is added to the DOM.
1001
- */
1002
- async waitForSelector(selector, options = {}) {
1003
- const handle = await this._secondaryWorld.waitForSelector(selector, options);
1004
- if (!handle) {
1005
- return null;
1006
- }
1007
- const mainExecutionContext = await this._mainWorld.executionContext();
1008
- const result = await mainExecutionContext._adoptElementHandle(handle);
1009
- await handle.dispose();
1010
- return result;
1011
- }
1012
- /**
1013
- * @remarks
1014
- * Wait for the `xpath` to appear in page. If at the moment of calling the
1015
- * method the `xpath` already exists, the method will return immediately. If
1016
- * the xpath doesn't appear after the `timeout` milliseconds of waiting, the
1017
- * function will throw.
1018
- *
1019
- * For a code example, see the example for {@link Frame.waitForSelector}. That
1020
- * function behaves identically other than taking a CSS selector rather than
1021
- * an XPath.
1022
- *
1023
- * @param xpath - the XPath expression to wait for.
1024
- * @param options - options to configure the visiblity of the element and how
1025
- * long to wait before timing out.
1026
- */
1027
- async waitForXPath(xpath, options = {}) {
1028
- const handle = await this._secondaryWorld.waitForXPath(xpath, options);
1029
- if (!handle) {
1030
- return null;
1031
- }
1032
- const mainExecutionContext = await this._mainWorld.executionContext();
1033
- const result = await mainExecutionContext._adoptElementHandle(handle);
1034
- await handle.dispose();
1035
- return result;
1036
- }
1037
- /**
1038
- * @remarks
1039
- *
1040
- * @example
1041
- *
1042
- * The `waitForFunction` can be used to observe viewport size change:
1043
- * ```ts
1044
- * const puppeteer = require('puppeteer');
1045
- *
1046
- * (async () => {
1047
- * . const browser = await puppeteer.launch();
1048
- * . const page = await browser.newPage();
1049
- * . const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');
1050
- * . page.setViewport({width: 50, height: 50});
1051
- * . await watchDog;
1052
- * . await browser.close();
1053
- * })();
1054
- * ```
1055
- *
1056
- * To pass arguments from Node.js to the predicate of `page.waitForFunction` function:
1057
- *
1058
- * ```ts
1059
- * const selector = '.foo';
1060
- * await frame.waitForFunction(
1061
- * selector => !!document.querySelector(selector),
1062
- * {}, // empty options object
1063
- * selector
1064
- *);
1065
- * ```
1066
- *
1067
- * @param pageFunction - the function to evaluate in the frame context.
1068
- * @param options - options to configure the polling method and timeout.
1069
- * @param args - arguments to pass to the `pageFunction`.
1070
- * @returns the promise which resolve when the `pageFunction` returns a truthy value.
1071
- */
1072
- waitForFunction(pageFunction, options = {}, ...args) {
1073
- // TODO: Fix when NodeHandle has been added.
1074
- return this._mainWorld.waitForFunction(pageFunction, options, ...args);
1075
- }
1076
- /**
1077
- * @returns the frame's title.
1078
- */
1079
- async title() {
1080
- return this._secondaryWorld.title();
1081
- }
1082
- /**
1083
- * @internal
1084
- */
1085
- _navigated(framePayload) {
1086
- this._name = framePayload.name;
1087
- __classPrivateFieldSet(this, _Frame_url, `${framePayload.url}${framePayload.urlFragment || ''}`, "f");
1088
- }
1089
- /**
1090
- * @internal
1091
- */
1092
- _navigatedWithinDocument(url) {
1093
- __classPrivateFieldSet(this, _Frame_url, url, "f");
1094
- }
1095
- /**
1096
- * @internal
1097
- */
1098
- _onLifecycleEvent(loaderId, name) {
1099
- if (name === 'init') {
1100
- this._loaderId = loaderId;
1101
- this._lifecycleEvents.clear();
1102
- }
1103
- this._lifecycleEvents.add(name);
1104
- }
1105
- /**
1106
- * @internal
1107
- */
1108
- _onLoadingStopped() {
1109
- this._lifecycleEvents.add('DOMContentLoaded');
1110
- this._lifecycleEvents.add('load');
1111
- }
1112
- /**
1113
- * @internal
1114
- */
1115
- _onLoadingStarted() {
1116
- this._hasStartedLoading = true;
1117
- }
1118
- /**
1119
- * @internal
1120
- */
1121
- _detach() {
1122
- __classPrivateFieldSet(this, _Frame_detached, true, "f");
1123
- this._mainWorld._detach();
1124
- this._secondaryWorld._detach();
1125
- if (__classPrivateFieldGet(this, _Frame_parentFrame, "f")) {
1126
- __classPrivateFieldGet(this, _Frame_parentFrame, "f")._childFrames.delete(this);
1127
- }
1128
- __classPrivateFieldSet(this, _Frame_parentFrame, null, "f");
1129
- }
1130
- }
1131
- _Frame_parentFrame = new WeakMap(), _Frame_url = new WeakMap(), _Frame_detached = new WeakMap(), _Frame_client = new WeakMap();
1132
- function assertNoLegacyNavigationOptions(options) {
1133
- assert(options['networkIdleTimeout'] === undefined, 'ERROR: networkIdleTimeout option is no longer supported.');
1134
- assert(options['networkIdleInflight'] === undefined, 'ERROR: networkIdleInflight option is no longer supported.');
1135
- assert(options['waitUntil'] !== 'networkidle', 'ERROR: "networkidle" option is no longer supported. Use "networkidle2" instead');
1136
- }
1137
412
  //# sourceMappingURL=FrameManager.js.map