brave-real-puppeteer-core 24.26.1 → 24.33.0
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.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.map +1 -1
- package/lib/cjs/puppeteer/api/Page.d.ts +39 -5
- 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 +16 -0
- 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 +3 -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 +0 -25
- 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/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 +6 -0
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.js +11 -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/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 +4 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.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 +29 -6
- 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/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/revisions.js.map +1 -1
- 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 +297 -19
- package/lib/es5-iife/puppeteer-core-browser.js +456 -215
- 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.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.map +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 +39 -5
- 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 +16 -0
- 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 +3 -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 +0 -25
- 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/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 +6 -0
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.js +11 -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/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 +4 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.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 +29 -6
- 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/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/revisions.js.map +1 -1
- 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 +297 -19
- 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 +2 -4
- package/src/api/Frame.ts +3 -5
- package/src/api/Page.ts +46 -9
- 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 +28 -0
- package/src/bidi/BrowserConnector.ts +8 -1
- package/src/bidi/BrowserContext.ts +9 -6
- package/src/bidi/Connection.ts +4 -1
- package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/src/bidi/Frame.ts +7 -3
- package/src/bidi/HTTPRequest.ts +0 -41
- 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/util.ts +8 -0
- package/src/cdp/Accessibility.ts +17 -3
- 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/ExtensionTransport.ts +5 -1
- package/src/cdp/Frame.ts +3 -5
- package/src/cdp/FrameManager.ts +9 -4
- package/src/cdp/HTTPRequest.ts +5 -1
- package/src/cdp/NetworkEventManager.ts +16 -1
- package/src/cdp/NetworkManager.ts +31 -1
- package/src/cdp/Page.ts +48 -13
- package/src/cdp/TargetManager.ts +36 -43
- package/src/cdp/WebWorker.ts +8 -3
- package/src/cdp/cdp.ts +1 -0
- 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
|
@@ -7,59 +7,17 @@
|
|
|
7
7
|
import type Protocol from 'devtools-protocol';
|
|
8
8
|
|
|
9
9
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
10
|
+
import {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
11
|
+
import type {DeviceRequestPromptDevice} from '../api/DeviceRequestPrompt.js';
|
|
10
12
|
import type {WaitTimeoutOptions} from '../api/Page.js';
|
|
11
13
|
import type {TimeoutSettings} from '../common/TimeoutSettings.js';
|
|
12
14
|
import {assert} from '../util/assert.js';
|
|
13
15
|
import {Deferred} from '../util/Deferred.js';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export class DeviceRequestPromptDevice {
|
|
21
|
-
/**
|
|
22
|
-
* Device id during a prompt.
|
|
23
|
-
*/
|
|
24
|
-
id: string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Device name as it appears in a prompt.
|
|
28
|
-
*/
|
|
29
|
-
name: string;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
constructor(id: string, name: string) {
|
|
35
|
-
this.id = id;
|
|
36
|
-
this.name = name;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Device request prompts let you respond to the page requesting for a device
|
|
42
|
-
* through an API like WebBluetooth.
|
|
43
|
-
*
|
|
44
|
-
* @remarks
|
|
45
|
-
* `DeviceRequestPrompt` instances are returned via the
|
|
46
|
-
* {@link Page.waitForDevicePrompt} method.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* const [devicePrompt] = Promise.all([
|
|
52
|
-
* page.waitForDevicePrompt(),
|
|
53
|
-
* page.click('#connect-bluetooth'),
|
|
54
|
-
* ]);
|
|
55
|
-
* await devicePrompt.select(
|
|
56
|
-
* await devicePrompt.waitForDevice(({name}) => name.includes('My Device')),
|
|
57
|
-
* );
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* @public
|
|
18
|
+
* @internal
|
|
61
19
|
*/
|
|
62
|
-
export class DeviceRequestPrompt {
|
|
20
|
+
export class CdpDeviceRequestPrompt extends DeviceRequestPrompt {
|
|
63
21
|
#client: CDPSession | null;
|
|
64
22
|
#timeoutSettings: TimeoutSettings;
|
|
65
23
|
#id: string;
|
|
@@ -70,19 +28,12 @@ export class DeviceRequestPrompt {
|
|
|
70
28
|
promise: Deferred<DeviceRequestPromptDevice>;
|
|
71
29
|
}>();
|
|
72
30
|
|
|
73
|
-
/**
|
|
74
|
-
* Current list of selectable devices.
|
|
75
|
-
*/
|
|
76
|
-
devices: DeviceRequestPromptDevice[] = [];
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
31
|
constructor(
|
|
82
32
|
client: CDPSession,
|
|
83
33
|
timeoutSettings: TimeoutSettings,
|
|
84
34
|
firstEvent: Protocol.DeviceAccess.DeviceRequestPromptedEvent,
|
|
85
35
|
) {
|
|
36
|
+
super();
|
|
86
37
|
this.#client = client;
|
|
87
38
|
this.#timeoutSettings = timeoutSettings;
|
|
88
39
|
this.#id = firstEvent.id;
|
|
@@ -112,10 +63,7 @@ export class DeviceRequestPrompt {
|
|
|
112
63
|
continue;
|
|
113
64
|
}
|
|
114
65
|
|
|
115
|
-
const newDevice =
|
|
116
|
-
rawDevice.id,
|
|
117
|
-
rawDevice.name,
|
|
118
|
-
);
|
|
66
|
+
const newDevice = {id: rawDevice.id, name: rawDevice.name};
|
|
119
67
|
this.devices.push(newDevice);
|
|
120
68
|
|
|
121
69
|
for (const waitForDevicePromise of this.#waitForDevicePromises) {
|
|
@@ -126,9 +74,6 @@ export class DeviceRequestPrompt {
|
|
|
126
74
|
}
|
|
127
75
|
}
|
|
128
76
|
|
|
129
|
-
/**
|
|
130
|
-
* Resolve to the first device in the prompt matching a filter.
|
|
131
|
-
*/
|
|
132
77
|
async waitForDevice(
|
|
133
78
|
filter: (device: DeviceRequestPromptDevice) => boolean,
|
|
134
79
|
options: WaitTimeoutOptions = {},
|
|
@@ -164,9 +109,6 @@ export class DeviceRequestPrompt {
|
|
|
164
109
|
}
|
|
165
110
|
}
|
|
166
111
|
|
|
167
|
-
/**
|
|
168
|
-
* Select a device in the prompt's list.
|
|
169
|
-
*/
|
|
170
112
|
async select(device: DeviceRequestPromptDevice): Promise<void> {
|
|
171
113
|
assert(
|
|
172
114
|
this.#client !== null,
|
|
@@ -188,9 +130,6 @@ export class DeviceRequestPrompt {
|
|
|
188
130
|
});
|
|
189
131
|
}
|
|
190
132
|
|
|
191
|
-
/**
|
|
192
|
-
* Cancel the prompt.
|
|
193
|
-
*/
|
|
194
133
|
async cancel(): Promise<void> {
|
|
195
134
|
assert(
|
|
196
135
|
this.#client !== null,
|
|
@@ -212,14 +151,11 @@ export class DeviceRequestPrompt {
|
|
|
212
151
|
/**
|
|
213
152
|
* @internal
|
|
214
153
|
*/
|
|
215
|
-
export class
|
|
154
|
+
export class CdpDeviceRequestPromptManager {
|
|
216
155
|
#client: CDPSession | null;
|
|
217
156
|
#timeoutSettings: TimeoutSettings;
|
|
218
157
|
#deviceRequestPromptDeferreds = new Set<Deferred<DeviceRequestPrompt>>();
|
|
219
158
|
|
|
220
|
-
/**
|
|
221
|
-
* @internal
|
|
222
|
-
*/
|
|
223
159
|
constructor(client: CDPSession, timeoutSettings: TimeoutSettings) {
|
|
224
160
|
this.#client = client;
|
|
225
161
|
this.#timeoutSettings = timeoutSettings;
|
|
@@ -232,10 +168,6 @@ export class DeviceRequestPromptManager {
|
|
|
232
168
|
});
|
|
233
169
|
}
|
|
234
170
|
|
|
235
|
-
/**
|
|
236
|
-
* Wait for device prompt created by an action like calling WebBluetooth's
|
|
237
|
-
* requestDevice.
|
|
238
|
-
*/
|
|
239
171
|
async waitForDevicePrompt(
|
|
240
172
|
options: WaitTimeoutOptions = {},
|
|
241
173
|
): Promise<DeviceRequestPrompt> {
|
|
@@ -277,9 +209,6 @@ export class DeviceRequestPromptManager {
|
|
|
277
209
|
}
|
|
278
210
|
}
|
|
279
211
|
|
|
280
|
-
/**
|
|
281
|
-
* @internal
|
|
282
|
-
*/
|
|
283
212
|
#onDeviceRequestPrompted(
|
|
284
213
|
event: Protocol.DeviceAccess.DeviceRequestPromptedEvent,
|
|
285
214
|
) {
|
|
@@ -288,7 +217,7 @@ export class DeviceRequestPromptManager {
|
|
|
288
217
|
}
|
|
289
218
|
|
|
290
219
|
assert(this.#client !== null);
|
|
291
|
-
const devicePrompt = new
|
|
220
|
+
const devicePrompt = new CdpDeviceRequestPrompt(
|
|
292
221
|
this.#client,
|
|
293
222
|
this.#timeoutSettings,
|
|
294
223
|
event,
|
|
@@ -66,6 +66,11 @@ interface JavascriptEnabledState {
|
|
|
66
66
|
active: boolean;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
interface FocusState {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
active: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
/**
|
|
70
75
|
* @internal
|
|
71
76
|
*/
|
|
@@ -193,6 +198,14 @@ export class EmulationManager implements ClientProvider {
|
|
|
193
198
|
this,
|
|
194
199
|
this.#setJavaScriptEnabled,
|
|
195
200
|
);
|
|
201
|
+
#focusState = new EmulatedState<FocusState>(
|
|
202
|
+
{
|
|
203
|
+
enabled: true,
|
|
204
|
+
active: false,
|
|
205
|
+
},
|
|
206
|
+
this,
|
|
207
|
+
this.#emulateFocus,
|
|
208
|
+
);
|
|
196
209
|
|
|
197
210
|
#secondaryClients = new Set<CDPSession>();
|
|
198
211
|
|
|
@@ -578,4 +591,21 @@ export class EmulationManager implements ClientProvider {
|
|
|
578
591
|
javaScriptEnabled: enabled,
|
|
579
592
|
});
|
|
580
593
|
}
|
|
594
|
+
|
|
595
|
+
@invokeAtMostOnceForArguments
|
|
596
|
+
async #emulateFocus(client: CDPSession, state: FocusState): Promise<void> {
|
|
597
|
+
if (!state.active) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
await client.send('Emulation.setFocusEmulationEnabled', {
|
|
601
|
+
enabled: state.enabled,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
async emulateFocus(enabled: boolean): Promise<void> {
|
|
606
|
+
await this.#focusState.setState({
|
|
607
|
+
active: true,
|
|
608
|
+
enabled,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
581
611
|
}
|
|
@@ -68,7 +68,10 @@ export class ExtensionTransport implements ConnectionTransport {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
#dispatchResponse(message: object): void {
|
|
71
|
-
|
|
71
|
+
// Dispatch in a new task like other transports.
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
this.onmessage?.(JSON.stringify(message));
|
|
74
|
+
}, 0);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
send(message: string): void {
|
|
@@ -125,6 +128,7 @@ export class ExtensionTransport implements ConnectionTransport {
|
|
|
125
128
|
if (parsed.sessionId === 'tabTargetSessionId') {
|
|
126
129
|
this.#dispatchResponse({
|
|
127
130
|
method: 'Target.attachedToTarget',
|
|
131
|
+
sessionId: 'tabTargetSessionId',
|
|
128
132
|
params: {
|
|
129
133
|
targetInfo: pageTargetInfo,
|
|
130
134
|
sessionId: 'pageTargetSessionId',
|
package/src/cdp/Frame.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type {Protocol} from 'devtools-protocol';
|
|
8
8
|
|
|
9
9
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
10
|
+
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
10
11
|
import type {ElementHandle} from '../api/ElementHandle.js';
|
|
11
12
|
import type {WaitForOptions} from '../api/Frame.js';
|
|
12
13
|
import {Frame, FrameEvent, throwIfDetached} from '../api/Frame.js';
|
|
@@ -21,10 +22,7 @@ import {isErrorLike} from '../util/ErrorLike.js';
|
|
|
21
22
|
import {Accessibility} from './Accessibility.js';
|
|
22
23
|
import type {Binding} from './Binding.js';
|
|
23
24
|
import type {CdpPreloadScript} from './CdpPreloadScript.js';
|
|
24
|
-
import type {
|
|
25
|
-
DeviceRequestPrompt,
|
|
26
|
-
DeviceRequestPromptManager,
|
|
27
|
-
} from './DeviceRequestPrompt.js';
|
|
25
|
+
import type {CdpDeviceRequestPromptManager} from './DeviceRequestPrompt.js';
|
|
28
26
|
import type {FrameManager} from './FrameManager.js';
|
|
29
27
|
import {FrameManagerEvent} from './FrameManagerEvents.js';
|
|
30
28
|
import type {IsolatedWorldChart} from './IsolatedWorld.js';
|
|
@@ -317,7 +315,7 @@ export class CdpFrame extends Frame {
|
|
|
317
315
|
return this._frameManager._frameTree.childFrames(this._id);
|
|
318
316
|
}
|
|
319
317
|
|
|
320
|
-
#deviceRequestPromptManager():
|
|
318
|
+
#deviceRequestPromptManager(): CdpDeviceRequestPromptManager {
|
|
321
319
|
return this._frameManager._deviceRequestPromptManager(this.#client);
|
|
322
320
|
}
|
|
323
321
|
|
package/src/cdp/FrameManager.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type {Binding} from './Binding.js';
|
|
|
21
21
|
import {CdpPreloadScript} from './CdpPreloadScript.js';
|
|
22
22
|
import type {CdpCDPSession} from './CdpSession.js';
|
|
23
23
|
import {isTargetClosedError} from './Connection.js';
|
|
24
|
-
import {
|
|
24
|
+
import {CdpDeviceRequestPromptManager} from './DeviceRequestPrompt.js';
|
|
25
25
|
import {ExecutionContext} from './ExecutionContext.js';
|
|
26
26
|
import {CdpFrame} from './Frame.js';
|
|
27
27
|
import type {FrameManagerEvents} from './FrameManagerEvents.js';
|
|
@@ -60,7 +60,7 @@ export class FrameManager extends EventEmitter<FrameManagerEvents> {
|
|
|
60
60
|
|
|
61
61
|
#deviceRequestPromptManagerMap = new WeakMap<
|
|
62
62
|
CDPSession,
|
|
63
|
-
|
|
63
|
+
CdpDeviceRequestPromptManager
|
|
64
64
|
>();
|
|
65
65
|
|
|
66
66
|
#frameTreeHandled?: Deferred<void>;
|
|
@@ -380,10 +380,15 @@ export class FrameManager extends EventEmitter<FrameManagerEvents> {
|
|
|
380
380
|
void this.initialize(target._session()!, frame);
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
_deviceRequestPromptManager(
|
|
383
|
+
_deviceRequestPromptManager(
|
|
384
|
+
client: CDPSession,
|
|
385
|
+
): CdpDeviceRequestPromptManager {
|
|
384
386
|
let manager = this.#deviceRequestPromptManagerMap.get(client);
|
|
385
387
|
if (manager === undefined) {
|
|
386
|
-
manager = new
|
|
388
|
+
manager = new CdpDeviceRequestPromptManager(
|
|
389
|
+
client,
|
|
390
|
+
this.#timeoutSettings,
|
|
391
|
+
);
|
|
387
392
|
this.#deviceRequestPromptManagerMap.set(client, manager);
|
|
388
393
|
}
|
|
389
394
|
return manager;
|
package/src/cdp/HTTPRequest.ts
CHANGED
|
@@ -100,7 +100,11 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
100
100
|
|
|
101
101
|
this.interception.enabled = allowInterception;
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
this.updateHeaders(data.request.headers);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
updateHeaders(headers: Protocol.Network.Headers): void {
|
|
107
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
104
108
|
this.#headers[key.toLowerCase()] = value;
|
|
105
109
|
}
|
|
106
110
|
}
|
|
@@ -83,7 +83,10 @@ export class NetworkEventManager {
|
|
|
83
83
|
Protocol.Fetch.RequestPausedEvent
|
|
84
84
|
>();
|
|
85
85
|
#httpRequestsMap = new Map<NetworkRequestId, CdpHTTPRequest>();
|
|
86
|
-
|
|
86
|
+
#requestWillBeSentExtraInfoMap = new Map<
|
|
87
|
+
NetworkRequestId,
|
|
88
|
+
Protocol.Network.RequestWillBeSentExtraInfoEvent[]
|
|
89
|
+
>();
|
|
87
90
|
/*
|
|
88
91
|
* The below maps are used to reconcile Network.responseReceivedExtraInfo
|
|
89
92
|
* events with their corresponding request. Each response and redirect
|
|
@@ -103,11 +106,23 @@ export class NetworkEventManager {
|
|
|
103
106
|
forget(networkRequestId: NetworkRequestId): void {
|
|
104
107
|
this.#requestWillBeSentMap.delete(networkRequestId);
|
|
105
108
|
this.#requestPausedMap.delete(networkRequestId);
|
|
109
|
+
this.#requestWillBeSentExtraInfoMap.delete(networkRequestId);
|
|
106
110
|
this.#queuedEventGroupMap.delete(networkRequestId);
|
|
107
111
|
this.#queuedRedirectInfoMap.delete(networkRequestId);
|
|
108
112
|
this.#responseReceivedExtraInfoMap.delete(networkRequestId);
|
|
109
113
|
}
|
|
110
114
|
|
|
115
|
+
requestExtraInfo(
|
|
116
|
+
networkRequestId: NetworkRequestId,
|
|
117
|
+
): Protocol.Network.RequestWillBeSentExtraInfoEvent[] {
|
|
118
|
+
if (!this.#requestWillBeSentExtraInfoMap.has(networkRequestId)) {
|
|
119
|
+
this.#requestWillBeSentExtraInfoMap.set(networkRequestId, []);
|
|
120
|
+
}
|
|
121
|
+
return this.#requestWillBeSentExtraInfoMap.get(
|
|
122
|
+
networkRequestId,
|
|
123
|
+
) as Protocol.Network.RequestWillBeSentExtraInfoEvent[];
|
|
124
|
+
}
|
|
125
|
+
|
|
111
126
|
responseExtraInfo(
|
|
112
127
|
networkRequestId: NetworkRequestId,
|
|
113
128
|
): Protocol.Network.ResponseReceivedExtraInfoEvent[] {
|
|
@@ -88,6 +88,7 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
88
88
|
['Fetch.requestPaused', this.#onRequestPaused],
|
|
89
89
|
['Fetch.authRequired', this.#onAuthRequired],
|
|
90
90
|
['Network.requestWillBeSent', this.#onRequestWillBeSent],
|
|
91
|
+
['Network.requestWillBeSentExtraInfo', this.#onRequestWillBeSentExtraInfo],
|
|
91
92
|
['Network.requestServedFromCache', this.#onRequestServedFromCache],
|
|
92
93
|
['Network.responseReceived', this.#onResponseReceived],
|
|
93
94
|
['Network.loadingFinished', this.#onLoadingFinished],
|
|
@@ -108,7 +109,9 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
108
109
|
#canIgnoreError(error: unknown) {
|
|
109
110
|
return (
|
|
110
111
|
isErrorLike(error) &&
|
|
111
|
-
(isTargetClosedError(error) ||
|
|
112
|
+
(isTargetClosedError(error) ||
|
|
113
|
+
error.message.includes('Not supported') ||
|
|
114
|
+
error.message.includes("wasn't found"))
|
|
112
115
|
);
|
|
113
116
|
}
|
|
114
117
|
|
|
@@ -534,6 +537,13 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
534
537
|
redirectResponseExtraInfo,
|
|
535
538
|
);
|
|
536
539
|
redirectChain = request._redirectChain;
|
|
540
|
+
|
|
541
|
+
const extraInfo = this.#networkEventManager
|
|
542
|
+
.requestExtraInfo(event.requestId)
|
|
543
|
+
.shift();
|
|
544
|
+
if (extraInfo) {
|
|
545
|
+
request.updateHeaders(extraInfo.headers);
|
|
546
|
+
}
|
|
537
547
|
}
|
|
538
548
|
}
|
|
539
549
|
const frame = event.frameId
|
|
@@ -548,12 +558,32 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
548
558
|
event,
|
|
549
559
|
redirectChain,
|
|
550
560
|
);
|
|
561
|
+
|
|
562
|
+
const extraInfo = this.#networkEventManager
|
|
563
|
+
.requestExtraInfo(event.requestId)
|
|
564
|
+
.shift();
|
|
565
|
+
if (extraInfo) {
|
|
566
|
+
request.updateHeaders(extraInfo.headers);
|
|
567
|
+
}
|
|
568
|
+
|
|
551
569
|
request._fromMemoryCache = fromMemoryCache;
|
|
552
570
|
this.#networkEventManager.storeRequest(event.requestId, request);
|
|
553
571
|
this.emit(NetworkManagerEvent.Request, request);
|
|
554
572
|
void request.finalizeInterceptions();
|
|
555
573
|
}
|
|
556
574
|
|
|
575
|
+
#onRequestWillBeSentExtraInfo(
|
|
576
|
+
_client: CDPSession,
|
|
577
|
+
event: Protocol.Network.RequestWillBeSentExtraInfoEvent,
|
|
578
|
+
): void {
|
|
579
|
+
const request = this.#networkEventManager.getRequest(event.requestId);
|
|
580
|
+
if (request) {
|
|
581
|
+
request.updateHeaders(event.headers);
|
|
582
|
+
} else {
|
|
583
|
+
this.#networkEventManager.requestExtraInfo(event.requestId).push(event);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
557
587
|
#onRequestServedFromCache(
|
|
558
588
|
client: CDPSession,
|
|
559
589
|
event: Protocol.Network.RequestServedFromCacheEvent,
|
package/src/cdp/Page.ts
CHANGED
|
@@ -7,14 +7,16 @@
|
|
|
7
7
|
import type {Protocol} from 'devtools-protocol';
|
|
8
8
|
|
|
9
9
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type {BluetoothEmulation} from '../api/BluetoothEmulation.js';
|
|
11
|
+
import type {Browser, WindowId} from '../api/Browser.js';
|
|
11
12
|
import type {BrowserContext} from '../api/BrowserContext.js';
|
|
12
13
|
import {CDPSessionEvent, type CDPSession} from '../api/CDPSession.js';
|
|
14
|
+
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
13
15
|
import type {ElementHandle} from '../api/ElementHandle.js';
|
|
14
16
|
import type {Frame, WaitForOptions} from '../api/Frame.js';
|
|
15
17
|
import type {HTTPResponse} from '../api/HTTPResponse.js';
|
|
16
18
|
import type {JSHandle} from '../api/JSHandle.js';
|
|
17
|
-
import type {Credentials} from '../api/Page.js';
|
|
19
|
+
import type {Credentials, ReloadOptions} from '../api/Page.js';
|
|
18
20
|
import {
|
|
19
21
|
Page,
|
|
20
22
|
PageEvent,
|
|
@@ -58,10 +60,11 @@ import {AsyncDisposableStack} from '../util/disposable.js';
|
|
|
58
60
|
import {isErrorLike} from '../util/ErrorLike.js';
|
|
59
61
|
|
|
60
62
|
import {Binding} from './Binding.js';
|
|
63
|
+
import {CdpBluetoothEmulation} from './BluetoothEmulation.js';
|
|
64
|
+
import type {CdpBrowser} from './Browser.js';
|
|
61
65
|
import {CdpCDPSession} from './CdpSession.js';
|
|
62
66
|
import {isTargetClosedError} from './Connection.js';
|
|
63
67
|
import {Coverage} from './Coverage.js';
|
|
64
|
-
import type {DeviceRequestPrompt} from './DeviceRequestPrompt.js';
|
|
65
68
|
import {CdpDialog} from './Dialog.js';
|
|
66
69
|
import {EmulationManager} from './EmulationManager.js';
|
|
67
70
|
import type {CdpFrame} from './Frame.js';
|
|
@@ -119,6 +122,7 @@ export class CdpPage extends Page {
|
|
|
119
122
|
|
|
120
123
|
#closed = false;
|
|
121
124
|
readonly #targetManager: TargetManager;
|
|
125
|
+
readonly #cdpBluetoothEmulation: CdpBluetoothEmulation;
|
|
122
126
|
|
|
123
127
|
#primaryTargetClient: CdpCDPSession;
|
|
124
128
|
#primaryTarget: CdpTarget;
|
|
@@ -158,6 +162,12 @@ export class CdpPage extends Page {
|
|
|
158
162
|
this.#coverage = new Coverage(client);
|
|
159
163
|
this.#viewport = null;
|
|
160
164
|
|
|
165
|
+
// Use browser context's connection, as current Bluetooth emulation in Chromium is
|
|
166
|
+
// implemented on the browser context level, and not tight to the specific tab.
|
|
167
|
+
this.#cdpBluetoothEmulation = new CdpBluetoothEmulation(
|
|
168
|
+
this.#primaryTargetClient.connection(),
|
|
169
|
+
);
|
|
170
|
+
|
|
161
171
|
const frameManagerEmitter = new EventEmitter(this.#frameManager);
|
|
162
172
|
frameManagerEmitter.on(FrameManagerEvent.FrameAttached, frame => {
|
|
163
173
|
this.emit(PageEvent.FrameAttached, frame);
|
|
@@ -365,17 +375,22 @@ export class CdpPage extends Page {
|
|
|
365
375
|
contentWidth: number;
|
|
366
376
|
contentHeight: number;
|
|
367
377
|
}): Promise<void> {
|
|
368
|
-
const
|
|
369
|
-
'Browser.getWindowForTarget',
|
|
370
|
-
);
|
|
371
|
-
|
|
378
|
+
const windowId = await this.windowId();
|
|
372
379
|
await this.#primaryTargetClient.send('Browser.setContentsSize', {
|
|
373
|
-
windowId,
|
|
380
|
+
windowId: Number(windowId),
|
|
374
381
|
width: params.contentWidth,
|
|
375
382
|
height: params.contentHeight,
|
|
376
383
|
});
|
|
377
384
|
}
|
|
378
385
|
|
|
386
|
+
override async windowId(): Promise<WindowId> {
|
|
387
|
+
const {windowId} = await this.#primaryTargetClient.send(
|
|
388
|
+
'Browser.getWindowForTarget',
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
return windowId.toString();
|
|
392
|
+
}
|
|
393
|
+
|
|
379
394
|
async #onFileChooser(
|
|
380
395
|
event: Protocol.Page.FileChooserOpenedEvent,
|
|
381
396
|
): Promise<void> {
|
|
@@ -417,6 +432,13 @@ export class CdpPage extends Page {
|
|
|
417
432
|
return this.#emulationManager.javascriptEnabled;
|
|
418
433
|
}
|
|
419
434
|
|
|
435
|
+
override async openDevTools(): Promise<Page> {
|
|
436
|
+
const pageTargetId = this.target()._targetId;
|
|
437
|
+
const browser = this.browser() as CdpBrowser;
|
|
438
|
+
const devtoolsPage = await browser._createDevToolsPage(pageTargetId);
|
|
439
|
+
return devtoolsPage;
|
|
440
|
+
}
|
|
441
|
+
|
|
420
442
|
override async waitForFileChooser(
|
|
421
443
|
options: WaitTimeoutOptions = {},
|
|
422
444
|
): Promise<FileChooser> {
|
|
@@ -480,7 +502,8 @@ export class CdpPage extends Page {
|
|
|
480
502
|
}
|
|
481
503
|
|
|
482
504
|
#onLogEntryAdded(event: Protocol.Log.EntryAddedEvent): void {
|
|
483
|
-
const {level, text, args, source, url, lineNumber} =
|
|
505
|
+
const {level, text, args, source, url, lineNumber, stackTrace} =
|
|
506
|
+
event.entry;
|
|
484
507
|
if (args) {
|
|
485
508
|
args.map(arg => {
|
|
486
509
|
void releaseObject(this.#primaryTargetClient, arg);
|
|
@@ -494,6 +517,8 @@ export class CdpPage extends Page {
|
|
|
494
517
|
text,
|
|
495
518
|
[],
|
|
496
519
|
[{url, lineNumber}],
|
|
520
|
+
undefined,
|
|
521
|
+
stackTrace,
|
|
497
522
|
),
|
|
498
523
|
);
|
|
499
524
|
}
|
|
@@ -560,6 +585,10 @@ export class CdpPage extends Page {
|
|
|
560
585
|
);
|
|
561
586
|
}
|
|
562
587
|
|
|
588
|
+
override async emulateFocusedPage(enabled: boolean): Promise<void> {
|
|
589
|
+
return await this.#emulationManager.emulateFocus(enabled);
|
|
590
|
+
}
|
|
591
|
+
|
|
563
592
|
override setDefaultNavigationTimeout(timeout: number): void {
|
|
564
593
|
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
|
565
594
|
}
|
|
@@ -883,6 +912,8 @@ export class CdpPage extends Page {
|
|
|
883
912
|
textTokens.join(' '),
|
|
884
913
|
args,
|
|
885
914
|
stackTraceLocations,
|
|
915
|
+
undefined,
|
|
916
|
+
stackTrace,
|
|
886
917
|
);
|
|
887
918
|
this.emit(PageEvent.Console, message);
|
|
888
919
|
}
|
|
@@ -898,15 +929,15 @@ export class CdpPage extends Page {
|
|
|
898
929
|
this.emit(PageEvent.Dialog, dialog);
|
|
899
930
|
}
|
|
900
931
|
|
|
901
|
-
override async reload(
|
|
902
|
-
options?: WaitForOptions,
|
|
903
|
-
): Promise<HTTPResponse | null> {
|
|
932
|
+
override async reload(options?: ReloadOptions): Promise<HTTPResponse | null> {
|
|
904
933
|
const [result] = await Promise.all([
|
|
905
934
|
this.waitForNavigation({
|
|
906
935
|
...options,
|
|
907
936
|
ignoreSameDocumentNavigation: true,
|
|
908
937
|
}),
|
|
909
|
-
this.#primaryTargetClient.send('Page.reload'
|
|
938
|
+
this.#primaryTargetClient.send('Page.reload', {
|
|
939
|
+
ignoreCache: options?.ignoreCache ?? false,
|
|
940
|
+
}),
|
|
910
941
|
]);
|
|
911
942
|
|
|
912
943
|
return result;
|
|
@@ -1219,6 +1250,10 @@ export class CdpPage extends Page {
|
|
|
1219
1250
|
): Promise<DeviceRequestPrompt> {
|
|
1220
1251
|
return await this.mainFrame().waitForDevicePrompt(options);
|
|
1221
1252
|
}
|
|
1253
|
+
|
|
1254
|
+
override get bluetooth(): BluetoothEmulation {
|
|
1255
|
+
return this.#cdpBluetoothEmulation;
|
|
1256
|
+
}
|
|
1222
1257
|
}
|
|
1223
1258
|
|
|
1224
1259
|
const supportedMetrics = new Set<string>([
|