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
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /**
8
+ * @public
9
+ * Emulated bluetooth adapter state.
10
+ */
11
+ export type AdapterState = 'absent' | 'powered-off' | 'powered-on';
12
+
13
+ /**
14
+ * @public
15
+ * Represents the simulated bluetooth peripheral's manufacturer data.
16
+ */
17
+ export interface BluetoothManufacturerData {
18
+ /**
19
+ * The company identifier, as defined by the {@link https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/|Bluetooth SIG}.
20
+ */
21
+ key: number;
22
+ /**
23
+ * The manufacturer-specific data as a base64-encoded string.
24
+ */
25
+ data: string;
26
+ }
27
+
28
+ /**
29
+ * @public
30
+ * A bluetooth peripheral to be simulated.
31
+ */
32
+ export interface PreconnectedPeripheral {
33
+ address: string;
34
+ name: string;
35
+ manufacturerData: BluetoothManufacturerData[];
36
+ knownServiceUuids: string[];
37
+ }
38
+
39
+ /**
40
+ * Exposes the bluetooth emulation abilities.
41
+ *
42
+ * @remarks {@link https://webbluetoothcg.github.io/web-bluetooth/#simulated-bluetooth-adapter|Web Bluetooth specification}
43
+ * requires the emulated adapters should be isolated per top-level navigable. However,
44
+ * at the moment Chromium's bluetooth emulation implementation is tight to the browser
45
+ * context, not the page. This means the bluetooth emulation exposed from different pages
46
+ * of the same browser context would interfere their states.
47
+ *
48
+ * @example
49
+ *
50
+ * ```ts
51
+ * await page.bluetooth.emulateAdapter('powered-on');
52
+ * await page.bluetooth.simulatePreconnectedPeripheral({
53
+ * address: '09:09:09:09:09:09',
54
+ * name: 'SOME_NAME',
55
+ * manufacturerData: [
56
+ * {
57
+ * key: 17,
58
+ * data: 'AP8BAX8=',
59
+ * },
60
+ * ],
61
+ * knownServiceUuids: ['12345678-1234-5678-9abc-def123456789'],
62
+ * });
63
+ * await page.bluetooth.disableEmulation();
64
+ * ```
65
+ *
66
+ * @experimental
67
+ * @public
68
+ */
69
+ export interface BluetoothEmulation {
70
+ /**
71
+ * Emulate Bluetooth adapter. Required for bluetooth simulations
72
+ * See {@link https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command|bluetooth.simulateAdapter}.
73
+ *
74
+ * @param state - The desired bluetooth adapter state.
75
+ * @param leSupported - Mark if the adapter supports low-energy bluetooth.
76
+ *
77
+ * @experimental
78
+ * @public
79
+ */
80
+ emulateAdapter(state: AdapterState, leSupported?: boolean): Promise<void>;
81
+
82
+ /**
83
+ * Disable emulated bluetooth adapter.
84
+ * See {@link https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-disableSimulation-command|bluetooth.disableSimulation}.
85
+ *
86
+ * @experimental
87
+ * @public
88
+ */
89
+ disableEmulation(): Promise<void>;
90
+
91
+ /**
92
+ * Simulated preconnected Bluetooth Peripheral.
93
+ * See {@link https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateconnectedperipheral-command|bluetooth.simulatePreconnectedPeripheral}.
94
+ *
95
+ * @param preconnectedPeripheral - The peripheral to simulate.
96
+ *
97
+ * @experimental
98
+ * @public
99
+ */
100
+ simulatePreconnectedPeripheral(
101
+ preconnectedPeripheral: PreconnectedPeripheral,
102
+ ): Promise<void>;
103
+ }
@@ -210,6 +210,95 @@ export interface DebugInfo {
210
210
  pendingProtocolErrors: Error[];
211
211
  }
212
212
 
213
+ /**
214
+ * @public
215
+ */
216
+ export type WindowState = 'normal' | 'minimized' | 'maximized' | 'fullscreen';
217
+
218
+ /**
219
+ * @public
220
+ */
221
+ export interface WindowBounds {
222
+ left?: number;
223
+ top?: number;
224
+ width?: number;
225
+ height?: number;
226
+ windowState?: WindowState;
227
+ }
228
+
229
+ /**
230
+ * @public
231
+ */
232
+ export type WindowId = string;
233
+
234
+ /**
235
+ * @public
236
+ */
237
+ export type CreatePageOptions =
238
+ | {
239
+ type: 'tab';
240
+ }
241
+ | {
242
+ type: 'window';
243
+ windowBounds?: WindowBounds;
244
+ };
245
+
246
+ /**
247
+ * @public
248
+ */
249
+ export interface ScreenOrientation {
250
+ angle: number;
251
+ type: string;
252
+ }
253
+
254
+ /**
255
+ * @public
256
+ */
257
+ export interface ScreenInfo {
258
+ left: number;
259
+ top: number;
260
+ width: number;
261
+ height: number;
262
+ availLeft: number;
263
+ availTop: number;
264
+ availWidth: number;
265
+ availHeight: number;
266
+ devicePixelRatio: number;
267
+ colorDepth: number;
268
+ orientation: ScreenOrientation;
269
+ isExtended: boolean;
270
+ isInternal: boolean;
271
+ isPrimary: boolean;
272
+ label: string;
273
+ id: string;
274
+ }
275
+
276
+ /**
277
+ * @public
278
+ */
279
+ export interface WorkAreaInsets {
280
+ top?: number;
281
+ left?: number;
282
+ bottom?: number;
283
+ right?: number;
284
+ }
285
+
286
+ /**
287
+ * @public
288
+ */
289
+ export interface AddScreenParams {
290
+ left: number;
291
+ top: number;
292
+ width: number;
293
+ height: number;
294
+ workAreaInsets?: WorkAreaInsets;
295
+ devicePixelRatio?: number;
296
+ rotation?: number;
297
+ colorDepth?: number;
298
+ label?: string;
299
+ isInternal?: boolean;
300
+ }
301
+
213
302
  /**
214
303
  * {@link Browser} represents a browser instance that is either:
215
304
  *
@@ -324,7 +413,20 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
324
413
  * Creates a new {@link Page | page} in the
325
414
  * {@link Browser.defaultBrowserContext | default browser context}.
326
415
  */
327
- abstract newPage(): Promise<Page>;
416
+ abstract newPage(options?: CreatePageOptions): Promise<Page>;
417
+
418
+ /**
419
+ * Gets the specified window {@link WindowBounds | bounds}.
420
+ */
421
+ abstract getWindowBounds(windowId: WindowId): Promise<WindowBounds>;
422
+
423
+ /**
424
+ * Sets the specified window {@link WindowBounds | bounds}.
425
+ */
426
+ abstract setWindowBounds(
427
+ windowId: WindowId,
428
+ windowBounds: WindowBounds,
429
+ ): Promise<void>;
328
430
 
329
431
  /**
330
432
  * Gets all active {@link Target | targets}.
@@ -380,13 +482,15 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
380
482
  * returns all {@link Page | pages} in all
381
483
  * {@link BrowserContext | browser contexts}.
382
484
  *
485
+ * @param includeAll - experimental, setting to true includes all kinds of pages.
486
+ *
383
487
  * @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
384
488
  * will not be listed here. You can find them using {@link Target.page}.
385
489
  */
386
- async pages(): Promise<Page[]> {
490
+ async pages(includeAll = false): Promise<Page[]> {
387
491
  const contextPages = await Promise.all(
388
492
  this.browserContexts().map(context => {
389
- return context.pages();
493
+ return context.pages(includeAll);
390
494
  }),
391
495
  );
392
496
  // Flatten array.
@@ -495,6 +599,29 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
495
599
  */
496
600
  abstract uninstallExtension(id: string): Promise<void>;
497
601
 
602
+ /**
603
+ * Gets a list of {@link ScreenInfo | screen information objects}.
604
+ */
605
+ abstract screens(): Promise<ScreenInfo[]>;
606
+
607
+ /**
608
+ * Adds a new screen, returns the added {@link ScreenInfo | screen information object}.
609
+ *
610
+ * @remarks
611
+ *
612
+ * Only supported in headless mode.
613
+ */
614
+ abstract addScreen(params: AddScreenParams): Promise<ScreenInfo>;
615
+
616
+ /**
617
+ * Removes a screen.
618
+ *
619
+ * @remarks
620
+ *
621
+ * Only supported in headless mode. Fails if the primary screen id is specified.
622
+ */
623
+ abstract removeScreen(screenId: string): Promise<void>;
624
+
498
625
  /**
499
626
  * Whether Puppeteer is connected to this {@link Browser | browser}.
500
627
  *
@@ -25,7 +25,12 @@ import {
25
25
  import {asyncDisposeSymbol, disposeSymbol} from '../util/disposable.js';
26
26
  import {Mutex} from '../util/Mutex.js';
27
27
 
28
- import type {Browser, Permission, WaitForTargetOptions} from './Browser.js';
28
+ import type {
29
+ Browser,
30
+ CreatePageOptions,
31
+ Permission,
32
+ WaitForTargetOptions,
33
+ } from './Browser.js';
29
34
  import type {Page} from './Page.js';
30
35
  import type {Target} from './Target.js';
31
36
 
@@ -181,10 +186,12 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
181
186
  * Gets a list of all open {@link Page | pages} inside this
182
187
  * {@link BrowserContext | browser context}.
183
188
  *
189
+ * @param includeAll - experimental, setting to true includes all kinds of pages.
190
+ *
184
191
  * @remarks Non-visible {@link Page | pages}, such as `"background_page"`,
185
192
  * will not be listed here. You can find them using {@link Target.page}.
186
193
  */
187
- abstract pages(): Promise<Page[]>;
194
+ abstract pages(includeAll?: boolean): Promise<Page[]>;
188
195
 
189
196
  /**
190
197
  * Grants this {@link BrowserContext | browser context} the given
@@ -230,7 +237,7 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
230
237
  * Creates a new {@link Page | page} in this
231
238
  * {@link BrowserContext | browser context}.
232
239
  */
233
- abstract newPage(): Promise<Page>;
240
+ abstract newPage(options?: CreatePageOptions): Promise<Page>;
234
241
 
235
242
  /**
236
243
  * Gets the {@link Browser | browser} associated with this
@@ -41,8 +41,7 @@ export namespace CDPSessionEvent {
41
41
  * @public
42
42
  */
43
43
  export interface CDPSessionEvents
44
- extends CDPEvents,
45
- Record<EventType, unknown> {
44
+ extends CDPEvents, Record<EventType, unknown> {
46
45
  /** @internal */
47
46
  [CDPSessionEvent.Disconnected]: undefined;
48
47
  /** @internal */
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ import type {WaitTimeoutOptions} from './Page.js';
8
+
9
+ /**
10
+ * Device in a request prompt.
11
+ *
12
+ * @public
13
+ */
14
+ export interface DeviceRequestPromptDevice {
15
+ /**
16
+ * Device id during a prompt.
17
+ */
18
+ id: string;
19
+
20
+ /**
21
+ * Device name as it appears in a prompt.
22
+ */
23
+ name: string;
24
+ }
25
+
26
+ /**
27
+ * Device request prompts let you respond to the page requesting for a device
28
+ * through an API like WebBluetooth.
29
+ *
30
+ * @remarks
31
+ * `DeviceRequestPrompt` instances are returned via the
32
+ * {@link Page.waitForDevicePrompt} method.
33
+ *
34
+ * @example
35
+ *
36
+ * ```ts
37
+ * const [devicePrompt] = Promise.all([
38
+ * page.waitForDevicePrompt(),
39
+ * page.click('#connect-bluetooth'),
40
+ * ]);
41
+ * await devicePrompt.select(
42
+ * await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
43
+ * );
44
+ * ```
45
+ *
46
+ * @public
47
+ */
48
+ export abstract class DeviceRequestPrompt {
49
+ /**
50
+ * Current list of selectable devices.
51
+ */
52
+ readonly devices: DeviceRequestPromptDevice[] = [];
53
+
54
+ /**
55
+ * Resolve to the first device in the prompt matching a filter.
56
+ */
57
+ abstract waitForDevice(
58
+ filter: (device: DeviceRequestPromptDevice) => boolean,
59
+ options?: WaitTimeoutOptions,
60
+ ): Promise<DeviceRequestPromptDevice>;
61
+
62
+ /**
63
+ * Select a device in the prompt's list.
64
+ */
65
+ abstract select(device: DeviceRequestPromptDevice): Promise<void>;
66
+
67
+ /**
68
+ * Cancel the prompt.
69
+ */
70
+ abstract cancel(): Promise<void>;
71
+ }
@@ -562,10 +562,8 @@ export abstract class ElementHandle<
562
562
  async $$eval<
563
563
  Selector extends string,
564
564
  Params extends unknown[],
565
- Func extends EvaluateFuncWith<
566
- Array<NodeFor<Selector>>,
567
- Params
568
- > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
565
+ Func extends EvaluateFuncWith<Array<NodeFor<Selector>>, Params> =
566
+ EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
569
567
  >(
570
568
  selector: Selector,
571
569
  pageFunction: Func | string,
@@ -1521,7 +1519,7 @@ export abstract class ElementHandle<
1521
1519
  } = {},
1522
1520
  ): Promise<boolean> {
1523
1521
  await this.assertConnectedElement();
1524
- // eslint-disable-next-line rulesdir/use-using -- Returns `this`.
1522
+ // eslint-disable-next-line @puppeteer/use-using -- Returns `this`.
1525
1523
  const handle = await this.#asSVGElementHandle();
1526
1524
  using target = handle && (await handle.#getOwnerSVGElement());
1527
1525
  return await ((target ?? this) as ElementHandle<Element>).evaluate(
package/src/api/Frame.ts CHANGED
@@ -15,7 +15,6 @@ import type {
15
15
  WaitTimeoutOptions,
16
16
  } from '../api/Page.js';
17
17
  import type {Accessibility} from '../cdp/Accessibility.js';
18
- import type {DeviceRequestPrompt} from '../cdp/DeviceRequestPrompt.js';
19
18
  import type {PuppeteerLifeCycleEvent} from '../cdp/LifecycleWatcher.js';
20
19
  import {EventEmitter, type EventType} from '../common/EventEmitter.js';
21
20
  import {getQueryHandlerAndSelector} from '../common/GetQueryHandler.js';
@@ -33,6 +32,7 @@ import {assert} from '../util/assert.js';
33
32
  import {throwIfDisposed} from '../util/decorators.js';
34
33
 
35
34
  import type {CDPSession} from './CDPSession.js';
35
+ import type {DeviceRequestPrompt} from './DeviceRequestPrompt.js';
36
36
  import type {KeyboardTypeOptions} from './Input.js';
37
37
  import {
38
38
  FunctionLocator,
@@ -557,7 +557,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
557
557
  async $<Selector extends string>(
558
558
  selector: Selector,
559
559
  ): Promise<ElementHandle<NodeFor<Selector>> | null> {
560
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
560
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
561
561
  const document = await this.#document();
562
562
  return await document.$(selector);
563
563
  }
@@ -589,7 +589,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
589
589
  selector: Selector,
590
590
  options?: QueryOptions,
591
591
  ): Promise<Array<ElementHandle<NodeFor<Selector>>>> {
592
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
592
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
593
593
  const document = await this.#document();
594
594
  return await document.$$(selector, options);
595
595
  }
@@ -642,7 +642,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
642
642
  ...args: Params
643
643
  ): Promise<Awaited<ReturnType<Func>>> {
644
644
  pageFunction = withSourcePuppeteerURLIfNone(this.$eval.name, pageFunction);
645
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
645
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
646
646
  const document = await this.#document();
647
647
  return await document.$eval(selector, pageFunction, ...args);
648
648
  }
@@ -685,17 +685,15 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
685
685
  async $$eval<
686
686
  Selector extends string,
687
687
  Params extends unknown[],
688
- Func extends EvaluateFuncWith<
689
- Array<NodeFor<Selector>>,
690
- Params
691
- > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
688
+ Func extends EvaluateFuncWith<Array<NodeFor<Selector>>, Params> =
689
+ EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
692
690
  >(
693
691
  selector: Selector,
694
692
  pageFunction: string | Func,
695
693
  ...args: Params
696
694
  ): Promise<Awaited<ReturnType<Func>>> {
697
695
  pageFunction = withSourcePuppeteerURLIfNone(this.$$eval.name, pageFunction);
698
- // eslint-disable-next-line rulesdir/use-using -- This is cached.
696
+ // eslint-disable-next-line @puppeteer/use-using -- This is cached.
699
697
  const document = await this.#document();
700
698
  return await document.$$eval(selector, pageFunction, ...args);
701
699
  }
@@ -285,7 +285,7 @@ export abstract class HTTPRequest {
285
285
  abstract method(): string;
286
286
 
287
287
  /**
288
- * The request's post body, if any.
288
+ * @deprecated Use {@link HTTPRequest.fetchPostData}.
289
289
  */
290
290
  abstract postData(): string | undefined;
291
291
 
package/src/api/Page.ts CHANGED
@@ -32,7 +32,6 @@ import type {HTTPRequest} from '../api/HTTPRequest.js';
32
32
  import type {HTTPResponse} from '../api/HTTPResponse.js';
33
33
  import type {Accessibility} from '../cdp/Accessibility.js';
34
34
  import type {Coverage} from '../cdp/Coverage.js';
35
- import type {DeviceRequestPrompt} from '../cdp/DeviceRequestPrompt.js';
36
35
  import type {NetworkConditions} from '../cdp/NetworkManager.js';
37
36
  import type {Tracing} from '../cdp/Tracing.js';
38
37
  import type {ConsoleMessage} from '../common/ConsoleMessage.js';
@@ -82,9 +81,11 @@ import {
82
81
  } from '../util/disposable.js';
83
82
  import {stringToTypedArray} from '../util/encoding.js';
84
83
 
85
- import type {Browser} from './Browser.js';
84
+ import type {BluetoothEmulation} from './BluetoothEmulation.js';
85
+ import type {Browser, WindowId} from './Browser.js';
86
86
  import type {BrowserContext} from './BrowserContext.js';
87
87
  import type {CDPSession} from './CDPSession.js';
88
+ import type {DeviceRequestPrompt} from './DeviceRequestPrompt.js';
88
89
  import type {Dialog} from './Dialog.js';
89
90
  import type {
90
91
  BoundingBox,
@@ -306,7 +307,7 @@ export interface ScreenshotOptions {
306
307
  * relative to current working directory. If no path is provided, the image
307
308
  * won't be saved to the disk.
308
309
  */
309
- path?: `${string}.${ImageFormat}`;
310
+ path?: string;
310
311
  /**
311
312
  * Specifies the region of the page/element to clip.
312
313
  */
@@ -507,7 +508,7 @@ export const enum PageEvent {
507
508
  Metrics = 'metrics',
508
509
  /**
509
510
  * Emitted when an uncaught exception happens within the page. Contains an
510
- * `Error`.
511
+ * `Error` or data of type unknown.
511
512
  */
512
513
  PageError = 'pageerror',
513
514
  /**
@@ -602,7 +603,7 @@ export interface PageEvents extends Record<EventType, unknown> {
602
603
  [PageEvent.FrameNavigated]: Frame;
603
604
  [PageEvent.Load]: undefined;
604
605
  [PageEvent.Metrics]: {title: string; metrics: Metrics};
605
- [PageEvent.PageError]: Error;
606
+ [PageEvent.PageError]: Error | unknown;
606
607
  [PageEvent.Popup]: Page | null;
607
608
  [PageEvent.Request]: HTTPRequest;
608
609
  [PageEvent.Response]: HTTPResponse;
@@ -633,6 +634,19 @@ export function setDefaultScreenshotOptions(options: ScreenshotOptions): void {
633
634
  options.captureBeyondViewport ??= true;
634
635
  }
635
636
 
637
+ /**
638
+ * @public
639
+ */
640
+ export interface ReloadOptions extends WaitForOptions {
641
+ /**
642
+ * If set to true, the browser caches are ignored for the page reload.
643
+ *
644
+ * @defaultValue true
645
+ * @public
646
+ */
647
+ ignoreCache?: boolean;
648
+ }
649
+
636
650
  /**
637
651
  * Page provides methods to interact with a single tab or
638
652
  * {@link https://developer.chrome.com/extensions/background_pages | extension background page}
@@ -1442,10 +1456,8 @@ export abstract class Page extends EventEmitter<PageEvents> {
1442
1456
  async $$eval<
1443
1457
  Selector extends string,
1444
1458
  Params extends unknown[],
1445
- Func extends EvaluateFuncWith<
1446
- Array<NodeFor<Selector>>,
1447
- Params
1448
- > = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
1459
+ Func extends EvaluateFuncWith<Array<NodeFor<Selector>>, Params> =
1460
+ EvaluateFuncWith<Array<NodeFor<Selector>>, Params>,
1449
1461
  >(
1450
1462
  selector: Selector,
1451
1463
  pageFunction: Func | string,
@@ -1743,7 +1755,7 @@ export abstract class Page extends EventEmitter<PageEvents> {
1743
1755
  * multiple redirects, the navigation will resolve with the response of the
1744
1756
  * last redirect.
1745
1757
  */
1746
- abstract reload(options?: WaitForOptions): Promise<HTTPResponse | null>;
1758
+ abstract reload(options?: ReloadOptions): Promise<HTTPResponse | null>;
1747
1759
 
1748
1760
  /**
1749
1761
  * Waits for the page to navigate to a new URL or to reload. It is useful when
@@ -2691,6 +2703,13 @@ export abstract class Page extends EventEmitter<PageEvents> {
2691
2703
  return typedArray;
2692
2704
  }
2693
2705
 
2706
+ /**
2707
+ * Emulates focus state of the page.
2708
+ *
2709
+ * @param enabled - Whether to emulate focus.
2710
+ */
2711
+ abstract emulateFocusedPage(enabled: boolean): Promise<void>;
2712
+
2694
2713
  /**
2695
2714
  * @internal
2696
2715
  */
@@ -3136,7 +3155,7 @@ export abstract class Page extends EventEmitter<PageEvents> {
3136
3155
 
3137
3156
  /**
3138
3157
  * Resizes the browser window the page is in so that the content area
3139
- * (excluding browser UI) is according to the specified widht and height.
3158
+ * (excluding browser UI) is according to the specified width and height.
3140
3159
  *
3141
3160
  * @experimental
3142
3161
  * @internal
@@ -3146,6 +3165,13 @@ export abstract class Page extends EventEmitter<PageEvents> {
3146
3165
  contentHeight: number;
3147
3166
  }): Promise<void>;
3148
3167
 
3168
+ /**
3169
+ * Returns the page's window id.
3170
+ *
3171
+ * @experimental
3172
+ */
3173
+ abstract windowId(): Promise<WindowId>;
3174
+
3149
3175
  /** @internal */
3150
3176
  override [disposeSymbol](): void {
3151
3177
  return void this.close().catch(debugError);
@@ -3155,6 +3181,17 @@ export abstract class Page extends EventEmitter<PageEvents> {
3155
3181
  [asyncDisposeSymbol](): Promise<void> {
3156
3182
  return this.close();
3157
3183
  }
3184
+
3185
+ /**
3186
+ * Opens DevTools for the current Page and returns the DevTools Page. This
3187
+ * method is only available in Chrome.
3188
+ */
3189
+ abstract openDevTools(): Promise<Page>;
3190
+
3191
+ /**
3192
+ * {@inheritDoc BluetoothEmulation}
3193
+ */
3194
+ abstract get bluetooth(): BluetoothEmulation;
3158
3195
  }
3159
3196
 
3160
3197
  /**
package/src/api/api.ts CHANGED
@@ -4,9 +4,11 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
+ export type * from './BluetoothEmulation.js';
7
8
  export * from './Browser.js';
8
9
  export * from './BrowserContext.js';
9
10
  export * from './CDPSession.js';
11
+ export * from './DeviceRequestPrompt.js';
10
12
  export * from './Dialog.js';
11
13
  export * from './ElementHandle.js';
12
14
  export type * from './Environment.js';
@@ -48,6 +48,7 @@ export async function connectBidiOverCdp(
48
48
  const pptrBiDiConnection = new BidiConnection(
49
49
  cdp.url(),
50
50
  pptrTransport,
51
+ cdp._idGenerator,
51
52
  cdp.delay,
52
53
  cdp.timeout,
53
54
  );
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ import type {
8
+ AdapterState,
9
+ BluetoothEmulation,
10
+ PreconnectedPeripheral,
11
+ } from '../api/BluetoothEmulation.js';
12
+
13
+ import type {Session} from './core/Session.js';
14
+
15
+ /**
16
+ * @internal
17
+ */
18
+ export class BidiBluetoothEmulation implements BluetoothEmulation {
19
+ readonly #session: Session;
20
+ readonly #contextId: string;
21
+
22
+ constructor(contextId: string, session: Session) {
23
+ this.#contextId = contextId;
24
+ this.#session = session;
25
+ }
26
+
27
+ async emulateAdapter(state: AdapterState, leSupported = true): Promise<void> {
28
+ await this.#session.send('bluetooth.simulateAdapter', {
29
+ context: this.#contextId,
30
+ state,
31
+ leSupported,
32
+ });
33
+ }
34
+
35
+ async disableEmulation(): Promise<void> {
36
+ await this.#session.send('bluetooth.disableSimulation', {
37
+ context: this.#contextId,
38
+ });
39
+ }
40
+
41
+ async simulatePreconnectedPeripheral(
42
+ preconnectedPeripheral: PreconnectedPeripheral,
43
+ ): Promise<void> {
44
+ await this.#session.send('bluetooth.simulatePreconnectedPeripheral', {
45
+ context: this.#contextId,
46
+ address: preconnectedPeripheral.address,
47
+ name: preconnectedPeripheral.name,
48
+ manufacturerData: preconnectedPeripheral.manufacturerData,
49
+ knownServiceUuids: preconnectedPeripheral.knownServiceUuids,
50
+ });
51
+ }
52
+ }