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.
- package/README.md +5 -5
- package/advanced-stealth.js +1 -1
- package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/api/Browser.d.ts +111 -2
- package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Browser.js +4 -2
- package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/api/BrowserContext.d.ts +5 -3
- package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +38 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
- package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Frame.js +4 -4
- package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/cjs/puppeteer/api/Page.d.ts +41 -7
- package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/lib/cjs/puppeteer/api/api.d.ts +2 -0
- package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/api.js +1 -0
- package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/bidi/Browser.d.ts +6 -1
- package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Browser.js +36 -14
- package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
- package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +3 -3
- package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserContext.js +6 -3
- package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
- package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.js +19 -2
- package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
- package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
- package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js +2 -29
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/Page.d.ts +10 -8
- package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Page.js +63 -47
- package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +55 -2
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Request.js +30 -4
- package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/util.js +7 -0
- package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +10 -0
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.js +30 -3
- package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/cdp/Browser.d.ts +10 -5
- package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Browser.js +61 -8
- package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
- package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +3 -2
- package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserContext.js +4 -4
- package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
- package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
- package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +10 -76
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js +6 -2
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.js +25 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Page.d.ts +9 -4
- package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Page.js +30 -7
- package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
- package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
- package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/BrowserConnector.js +47 -3
- package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
- package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +22 -0
- package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
- package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
- package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
- package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
- package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/lib/cjs/puppeteer/revisions.js +3 -3
- package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/lib/cjs/puppeteer/util/disposable.d.ts +2 -2
- package/lib/cjs/puppeteer/util/disposable.d.ts.map +1 -1
- package/lib/cjs/puppeteer/util/disposable.js +3 -1
- package/lib/cjs/puppeteer/util/disposable.js.map +1 -1
- package/lib/cjs/puppeteer/util/util.d.ts +1 -0
- package/lib/cjs/puppeteer/util/util.d.ts.map +1 -1
- package/lib/cjs/puppeteer/util/util.js +1 -0
- package/lib/cjs/puppeteer/util/util.js.map +1 -1
- package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/lib/cjs/puppeteer/util/version.js +1 -1
- package/lib/es5-iife/puppeteer-core-browser.d.ts +304 -22
- package/lib/es5-iife/puppeteer-core-browser.js +484 -224
- package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/api/Browser.d.ts +111 -2
- package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Browser.js +4 -2
- package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/lib/esm/puppeteer/api/BrowserContext.d.ts +5 -3
- package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +34 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/ElementHandle.js +1 -1
- package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
- package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Frame.js +4 -4
- package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/lib/esm/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/esm/puppeteer/api/Input.d.ts +1 -1
- package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Page.d.ts +41 -7
- package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/lib/esm/puppeteer/api/api.d.ts +2 -0
- package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/api.js +1 -0
- package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/bidi/Browser.d.ts +6 -1
- package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Browser.js +36 -14
- package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
- package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +3 -3
- package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserContext.js +6 -3
- package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
- package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.js +19 -2
- package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
- package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Frame.js +3 -2
- package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.js +2 -29
- package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/bidi/Page.d.ts +10 -8
- package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Page.js +64 -48
- package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +55 -2
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.js +31 -5
- package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/util.js +7 -0
- package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts +10 -0
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.js +30 -3
- package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/cdp/Browser.d.ts +10 -5
- package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Browser.js +61 -8
- package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
- package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +3 -2
- package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserContext.js +4 -4
- package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
- package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
- package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Connection.js +11 -2
- package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +7 -72
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
- package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.js +6 -2
- package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/lib/esm/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.js +25 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Page.d.ts +9 -4
- package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Page.js +30 -7
- package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
- package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
- package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/lib/esm/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/BrowserConnector.js +48 -4
- package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
- package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/lib/esm/puppeteer/common/ConnectOptions.d.ts +22 -0
- package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
- package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
- package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
- package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
- package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/lib/esm/puppeteer/revisions.js +3 -3
- package/lib/esm/puppeteer/util/disposable.d.ts +2 -2
- package/lib/esm/puppeteer/util/disposable.d.ts.map +1 -1
- package/lib/esm/puppeteer/util/disposable.js +2 -2
- package/lib/esm/puppeteer/util/disposable.js.map +1 -1
- package/lib/esm/puppeteer/util/util.d.ts +1 -0
- package/lib/esm/puppeteer/util/util.d.ts.map +1 -1
- package/lib/esm/puppeteer/util/util.js +1 -0
- package/lib/esm/puppeteer/util/util.js.map +1 -1
- package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/lib/esm/puppeteer/util/version.js +1 -1
- package/lib/types.d.ts +304 -22
- package/package.json +15 -15
- package/src/api/BluetoothEmulation.ts +103 -0
- package/src/api/Browser.ts +130 -3
- package/src/api/BrowserContext.ts +10 -3
- package/src/api/CDPSession.ts +1 -2
- package/src/api/DeviceRequestPrompt.ts +71 -0
- package/src/api/ElementHandle.ts +3 -5
- package/src/api/Frame.ts +7 -9
- package/src/api/HTTPRequest.ts +1 -1
- package/src/api/Page.ts +48 -11
- package/src/api/api.ts +2 -0
- package/src/bidi/BidiOverCdp.ts +1 -0
- package/src/bidi/BluetoothEmulation.ts +52 -0
- package/src/bidi/Browser.ts +52 -14
- package/src/bidi/BrowserConnector.ts +8 -1
- package/src/bidi/BrowserContext.ts +9 -6
- package/src/bidi/Connection.ts +20 -1
- package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/src/bidi/Frame.ts +7 -3
- package/src/bidi/HTTPRequest.ts +2 -45
- package/src/bidi/Page.ts +86 -71
- package/src/bidi/core/BrowsingContext.ts +80 -2
- package/src/bidi/core/Connection.ts +3 -2
- package/src/bidi/core/Request.ts +35 -5
- package/src/bidi/util.ts +8 -0
- package/src/cdp/Accessibility.ts +45 -4
- package/src/cdp/BluetoothEmulation.ts +47 -0
- package/src/cdp/Browser.ts +95 -10
- package/src/cdp/BrowserConnector.ts +4 -0
- package/src/cdp/BrowserContext.ts +5 -4
- package/src/cdp/CdpSession.ts +3 -2
- package/src/cdp/Connection.ts +15 -1
- package/src/cdp/DeviceRequestPrompt.ts +8 -79
- package/src/cdp/EmulationManager.ts +30 -0
- package/src/cdp/ExecutionContext.ts +6 -2
- package/src/cdp/ExtensionTransport.ts +5 -1
- package/src/cdp/Frame.ts +3 -5
- package/src/cdp/FrameManager.ts +9 -4
- package/src/cdp/HTTPRequest.ts +7 -2
- package/src/cdp/HTTPResponse.ts +1 -1
- package/src/cdp/JSHandle.ts +1 -1
- package/src/cdp/NetworkEventManager.ts +16 -1
- package/src/cdp/NetworkManager.ts +31 -1
- package/src/cdp/Page.ts +49 -14
- package/src/cdp/TargetManager.ts +36 -43
- package/src/cdp/WebWorker.ts +8 -3
- package/src/cdp/cdp.ts +1 -0
- package/src/cdp/utils.ts +2 -2
- package/src/common/BrowserConnector.ts +67 -4
- package/src/common/CallbackRegistry.ts +7 -5
- package/src/common/ConnectOptions.ts +28 -0
- package/src/common/ConsoleMessage.ts +14 -0
- package/src/common/EventEmitter.ts +3 -3
- package/src/node/BrowserLauncher.ts +22 -1
- package/src/node/ChromeLauncher.ts +5 -17
- package/src/node/LaunchOptions.ts +23 -7
- package/src/revisions.ts +3 -3
- package/src/util/disposable.ts +2 -2
- package/src/util/util.ts +1 -0
- package/src/util/version.ts +1 -1
- package/src/templates/version.ts.tmpl +0 -4
package/src/bidi/Browser.ts
CHANGED
|
@@ -14,6 +14,10 @@ import {
|
|
|
14
14
|
BrowserEvent,
|
|
15
15
|
type BrowserCloseCallback,
|
|
16
16
|
type BrowserContextOptions,
|
|
17
|
+
type ScreenInfo,
|
|
18
|
+
type AddScreenParams,
|
|
19
|
+
type WindowBounds,
|
|
20
|
+
type WindowId,
|
|
17
21
|
type DebugInfo,
|
|
18
22
|
} from '../api/Browser.js';
|
|
19
23
|
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
@@ -22,6 +26,7 @@ import type {Target} from '../api/Target.js';
|
|
|
22
26
|
import type {Connection as CdpConnection} from '../cdp/Connection.js';
|
|
23
27
|
import type {SupportedWebDriverCapabilities} from '../common/ConnectOptions.js';
|
|
24
28
|
import {ProtocolError} from '../common/Errors.js';
|
|
29
|
+
import {UnsupportedOperation} from '../common/Errors.js';
|
|
25
30
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
26
31
|
import {debugError} from '../common/util.js';
|
|
27
32
|
import type {Viewport} from '../common/Viewport.js';
|
|
@@ -89,6 +94,8 @@ export class BidiBrowser extends Browser {
|
|
|
89
94
|
// yet because WebDriver BiDi behavior is not specified. See
|
|
90
95
|
// https://github.com/w3c/webdriver-bidi/issues/321.
|
|
91
96
|
'goog:prerenderingDisabled': true,
|
|
97
|
+
// TODO: remove after Puppeteer rolled Chrome to 142 after Oct 28, 2025.
|
|
98
|
+
'goog:disableNetworkDurableMessages': true,
|
|
92
99
|
},
|
|
93
100
|
});
|
|
94
101
|
|
|
@@ -109,20 +116,28 @@ export class BidiBrowser extends Browser {
|
|
|
109
116
|
}) as [string, ...string[]],
|
|
110
117
|
);
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
await Promise.all(
|
|
120
|
+
[Bidi.Network.DataType.Request, Bidi.Network.DataType.Response].map(
|
|
121
|
+
// Data collectors might be not implemented for specific data type, so create them
|
|
122
|
+
// separately and ignore protocol errors.
|
|
123
|
+
async dataType => {
|
|
124
|
+
try {
|
|
125
|
+
await session.send('network.addDataCollector', {
|
|
126
|
+
dataTypes: [dataType],
|
|
127
|
+
// Buffer size of 20 MB is equivalent to the CDP:
|
|
128
|
+
maxEncodedDataSize: 20_000_000,
|
|
129
|
+
});
|
|
130
|
+
} catch (err) {
|
|
131
|
+
if (err instanceof ProtocolError) {
|
|
132
|
+
debugError(err);
|
|
133
|
+
} else {
|
|
134
|
+
throw err;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
|
|
126
141
|
const browser = new BidiBrowser(session.browser, opts);
|
|
127
142
|
browser.#initialize();
|
|
128
143
|
return browser;
|
|
@@ -279,6 +294,29 @@ export class BidiBrowser extends Browser {
|
|
|
279
294
|
await this.#browserCore.uninstallExtension(id);
|
|
280
295
|
}
|
|
281
296
|
|
|
297
|
+
override screens(): Promise<ScreenInfo[]> {
|
|
298
|
+
throw new UnsupportedOperation();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
override addScreen(_params: AddScreenParams): Promise<ScreenInfo> {
|
|
302
|
+
throw new UnsupportedOperation();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
override removeScreen(_screenId: string): Promise<void> {
|
|
306
|
+
throw new UnsupportedOperation();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
override getWindowBounds(_windowId: WindowId): Promise<WindowBounds> {
|
|
310
|
+
throw new UnsupportedOperation();
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
override setWindowBounds(
|
|
314
|
+
_windowId: WindowId,
|
|
315
|
+
_windowBounds: WindowBounds,
|
|
316
|
+
): Promise<void> {
|
|
317
|
+
throw new UnsupportedOperation();
|
|
318
|
+
}
|
|
319
|
+
|
|
282
320
|
override targets(): Target[] {
|
|
283
321
|
return [
|
|
284
322
|
this.#target,
|
|
@@ -10,6 +10,7 @@ import type {ConnectionTransport} from '../common/ConnectionTransport.js';
|
|
|
10
10
|
import type {ConnectOptions} from '../common/ConnectOptions.js';
|
|
11
11
|
import {ProtocolError, UnsupportedOperation} from '../common/Errors.js';
|
|
12
12
|
import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
|
|
13
|
+
import {createIncrementalIdGenerator} from '../util/incremental-id-generator.js';
|
|
13
14
|
|
|
14
15
|
import type {BidiBrowser} from './Browser.js';
|
|
15
16
|
import type {BidiConnection} from './Connection.js';
|
|
@@ -66,12 +67,17 @@ async function getBiDiConnection(
|
|
|
66
67
|
closeCallback: BrowserCloseCallback;
|
|
67
68
|
}> {
|
|
68
69
|
const BiDi = await import(/* webpackIgnore: true */ './bidi.js');
|
|
69
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
slowMo = 0,
|
|
72
|
+
protocolTimeout,
|
|
73
|
+
idGenerator = createIncrementalIdGenerator(),
|
|
74
|
+
} = options;
|
|
70
75
|
|
|
71
76
|
// Try pure BiDi first.
|
|
72
77
|
const pureBidiConnection = new BiDi.BidiConnection(
|
|
73
78
|
url,
|
|
74
79
|
connectionTransport,
|
|
80
|
+
idGenerator,
|
|
75
81
|
slowMo,
|
|
76
82
|
protocolTimeout,
|
|
77
83
|
);
|
|
@@ -102,6 +108,7 @@ async function getBiDiConnection(
|
|
|
102
108
|
slowMo,
|
|
103
109
|
protocolTimeout,
|
|
104
110
|
/* rawErrors= */ true,
|
|
111
|
+
idGenerator,
|
|
105
112
|
);
|
|
106
113
|
|
|
107
114
|
const version = await cdpConnection.send('Browser.getVersion');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
|
-
import type {Permission} from '../api/Browser.js';
|
|
9
|
+
import type {CreatePageOptions, Permission} from '../api/Browser.js';
|
|
10
10
|
import {WEB_PERMISSION_TO_PROTOCOL_PERMISSION} from '../api/Browser.js';
|
|
11
11
|
import type {BrowserContextEvents} from '../api/BrowserContext.js';
|
|
12
12
|
import {BrowserContext, BrowserContextEvent} from '../api/BrowserContext.js';
|
|
@@ -181,12 +181,15 @@ export class BidiBrowserContext extends BrowserContext {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
override async newPage(): Promise<Page> {
|
|
184
|
+
override async newPage(options?: CreatePageOptions): Promise<Page> {
|
|
185
185
|
using _guard = await this.waitForScreenshotOperations();
|
|
186
186
|
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
const type =
|
|
188
|
+
options?.type === 'window'
|
|
189
|
+
? Bidi.BrowsingContext.CreateType.Window
|
|
190
|
+
: Bidi.BrowsingContext.CreateType.Tab;
|
|
191
|
+
|
|
192
|
+
const context = await this.userContext.createBrowsingContext(type);
|
|
190
193
|
const page = this.#pages.get(context)!;
|
|
191
194
|
if (!page) {
|
|
192
195
|
throw new Error('Page is not found');
|
|
@@ -221,7 +224,7 @@ export class BidiBrowserContext extends BrowserContext {
|
|
|
221
224
|
return this.#browser;
|
|
222
225
|
}
|
|
223
226
|
|
|
224
|
-
override async pages(): Promise<BidiPage[]> {
|
|
227
|
+
override async pages(_includeAll = false): Promise<BidiPage[]> {
|
|
225
228
|
return [...this.userContext.browsingContexts].map(context => {
|
|
226
229
|
return this.#pages.get(context)!;
|
|
227
230
|
});
|
package/src/bidi/Connection.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {ConnectionClosedError} from '../common/Errors.js';
|
|
|
14
14
|
import type {EventsWithWildcard} from '../common/EventEmitter.js';
|
|
15
15
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
16
16
|
import {debugError} from '../common/util.js';
|
|
17
|
+
import type {GetIdFn} from '../util/incremental-id-generator.js';
|
|
17
18
|
|
|
18
19
|
import {BidiCdpSession} from './CDPSession.js';
|
|
19
20
|
import type {
|
|
@@ -57,12 +58,13 @@ export class BidiConnection
|
|
|
57
58
|
#delay: number;
|
|
58
59
|
#timeout = 0;
|
|
59
60
|
#closed = false;
|
|
60
|
-
#callbacks
|
|
61
|
+
#callbacks: CallbackRegistry;
|
|
61
62
|
#emitters: Array<EventEmitter<any>> = [];
|
|
62
63
|
|
|
63
64
|
constructor(
|
|
64
65
|
url: string,
|
|
65
66
|
transport: ConnectionTransport,
|
|
67
|
+
idGenerator: GetIdFn,
|
|
66
68
|
delay = 0,
|
|
67
69
|
timeout?: number,
|
|
68
70
|
) {
|
|
@@ -70,6 +72,7 @@ export class BidiConnection
|
|
|
70
72
|
this.#url = url;
|
|
71
73
|
this.#delay = delay;
|
|
72
74
|
this.#timeout = timeout ?? 180_000;
|
|
75
|
+
this.#callbacks = new CallbackRegistry(idGenerator);
|
|
73
76
|
|
|
74
77
|
this.#transport = transport;
|
|
75
78
|
this.#transport.onmessage = this.onMessage.bind(this);
|
|
@@ -88,10 +91,26 @@ export class BidiConnection
|
|
|
88
91
|
this.#emitters.push(emitter);
|
|
89
92
|
}
|
|
90
93
|
|
|
94
|
+
#toWebDriverOnlyEvent(event: Record<string, any>) {
|
|
95
|
+
for (const key in event) {
|
|
96
|
+
if (key.startsWith('goog:')) {
|
|
97
|
+
delete event[key];
|
|
98
|
+
} else {
|
|
99
|
+
if (typeof event[key] === 'object' && event[key] !== null) {
|
|
100
|
+
this.#toWebDriverOnlyEvent(event[key]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
91
106
|
override emit<Key extends keyof EventsWithWildcard<BidiEvents>>(
|
|
92
107
|
type: Key,
|
|
93
108
|
event: EventsWithWildcard<BidiEvents>[Key],
|
|
94
109
|
): boolean {
|
|
110
|
+
if (process.env['PUPPETEER_WEBDRIVER_BIDI_ONLY'] === 'true') {
|
|
111
|
+
// Required for WebDriver-only testing.
|
|
112
|
+
this.#toWebDriverOnlyEvent(event);
|
|
113
|
+
}
|
|
95
114
|
for (const emitter of this.#emitters) {
|
|
96
115
|
emitter.emit(type, event);
|
|
97
116
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type * as Bidi from 'webdriver-bidi-protocol';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
DeviceRequestPrompt,
|
|
11
|
+
type DeviceRequestPromptDevice,
|
|
12
|
+
} from '../api/DeviceRequestPrompt.js';
|
|
13
|
+
import {UnsupportedOperation} from '../common/Errors.js';
|
|
14
|
+
import {Deferred} from '../util/Deferred.js';
|
|
15
|
+
|
|
16
|
+
import type {Session} from './core/Session.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export class BidiDeviceRequestPromptManager {
|
|
22
|
+
readonly #session: Session;
|
|
23
|
+
readonly #contextId: string;
|
|
24
|
+
#enabled = false;
|
|
25
|
+
|
|
26
|
+
constructor(contextId: string, session: Session) {
|
|
27
|
+
this.#session = session;
|
|
28
|
+
this.#contextId = contextId;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async #enableIfNeeded(): Promise<void> {
|
|
32
|
+
if (!this.#enabled) {
|
|
33
|
+
this.#enabled = true;
|
|
34
|
+
await this.#session.subscribe(
|
|
35
|
+
['bluetooth.requestDevicePromptUpdated'],
|
|
36
|
+
[this.#contextId],
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async waitForDevicePrompt(
|
|
42
|
+
timeout: number,
|
|
43
|
+
signal: AbortSignal | undefined,
|
|
44
|
+
): Promise<DeviceRequestPrompt> {
|
|
45
|
+
const deferred = Deferred.create<DeviceRequestPrompt>({
|
|
46
|
+
message: `Waiting for \`DeviceRequestPrompt\` failed: ${timeout}ms exceeded`,
|
|
47
|
+
timeout,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const onRequestDevicePromptUpdated = (
|
|
51
|
+
params: Bidi.Bluetooth.RequestDevicePromptUpdatedParameters,
|
|
52
|
+
) => {
|
|
53
|
+
if (params.context === this.#contextId) {
|
|
54
|
+
deferred.resolve(
|
|
55
|
+
new BidiDeviceRequestPrompt(
|
|
56
|
+
this.#contextId,
|
|
57
|
+
params.prompt,
|
|
58
|
+
this.#session,
|
|
59
|
+
params.devices,
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
this.#session.off(
|
|
63
|
+
'bluetooth.requestDevicePromptUpdated',
|
|
64
|
+
onRequestDevicePromptUpdated,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.#session.on(
|
|
69
|
+
'bluetooth.requestDevicePromptUpdated',
|
|
70
|
+
onRequestDevicePromptUpdated,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
if (signal) {
|
|
74
|
+
signal.addEventListener(
|
|
75
|
+
'abort',
|
|
76
|
+
() => {
|
|
77
|
+
deferred.reject(signal.reason);
|
|
78
|
+
},
|
|
79
|
+
{once: true},
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
await this.#enableIfNeeded();
|
|
84
|
+
|
|
85
|
+
return await deferred.valueOrThrow();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
export class BidiDeviceRequestPrompt extends DeviceRequestPrompt {
|
|
93
|
+
readonly #session: Session;
|
|
94
|
+
#promptId: string;
|
|
95
|
+
#contextId: string;
|
|
96
|
+
|
|
97
|
+
constructor(
|
|
98
|
+
contextId: string,
|
|
99
|
+
promptId: string,
|
|
100
|
+
session: Session,
|
|
101
|
+
devices: Bidi.Bluetooth.RequestDeviceInfo[],
|
|
102
|
+
) {
|
|
103
|
+
super();
|
|
104
|
+
this.#session = session;
|
|
105
|
+
this.#promptId = promptId;
|
|
106
|
+
this.#contextId = contextId;
|
|
107
|
+
|
|
108
|
+
this.devices.push(
|
|
109
|
+
...devices.map(d => {
|
|
110
|
+
return {
|
|
111
|
+
id: d.id,
|
|
112
|
+
name: d.name ?? 'UNKNOWN',
|
|
113
|
+
};
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async cancel(): Promise<void> {
|
|
119
|
+
await this.#session.send('bluetooth.handleRequestDevicePrompt', {
|
|
120
|
+
context: this.#contextId,
|
|
121
|
+
prompt: this.#promptId,
|
|
122
|
+
accept: false,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async select(device: DeviceRequestPromptDevice): Promise<void> {
|
|
127
|
+
await this.#session.send('bluetooth.handleRequestDevicePrompt', {
|
|
128
|
+
context: this.#contextId,
|
|
129
|
+
prompt: this.#promptId,
|
|
130
|
+
accept: true,
|
|
131
|
+
device: device.id,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
waitForDevice(): never {
|
|
136
|
+
throw new UnsupportedOperation();
|
|
137
|
+
}
|
|
138
|
+
}
|
package/src/bidi/Frame.ts
CHANGED
|
@@ -21,13 +21,14 @@ import {
|
|
|
21
21
|
switchMap,
|
|
22
22
|
} from '../../third_party/rxjs/rxjs.js';
|
|
23
23
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
24
|
+
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
24
25
|
import {
|
|
25
26
|
Frame,
|
|
26
27
|
throwIfDetached,
|
|
27
28
|
type GoToOptions,
|
|
28
29
|
type WaitForOptions,
|
|
29
30
|
} from '../api/Frame.js';
|
|
30
|
-
import {PageEvent} from '../api/Page.js';
|
|
31
|
+
import {PageEvent, type WaitTimeoutOptions} from '../api/Page.js';
|
|
31
32
|
import {Accessibility} from '../cdp/Accessibility.js';
|
|
32
33
|
import type {ConsoleMessageType} from '../common/ConsoleMessage.js';
|
|
33
34
|
import {
|
|
@@ -474,8 +475,11 @@ export class BidiFrame extends Frame {
|
|
|
474
475
|
);
|
|
475
476
|
}
|
|
476
477
|
|
|
477
|
-
override waitForDevicePrompt(
|
|
478
|
-
|
|
478
|
+
override waitForDevicePrompt(
|
|
479
|
+
options: WaitTimeoutOptions = {},
|
|
480
|
+
): Promise<DeviceRequestPrompt> {
|
|
481
|
+
const {timeout = this.timeoutSettings.timeout(), signal} = options;
|
|
482
|
+
return this.browsingContext.waitForDevicePrompt(timeout, signal);
|
|
479
483
|
}
|
|
480
484
|
|
|
481
485
|
override get detached(): boolean {
|
package/src/bidi/HTTPRequest.ts
CHANGED
|
@@ -109,17 +109,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
109
109
|
this.#request.on('authenticate', this.#handleAuthentication);
|
|
110
110
|
|
|
111
111
|
this.#frame.page().trustedEmitter.emit(PageEvent.Request, this);
|
|
112
|
-
|
|
113
|
-
if (this.#hasInternalHeaderOverwrite) {
|
|
114
|
-
this.interception.handlers.push(async () => {
|
|
115
|
-
await this.continue(
|
|
116
|
-
{
|
|
117
|
-
headers: this.headers(),
|
|
118
|
-
},
|
|
119
|
-
0,
|
|
120
|
-
);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
112
|
}
|
|
124
113
|
|
|
125
114
|
protected canBeIntercepted(): boolean {
|
|
@@ -158,40 +147,21 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
158
147
|
}
|
|
159
148
|
|
|
160
149
|
override hasPostData(): boolean {
|
|
161
|
-
if (!this.#frame.page().browser().cdpSupported) {
|
|
162
|
-
throw new UnsupportedOperation();
|
|
163
|
-
}
|
|
164
150
|
return this.#request.hasPostData;
|
|
165
151
|
}
|
|
166
152
|
|
|
167
153
|
override async fetchPostData(): Promise<string | undefined> {
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
get #hasInternalHeaderOverwrite(): boolean {
|
|
172
|
-
return Boolean(
|
|
173
|
-
Object.keys(this.#extraHTTPHeaders).length ||
|
|
174
|
-
Object.keys(this.#userAgentHeaders).length,
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
get #extraHTTPHeaders(): Record<string, string> {
|
|
179
|
-
return this.#frame?.page()._extraHTTPHeaders ?? {};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
get #userAgentHeaders(): Record<string, string> {
|
|
183
|
-
return this.#frame?.page()._userAgentHeaders ?? {};
|
|
154
|
+
return await this.#request.fetchPostData();
|
|
184
155
|
}
|
|
185
156
|
|
|
186
157
|
override headers(): Record<string, string> {
|
|
158
|
+
// Callers should not be allowed to mutate internal structure.
|
|
187
159
|
const headers: Record<string, string> = {};
|
|
188
160
|
for (const header of this.#request.headers) {
|
|
189
161
|
headers[header.name.toLowerCase()] = header.value.value;
|
|
190
162
|
}
|
|
191
163
|
return {
|
|
192
164
|
...headers,
|
|
193
|
-
...this.#extraHTTPHeaders,
|
|
194
|
-
...this.#userAgentHeaders,
|
|
195
165
|
};
|
|
196
166
|
}
|
|
197
167
|
|
|
@@ -225,19 +195,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
225
195
|
return this.#frame;
|
|
226
196
|
}
|
|
227
197
|
|
|
228
|
-
override async continue(
|
|
229
|
-
overrides?: ContinueRequestOverrides,
|
|
230
|
-
priority?: number | undefined,
|
|
231
|
-
): Promise<void> {
|
|
232
|
-
return await super.continue(
|
|
233
|
-
{
|
|
234
|
-
headers: this.#hasInternalHeaderOverwrite ? this.headers() : undefined,
|
|
235
|
-
...overrides,
|
|
236
|
-
},
|
|
237
|
-
priority,
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
198
|
override async _continue(
|
|
242
199
|
overrides: ContinueRequestOverrides = {},
|
|
243
200
|
): Promise<void> {
|