brave-real-puppeteer-core 24.25.0 → 24.33.0-patch.1

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 (468) hide show
  1. package/README.md +5 -5
  2. package/advanced-stealth.js +1 -1
  3. package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
  4. package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
  5. package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
  6. package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
  7. package/lib/cjs/puppeteer/api/Browser.d.ts +111 -2
  8. package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  9. package/lib/cjs/puppeteer/api/Browser.js +4 -2
  10. package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  11. package/lib/cjs/puppeteer/api/BrowserContext.d.ts +5 -3
  12. package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
  13. package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
  14. package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
  15. package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
  16. package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
  17. package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  18. package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +38 -0
  19. package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  20. package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  21. package/lib/cjs/puppeteer/api/ElementHandle.js +1 -1
  22. package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  23. package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
  24. package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  25. package/lib/cjs/puppeteer/api/Frame.js +4 -4
  26. package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  27. package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +1 -1
  28. package/lib/cjs/puppeteer/api/Page.d.ts +41 -7
  29. package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  30. package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  31. package/lib/cjs/puppeteer/api/api.d.ts +2 -0
  32. package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
  33. package/lib/cjs/puppeteer/api/api.js +1 -0
  34. package/lib/cjs/puppeteer/api/api.js.map +1 -1
  35. package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  36. package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
  37. package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  38. package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
  39. package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
  40. package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
  41. package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
  42. package/lib/cjs/puppeteer/bidi/Browser.d.ts +6 -1
  43. package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  44. package/lib/cjs/puppeteer/bidi/Browser.js +36 -14
  45. package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  46. package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  47. package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
  48. package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
  49. package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +3 -3
  50. package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  51. package/lib/cjs/puppeteer/bidi/BrowserContext.js +6 -3
  52. package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  53. package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
  54. package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
  55. package/lib/cjs/puppeteer/bidi/Connection.js +19 -2
  56. package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
  57. package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
  58. package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
  59. package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
  60. package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
  61. package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
  62. package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  63. package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
  64. package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  65. package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
  66. package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  67. package/lib/cjs/puppeteer/bidi/HTTPRequest.js +2 -29
  68. package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  69. package/lib/cjs/puppeteer/bidi/Page.d.ts +10 -8
  70. package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  71. package/lib/cjs/puppeteer/bidi/Page.js +63 -47
  72. package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  73. package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
  74. package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  75. package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +55 -2
  76. package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  77. package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
  78. package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +1 -12
  79. package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  80. package/lib/cjs/puppeteer/bidi/core/Request.d.ts +1 -0
  81. package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
  82. package/lib/cjs/puppeteer/bidi/core/Request.js +30 -4
  83. package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
  84. package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
  85. package/lib/cjs/puppeteer/bidi/util.js +7 -0
  86. package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
  87. package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +10 -0
  88. package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  89. package/lib/cjs/puppeteer/cdp/Accessibility.js +30 -3
  90. package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
  91. package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
  92. package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
  93. package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
  94. package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
  95. package/lib/cjs/puppeteer/cdp/Browser.d.ts +10 -5
  96. package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  97. package/lib/cjs/puppeteer/cdp/Browser.js +61 -8
  98. package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  99. package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  100. package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
  101. package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
  102. package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +3 -2
  103. package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  104. package/lib/cjs/puppeteer/cdp/BrowserContext.js +4 -4
  105. package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  106. package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
  107. package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  108. package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
  109. package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
  110. package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
  111. package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
  112. package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
  113. package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
  114. package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
  115. package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  116. package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +10 -76
  117. package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  118. package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
  119. package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
  120. package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
  121. package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
  122. package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
  123. package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
  124. package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
  125. package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
  126. package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
  127. package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
  128. package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
  129. package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
  130. package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
  131. package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  132. package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
  133. package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
  134. package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  135. package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  136. package/lib/cjs/puppeteer/cdp/HTTPRequest.js +6 -2
  137. package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  138. package/lib/cjs/puppeteer/cdp/HTTPResponse.js +1 -1
  139. package/lib/cjs/puppeteer/cdp/HTTPResponse.js.map +1 -1
  140. package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
  141. package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
  142. package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
  143. package/lib/cjs/puppeteer/cdp/NetworkEventManager.js +8 -0
  144. package/lib/cjs/puppeteer/cdp/NetworkEventManager.js.map +1 -1
  145. package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  146. package/lib/cjs/puppeteer/cdp/NetworkManager.js +25 -1
  147. package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
  148. package/lib/cjs/puppeteer/cdp/Page.d.ts +9 -4
  149. package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  150. package/lib/cjs/puppeteer/cdp/Page.js +30 -7
  151. package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  152. package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
  153. package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  154. package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
  155. package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
  156. package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  157. package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
  158. package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
  159. package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
  160. package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
  161. package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
  162. package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
  163. package/lib/cjs/puppeteer/cdp/utils.d.ts +2 -2
  164. package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
  165. package/lib/cjs/puppeteer/common/BrowserConnector.js +47 -3
  166. package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
  167. package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
  168. package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  169. package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
  170. package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
  171. package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +22 -0
  172. package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  173. package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
  174. package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  175. package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  176. package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  177. package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
  178. package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  179. package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
  180. package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  181. package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
  182. package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  183. package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
  184. package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  185. package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
  186. package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  187. package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
  188. package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  189. package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
  190. package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
  191. package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  192. package/lib/cjs/puppeteer/revisions.js +3 -3
  193. package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  194. package/lib/cjs/puppeteer/util/disposable.d.ts +2 -2
  195. package/lib/cjs/puppeteer/util/disposable.d.ts.map +1 -1
  196. package/lib/cjs/puppeteer/util/disposable.js +3 -1
  197. package/lib/cjs/puppeteer/util/disposable.js.map +1 -1
  198. package/lib/cjs/puppeteer/util/util.d.ts +1 -0
  199. package/lib/cjs/puppeteer/util/util.d.ts.map +1 -1
  200. package/lib/cjs/puppeteer/util/util.js +1 -0
  201. package/lib/cjs/puppeteer/util/util.js.map +1 -1
  202. package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  203. package/lib/cjs/puppeteer/util/version.js +1 -1
  204. package/lib/es5-iife/puppeteer-core-browser.d.ts +304 -22
  205. package/lib/es5-iife/puppeteer-core-browser.js +484 -224
  206. package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
  207. package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
  208. package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
  209. package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
  210. package/lib/esm/puppeteer/api/Browser.d.ts +111 -2
  211. package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  212. package/lib/esm/puppeteer/api/Browser.js +4 -2
  213. package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  214. package/lib/esm/puppeteer/api/BrowserContext.d.ts +5 -3
  215. package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
  216. package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
  217. package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
  218. package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
  219. package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
  220. package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
  221. package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +34 -0
  222. package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
  223. package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  224. package/lib/esm/puppeteer/api/ElementHandle.js +1 -1
  225. package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  226. package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
  227. package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  228. package/lib/esm/puppeteer/api/Frame.js +4 -4
  229. package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  230. package/lib/esm/puppeteer/api/HTTPRequest.d.ts +1 -1
  231. package/lib/esm/puppeteer/api/Input.d.ts +1 -1
  232. package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
  233. package/lib/esm/puppeteer/api/Page.d.ts +41 -7
  234. package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  235. package/lib/esm/puppeteer/api/Page.js.map +1 -1
  236. package/lib/esm/puppeteer/api/api.d.ts +2 -0
  237. package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
  238. package/lib/esm/puppeteer/api/api.js +1 -0
  239. package/lib/esm/puppeteer/api/api.js.map +1 -1
  240. package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
  241. package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
  242. package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
  243. package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
  244. package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
  245. package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
  246. package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
  247. package/lib/esm/puppeteer/bidi/Browser.d.ts +6 -1
  248. package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  249. package/lib/esm/puppeteer/bidi/Browser.js +36 -14
  250. package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  251. package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
  252. package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
  253. package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
  254. package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +3 -3
  255. package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  256. package/lib/esm/puppeteer/bidi/BrowserContext.js +6 -3
  257. package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  258. package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
  259. package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
  260. package/lib/esm/puppeteer/bidi/Connection.js +19 -2
  261. package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
  262. package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
  263. package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
  264. package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
  265. package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
  266. package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
  267. package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  268. package/lib/esm/puppeteer/bidi/Frame.js +3 -2
  269. package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  270. package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
  271. package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  272. package/lib/esm/puppeteer/bidi/HTTPRequest.js +2 -29
  273. package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  274. package/lib/esm/puppeteer/bidi/Page.d.ts +10 -8
  275. package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  276. package/lib/esm/puppeteer/bidi/Page.js +64 -48
  277. package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  278. package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
  279. package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  280. package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +55 -2
  281. package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  282. package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
  283. package/lib/esm/puppeteer/bidi/core/Realm.d.ts +1 -12
  284. package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
  285. package/lib/esm/puppeteer/bidi/core/Request.d.ts +1 -0
  286. package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
  287. package/lib/esm/puppeteer/bidi/core/Request.js +31 -5
  288. package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
  289. package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
  290. package/lib/esm/puppeteer/bidi/util.js +7 -0
  291. package/lib/esm/puppeteer/bidi/util.js.map +1 -1
  292. package/lib/esm/puppeteer/cdp/Accessibility.d.ts +10 -0
  293. package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
  294. package/lib/esm/puppeteer/cdp/Accessibility.js +30 -3
  295. package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
  296. package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
  297. package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
  298. package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
  299. package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
  300. package/lib/esm/puppeteer/cdp/Browser.d.ts +10 -5
  301. package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  302. package/lib/esm/puppeteer/cdp/Browser.js +61 -8
  303. package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  304. package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
  305. package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
  306. package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
  307. package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +3 -2
  308. package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
  309. package/lib/esm/puppeteer/cdp/BrowserContext.js +4 -4
  310. package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  311. package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
  312. package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
  313. package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
  314. package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
  315. package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
  316. package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
  317. package/lib/esm/puppeteer/cdp/Connection.js +11 -2
  318. package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
  319. package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
  320. package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
  321. package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +7 -72
  322. package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
  323. package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
  324. package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
  325. package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
  326. package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
  327. package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
  328. package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
  329. package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
  330. package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
  331. package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
  332. package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
  333. package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
  334. package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
  335. package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
  336. package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
  337. package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
  338. package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
  339. package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  340. package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  341. package/lib/esm/puppeteer/cdp/HTTPRequest.js +6 -2
  342. package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  343. package/lib/esm/puppeteer/cdp/HTTPResponse.js +1 -1
  344. package/lib/esm/puppeteer/cdp/HTTPResponse.js.map +1 -1
  345. package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
  346. package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
  347. package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
  348. package/lib/esm/puppeteer/cdp/NetworkEventManager.js +8 -0
  349. package/lib/esm/puppeteer/cdp/NetworkEventManager.js.map +1 -1
  350. package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  351. package/lib/esm/puppeteer/cdp/NetworkManager.js +25 -1
  352. package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
  353. package/lib/esm/puppeteer/cdp/Page.d.ts +9 -4
  354. package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  355. package/lib/esm/puppeteer/cdp/Page.js +30 -7
  356. package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  357. package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
  358. package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  359. package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
  360. package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
  361. package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  362. package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
  363. package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
  364. package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
  365. package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
  366. package/lib/esm/puppeteer/cdp/cdp.js +1 -0
  367. package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
  368. package/lib/esm/puppeteer/cdp/utils.d.ts +2 -2
  369. package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
  370. package/lib/esm/puppeteer/common/BrowserConnector.js +48 -4
  371. package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
  372. package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
  373. package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
  374. package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
  375. package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
  376. package/lib/esm/puppeteer/common/ConnectOptions.d.ts +22 -0
  377. package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
  378. package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
  379. package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  380. package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  381. package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  382. package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
  383. package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
  384. package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  385. package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
  386. package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  387. package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
  388. package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  389. package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
  390. package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  391. package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
  392. package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
  393. package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
  394. package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
  395. package/lib/esm/puppeteer/revisions.d.ts +3 -3
  396. package/lib/esm/puppeteer/revisions.js +3 -3
  397. package/lib/esm/puppeteer/util/disposable.d.ts +2 -2
  398. package/lib/esm/puppeteer/util/disposable.d.ts.map +1 -1
  399. package/lib/esm/puppeteer/util/disposable.js +2 -2
  400. package/lib/esm/puppeteer/util/disposable.js.map +1 -1
  401. package/lib/esm/puppeteer/util/util.d.ts +1 -0
  402. package/lib/esm/puppeteer/util/util.d.ts.map +1 -1
  403. package/lib/esm/puppeteer/util/util.js +1 -0
  404. package/lib/esm/puppeteer/util/util.js.map +1 -1
  405. package/lib/esm/puppeteer/util/version.d.ts +1 -1
  406. package/lib/esm/puppeteer/util/version.js +1 -1
  407. package/lib/types.d.ts +304 -22
  408. package/package.json +15 -15
  409. package/src/api/BluetoothEmulation.ts +103 -0
  410. package/src/api/Browser.ts +130 -3
  411. package/src/api/BrowserContext.ts +10 -3
  412. package/src/api/CDPSession.ts +1 -2
  413. package/src/api/DeviceRequestPrompt.ts +71 -0
  414. package/src/api/ElementHandle.ts +3 -5
  415. package/src/api/Frame.ts +7 -9
  416. package/src/api/HTTPRequest.ts +1 -1
  417. package/src/api/Page.ts +48 -11
  418. package/src/api/api.ts +2 -0
  419. package/src/bidi/BidiOverCdp.ts +1 -0
  420. package/src/bidi/BluetoothEmulation.ts +52 -0
  421. package/src/bidi/Browser.ts +52 -14
  422. package/src/bidi/BrowserConnector.ts +8 -1
  423. package/src/bidi/BrowserContext.ts +9 -6
  424. package/src/bidi/Connection.ts +20 -1
  425. package/src/bidi/DeviceRequestPrompt.ts +138 -0
  426. package/src/bidi/Frame.ts +7 -3
  427. package/src/bidi/HTTPRequest.ts +2 -45
  428. package/src/bidi/Page.ts +86 -71
  429. package/src/bidi/core/BrowsingContext.ts +80 -2
  430. package/src/bidi/core/Connection.ts +3 -2
  431. package/src/bidi/core/Request.ts +35 -5
  432. package/src/bidi/util.ts +8 -0
  433. package/src/cdp/Accessibility.ts +45 -4
  434. package/src/cdp/BluetoothEmulation.ts +47 -0
  435. package/src/cdp/Browser.ts +95 -10
  436. package/src/cdp/BrowserConnector.ts +4 -0
  437. package/src/cdp/BrowserContext.ts +5 -4
  438. package/src/cdp/CdpSession.ts +3 -2
  439. package/src/cdp/Connection.ts +15 -1
  440. package/src/cdp/DeviceRequestPrompt.ts +8 -79
  441. package/src/cdp/EmulationManager.ts +30 -0
  442. package/src/cdp/ExecutionContext.ts +6 -2
  443. package/src/cdp/ExtensionTransport.ts +5 -1
  444. package/src/cdp/Frame.ts +3 -5
  445. package/src/cdp/FrameManager.ts +9 -4
  446. package/src/cdp/HTTPRequest.ts +7 -2
  447. package/src/cdp/HTTPResponse.ts +1 -1
  448. package/src/cdp/JSHandle.ts +1 -1
  449. package/src/cdp/NetworkEventManager.ts +16 -1
  450. package/src/cdp/NetworkManager.ts +31 -1
  451. package/src/cdp/Page.ts +49 -14
  452. package/src/cdp/TargetManager.ts +36 -43
  453. package/src/cdp/WebWorker.ts +8 -3
  454. package/src/cdp/cdp.ts +1 -0
  455. package/src/cdp/utils.ts +2 -2
  456. package/src/common/BrowserConnector.ts +67 -4
  457. package/src/common/CallbackRegistry.ts +7 -5
  458. package/src/common/ConnectOptions.ts +28 -0
  459. package/src/common/ConsoleMessage.ts +14 -0
  460. package/src/common/EventEmitter.ts +3 -3
  461. package/src/node/BrowserLauncher.ts +22 -1
  462. package/src/node/ChromeLauncher.ts +5 -17
  463. package/src/node/LaunchOptions.ts +23 -7
  464. package/src/revisions.ts +3 -3
  465. package/src/util/disposable.ts +2 -2
  466. package/src/util/util.ts +1 -0
  467. package/src/util/version.ts +1 -1
  468. package/src/templates/version.ts.tmpl +0 -4
@@ -3048,7 +3048,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
3048
3048
  */
3049
3049
  // If moved update release-please config
3050
3050
  // x-release-please-start-version
3051
- const packageVersion = '24.25.0';
3051
+ const packageVersion = '24.33.0';
3052
3052
  // x-release-please-end
3053
3053
 
3054
3054
  /**
@@ -3833,12 +3833,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
3833
3833
  * returns all {@link Page | pages} in all
3834
3834
  * {@link BrowserContext | browser contexts}.
3835
3835
  *
3836
+ * @param includeAll - experimental, setting to true includes all kinds of pages.
3837
+ *
3836
3838
  * @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
3837
3839
  * will not be listed here. You can find them using {@link Target.page}.
3838
3840
  */
3839
- async pages() {
3841
+ async pages(includeAll = false) {
3840
3842
  const contextPages = await Promise.all(this.browserContexts().map(context => {
3841
- return context.pages();
3843
+ return context.pages(includeAll);
3842
3844
  }));
3843
3845
  // Flatten array.
3844
3846
  return contextPages.reduce((acc, x) => {
@@ -4322,6 +4324,42 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
4322
4324
  }
4323
4325
  }
4324
4326
 
4327
+ /**
4328
+ * @license
4329
+ * Copyright 2025 Google Inc.
4330
+ * SPDX-License-Identifier: Apache-2.0
4331
+ */
4332
+ /**
4333
+ * Device request prompts let you respond to the page requesting for a device
4334
+ * through an API like WebBluetooth.
4335
+ *
4336
+ * @remarks
4337
+ * `DeviceRequestPrompt` instances are returned via the
4338
+ * {@link Page.waitForDevicePrompt} method.
4339
+ *
4340
+ * @example
4341
+ *
4342
+ * ```ts
4343
+ * const [devicePrompt] = Promise.all([
4344
+ * page.waitForDevicePrompt(),
4345
+ * page.click('#connect-bluetooth'),
4346
+ * ]);
4347
+ * await devicePrompt.select(
4348
+ * await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
4349
+ * );
4350
+ * ```
4351
+ *
4352
+ * @public
4353
+ */
4354
+ class DeviceRequestPrompt {
4355
+ constructor() {
4356
+ /**
4357
+ * Current list of selectable devices.
4358
+ */
4359
+ _defineProperty(this, "devices", []);
4360
+ }
4361
+ }
4362
+
4325
4363
  /**
4326
4364
  * @license
4327
4365
  * Copyright 2017 Google Inc.
@@ -8028,7 +8066,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
8028
8066
  };
8029
8067
  try {
8030
8068
  await this.assertConnectedElement();
8031
- // eslint-disable-next-line rulesdir/use-using -- Returns `this`.
8069
+ // eslint-disable-next-line @puppeteer/use-using -- Returns `this`.
8032
8070
  const handle = await _assertClassBrand(_ElementHandle_brand, this, _asSVGElementHandle).call(this);
8033
8071
  const target = __addDisposableResource$7(env_5, handle && (await _assertClassBrand(_ElementHandle_brand, handle, _getOwnerSVGElement).call(handle)), false);
8034
8072
  return await (target ?? this).evaluate(async (element, threshold) => {
@@ -9015,7 +9053,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
9015
9053
  * matching the given selector. Otherwise, `null`.
9016
9054
  */
9017
9055
  async $(selector) {
9018
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
9056
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
9019
9057
  const document = await _assertClassBrand(_Frame_brand, this, _document2).call(this);
9020
9058
  return await document.$(selector);
9021
9059
  }
@@ -9042,7 +9080,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
9042
9080
  * elements matching the given selector.
9043
9081
  */
9044
9082
  async $$(selector, options) {
9045
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
9083
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
9046
9084
  const document = await _assertClassBrand(_Frame_brand, this, _document2).call(this);
9047
9085
  return await document.$$(selector, options);
9048
9086
  }
@@ -9082,7 +9120,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
9082
9120
  */
9083
9121
  async $eval(selector, pageFunction, ...args) {
9084
9122
  pageFunction = withSourcePuppeteerURLIfNone(this.$eval.name, pageFunction);
9085
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
9123
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
9086
9124
  const document = await _assertClassBrand(_Frame_brand, this, _document2).call(this);
9087
9125
  return await document.$eval(selector, pageFunction, ...args);
9088
9126
  }
@@ -9122,7 +9160,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
9122
9160
  */
9123
9161
  async $$eval(selector, pageFunction, ...args) {
9124
9162
  pageFunction = withSourcePuppeteerURLIfNone(this.$$eval.name, pageFunction);
9125
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
9163
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
9126
9164
  const document = await _assertClassBrand(_Frame_brand, this, _document2).call(this);
9127
9165
  return await document.$$eval(selector, pageFunction, ...args);
9128
9166
  }
@@ -12715,8 +12753,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
12715
12753
  if (!frame) {
12716
12754
  return;
12717
12755
  }
12718
- const iframeSnapshot = await frame.accessibility.snapshot(options);
12719
- root.iframeSnapshot = iframeSnapshot ?? undefined;
12756
+ try {
12757
+ const iframeSnapshot = await frame.accessibility.snapshot(options);
12758
+ root.iframeSnapshot = iframeSnapshot ?? undefined;
12759
+ } catch (error) {
12760
+ // Frames can get detached at any time resulting in errors.
12761
+ debugError(error);
12762
+ }
12720
12763
  } catch (e_1) {
12721
12764
  env_1.error = e_1;
12722
12765
  env_1.hasError = true;
@@ -12901,11 +12944,29 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
12901
12944
  return false;
12902
12945
  }
12903
12946
  }
12947
+ isLandmark() {
12948
+ switch (_classPrivateFieldGet(_role, this)) {
12949
+ case 'banner':
12950
+ case 'complementary':
12951
+ case 'contentinfo':
12952
+ case 'form':
12953
+ case 'main':
12954
+ case 'navigation':
12955
+ case 'region':
12956
+ case 'search':
12957
+ return true;
12958
+ default:
12959
+ return false;
12960
+ }
12961
+ }
12904
12962
  isInteresting(insideControl) {
12905
12963
  const role = _classPrivateFieldGet(_role, this);
12906
12964
  if (role === 'Ignored' || _classPrivateFieldGet(_hidden, this) || _classPrivateFieldGet(_ignored, this)) {
12907
12965
  return false;
12908
12966
  }
12967
+ if (this.isLandmark()) {
12968
+ return true;
12969
+ }
12909
12970
  if (_classPrivateFieldGet(_focusable, this) || _classPrivateFieldGet(_richlyEditable, this)) {
12910
12971
  return true;
12911
12972
  }
@@ -12957,9 +13018,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
12957
13018
  } finally {
12958
13019
  __disposeResources$4(env_2);
12959
13020
  }
12960
- }
13021
+ },
13022
+ backendNodeId: this.payload.backendDOMNodeId
12961
13023
  };
12962
- const userStringProperties = ['name', 'value', 'description', 'keyshortcuts', 'roledescription', 'valuetext'];
13024
+ const userStringProperties = ['name', 'value', 'description', 'keyshortcuts', 'roledescription', 'valuetext', 'url'];
12963
13025
  const getUserStringPropertyValue = key => {
12964
13026
  return properties.get(key);
12965
13027
  };
@@ -12981,7 +13043,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
12981
13043
  continue;
12982
13044
  }
12983
13045
  const value = getBooleanPropertyValue(booleanProperty);
12984
- if (!value) {
13046
+ if (value === undefined) {
12985
13047
  continue;
12986
13048
  }
12987
13049
  node[booleanProperty] = getBooleanPropertyValue(booleanProperty);
@@ -13222,6 +13284,33 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13222
13284
  }
13223
13285
  }
13224
13286
 
13287
+ /**
13288
+ * @internal
13289
+ */
13290
+ var _connection = /*#__PURE__*/new WeakMap();
13291
+ class CdpBluetoothEmulation {
13292
+ constructor(connection) {
13293
+ _classPrivateFieldInitSpec(this, _connection, void 0);
13294
+ _classPrivateFieldSet(_connection, this, connection);
13295
+ }
13296
+ async emulateAdapter(state, leSupported = true) {
13297
+ // Bluetooth spec requires overriding the existing adapter (step 6). From the CDP
13298
+ // perspective, it means disabling the emulation first.
13299
+ // https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command
13300
+ await _classPrivateFieldGet(_connection, this).send('BluetoothEmulation.disable');
13301
+ await _classPrivateFieldGet(_connection, this).send('BluetoothEmulation.enable', {
13302
+ state,
13303
+ leSupported
13304
+ });
13305
+ }
13306
+ async disableEmulation() {
13307
+ await _classPrivateFieldGet(_connection, this).send('BluetoothEmulation.disable');
13308
+ }
13309
+ async simulatePreconnectedPeripheral(preconnectedPeripheral) {
13310
+ await _classPrivateFieldGet(_connection, this).send('BluetoothEmulation.simulatePreconnectedPeripheral', preconnectedPeripheral);
13311
+ }
13312
+ }
13313
+
13225
13314
  /**
13226
13315
  * @license
13227
13316
  * Copyright 2020 Google Inc.
@@ -13236,21 +13325,24 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13236
13325
  var _args2 = /*#__PURE__*/new WeakMap();
13237
13326
  var _stackTraceLocations = /*#__PURE__*/new WeakMap();
13238
13327
  var _frame = /*#__PURE__*/new WeakMap();
13328
+ var _rawStackTrace = /*#__PURE__*/new WeakMap();
13239
13329
  class ConsoleMessage {
13240
13330
  /**
13241
13331
  * @internal
13242
13332
  */
13243
- constructor(type, text, args, stackTraceLocations, frame) {
13333
+ constructor(type, text, args, stackTraceLocations, frame, rawStackTrace) {
13244
13334
  _classPrivateFieldInitSpec(this, _type2, void 0);
13245
13335
  _classPrivateFieldInitSpec(this, _text, void 0);
13246
13336
  _classPrivateFieldInitSpec(this, _args2, void 0);
13247
13337
  _classPrivateFieldInitSpec(this, _stackTraceLocations, void 0);
13248
13338
  _classPrivateFieldInitSpec(this, _frame, void 0);
13339
+ _classPrivateFieldInitSpec(this, _rawStackTrace, void 0);
13249
13340
  _classPrivateFieldSet(_type2, this, type);
13250
13341
  _classPrivateFieldSet(_text, this, text);
13251
13342
  _classPrivateFieldSet(_args2, this, args);
13252
13343
  _classPrivateFieldSet(_stackTraceLocations, this, stackTraceLocations);
13253
13344
  _classPrivateFieldSet(_frame, this, frame);
13345
+ _classPrivateFieldSet(_rawStackTrace, this, rawStackTrace);
13254
13346
  }
13255
13347
  /**
13256
13348
  * The type of the console message.
@@ -13284,6 +13376,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13284
13376
  stackTrace() {
13285
13377
  return _classPrivateFieldGet(_stackTraceLocations, this);
13286
13378
  }
13379
+ /**
13380
+ * The underlying protocol stack trace if available.
13381
+ *
13382
+ * @internal
13383
+ */
13384
+ _rawStackTrace() {
13385
+ return _classPrivateFieldGet(_rawStackTrace, this);
13386
+ }
13287
13387
  }
13288
13388
 
13289
13389
  /**
@@ -13391,7 +13491,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13391
13491
  * Copyright 2023 Google Inc.
13392
13492
  * SPDX-License-Identifier: Apache-2.0
13393
13493
  */
13394
- const idGenerator = createIncrementalIdGenerator();
13395
13494
  /**
13396
13495
  * Manages callbacks and their IDs for the protocol request/response communication.
13397
13496
  *
@@ -13400,9 +13499,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13400
13499
  var _callbacks = /*#__PURE__*/new WeakMap();
13401
13500
  var _idGenerator = /*#__PURE__*/new WeakMap();
13402
13501
  class CallbackRegistry {
13403
- constructor() {
13502
+ constructor(idGenerator) {
13404
13503
  _classPrivateFieldInitSpec(this, _callbacks, new Map());
13405
- _classPrivateFieldInitSpec(this, _idGenerator, idGenerator);
13504
+ _classPrivateFieldInitSpec(this, _idGenerator, void 0);
13505
+ _classPrivateFieldSet(_idGenerator, this, idGenerator);
13406
13506
  }
13407
13507
  create(label, timeout, request) {
13408
13508
  const callback = new Callback(_classPrivateFieldGet(_idGenerator, this).call(this), label, timeout);
@@ -13531,7 +13631,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13531
13631
  var _sessionId = /*#__PURE__*/new WeakMap();
13532
13632
  var _targetType = /*#__PURE__*/new WeakMap();
13533
13633
  var _callbacks2 = /*#__PURE__*/new WeakMap();
13534
- var _connection = /*#__PURE__*/new WeakMap();
13634
+ var _connection2 = /*#__PURE__*/new WeakMap();
13535
13635
  var _parentSessionId = /*#__PURE__*/new WeakMap();
13536
13636
  var _target = /*#__PURE__*/new WeakMap();
13537
13637
  var _rawErrors = /*#__PURE__*/new WeakMap();
@@ -13544,14 +13644,15 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13544
13644
  super();
13545
13645
  _classPrivateFieldInitSpec(this, _sessionId, void 0);
13546
13646
  _classPrivateFieldInitSpec(this, _targetType, void 0);
13547
- _classPrivateFieldInitSpec(this, _callbacks2, new CallbackRegistry());
13548
- _classPrivateFieldInitSpec(this, _connection, void 0);
13647
+ _classPrivateFieldInitSpec(this, _callbacks2, void 0);
13648
+ _classPrivateFieldInitSpec(this, _connection2, void 0);
13549
13649
  _classPrivateFieldInitSpec(this, _parentSessionId, void 0);
13550
13650
  _classPrivateFieldInitSpec(this, _target, void 0);
13551
13651
  _classPrivateFieldInitSpec(this, _rawErrors, false);
13552
13652
  _classPrivateFieldInitSpec(this, _detached, false);
13553
- _classPrivateFieldSet(_connection, this, connection);
13653
+ _classPrivateFieldSet(_connection2, this, connection);
13554
13654
  _classPrivateFieldSet(_targetType, this, targetType);
13655
+ _classPrivateFieldSet(_callbacks2, this, new CallbackRegistry(connection._idGenerator));
13555
13656
  _classPrivateFieldSet(_sessionId, this, sessionId);
13556
13657
  _classPrivateFieldSet(_parentSessionId, this, parentSessionId);
13557
13658
  _classPrivateFieldSet(_rawErrors, this, rawErrors);
@@ -13574,10 +13675,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13574
13675
  return _classPrivateFieldGet(_target, this);
13575
13676
  }
13576
13677
  connection() {
13577
- return _classPrivateFieldGet(_connection, this);
13678
+ return _classPrivateFieldGet(_connection2, this);
13578
13679
  }
13579
13680
  get detached() {
13580
- return _classPrivateFieldGet(_connection, this)._closed || _classPrivateFieldGet(_detached, this);
13681
+ return _classPrivateFieldGet(_connection2, this)._closed || _classPrivateFieldGet(_detached, this);
13581
13682
  }
13582
13683
  parentSession() {
13583
13684
  if (!_classPrivateFieldGet(_parentSessionId, this)) {
@@ -13585,14 +13686,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13585
13686
  // case, we treat the current session as the parent session.
13586
13687
  return this;
13587
13688
  }
13588
- const parent = _classPrivateFieldGet(_connection, this)?.session(_classPrivateFieldGet(_parentSessionId, this));
13689
+ const parent = _classPrivateFieldGet(_connection2, this)?.session(_classPrivateFieldGet(_parentSessionId, this));
13589
13690
  return parent ?? undefined;
13590
13691
  }
13591
13692
  send(method, params, options) {
13592
13693
  if (this.detached) {
13593
13694
  return Promise.reject(new TargetCloseError(`Protocol error (${method}): Session closed. Most likely the ${_classPrivateFieldGet(_targetType, this)} has been closed.`));
13594
13695
  }
13595
- return _classPrivateFieldGet(_connection, this)._rawSend(_classPrivateFieldGet(_callbacks2, this), method, params, _classPrivateFieldGet(_sessionId, this), options);
13696
+ return _classPrivateFieldGet(_connection2, this)._rawSend(_classPrivateFieldGet(_callbacks2, this), method, params, _classPrivateFieldGet(_sessionId, this), options);
13596
13697
  }
13597
13698
  /**
13598
13699
  * @internal
@@ -13621,7 +13722,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13621
13722
  if (this.detached) {
13622
13723
  throw new Error(`Session already detached. Most likely the ${_classPrivateFieldGet(_targetType, this)} has been closed.`);
13623
13724
  }
13624
- await _classPrivateFieldGet(_connection, this).send('Target.detachFromTarget', {
13725
+ await _classPrivateFieldGet(_connection2, this).send('Target.detachFromTarget', {
13625
13726
  sessionId: _classPrivateFieldGet(_sessionId, this)
13626
13727
  });
13627
13728
  _classPrivateFieldSet(_detached, this, true);
@@ -13667,9 +13768,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13667
13768
  var _manuallyAttached = /*#__PURE__*/new WeakMap();
13668
13769
  var _callbacks3 = /*#__PURE__*/new WeakMap();
13669
13770
  var _rawErrors2 = /*#__PURE__*/new WeakMap();
13771
+ var _idGenerator2 = /*#__PURE__*/new WeakMap();
13670
13772
  var _Connection_brand = /*#__PURE__*/new WeakSet();
13671
13773
  class Connection extends EventEmitter {
13672
- constructor(url, transport, delay = 0, timeout, rawErrors = false) {
13774
+ constructor(url, transport, delay = 0, timeout, rawErrors = false, idGenerator = createIncrementalIdGenerator()) {
13673
13775
  super();
13674
13776
  _classPrivateMethodInitSpec(this, _Connection_brand);
13675
13777
  _classPrivateFieldInitSpec(this, _url2, void 0);
@@ -13681,8 +13783,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13681
13783
  _classPrivateFieldInitSpec(this, _manuallyAttached, new Set());
13682
13784
  _classPrivateFieldInitSpec(this, _callbacks3, void 0);
13683
13785
  _classPrivateFieldInitSpec(this, _rawErrors2, false);
13786
+ _classPrivateFieldInitSpec(this, _idGenerator2, void 0);
13684
13787
  _classPrivateFieldSet(_rawErrors2, this, rawErrors);
13685
- _classPrivateFieldSet(_callbacks3, this, new CallbackRegistry());
13788
+ _classPrivateFieldSet(_idGenerator2, this, idGenerator);
13789
+ _classPrivateFieldSet(_callbacks3, this, new CallbackRegistry(idGenerator));
13686
13790
  _classPrivateFieldSet(_url2, this, url);
13687
13791
  _classPrivateFieldSet(_delay2, this, delay);
13688
13792
  _classPrivateFieldSet(_timeout2, this, timeout ?? 180_000);
@@ -13708,6 +13812,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
13708
13812
  get _closed() {
13709
13813
  return _classPrivateFieldGet(_closed, this);
13710
13814
  }
13815
+ /**
13816
+ * @internal
13817
+ */
13818
+ get _idGenerator() {
13819
+ return _classPrivateFieldGet(_idGenerator2, this);
13820
+ }
13711
13821
  /**
13712
13822
  * @internal
13713
13823
  */
@@ -14385,7 +14495,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14385
14495
  /**
14386
14496
  * @internal
14387
14497
  */
14388
- let EmulationManager = ((_EmulationManager, _client5, _emulatingMobile, _hasTouch, _states, _viewportState, _idleOverridesState, _timezoneState, _visionDeficiencyState, _cpuThrottlingState, _mediaFeaturesState, _mediaTypeState, _geoLocationState, _defaultBackgroundColorState, _javascriptEnabledState, _secondaryClients, _EmulationManager_brand) => {
14498
+ let EmulationManager = ((_EmulationManager, _client5, _emulatingMobile, _hasTouch, _states, _viewportState, _idleOverridesState, _timezoneState, _visionDeficiencyState, _cpuThrottlingState, _mediaFeaturesState, _mediaTypeState, _geoLocationState, _defaultBackgroundColorState, _javascriptEnabledState, _focusState, _secondaryClients, _EmulationManager_brand) => {
14389
14499
  let _instanceExtraInitializers = [];
14390
14500
  let _private_applyViewport_decorators;
14391
14501
  let _private_applyViewport_descriptor;
@@ -14407,7 +14517,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14407
14517
  let _private_setDefaultBackgroundColor_descriptor;
14408
14518
  let _private_setJavaScriptEnabled_decorators;
14409
14519
  let _private_setJavaScriptEnabled_descriptor;
14410
- return _client5 = /*#__PURE__*/new WeakMap(), _emulatingMobile = /*#__PURE__*/new WeakMap(), _hasTouch = /*#__PURE__*/new WeakMap(), _states = /*#__PURE__*/new WeakMap(), _viewportState = /*#__PURE__*/new WeakMap(), _idleOverridesState = /*#__PURE__*/new WeakMap(), _timezoneState = /*#__PURE__*/new WeakMap(), _visionDeficiencyState = /*#__PURE__*/new WeakMap(), _cpuThrottlingState = /*#__PURE__*/new WeakMap(), _mediaFeaturesState = /*#__PURE__*/new WeakMap(), _mediaTypeState = /*#__PURE__*/new WeakMap(), _geoLocationState = /*#__PURE__*/new WeakMap(), _defaultBackgroundColorState = /*#__PURE__*/new WeakMap(), _javascriptEnabledState = /*#__PURE__*/new WeakMap(), _secondaryClients = /*#__PURE__*/new WeakMap(), _EmulationManager_brand = /*#__PURE__*/new WeakSet(), _EmulationManager = class EmulationManager {
14520
+ let _private_emulateFocus_decorators;
14521
+ let _private_emulateFocus_descriptor;
14522
+ return _client5 = /*#__PURE__*/new WeakMap(), _emulatingMobile = /*#__PURE__*/new WeakMap(), _hasTouch = /*#__PURE__*/new WeakMap(), _states = /*#__PURE__*/new WeakMap(), _viewportState = /*#__PURE__*/new WeakMap(), _idleOverridesState = /*#__PURE__*/new WeakMap(), _timezoneState = /*#__PURE__*/new WeakMap(), _visionDeficiencyState = /*#__PURE__*/new WeakMap(), _cpuThrottlingState = /*#__PURE__*/new WeakMap(), _mediaFeaturesState = /*#__PURE__*/new WeakMap(), _mediaTypeState = /*#__PURE__*/new WeakMap(), _geoLocationState = /*#__PURE__*/new WeakMap(), _defaultBackgroundColorState = /*#__PURE__*/new WeakMap(), _javascriptEnabledState = /*#__PURE__*/new WeakMap(), _focusState = /*#__PURE__*/new WeakMap(), _secondaryClients = /*#__PURE__*/new WeakMap(), _EmulationManager_brand = /*#__PURE__*/new WeakSet(), _EmulationManager = class EmulationManager {
14411
14523
  constructor(client) {
14412
14524
  _classPrivateMethodInitSpec(this, _EmulationManager_brand);
14413
14525
  _classPrivateFieldInitSpec(this, _client5, __runInitializers$2(this, _instanceExtraInitializers));
@@ -14445,6 +14557,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14445
14557
  javaScriptEnabled: true,
14446
14558
  active: false
14447
14559
  }, this, _classPrivateGetter(_EmulationManager_brand, this, _get_setJavaScriptEnabled)));
14560
+ _classPrivateFieldInitSpec(this, _focusState, new EmulatedState({
14561
+ enabled: true,
14562
+ active: false
14563
+ }, this, _classPrivateGetter(_EmulationManager_brand, this, _get_emulateFocus)));
14448
14564
  _classPrivateFieldInitSpec(this, _secondaryClients, new Set());
14449
14565
  _classPrivateFieldSet(_client5, this, client);
14450
14566
  }
@@ -14589,6 +14705,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14589
14705
  javaScriptEnabled: enabled
14590
14706
  });
14591
14707
  }
14708
+ async emulateFocus(enabled) {
14709
+ await _classPrivateFieldGet(_focusState, this).setState({
14710
+ active: true,
14711
+ enabled
14712
+ });
14713
+ }
14592
14714
  }, (() => {
14593
14715
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14594
14716
  _private_applyViewport_decorators = [invokeAtMostOnceForArguments];
@@ -14601,6 +14723,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14601
14723
  _private_setGeolocation_decorators = [invokeAtMostOnceForArguments];
14602
14724
  _private_setDefaultBackgroundColor_decorators = [invokeAtMostOnceForArguments];
14603
14725
  _private_setJavaScriptEnabled_decorators = [invokeAtMostOnceForArguments];
14726
+ _private_emulateFocus_decorators = [invokeAtMostOnceForArguments];
14604
14727
  __esDecorate$2(_EmulationManager, _private_applyViewport_descriptor = {
14605
14728
  value: __setFunctionName(async function (client, viewportState) {
14606
14729
  if (!viewportState.viewport) {
@@ -14845,6 +14968,26 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14845
14968
  },
14846
14969
  metadata: _metadata
14847
14970
  }, null, _instanceExtraInitializers);
14971
+ __esDecorate$2(_EmulationManager, _private_emulateFocus_descriptor = {
14972
+ value: __setFunctionName(async function (client, state) {
14973
+ if (!state.active) {
14974
+ return;
14975
+ }
14976
+ await client.send('Emulation.setFocusEmulationEnabled', {
14977
+ enabled: state.enabled
14978
+ });
14979
+ }, "#emulateFocus")
14980
+ }, _private_emulateFocus_decorators, {
14981
+ kind: "method",
14982
+ name: "#emulateFocus",
14983
+ static: false,
14984
+ private: true,
14985
+ access: {
14986
+ has: obj => _EmulationManager_brand.has(_checkInRHS(obj)),
14987
+ get: obj => _classPrivateGetter(_EmulationManager_brand, obj, _get_emulateFocus)
14988
+ },
14989
+ metadata: _metadata
14990
+ }, null, _instanceExtraInitializers);
14848
14991
  if (_metadata) Object.defineProperty(_EmulationManager, Symbol.metadata, {
14849
14992
  enumerable: true,
14850
14993
  configurable: true,
@@ -14882,6 +15025,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14882
15025
  function _get_setJavaScriptEnabled(_this12) {
14883
15026
  return _private_setJavaScriptEnabled_descriptor.value;
14884
15027
  }
15028
+ function _get_emulateFocus(_this13) {
15029
+ return _private_emulateFocus_descriptor.value;
15030
+ }
14885
15031
  })();
14886
15032
 
14887
15033
  /**
@@ -14932,48 +15078,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14932
15078
  * SPDX-License-Identifier: Apache-2.0
14933
15079
  */
14934
15080
  /**
14935
- * Device in a request prompt.
14936
- *
14937
- * @public
14938
- */
14939
- class DeviceRequestPromptDevice {
14940
- /**
14941
- * @internal
14942
- */
14943
- constructor(id, name) {
14944
- /**
14945
- * Device id during a prompt.
14946
- */
14947
- _defineProperty(this, "id", void 0);
14948
- /**
14949
- * Device name as it appears in a prompt.
14950
- */
14951
- _defineProperty(this, "name", void 0);
14952
- this.id = id;
14953
- this.name = name;
14954
- }
14955
- }
14956
- /**
14957
- * Device request prompts let you respond to the page requesting for a device
14958
- * through an API like WebBluetooth.
14959
- *
14960
- * @remarks
14961
- * `DeviceRequestPrompt` instances are returned via the
14962
- * {@link Page.waitForDevicePrompt} method.
14963
- *
14964
- * @example
14965
- *
14966
- * ```ts
14967
- * const [devicePrompt] = Promise.all([
14968
- * page.waitForDevicePrompt(),
14969
- * page.click('#connect-bluetooth'),
14970
- * ]);
14971
- * await devicePrompt.select(
14972
- * await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
14973
- * );
14974
- * ```
14975
- *
14976
- * @public
15081
+ * @internal
14977
15082
  */
14978
15083
  var _client6 = /*#__PURE__*/new WeakMap();
14979
15084
  var _timeoutSettings = /*#__PURE__*/new WeakMap();
@@ -14981,23 +15086,17 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
14981
15086
  var _handled2 = /*#__PURE__*/new WeakMap();
14982
15087
  var _updateDevicesHandle = /*#__PURE__*/new WeakMap();
14983
15088
  var _waitForDevicePromises = /*#__PURE__*/new WeakMap();
14984
- var _DeviceRequestPrompt_brand = /*#__PURE__*/new WeakSet();
14985
- class DeviceRequestPrompt {
14986
- /**
14987
- * @internal
14988
- */
15089
+ var _CdpDeviceRequestPrompt_brand = /*#__PURE__*/new WeakSet();
15090
+ class CdpDeviceRequestPrompt extends DeviceRequestPrompt {
14989
15091
  constructor(client, timeoutSettings, firstEvent) {
14990
- _classPrivateMethodInitSpec(this, _DeviceRequestPrompt_brand);
15092
+ super();
15093
+ _classPrivateMethodInitSpec(this, _CdpDeviceRequestPrompt_brand);
14991
15094
  _classPrivateFieldInitSpec(this, _client6, void 0);
14992
15095
  _classPrivateFieldInitSpec(this, _timeoutSettings, void 0);
14993
15096
  _classPrivateFieldInitSpec(this, _id4, void 0);
14994
15097
  _classPrivateFieldInitSpec(this, _handled2, false);
14995
- _classPrivateFieldInitSpec(this, _updateDevicesHandle, _assertClassBrand(_DeviceRequestPrompt_brand, this, _updateDevices).bind(this));
15098
+ _classPrivateFieldInitSpec(this, _updateDevicesHandle, _assertClassBrand(_CdpDeviceRequestPrompt_brand, this, _updateDevices).bind(this));
14996
15099
  _classPrivateFieldInitSpec(this, _waitForDevicePromises, new Set());
14997
- /**
14998
- * Current list of selectable devices.
14999
- */
15000
- _defineProperty(this, "devices", []);
15001
15100
  _classPrivateFieldSet(_client6, this, client);
15002
15101
  _classPrivateFieldSet(_timeoutSettings, this, timeoutSettings);
15003
15102
  _classPrivateFieldSet(_id4, this, firstEvent.id);
@@ -15005,11 +15104,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15005
15104
  _classPrivateFieldGet(_client6, this).on('Target.detachedFromTarget', () => {
15006
15105
  _classPrivateFieldSet(_client6, this, null);
15007
15106
  });
15008
- _assertClassBrand(_DeviceRequestPrompt_brand, this, _updateDevices).call(this, firstEvent);
15107
+ _assertClassBrand(_CdpDeviceRequestPrompt_brand, this, _updateDevices).call(this, firstEvent);
15009
15108
  }
15010
- /**
15011
- * Resolve to the first device in the prompt matching a filter.
15012
- */
15013
15109
  async waitForDevice(filter, options = {}) {
15014
15110
  for (const device of this.devices) {
15015
15111
  if (filter(device)) {
@@ -15041,9 +15137,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15041
15137
  _classPrivateFieldGet(_waitForDevicePromises, this).delete(handle);
15042
15138
  }
15043
15139
  }
15044
- /**
15045
- * Select a device in the prompt's list.
15046
- */
15047
15140
  async select(device) {
15048
15141
  assert(_classPrivateFieldGet(_client6, this) !== null, 'Cannot select device through detached session!');
15049
15142
  assert(this.devices.includes(device), 'Cannot select unknown device!');
@@ -15055,9 +15148,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15055
15148
  deviceId: device.id
15056
15149
  });
15057
15150
  }
15058
- /**
15059
- * Cancel the prompt.
15060
- */
15061
15151
  async cancel() {
15062
15152
  assert(_classPrivateFieldGet(_client6, this) !== null, 'Cannot cancel prompt through detached session!');
15063
15153
  assert(!_classPrivateFieldGet(_handled2, this), 'Cannot cancel DeviceRequestPrompt which is already handled!');
@@ -15081,7 +15171,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15081
15171
  })) {
15082
15172
  continue;
15083
15173
  }
15084
- const newDevice = new DeviceRequestPromptDevice(rawDevice.id, rawDevice.name);
15174
+ const newDevice = {
15175
+ id: rawDevice.id,
15176
+ name: rawDevice.name
15177
+ };
15085
15178
  this.devices.push(newDevice);
15086
15179
  for (const waitForDevicePromise of _classPrivateFieldGet(_waitForDevicePromises, this)) {
15087
15180
  if (waitForDevicePromise.filter(newDevice)) {
@@ -15093,32 +15186,22 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15093
15186
  var _client7 = /*#__PURE__*/new WeakMap();
15094
15187
  var _timeoutSettings2 = /*#__PURE__*/new WeakMap();
15095
15188
  var _deviceRequestPromptDeferreds = /*#__PURE__*/new WeakMap();
15096
- var _DeviceRequestPromptManager_brand = /*#__PURE__*/new WeakSet();
15097
- class DeviceRequestPromptManager {
15098
- /**
15099
- * @internal
15100
- */
15189
+ var _CdpDeviceRequestPromptManager_brand = /*#__PURE__*/new WeakSet();
15190
+ class CdpDeviceRequestPromptManager {
15101
15191
  constructor(client, timeoutSettings) {
15102
- /**
15103
- * @internal
15104
- */
15105
- _classPrivateMethodInitSpec(this, _DeviceRequestPromptManager_brand);
15192
+ _classPrivateMethodInitSpec(this, _CdpDeviceRequestPromptManager_brand);
15106
15193
  _classPrivateFieldInitSpec(this, _client7, void 0);
15107
15194
  _classPrivateFieldInitSpec(this, _timeoutSettings2, void 0);
15108
15195
  _classPrivateFieldInitSpec(this, _deviceRequestPromptDeferreds, new Set());
15109
15196
  _classPrivateFieldSet(_client7, this, client);
15110
15197
  _classPrivateFieldSet(_timeoutSettings2, this, timeoutSettings);
15111
15198
  _classPrivateFieldGet(_client7, this).on('DeviceAccess.deviceRequestPrompted', event => {
15112
- _assertClassBrand(_DeviceRequestPromptManager_brand, this, _onDeviceRequestPrompted).call(this, event);
15199
+ _assertClassBrand(_CdpDeviceRequestPromptManager_brand, this, _onDeviceRequestPrompted).call(this, event);
15113
15200
  });
15114
15201
  _classPrivateFieldGet(_client7, this).on('Target.detachedFromTarget', () => {
15115
15202
  _classPrivateFieldSet(_client7, this, null);
15116
15203
  });
15117
15204
  }
15118
- /**
15119
- * Wait for device prompt created by an action like calling WebBluetooth's
15120
- * requestDevice.
15121
- */
15122
15205
  async waitForDevicePrompt(options = {}) {
15123
15206
  assert(_classPrivateFieldGet(_client7, this) !== null, 'Cannot wait for device prompt through detached session!');
15124
15207
  const needsEnable = _classPrivateFieldGet(_deviceRequestPromptDeferreds, this).size === 0;
@@ -15163,7 +15246,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15163
15246
  return;
15164
15247
  }
15165
15248
  assert(_classPrivateFieldGet(_client7, this) !== null);
15166
- const devicePrompt = new DeviceRequestPrompt(_classPrivateFieldGet(_client7, this), _classPrivateFieldGet(_timeoutSettings2, this), event);
15249
+ const devicePrompt = new CdpDeviceRequestPrompt(_classPrivateFieldGet(_client7, this), _classPrivateFieldGet(_timeoutSettings2, this), event);
15167
15250
  for (const promise of _classPrivateFieldGet(_deviceRequestPromptDeferreds, this)) {
15168
15251
  promise.resolve(devicePrompt);
15169
15252
  }
@@ -15697,8 +15780,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
15697
15780
  value: _metadata
15698
15781
  });
15699
15782
  })(), _CdpElementHandle;
15700
- function _get_frameManager(_this13) {
15701
- return _this13.frame._frameManager;
15783
+ function _get_frameManager(_this14) {
15784
+ return _this14.frame._frameManager;
15702
15785
  }
15703
15786
  })();
15704
15787
 
@@ -17316,7 +17399,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17316
17399
  this._redirectChain = redirectChain;
17317
17400
  _classPrivateFieldSet(_initiator, this, data.initiator);
17318
17401
  this.interception.enabled = allowInterception;
17319
- for (const [key, value] of Object.entries(data.request.headers)) {
17402
+ this.updateHeaders(data.request.headers);
17403
+ }
17404
+ updateHeaders(headers) {
17405
+ for (const [key, value] of Object.entries(headers)) {
17320
17406
  _classPrivateFieldGet(_headers, this)[key.toLowerCase()] = value;
17321
17407
  }
17322
17408
  }
@@ -17347,7 +17433,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17347
17433
  }
17348
17434
  }
17349
17435
  headers() {
17350
- return _classPrivateFieldGet(_headers, this);
17436
+ // Callers should not be allowed to mutate internal structure.
17437
+ return structuredClone(_classPrivateFieldGet(_headers, this));
17351
17438
  }
17352
17439
  response() {
17353
17440
  return this._response;
@@ -17609,7 +17696,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17609
17696
  return stringToTypedArray(response.body, response.base64Encoded);
17610
17697
  } catch (error) {
17611
17698
  if (error instanceof ProtocolError && error.originalMessage === 'No resource with given identifier found') {
17612
- throw new ProtocolError('Could not load body for this request. This might happen if the request is a preflight request.');
17699
+ throw new ProtocolError('Could not load response body for this request. This might happen if the request is a preflight request.');
17613
17700
  }
17614
17701
  throw error;
17615
17702
  }
@@ -17662,6 +17749,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17662
17749
  var _requestWillBeSentMap = /*#__PURE__*/new WeakMap();
17663
17750
  var _requestPausedMap = /*#__PURE__*/new WeakMap();
17664
17751
  var _httpRequestsMap = /*#__PURE__*/new WeakMap();
17752
+ var _requestWillBeSentExtraInfoMap = /*#__PURE__*/new WeakMap();
17665
17753
  var _responseReceivedExtraInfoMap = /*#__PURE__*/new WeakMap();
17666
17754
  var _queuedRedirectInfoMap = /*#__PURE__*/new WeakMap();
17667
17755
  var _queuedEventGroupMap = /*#__PURE__*/new WeakMap();
@@ -17702,6 +17790,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17702
17790
  _classPrivateFieldInitSpec(this, _requestWillBeSentMap, new Map());
17703
17791
  _classPrivateFieldInitSpec(this, _requestPausedMap, new Map());
17704
17792
  _classPrivateFieldInitSpec(this, _httpRequestsMap, new Map());
17793
+ _classPrivateFieldInitSpec(this, _requestWillBeSentExtraInfoMap, new Map());
17705
17794
  /*
17706
17795
  * The below maps are used to reconcile Network.responseReceivedExtraInfo
17707
17796
  * events with their corresponding request. Each response and redirect
@@ -17718,10 +17807,17 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17718
17807
  forget(networkRequestId) {
17719
17808
  _classPrivateFieldGet(_requestWillBeSentMap, this).delete(networkRequestId);
17720
17809
  _classPrivateFieldGet(_requestPausedMap, this).delete(networkRequestId);
17810
+ _classPrivateFieldGet(_requestWillBeSentExtraInfoMap, this).delete(networkRequestId);
17721
17811
  _classPrivateFieldGet(_queuedEventGroupMap, this).delete(networkRequestId);
17722
17812
  _classPrivateFieldGet(_queuedRedirectInfoMap, this).delete(networkRequestId);
17723
17813
  _classPrivateFieldGet(_responseReceivedExtraInfoMap, this).delete(networkRequestId);
17724
17814
  }
17815
+ requestExtraInfo(networkRequestId) {
17816
+ if (!_classPrivateFieldGet(_requestWillBeSentExtraInfoMap, this).has(networkRequestId)) {
17817
+ _classPrivateFieldGet(_requestWillBeSentExtraInfoMap, this).set(networkRequestId, []);
17818
+ }
17819
+ return _classPrivateFieldGet(_requestWillBeSentExtraInfoMap, this).get(networkRequestId);
17820
+ }
17725
17821
  responseExtraInfo(networkRequestId) {
17726
17822
  if (!_classPrivateFieldGet(_responseReceivedExtraInfoMap, this).has(networkRequestId)) {
17727
17823
  _classPrivateFieldGet(_responseReceivedExtraInfoMap, this).set(networkRequestId, []);
@@ -17849,7 +17945,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17849
17945
  _classPrivateFieldInitSpec(this, _userAgent, void 0);
17850
17946
  _classPrivateFieldInitSpec(this, _userAgentMetadata, void 0);
17851
17947
  _classPrivateFieldInitSpec(this, _platform, void 0);
17852
- _classPrivateFieldInitSpec(this, _handlers3, [['Fetch.requestPaused', _assertClassBrand(_NetworkManager_brand, this, _onRequestPaused)], ['Fetch.authRequired', _assertClassBrand(_NetworkManager_brand, this, _onAuthRequired)], ['Network.requestWillBeSent', _assertClassBrand(_NetworkManager_brand, this, _onRequestWillBeSent)], ['Network.requestServedFromCache', _assertClassBrand(_NetworkManager_brand, this, _onRequestServedFromCache)], ['Network.responseReceived', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceived)], ['Network.loadingFinished', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFinished)], ['Network.loadingFailed', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFailed)], ['Network.responseReceivedExtraInfo', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceivedExtraInfo)], [exports.CDPSessionEvent.Disconnected, _assertClassBrand(_NetworkManager_brand, this, _removeClient)]]);
17948
+ _classPrivateFieldInitSpec(this, _handlers3, [['Fetch.requestPaused', _assertClassBrand(_NetworkManager_brand, this, _onRequestPaused)], ['Fetch.authRequired', _assertClassBrand(_NetworkManager_brand, this, _onAuthRequired)], ['Network.requestWillBeSent', _assertClassBrand(_NetworkManager_brand, this, _onRequestWillBeSent)], ['Network.requestWillBeSentExtraInfo', _assertClassBrand(_NetworkManager_brand, this, _onRequestWillBeSentExtraInfo)], ['Network.requestServedFromCache', _assertClassBrand(_NetworkManager_brand, this, _onRequestServedFromCache)], ['Network.responseReceived', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceived)], ['Network.loadingFinished', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFinished)], ['Network.loadingFailed', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFailed)], ['Network.responseReceivedExtraInfo', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceivedExtraInfo)], [exports.CDPSessionEvent.Disconnected, _assertClassBrand(_NetworkManager_brand, this, _removeClient)]]);
17853
17949
  _classPrivateFieldInitSpec(this, _clients, new Map());
17854
17950
  _classPrivateFieldInitSpec(this, _networkEnabled, true);
17855
17951
  _classPrivateFieldSet(_frameManager, this, frameManager);
@@ -17954,7 +18050,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
17954
18050
  * SPDX-License-Identifier: Apache-2.0
17955
18051
  */
17956
18052
  function _canIgnoreError(error) {
17957
- return isErrorLike(error) && (isTargetClosedError(error) || error.message.includes('Not supported'));
18053
+ return isErrorLike(error) && (isTargetClosedError(error) || error.message.includes('Not supported') || error.message.includes("wasn't found"));
17958
18054
  }
17959
18055
  async function _removeClient(client) {
17960
18056
  _classPrivateFieldGet(_clients, this).get(client)?.dispose();
@@ -18181,15 +18277,31 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
18181
18277
  if (request) {
18182
18278
  _assertClassBrand(_NetworkManager_brand, this, _handleRequestRedirect).call(this, client, request, event.redirectResponse, redirectResponseExtraInfo);
18183
18279
  redirectChain = request._redirectChain;
18280
+ const extraInfo = _classPrivateFieldGet(_networkEventManager, this).requestExtraInfo(event.requestId).shift();
18281
+ if (extraInfo) {
18282
+ request.updateHeaders(extraInfo.headers);
18283
+ }
18184
18284
  }
18185
18285
  }
18186
18286
  const frame = event.frameId ? _classPrivateFieldGet(_frameManager, this).frame(event.frameId) : null;
18187
18287
  const request = new CdpHTTPRequest(client, frame, fetchRequestId, _classPrivateFieldGet(_userRequestInterceptionEnabled, this), event, redirectChain);
18288
+ const extraInfo = _classPrivateFieldGet(_networkEventManager, this).requestExtraInfo(event.requestId).shift();
18289
+ if (extraInfo) {
18290
+ request.updateHeaders(extraInfo.headers);
18291
+ }
18188
18292
  request._fromMemoryCache = fromMemoryCache;
18189
18293
  _classPrivateFieldGet(_networkEventManager, this).storeRequest(event.requestId, request);
18190
18294
  this.emit(exports.NetworkManagerEvent.Request, request);
18191
18295
  void request.finalizeInterceptions();
18192
18296
  }
18297
+ function _onRequestWillBeSentExtraInfo(_client, event) {
18298
+ const request = _classPrivateFieldGet(_networkEventManager, this).getRequest(event.requestId);
18299
+ if (request) {
18300
+ request.updateHeaders(event.headers);
18301
+ } else {
18302
+ _classPrivateFieldGet(_networkEventManager, this).requestExtraInfo(event.requestId).push(event);
18303
+ }
18304
+ }
18193
18305
  function _onRequestServedFromCache(client, event) {
18194
18306
  const requestWillBeSentEvent = _classPrivateFieldGet(_networkEventManager, this).getRequestWillBeSent(event.requestId);
18195
18307
  let request = _classPrivateFieldGet(_networkEventManager, this).getRequest(event.requestId);
@@ -18609,7 +18721,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
18609
18721
  _deviceRequestPromptManager(client) {
18610
18722
  let manager = _classPrivateFieldGet(_deviceRequestPromptManagerMap, this).get(client);
18611
18723
  if (manager === undefined) {
18612
- manager = new DeviceRequestPromptManager(client, _classPrivateFieldGet(_timeoutSettings3, this));
18724
+ manager = new CdpDeviceRequestPromptManager(client, _classPrivateFieldGet(_timeoutSettings3, this));
18613
18725
  _classPrivateFieldGet(_deviceRequestPromptManagerMap, this).set(client, manager);
18614
18726
  }
18615
18727
  return manager;
@@ -20671,10 +20783,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
20671
20783
  /**
20672
20784
  * @internal
20673
20785
  */
20674
- function _get_state(_this14) {
20786
+ function _get_state(_this15) {
20675
20787
  return Object.assign({
20676
- ..._classPrivateFieldGet(_state2, _this14)
20677
- }, ..._classPrivateFieldGet(_transactions, _this14));
20788
+ ..._classPrivateFieldGet(_state2, _this15)
20789
+ }, ..._classPrivateFieldGet(_transactions, _this15));
20678
20790
  }
20679
20791
  function _createTransaction() {
20680
20792
  const transaction = {};
@@ -20961,9 +21073,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
20961
21073
  async close() {
20962
21074
  switch (_classPrivateFieldGet(_targetType2, this)) {
20963
21075
  case exports.TargetType.SERVICE_WORKER:
20964
- case exports.TargetType.SHARED_WORKER:
20965
21076
  {
20966
- // For service and shared workers we need to close the target and detach to allow
21077
+ // For service workers we need to close the target and detach to allow
20967
21078
  // the worker to stop.
20968
21079
  await this.client.connection()?.send('Target.closeTarget', {
20969
21080
  targetId: _classPrivateFieldGet(_id6, this)
@@ -20973,6 +21084,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
20973
21084
  });
20974
21085
  break;
20975
21086
  }
21087
+ case exports.TargetType.SHARED_WORKER:
21088
+ {
21089
+ await this.client.connection()?.send('Target.closeTarget', {
21090
+ targetId: _classPrivateFieldGet(_id6, this)
21091
+ });
21092
+ break;
21093
+ }
20976
21094
  default:
20977
21095
  await this.evaluate(() => {
20978
21096
  self.close();
@@ -21064,6 +21182,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21064
21182
  */
21065
21183
  var _closed2 = /*#__PURE__*/new WeakMap();
21066
21184
  var _targetManager = /*#__PURE__*/new WeakMap();
21185
+ var _cdpBluetoothEmulation = /*#__PURE__*/new WeakMap();
21067
21186
  var _primaryTargetClient = /*#__PURE__*/new WeakMap();
21068
21187
  var _primaryTarget = /*#__PURE__*/new WeakMap();
21069
21188
  var _tabTargetClient = /*#__PURE__*/new WeakMap();
@@ -21108,6 +21227,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21108
21227
  _classPrivateMethodInitSpec(this, _CdpPage_brand);
21109
21228
  _classPrivateFieldInitSpec(this, _closed2, false);
21110
21229
  _classPrivateFieldInitSpec(this, _targetManager, void 0);
21230
+ _classPrivateFieldInitSpec(this, _cdpBluetoothEmulation, void 0);
21111
21231
  _classPrivateFieldInitSpec(this, _primaryTargetClient, void 0);
21112
21232
  _classPrivateFieldInitSpec(this, _primaryTarget, void 0);
21113
21233
  _classPrivateFieldInitSpec(this, _tabTargetClient, void 0);
@@ -21161,6 +21281,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21161
21281
  _classPrivateFieldSet(_tracing, this, new Tracing(client));
21162
21282
  _classPrivateFieldSet(_coverage, this, new Coverage(client));
21163
21283
  _classPrivateFieldSet(_viewport, this, null);
21284
+ // Use browser context's connection, as current Bluetooth emulation in Chromium is
21285
+ // implemented on the browser context level, and not tight to the specific tab.
21286
+ _classPrivateFieldSet(_cdpBluetoothEmulation, this, new CdpBluetoothEmulation(_classPrivateFieldGet(_primaryTargetClient, this).connection()));
21164
21287
  const frameManagerEmitter = new EventEmitter(_classPrivateFieldGet(_frameManager2, this));
21165
21288
  frameManagerEmitter.on(exports.FrameManagerEvent.FrameAttached, frame => {
21166
21289
  this.emit("frameattached" /* PageEvent.FrameAttached */, frame);
@@ -21205,15 +21328,19 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21205
21328
  _assertClassBrand(_CdpPage_brand, this, _attachExistingTargets).call(this);
21206
21329
  }
21207
21330
  async resize(params) {
21208
- const {
21209
- windowId
21210
- } = await _classPrivateFieldGet(_primaryTargetClient, this).send('Browser.getWindowForTarget');
21331
+ const windowId = await this.windowId();
21211
21332
  await _classPrivateFieldGet(_primaryTargetClient, this).send('Browser.setContentsSize', {
21212
- windowId,
21333
+ windowId: Number(windowId),
21213
21334
  width: params.contentWidth,
21214
21335
  height: params.contentHeight
21215
21336
  });
21216
21337
  }
21338
+ async windowId() {
21339
+ const {
21340
+ windowId
21341
+ } = await _classPrivateFieldGet(_primaryTargetClient, this).send('Browser.getWindowForTarget');
21342
+ return windowId.toString();
21343
+ }
21217
21344
  _client() {
21218
21345
  return _classPrivateFieldGet(_primaryTargetClient, this);
21219
21346
  }
@@ -21226,6 +21353,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21226
21353
  isJavaScriptEnabled() {
21227
21354
  return _classPrivateFieldGet(_emulationManager, this).javascriptEnabled;
21228
21355
  }
21356
+ async openDevTools() {
21357
+ const pageTargetId = this.target()._targetId;
21358
+ const browser = this.browser();
21359
+ const devtoolsPage = await browser._createDevToolsPage(pageTargetId);
21360
+ return devtoolsPage;
21361
+ }
21229
21362
  async waitForFileChooser(options = {}) {
21230
21363
  const needsEnable = _classPrivateFieldGet(_fileChooserDeferreds, this).size === 0;
21231
21364
  const {
@@ -21311,6 +21444,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21311
21444
  async emulateNetworkConditions(networkConditions) {
21312
21445
  return await _classPrivateFieldGet(_frameManager2, this).networkManager.emulateNetworkConditions(networkConditions);
21313
21446
  }
21447
+ async emulateFocusedPage(enabled) {
21448
+ return await _classPrivateFieldGet(_emulationManager, this).emulateFocus(enabled);
21449
+ }
21314
21450
  setDefaultNavigationTimeout(timeout) {
21315
21451
  this._timeoutSettings.setDefaultNavigationTimeout(timeout);
21316
21452
  }
@@ -21454,7 +21590,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21454
21590
  const [result] = await Promise.all([this.waitForNavigation({
21455
21591
  ...options,
21456
21592
  ignoreSameDocumentNavigation: true
21457
- }), _classPrivateFieldGet(_primaryTargetClient, this).send('Page.reload')]);
21593
+ }), _classPrivateFieldGet(_primaryTargetClient, this).send('Page.reload', {
21594
+ ignoreCache: options?.ignoreCache ?? false
21595
+ })]);
21458
21596
  return result;
21459
21597
  }
21460
21598
  async createCDPSession() {
@@ -21706,6 +21844,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21706
21844
  async waitForDevicePrompt(options = {}) {
21707
21845
  return await this.mainFrame().waitForDevicePrompt(options);
21708
21846
  }
21847
+ get bluetooth() {
21848
+ return _classPrivateFieldGet(_cdpBluetoothEmulation, this);
21849
+ }
21709
21850
  }
21710
21851
  function _attachExistingTargets() {
21711
21852
  const queue = [];
@@ -21818,7 +21959,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21818
21959
  args,
21819
21960
  source,
21820
21961
  url,
21821
- lineNumber
21962
+ lineNumber,
21963
+ stackTrace
21822
21964
  } = event.entry;
21823
21965
  if (args) {
21824
21966
  args.map(arg => {
@@ -21829,7 +21971,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21829
21971
  this.emit("console" /* PageEvent.Console */, new ConsoleMessage(convertConsoleMessageLevel(level), text, [], [{
21830
21972
  url,
21831
21973
  lineNumber
21832
- }]));
21974
+ }], undefined, stackTrace));
21833
21975
  }
21834
21976
  }
21835
21977
  function _emitMetrics(event) {
@@ -21891,7 +22033,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21891
22033
  }
21892
22034
  const textTokens = [];
21893
22035
  // eslint-disable-next-line max-len -- The comment is long.
21894
- // eslint-disable-next-line rulesdir/use-using -- These are not owned by this function.
22036
+ // eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
21895
22037
  for (const arg of args) {
21896
22038
  const remoteObject = arg.remoteObject();
21897
22039
  if (remoteObject.objectId) {
@@ -21910,7 +22052,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
21910
22052
  });
21911
22053
  }
21912
22054
  }
21913
- const message = new ConsoleMessage(convertConsoleMessageLevel(eventType), textTokens.join(' '), args, stackTraceLocations);
22055
+ const message = new ConsoleMessage(convertConsoleMessageLevel(eventType), textTokens.join(' '), args, stackTraceLocations, undefined, stackTrace);
21914
22056
  this.emit("console" /* PageEvent.Console */, message);
21915
22057
  }
21916
22058
  function _onDialog(event) {
@@ -22034,16 +22176,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22034
22176
  /**
22035
22177
  * @internal
22036
22178
  */
22037
- var _connection2 = /*#__PURE__*/new WeakMap();
22179
+ var _connection3 = /*#__PURE__*/new WeakMap();
22038
22180
  var _browser = /*#__PURE__*/new WeakMap();
22039
22181
  var _id7 = /*#__PURE__*/new WeakMap();
22040
22182
  class CdpBrowserContext extends BrowserContext {
22041
22183
  constructor(connection, browser, contextId) {
22042
22184
  super();
22043
- _classPrivateFieldInitSpec(this, _connection2, void 0);
22185
+ _classPrivateFieldInitSpec(this, _connection3, void 0);
22044
22186
  _classPrivateFieldInitSpec(this, _browser, void 0);
22045
22187
  _classPrivateFieldInitSpec(this, _id7, void 0);
22046
- _classPrivateFieldSet(_connection2, this, connection);
22188
+ _classPrivateFieldSet(_connection3, this, connection);
22047
22189
  _classPrivateFieldSet(_browser, this, browser);
22048
22190
  _classPrivateFieldSet(_id7, this, contextId);
22049
22191
  }
@@ -22055,9 +22197,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22055
22197
  return target.browserContext() === this;
22056
22198
  });
22057
22199
  }
22058
- async pages() {
22200
+ async pages(includeAll = false) {
22059
22201
  const pages = await Promise.all(this.targets().filter(target => {
22060
- return target.type() === 'page' || target.type() === 'other' && _classPrivateFieldGet(_browser, this)._getIsPageTargetCallback()?.(target);
22202
+ return target.type() === 'page' || (target.type() === 'other' || includeAll) && _classPrivateFieldGet(_browser, this)._getIsPageTargetCallback()?.(target);
22061
22203
  }).map(target => {
22062
22204
  return target.page();
22063
22205
  }));
@@ -22073,18 +22215,18 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22073
22215
  }
22074
22216
  return protocolPermission;
22075
22217
  });
22076
- await _classPrivateFieldGet(_connection2, this).send('Browser.grantPermissions', {
22218
+ await _classPrivateFieldGet(_connection3, this).send('Browser.grantPermissions', {
22077
22219
  origin,
22078
22220
  browserContextId: _classPrivateFieldGet(_id7, this) || undefined,
22079
22221
  permissions: protocolPermissions
22080
22222
  });
22081
22223
  }
22082
22224
  async clearPermissionOverrides() {
22083
- await _classPrivateFieldGet(_connection2, this).send('Browser.resetPermissions', {
22225
+ await _classPrivateFieldGet(_connection3, this).send('Browser.resetPermissions', {
22084
22226
  browserContextId: _classPrivateFieldGet(_id7, this) || undefined
22085
22227
  });
22086
22228
  }
22087
- async newPage() {
22229
+ async newPage(options) {
22088
22230
  const env_1 = {
22089
22231
  stack: [],
22090
22232
  error: void 0,
@@ -22092,7 +22234,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22092
22234
  };
22093
22235
  try {
22094
22236
  const _guard = __addDisposableResource(env_1, await this.waitForScreenshotOperations(), false);
22095
- return await _classPrivateFieldGet(_browser, this)._createPageInContext(_classPrivateFieldGet(_id7, this));
22237
+ return await _classPrivateFieldGet(_browser, this)._createPageInContext(_classPrivateFieldGet(_id7, this), options);
22096
22238
  } catch (e_1) {
22097
22239
  env_1.error = e_1;
22098
22240
  env_1.hasError = true;
@@ -22110,7 +22252,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22110
22252
  async cookies() {
22111
22253
  const {
22112
22254
  cookies
22113
- } = await _classPrivateFieldGet(_connection2, this).send('Storage.getCookies', {
22255
+ } = await _classPrivateFieldGet(_connection3, this).send('Storage.getCookies', {
22114
22256
  browserContextId: _classPrivateFieldGet(_id7, this)
22115
22257
  });
22116
22258
  return cookies.map(cookie => {
@@ -22124,7 +22266,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22124
22266
  });
22125
22267
  }
22126
22268
  async setCookie(...cookies) {
22127
- return await _classPrivateFieldGet(_connection2, this).send('Storage.setCookies', {
22269
+ return await _classPrivateFieldGet(_connection3, this).send('Storage.setCookies', {
22128
22270
  browserContextId: _classPrivateFieldGet(_id7, this),
22129
22271
  cookies: cookies.map(cookie => {
22130
22272
  return {
@@ -22135,7 +22277,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22135
22277
  });
22136
22278
  }
22137
22279
  async setDownloadBehavior(downloadBehavior) {
22138
- await _classPrivateFieldGet(_connection2, this).send('Browser.setDownloadBehavior', {
22280
+ await _classPrivateFieldGet(_connection3, this).send('Browser.setDownloadBehavior', {
22139
22281
  behavior: downloadBehavior.policy,
22140
22282
  downloadPath: downloadBehavior.downloadPath,
22141
22283
  browserContextId: _classPrivateFieldGet(_id7, this)
@@ -22403,7 +22545,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22403
22545
  *
22404
22546
  * @internal
22405
22547
  */
22406
- var _connection3 = /*#__PURE__*/new WeakMap();
22548
+ var _connection4 = /*#__PURE__*/new WeakMap();
22407
22549
  var _discoveredTargetsByTargetId = /*#__PURE__*/new WeakMap();
22408
22550
  var _attachedTargetsByTargetId = /*#__PURE__*/new WeakMap();
22409
22551
  var _attachedTargetsBySessionId = /*#__PURE__*/new WeakMap();
@@ -22413,10 +22555,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22413
22555
  var _attachedToTargetListenersBySession = /*#__PURE__*/new WeakMap();
22414
22556
  var _detachedFromTargetListenersBySession = /*#__PURE__*/new WeakMap();
22415
22557
  var _initializeDeferred = /*#__PURE__*/new WeakMap();
22416
- var _targetsIdsForInit = /*#__PURE__*/new WeakMap();
22417
22558
  var _waitForInitiallyDiscoveredTargets = /*#__PURE__*/new WeakMap();
22418
22559
  var _discoveryFilter = /*#__PURE__*/new WeakMap();
22419
- var _storeExistingTargetsForInit = /*#__PURE__*/new WeakMap();
22560
+ var _targetsIdsForInit = /*#__PURE__*/new WeakMap();
22561
+ var _initialAttachDone = /*#__PURE__*/new WeakMap();
22420
22562
  var _TargetManager_brand = /*#__PURE__*/new WeakSet();
22421
22563
  var _onSessionDetached = /*#__PURE__*/new WeakMap();
22422
22564
  var _onTargetCreated = /*#__PURE__*/new WeakMap();
@@ -22428,7 +22570,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22428
22570
  constructor(connection, targetFactory, targetFilterCallback, waitForInitiallyDiscoveredTargets = true) {
22429
22571
  super();
22430
22572
  _classPrivateMethodInitSpec(this, _TargetManager_brand);
22431
- _classPrivateFieldInitSpec(this, _connection3, void 0);
22573
+ _classPrivateFieldInitSpec(this, _connection4, void 0);
22432
22574
  /**
22433
22575
  * Keeps track of the following events: 'Target.targetCreated',
22434
22576
  * 'Target.targetDestroyed', 'Target.targetInfoChanged'.
@@ -22459,24 +22601,19 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22459
22601
  _classPrivateFieldInitSpec(this, _attachedToTargetListenersBySession, new WeakMap());
22460
22602
  _classPrivateFieldInitSpec(this, _detachedFromTargetListenersBySession, new WeakMap());
22461
22603
  _classPrivateFieldInitSpec(this, _initializeDeferred, Deferred.create());
22462
- _classPrivateFieldInitSpec(this, _targetsIdsForInit, new Set());
22463
22604
  _classPrivateFieldInitSpec(this, _waitForInitiallyDiscoveredTargets, true);
22464
22605
  _classPrivateFieldInitSpec(this, _discoveryFilter, [{}]);
22465
- _classPrivateFieldInitSpec(this, _storeExistingTargetsForInit, () => {
22466
- if (!_classPrivateFieldGet(_waitForInitiallyDiscoveredTargets, this)) {
22467
- return;
22468
- }
22469
- for (const [targetId, targetInfo] of _classPrivateFieldGet(_discoveredTargetsByTargetId, this).entries()) {
22470
- const targetForFilter = new CdpTarget(targetInfo, undefined, undefined, this, undefined);
22471
- // Only wait for pages and frames (except those from extensions)
22472
- // to auto-attach.
22473
- const isPageOrFrame = targetInfo.type === 'page' || targetInfo.type === 'iframe';
22474
- const isExtension = targetInfo.url.startsWith('chrome-extension://');
22475
- if ((!_classPrivateFieldGet(_targetFilterCallback, this) || _classPrivateFieldGet(_targetFilterCallback, this).call(this, targetForFilter)) && isPageOrFrame && !isExtension) {
22476
- _classPrivateFieldGet(_targetsIdsForInit, this).add(targetId);
22477
- }
22478
- }
22479
- });
22606
+ // IDs of tab targets detected while running the initial Target.setAutoAttach
22607
+ // request. These are the targets whose initialization we want to await for
22608
+ // before resolving puppeteer.connect() or launch() to avoid flakiness.
22609
+ // Whenever a sub-target whose parent is a tab target is attached, we remove
22610
+ // the tab target from this list. Once the list is empty, we resolve the
22611
+ // initializeDeferred.
22612
+ _classPrivateFieldInitSpec(this, _targetsIdsForInit, new Set());
22613
+ // This is false until the connection-level Target.setAutoAttach request is
22614
+ // done. It indicates whethere we are running the initial auto-attach step or
22615
+ // if we are handling targets after that.
22616
+ _classPrivateFieldInitSpec(this, _initialAttachDone, false);
22480
22617
  _classPrivateFieldInitSpec(this, _onSessionDetached, session => {
22481
22618
  _assertClassBrand(_TargetManager_brand, this, _removeAttachmentListeners).call(this, session);
22482
22619
  });
@@ -22536,7 +22673,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22536
22673
  });
22537
22674
  _classPrivateFieldInitSpec(this, _onAttachedToTarget2, async (parentSession, event) => {
22538
22675
  const targetInfo = event.targetInfo;
22539
- const session = _classPrivateFieldGet(_connection3, this)._session(event.sessionId);
22676
+ const session = _classPrivateFieldGet(_connection4, this)._session(event.sessionId);
22540
22677
  if (!session) {
22541
22678
  throw new Error(`Session ${event.sessionId} was not created.`);
22542
22679
  }
@@ -22548,7 +22685,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22548
22685
  sessionId: session.id()
22549
22686
  }).catch(debugError);
22550
22687
  };
22551
- if (!_classPrivateFieldGet(_connection3, this).isAutoAttached(targetInfo.targetId)) {
22688
+ if (!_classPrivateFieldGet(_connection4, this).isAutoAttached(targetInfo.targetId)) {
22552
22689
  return;
22553
22690
  }
22554
22691
  // Special case for service workers: being attached to service workers will
@@ -22559,7 +22696,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22559
22696
  // should determine if a target is auto-attached or not with the help of
22560
22697
  // CDP.
22561
22698
  if (targetInfo.type === 'service_worker') {
22562
- _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this, targetInfo.targetId);
22563
22699
  await silentDetach();
22564
22700
  if (_classPrivateFieldGet(_attachedTargetsByTargetId, this).has(targetInfo.targetId)) {
22565
22701
  return;
@@ -22572,12 +22708,18 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22572
22708
  }
22573
22709
  const isExistingTarget = _classPrivateFieldGet(_attachedTargetsByTargetId, this).has(targetInfo.targetId);
22574
22710
  const target = isExistingTarget ? _classPrivateFieldGet(_attachedTargetsByTargetId, this).get(targetInfo.targetId) : _classPrivateFieldGet(_targetFactory, this).call(this, targetInfo, session, parentSession instanceof CdpCDPSession ? parentSession : undefined);
22711
+ const parentTarget = parentSession instanceof CdpCDPSession ? parentSession.target() : null;
22575
22712
  if (_classPrivateFieldGet(_targetFilterCallback, this) && !_classPrivateFieldGet(_targetFilterCallback, this).call(this, target)) {
22576
22713
  _classPrivateFieldGet(_ignoredTargets, this).add(targetInfo.targetId);
22577
- _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this, targetInfo.targetId);
22714
+ if (parentTarget?.type() === 'tab') {
22715
+ _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this, parentTarget._targetId);
22716
+ }
22578
22717
  await silentDetach();
22579
22718
  return;
22580
22719
  }
22720
+ if (_classPrivateFieldGet(_waitForInitiallyDiscoveredTargets, this) && event.targetInfo.type === 'tab' && !_classPrivateFieldGet(_initialAttachDone, this)) {
22721
+ _classPrivateFieldGet(_targetsIdsForInit, this).add(event.targetInfo.targetId);
22722
+ }
22581
22723
  _assertClassBrand(_TargetManager_brand, this, _setupAttachmentListeners).call(this, session);
22582
22724
  if (isExistingTarget) {
22583
22725
  session.setTarget(target);
@@ -22587,14 +22729,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22587
22729
  _classPrivateFieldGet(_attachedTargetsByTargetId, this).set(targetInfo.targetId, target);
22588
22730
  _classPrivateFieldGet(_attachedTargetsBySessionId, this).set(session.id(), target);
22589
22731
  }
22590
- const parentTarget = parentSession instanceof CDPSession ? parentSession.target() : null;
22591
22732
  parentTarget?._addChildTarget(target);
22592
22733
  parentSession.emit(exports.CDPSessionEvent.Ready, session);
22593
- _classPrivateFieldGet(_targetsIdsForInit, this).delete(target._targetId);
22594
22734
  if (!isExistingTarget) {
22595
22735
  this.emit("targetAvailable" /* TargetManagerEvent.TargetAvailable */, target);
22596
22736
  }
22597
- _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this);
22737
+ if (parentTarget?.type() === 'tab') {
22738
+ _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this, parentTarget._targetId);
22739
+ }
22598
22740
  // TODO: the browser might be shutting down here. What do we do with the
22599
22741
  // error?
22600
22742
  await Promise.all([session.send('Target.setAutoAttach', {
@@ -22616,23 +22758,22 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22616
22758
  _classPrivateFieldGet(_attachedTargetsByTargetId, this).delete(target._targetId);
22617
22759
  this.emit("targetGone" /* TargetManagerEvent.TargetGone */, target);
22618
22760
  });
22619
- _classPrivateFieldSet(_connection3, this, connection);
22761
+ _classPrivateFieldSet(_connection4, this, connection);
22620
22762
  _classPrivateFieldSet(_targetFilterCallback, this, targetFilterCallback);
22621
22763
  _classPrivateFieldSet(_targetFactory, this, targetFactory);
22622
22764
  _classPrivateFieldSet(_waitForInitiallyDiscoveredTargets, this, waitForInitiallyDiscoveredTargets);
22623
- _classPrivateFieldGet(_connection3, this).on('Target.targetCreated', _classPrivateFieldGet(_onTargetCreated, this));
22624
- _classPrivateFieldGet(_connection3, this).on('Target.targetDestroyed', _classPrivateFieldGet(_onTargetDestroyed, this));
22625
- _classPrivateFieldGet(_connection3, this).on('Target.targetInfoChanged', _classPrivateFieldGet(_onTargetInfoChanged, this));
22626
- _classPrivateFieldGet(_connection3, this).on(exports.CDPSessionEvent.SessionDetached, _classPrivateFieldGet(_onSessionDetached, this));
22627
- _assertClassBrand(_TargetManager_brand, this, _setupAttachmentListeners).call(this, _classPrivateFieldGet(_connection3, this));
22765
+ _classPrivateFieldGet(_connection4, this).on('Target.targetCreated', _classPrivateFieldGet(_onTargetCreated, this));
22766
+ _classPrivateFieldGet(_connection4, this).on('Target.targetDestroyed', _classPrivateFieldGet(_onTargetDestroyed, this));
22767
+ _classPrivateFieldGet(_connection4, this).on('Target.targetInfoChanged', _classPrivateFieldGet(_onTargetInfoChanged, this));
22768
+ _classPrivateFieldGet(_connection4, this).on(exports.CDPSessionEvent.SessionDetached, _classPrivateFieldGet(_onSessionDetached, this));
22769
+ _assertClassBrand(_TargetManager_brand, this, _setupAttachmentListeners).call(this, _classPrivateFieldGet(_connection4, this));
22628
22770
  }
22629
22771
  async initialize() {
22630
- await _classPrivateFieldGet(_connection3, this).send('Target.setDiscoverTargets', {
22772
+ await _classPrivateFieldGet(_connection4, this).send('Target.setDiscoverTargets', {
22631
22773
  discover: true,
22632
22774
  filter: _classPrivateFieldGet(_discoveryFilter, this)
22633
22775
  });
22634
- _classPrivateFieldGet(_storeExistingTargetsForInit, this).call(this);
22635
- await _classPrivateFieldGet(_connection3, this).send('Target.setAutoAttach', {
22776
+ await _classPrivateFieldGet(_connection4, this).send('Target.setAutoAttach', {
22636
22777
  waitForDebuggerOnStart: true,
22637
22778
  flatten: true,
22638
22779
  autoAttach: true,
@@ -22641,6 +22782,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22641
22782
  exclude: true
22642
22783
  }, ..._classPrivateFieldGet(_discoveryFilter, this)]
22643
22784
  });
22785
+ _classPrivateFieldSet(_initialAttachDone, this, true);
22644
22786
  _assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this);
22645
22787
  await _classPrivateFieldGet(_initializeDeferred, this).valueOrThrow();
22646
22788
  }
@@ -22648,11 +22790,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22648
22790
  return target._childTargets();
22649
22791
  }
22650
22792
  dispose() {
22651
- _classPrivateFieldGet(_connection3, this).off('Target.targetCreated', _classPrivateFieldGet(_onTargetCreated, this));
22652
- _classPrivateFieldGet(_connection3, this).off('Target.targetDestroyed', _classPrivateFieldGet(_onTargetDestroyed, this));
22653
- _classPrivateFieldGet(_connection3, this).off('Target.targetInfoChanged', _classPrivateFieldGet(_onTargetInfoChanged, this));
22654
- _classPrivateFieldGet(_connection3, this).off(exports.CDPSessionEvent.SessionDetached, _classPrivateFieldGet(_onSessionDetached, this));
22655
- _assertClassBrand(_TargetManager_brand, this, _removeAttachmentListeners).call(this, _classPrivateFieldGet(_connection3, this));
22793
+ _classPrivateFieldGet(_connection4, this).off('Target.targetCreated', _classPrivateFieldGet(_onTargetCreated, this));
22794
+ _classPrivateFieldGet(_connection4, this).off('Target.targetDestroyed', _classPrivateFieldGet(_onTargetDestroyed, this));
22795
+ _classPrivateFieldGet(_connection4, this).off('Target.targetInfoChanged', _classPrivateFieldGet(_onTargetInfoChanged, this));
22796
+ _classPrivateFieldGet(_connection4, this).off(exports.CDPSessionEvent.SessionDetached, _classPrivateFieldGet(_onSessionDetached, this));
22797
+ _assertClassBrand(_TargetManager_brand, this, _removeAttachmentListeners).call(this, _classPrivateFieldGet(_connection4, this));
22656
22798
  }
22657
22799
  getAvailableTargets() {
22658
22800
  return _classPrivateFieldGet(_attachedTargetsByTargetId, this);
@@ -22696,13 +22838,18 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22696
22838
  if (targetId !== undefined) {
22697
22839
  _classPrivateFieldGet(_targetsIdsForInit, this).delete(targetId);
22698
22840
  }
22841
+ // If we are still initializing it might be that we have not learned about
22842
+ // some targets yet.
22843
+ if (!_classPrivateFieldGet(_initialAttachDone, this)) {
22844
+ return;
22845
+ }
22699
22846
  if (_classPrivateFieldGet(_targetsIdsForInit, this).size === 0) {
22700
22847
  _classPrivateFieldGet(_initializeDeferred, this).resolve();
22701
22848
  }
22702
22849
  }
22703
22850
  var _defaultViewport2 = /*#__PURE__*/new WeakMap();
22704
22851
  var _process = /*#__PURE__*/new WeakMap();
22705
- var _connection4 = /*#__PURE__*/new WeakMap();
22852
+ var _connection5 = /*#__PURE__*/new WeakMap();
22706
22853
  var _closeCallback = /*#__PURE__*/new WeakMap();
22707
22854
  var _targetFilterCallback2 = /*#__PURE__*/new WeakMap();
22708
22855
  var _isPageTargetCallback = /*#__PURE__*/new WeakMap();
@@ -22735,7 +22882,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22735
22882
  _defineProperty(this, "protocol", 'cdp');
22736
22883
  _classPrivateFieldInitSpec(this, _defaultViewport2, void 0);
22737
22884
  _classPrivateFieldInitSpec(this, _process, void 0);
22738
- _classPrivateFieldInitSpec(this, _connection4, void 0);
22885
+ _classPrivateFieldInitSpec(this, _connection5, void 0);
22739
22886
  _classPrivateFieldInitSpec(this, _closeCallback, void 0);
22740
22887
  _classPrivateFieldInitSpec(this, _targetFilterCallback2, void 0);
22741
22888
  _classPrivateFieldInitSpec(this, _isPageTargetCallback, void 0);
@@ -22756,7 +22903,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22756
22903
  throw new Error('Missing browser context');
22757
22904
  }
22758
22905
  const createSession = isAutoAttachEmulated => {
22759
- return _classPrivateFieldGet(_connection4, this)._createSession(targetInfo, isAutoAttachEmulated);
22906
+ return _classPrivateFieldGet(_connection5, this)._createSession(targetInfo, isAutoAttachEmulated);
22760
22907
  };
22761
22908
  const otherTarget = new OtherTarget(targetInfo, session, context, _classPrivateFieldGet(_targetManager3, this), createSession);
22762
22909
  if (targetInfo.url?.startsWith('devtools://')) {
@@ -22796,7 +22943,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22796
22943
  _classPrivateFieldSet(_networkEnabled2, this, networkEnabled);
22797
22944
  _classPrivateFieldSet(_defaultViewport2, this, defaultViewport);
22798
22945
  _classPrivateFieldSet(_process, this, process);
22799
- _classPrivateFieldSet(_connection4, this, connection);
22946
+ _classPrivateFieldSet(_connection5, this, connection);
22800
22947
  _classPrivateFieldSet(_closeCallback, this, closeCallback || (() => {}));
22801
22948
  _classPrivateFieldSet(_targetFilterCallback2, this, targetFilterCallback || (() => {
22802
22949
  return true;
@@ -22804,13 +22951,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22804
22951
  _classPrivateFieldSet(_handleDevToolsAsPage, this, handleDevToolsAsPage);
22805
22952
  _assertClassBrand(_CdpBrowser_brand, this, _setIsPageTargetCallback).call(this, _isPageTargetCallback2);
22806
22953
  _classPrivateFieldSet(_targetManager3, this, new TargetManager(connection, _classPrivateFieldGet(_createTarget, this), _classPrivateFieldGet(_targetFilterCallback2, this), waitForInitiallyDiscoveredTargets));
22807
- _classPrivateFieldSet(_defaultContext, this, new CdpBrowserContext(_classPrivateFieldGet(_connection4, this), this));
22954
+ _classPrivateFieldSet(_defaultContext, this, new CdpBrowserContext(_classPrivateFieldGet(_connection5, this), this));
22808
22955
  for (const contextId of contextIds) {
22809
- _classPrivateFieldGet(_contexts, this).set(contextId, new CdpBrowserContext(_classPrivateFieldGet(_connection4, this), this, contextId));
22956
+ _classPrivateFieldGet(_contexts, this).set(contextId, new CdpBrowserContext(_classPrivateFieldGet(_connection5, this), this, contextId));
22810
22957
  }
22811
22958
  }
22812
22959
  async _attach(downloadBehavior) {
22813
- _classPrivateFieldGet(_connection4, this).on(exports.CDPSessionEvent.Disconnected, _classPrivateFieldGet(_emitDisconnected, this));
22960
+ _classPrivateFieldGet(_connection5, this).on(exports.CDPSessionEvent.Disconnected, _classPrivateFieldGet(_emitDisconnected, this));
22814
22961
  if (downloadBehavior) {
22815
22962
  await _classPrivateFieldGet(_defaultContext, this).setDownloadBehavior(downloadBehavior);
22816
22963
  }
@@ -22821,7 +22968,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22821
22968
  await _classPrivateFieldGet(_targetManager3, this).initialize();
22822
22969
  }
22823
22970
  _detach() {
22824
- _classPrivateFieldGet(_connection4, this).off(exports.CDPSessionEvent.Disconnected, _classPrivateFieldGet(_emitDisconnected, this));
22971
+ _classPrivateFieldGet(_connection5, this).off(exports.CDPSessionEvent.Disconnected, _classPrivateFieldGet(_emitDisconnected, this));
22825
22972
  _classPrivateFieldGet(_targetManager3, this).off("targetAvailable" /* TargetManagerEvent.TargetAvailable */, _classPrivateFieldGet(_onAttachedToTarget3, this));
22826
22973
  _classPrivateFieldGet(_targetManager3, this).off("targetGone" /* TargetManagerEvent.TargetGone */, _classPrivateFieldGet(_onDetachedFromTarget3, this));
22827
22974
  _classPrivateFieldGet(_targetManager3, this).off("targetChanged" /* TargetManagerEvent.TargetChanged */, _classPrivateFieldGet(_onTargetChanged, this));
@@ -22844,11 +22991,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22844
22991
  } = options;
22845
22992
  const {
22846
22993
  browserContextId
22847
- } = await _classPrivateFieldGet(_connection4, this).send('Target.createBrowserContext', {
22994
+ } = await _classPrivateFieldGet(_connection5, this).send('Target.createBrowserContext', {
22848
22995
  proxyServer,
22849
22996
  proxyBypassList: proxyBypassList && proxyBypassList.join(',')
22850
22997
  });
22851
- const context = new CdpBrowserContext(_classPrivateFieldGet(_connection4, this), this, browserContextId);
22998
+ const context = new CdpBrowserContext(_classPrivateFieldGet(_connection5, this), this, browserContextId);
22852
22999
  if (downloadBehavior) {
22853
23000
  await context.setDownloadBehavior(downloadBehavior);
22854
23001
  }
@@ -22865,27 +23012,34 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22865
23012
  if (!contextId) {
22866
23013
  return;
22867
23014
  }
22868
- await _classPrivateFieldGet(_connection4, this).send('Target.disposeBrowserContext', {
23015
+ await _classPrivateFieldGet(_connection5, this).send('Target.disposeBrowserContext', {
22869
23016
  browserContextId: contextId
22870
23017
  });
22871
23018
  _classPrivateFieldGet(_contexts, this).delete(contextId);
22872
23019
  }
22873
23020
  wsEndpoint() {
22874
- return _classPrivateFieldGet(_connection4, this).url();
23021
+ return _classPrivateFieldGet(_connection5, this).url();
22875
23022
  }
22876
- async newPage() {
22877
- return await _classPrivateFieldGet(_defaultContext, this).newPage();
23023
+ async newPage(options) {
23024
+ return await _classPrivateFieldGet(_defaultContext, this).newPage(options);
22878
23025
  }
22879
- // rebrowser-patches: expose browser CDP session
22880
- _connection() {
22881
- return _classPrivateFieldGet(_connection4, this);
22882
- }
22883
- async _createPageInContext(contextId) {
23026
+ async _createPageInContext(contextId, options) {
23027
+ const hasTargets = this.targets().filter(t => {
23028
+ return t.browserContext().id === contextId;
23029
+ }).length > 0;
23030
+ const windowBounds = options?.type === 'window' ? options.windowBounds : undefined;
22884
23031
  const {
22885
23032
  targetId
22886
- } = await _classPrivateFieldGet(_connection4, this).send('Target.createTarget', {
23033
+ } = await _classPrivateFieldGet(_connection5, this).send('Target.createTarget', {
22887
23034
  url: 'about:blank',
22888
- browserContextId: contextId || undefined
23035
+ browserContextId: contextId || undefined,
23036
+ left: windowBounds?.left,
23037
+ top: windowBounds?.top,
23038
+ width: windowBounds?.width,
23039
+ height: windowBounds?.height,
23040
+ windowState: windowBounds?.windowState,
23041
+ // Works around crbug.com/454825274.
23042
+ newWindow: hasTargets && options?.type === 'window' ? true : undefined
22889
23043
  });
22890
23044
  const target = await this.waitForTarget(t => {
22891
23045
  return t._targetId === targetId;
@@ -22903,19 +23057,70 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22903
23057
  }
22904
23058
  return page;
22905
23059
  }
23060
+ async _createDevToolsPage(pageTargetId) {
23061
+ const openDevToolsResponse = await _classPrivateFieldGet(_connection5, this).send('Target.openDevTools', {
23062
+ targetId: pageTargetId
23063
+ });
23064
+ const target = await this.waitForTarget(t => {
23065
+ return t._targetId === openDevToolsResponse.targetId;
23066
+ });
23067
+ if (!target) {
23068
+ throw new Error(`Missing target for DevTools page (id = ${pageTargetId})`);
23069
+ }
23070
+ const initialized = (await target._initializedDeferred.valueOrThrow()) === exports.InitializationStatus.SUCCESS;
23071
+ if (!initialized) {
23072
+ throw new Error(`Failed to create target for DevTools page (id = ${pageTargetId})`);
23073
+ }
23074
+ const page = await target.page();
23075
+ if (!page) {
23076
+ throw new Error(`Failed to create a DevTools Page for target (id = ${pageTargetId})`);
23077
+ }
23078
+ return page;
23079
+ }
22906
23080
  async installExtension(path) {
22907
23081
  const {
22908
23082
  id
22909
- } = await _classPrivateFieldGet(_connection4, this).send('Extensions.loadUnpacked', {
23083
+ } = await _classPrivateFieldGet(_connection5, this).send('Extensions.loadUnpacked', {
22910
23084
  path
22911
23085
  });
22912
23086
  return id;
22913
23087
  }
22914
23088
  uninstallExtension(id) {
22915
- return _classPrivateFieldGet(_connection4, this).send('Extensions.uninstall', {
23089
+ return _classPrivateFieldGet(_connection5, this).send('Extensions.uninstall', {
22916
23090
  id
22917
23091
  });
22918
23092
  }
23093
+ async screens() {
23094
+ const {
23095
+ screenInfos
23096
+ } = await _classPrivateFieldGet(_connection5, this).send('Emulation.getScreenInfos');
23097
+ return screenInfos;
23098
+ }
23099
+ async addScreen(params) {
23100
+ const {
23101
+ screenInfo
23102
+ } = await _classPrivateFieldGet(_connection5, this).send('Emulation.addScreen', params);
23103
+ return screenInfo;
23104
+ }
23105
+ async removeScreen(screenId) {
23106
+ return await _classPrivateFieldGet(_connection5, this).send('Emulation.removeScreen', {
23107
+ screenId
23108
+ });
23109
+ }
23110
+ async getWindowBounds(windowId) {
23111
+ const {
23112
+ bounds
23113
+ } = await _classPrivateFieldGet(_connection5, this).send('Browser.getWindowBounds', {
23114
+ windowId: Number(windowId)
23115
+ });
23116
+ return bounds;
23117
+ }
23118
+ async setWindowBounds(windowId, windowBounds) {
23119
+ await _classPrivateFieldGet(_connection5, this).send('Browser.setWindowBounds', {
23120
+ windowId: Number(windowId),
23121
+ bounds: windowBounds
23122
+ });
23123
+ }
22919
23124
  targets() {
22920
23125
  return Array.from(_classPrivateFieldGet(_targetManager3, this).getAvailableTargets().values()).filter(target => {
22921
23126
  return target._isTargetExposed() && target._initializedDeferred.value() === exports.InitializationStatus.SUCCESS;
@@ -22944,16 +23149,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22944
23149
  }
22945
23150
  disconnect() {
22946
23151
  _classPrivateFieldGet(_targetManager3, this).dispose();
22947
- _classPrivateFieldGet(_connection4, this).dispose();
23152
+ _classPrivateFieldGet(_connection5, this).dispose();
22948
23153
  this._detach();
22949
23154
  return Promise.resolve();
22950
23155
  }
22951
23156
  get connected() {
22952
- return !_classPrivateFieldGet(_connection4, this)._closed;
23157
+ return !_classPrivateFieldGet(_connection5, this)._closed;
22953
23158
  }
22954
23159
  get debugInfo() {
22955
23160
  return {
22956
- pendingProtocolErrors: _classPrivateFieldGet(_connection4, this).getPendingProtocolErrors()
23161
+ pendingProtocolErrors: _classPrivateFieldGet(_connection5, this).getPendingProtocolErrors()
22957
23162
  };
22958
23163
  }
22959
23164
  isNetworkEnabled() {
@@ -22974,11 +23179,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22974
23179
  */
22975
23180
  function _setIsPageTargetCallback(isPageTargetCallback) {
22976
23181
  _classPrivateFieldSet(_isPageTargetCallback, this, isPageTargetCallback || (target => {
22977
- return target.type() === 'page' || target.type() === 'background_page' || target.type() === 'webview' || _classPrivateFieldGet(_handleDevToolsAsPage, this) && target.type() === 'other' && target.url().startsWith('devtools://');
23182
+ return target.type() === 'page' || target.type() === 'background_page' || target.type() === 'webview' || _classPrivateFieldGet(_handleDevToolsAsPage, this) && target.type() === 'other' && target.url().startsWith('devtools://devtools/bundled/devtools_app.html');
22978
23183
  }));
22979
23184
  }
22980
23185
  function _getVersion() {
22981
- return _classPrivateFieldGet(_connection4, this).send('Browser.getVersion');
23186
+ return _classPrivateFieldGet(_connection5, this).send('Browser.getVersion');
22982
23187
  }
22983
23188
  async function _connectToCdpBrowser(connectionTransport, url, options) {
22984
23189
  const {
@@ -22990,9 +23195,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
22990
23195
  _isPageTarget: isPageTarget,
22991
23196
  slowMo = 0,
22992
23197
  protocolTimeout,
22993
- handleDevToolsAsPage
23198
+ handleDevToolsAsPage,
23199
+ idGenerator = createIncrementalIdGenerator()
22994
23200
  } = options;
22995
- const connection = new Connection(url, connectionTransport, slowMo, protocolTimeout);
23201
+ const connection = new Connection(url, connectionTransport, slowMo, protocolTimeout, /* rawErrors */false, idGenerator);
22996
23202
  const {
22997
23203
  browserContextIds
22998
23204
  } = await connection.send('Target.getBrowserContexts');
@@ -23116,6 +23322,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
23116
23322
  if (parsed.sessionId === 'tabTargetSessionId') {
23117
23323
  _assertClassBrand(_ExtensionTransport_brand, this, _dispatchResponse).call(this, {
23118
23324
  method: 'Target.attachedToTarget',
23325
+ sessionId: 'tabTargetSessionId',
23119
23326
  params: {
23120
23327
  targetInfo: pageTargetInfo,
23121
23328
  sessionId: 'pageTargetSessionId'
@@ -23211,7 +23418,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
23211
23418
  * @public
23212
23419
  */
23213
23420
  function _dispatchResponse(message) {
23214
- this.onmessage?.(JSON.stringify(message));
23421
+ // Dispatch in a new task like other transports.
23422
+ setTimeout(() => {
23423
+ this.onmessage?.(JSON.stringify(message));
23424
+ }, 0);
23215
23425
  }
23216
23426
  const PredefinedNetworkConditions = Object.freeze({
23217
23427
  // Generally aligned with DevTools
@@ -24816,10 +25026,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
24816
25026
  const BiDi = await Promise.resolve().then(() => _interopRequireWildcard(require(/* webpackIgnore: true */'./bidi/bidi.js')));
24817
25027
  const {
24818
25028
  slowMo = 0,
24819
- protocolTimeout
25029
+ protocolTimeout,
25030
+ idGenerator = createIncrementalIdGenerator()
24820
25031
  } = options;
24821
25032
  // Try pure BiDi first.
24822
- const pureBidiConnection = new BiDi.BidiConnection(url, connectionTransport, slowMo, protocolTimeout);
25033
+ const pureBidiConnection = new BiDi.BidiConnection(url, connectionTransport, idGenerator, slowMo, protocolTimeout);
24823
25034
  try {
24824
25035
  const result = await pureBidiConnection.send('session.status', {});
24825
25036
  if ('type' in result && result.type === 'success') {
@@ -24840,7 +25051,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
24840
25051
  // Unbind the connection to avoid memory leaks.
24841
25052
  pureBidiConnection.unbind();
24842
25053
  // Fall back to CDP over BiDi reusing the WS connection.
24843
- const cdpConnection = new Connection(url, connectionTransport, slowMo, protocolTimeout, /* rawErrors= */true);
25054
+ const cdpConnection = new Connection(url, connectionTransport, slowMo, protocolTimeout, /* rawErrors= */true, idGenerator);
24844
25055
  const version = await cdpConnection.send('Browser.getVersion');
24845
25056
  if (version.product.toLowerCase().includes('firefox')) {
24846
25057
  throw new UnsupportedOperation('Firefox is not supported in BiDi over CDP mode.');
@@ -24893,10 +25104,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
24893
25104
  const {
24894
25105
  browserWSEndpoint,
24895
25106
  browserURL,
25107
+ channel,
24896
25108
  transport,
24897
25109
  headers = {}
24898
25110
  } = options;
24899
- assert(Number(!!browserWSEndpoint) + Number(!!browserURL) + Number(!!transport) === 1, 'Exactly one of browserWSEndpoint, browserURL or transport must be passed to puppeteer.connect');
25111
+ assert(Number(!!browserWSEndpoint) + Number(!!browserURL) + Number(!!transport) + Number(!!channel) === 1, 'Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to puppeteer.connect');
24900
25112
  if (transport) {
24901
25113
  return {
24902
25114
  connectionTransport: transport,
@@ -24917,6 +25129,50 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
24917
25129
  connectionTransport: connectionTransport,
24918
25130
  endpointUrl: connectionURL
24919
25131
  };
25132
+ } else if (options.channel && isNode) {
25133
+ const {
25134
+ detectBrowserPlatform,
25135
+ resolveDefaultUserDataDir,
25136
+ Browser
25137
+ } = await Promise.resolve().then(() => _interopRequireWildcard(require('@puppeteer/browsers')));
25138
+ const platform = detectBrowserPlatform();
25139
+ if (!platform) {
25140
+ throw new Error('Could not detect required browser platform');
25141
+ }
25142
+ const {
25143
+ convertPuppeteerChannelToBrowsersChannel
25144
+ } = await Promise.resolve().then(() => _interopRequireWildcard(require('./node/LaunchOptions.js')));
25145
+ const {
25146
+ join
25147
+ } = await Promise.resolve().then(() => _interopRequireWildcard(require('node:path')));
25148
+ const userDataDir = resolveDefaultUserDataDir(Browser.CHROME, platform, convertPuppeteerChannelToBrowsersChannel(options.channel));
25149
+ const portPath = join(userDataDir, 'DevToolsActivePort');
25150
+ try {
25151
+ const fileContent = await environment.value.fs.promises.readFile(portPath, 'ascii');
25152
+ const [rawPort, rawPath] = fileContent.split('\n').map(line => {
25153
+ return line.trim();
25154
+ }).filter(line => {
25155
+ return !!line;
25156
+ });
25157
+ if (!rawPort || !rawPath) {
25158
+ throw new Error(`Invalid DevToolsActivePort '${fileContent}' found`);
25159
+ }
25160
+ const port = parseInt(rawPort, 10);
25161
+ if (isNaN(port) || port <= 0 || port > 65535) {
25162
+ throw new Error(`Invalid port '${rawPort}' found`);
25163
+ }
25164
+ const browserWSEndpoint = `ws://localhost:${port}${rawPath}`;
25165
+ const WebSocketClass = await getWebSocketTransportClass();
25166
+ const connectionTransport = await WebSocketClass.create(browserWSEndpoint, headers);
25167
+ return {
25168
+ connectionTransport: connectionTransport,
25169
+ endpointUrl: browserWSEndpoint
25170
+ };
25171
+ } catch (error) {
25172
+ throw new Error(`Could not find DevToolsActivePort for ${options.channel} at ${portPath}`, {
25173
+ cause: error
25174
+ });
25175
+ }
24920
25176
  }
24921
25177
  throw new Error('Invalid connection options');
24922
25178
  }
@@ -25070,9 +25326,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
25070
25326
  * @internal
25071
25327
  */
25072
25328
  const PUPPETEER_REVISIONS = Object.freeze({
25073
- chrome: '141.0.7390.78',
25074
- 'chrome-headless-shell': '141.0.7390.78',
25075
- firefox: 'stable_144.0'
25329
+ chrome: '143.0.7499.42',
25330
+ 'chrome-headless-shell': '143.0.7499.42',
25331
+ firefox: 'stable_146.0'
25076
25332
  });
25077
25333
 
25078
25334
  /**
@@ -25095,6 +25351,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
25095
25351
  exports.ARIAQueryHandler = ARIAQueryHandler;
25096
25352
  exports.Accessibility = Accessibility;
25097
25353
  exports.AsyncDisposableStack = AsyncDisposableStack;
25354
+ exports.AsyncDisposableStackPolyfill = AsyncDisposableStackPolyfill;
25098
25355
  exports.AsyncIterableUtil = AsyncIterableUtil;
25099
25356
  exports.Binding = Binding;
25100
25357
  exports.Browser = Browser;
@@ -25105,9 +25362,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
25105
25362
  exports.CSSCoverage = CSSCoverage;
25106
25363
  exports.Callback = Callback;
25107
25364
  exports.CallbackRegistry = CallbackRegistry;
25365
+ exports.CdpBluetoothEmulation = CdpBluetoothEmulation;
25108
25366
  exports.CdpBrowser = CdpBrowser;
25109
25367
  exports.CdpBrowserContext = CdpBrowserContext;
25110
25368
  exports.CdpCDPSession = CdpCDPSession;
25369
+ exports.CdpDeviceRequestPrompt = CdpDeviceRequestPrompt;
25370
+ exports.CdpDeviceRequestPromptManager = CdpDeviceRequestPromptManager;
25111
25371
  exports.CdpDialog = CdpDialog;
25112
25372
  exports.CdpElementHandle = CdpElementHandle;
25113
25373
  exports.CdpFrame = CdpFrame;
@@ -25133,10 +25393,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
25133
25393
  exports.DelegatedLocator = DelegatedLocator;
25134
25394
  exports.DevToolsTarget = DevToolsTarget;
25135
25395
  exports.DeviceRequestPrompt = DeviceRequestPrompt;
25136
- exports.DeviceRequestPromptDevice = DeviceRequestPromptDevice;
25137
- exports.DeviceRequestPromptManager = DeviceRequestPromptManager;
25138
25396
  exports.Dialog = Dialog;
25139
25397
  exports.DisposableStack = DisposableStack;
25398
+ exports.DisposableStackPolyfill = DisposableStackPolyfill;
25140
25399
  exports.ElementHandle = ElementHandle;
25141
25400
  exports.EmulatedState = EmulatedState;
25142
25401
  exports.EmulationManager = EmulationManager;
@@ -25217,6 +25476,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
25217
25476
  exports.convertCookiesPartitionKeyFromPuppeteerToCdp = convertCookiesPartitionKeyFromPuppeteerToCdp;
25218
25477
  exports.createClientError = createClientError;
25219
25478
  exports.createEvaluationError = createEvaluationError;
25479
+ exports.createIncrementalIdGenerator = createIncrementalIdGenerator;
25220
25480
  exports.createProtocolErrorMessage = createProtocolErrorMessage;
25221
25481
  exports.customQueryHandlers = customQueryHandlers;
25222
25482
  exports.debug = debug;