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
package/src/cdp/TargetManager.ts
CHANGED
|
@@ -15,7 +15,8 @@ import {Deferred} from '../util/Deferred.js';
|
|
|
15
15
|
|
|
16
16
|
import {CdpCDPSession} from './CdpSession.js';
|
|
17
17
|
import type {Connection} from './Connection.js';
|
|
18
|
-
import {CdpTarget
|
|
18
|
+
import type {CdpTarget} from './Target.js';
|
|
19
|
+
import {InitializationStatus} from './Target.js';
|
|
19
20
|
import type {TargetManagerEvents} from './TargetManageEvents.js';
|
|
20
21
|
import {TargetManagerEvent} from './TargetManageEvents.js';
|
|
21
22
|
|
|
@@ -90,10 +91,20 @@ export class TargetManager
|
|
|
90
91
|
>();
|
|
91
92
|
|
|
92
93
|
#initializeDeferred = Deferred.create<void>();
|
|
93
|
-
#targetsIdsForInit = new Set<string>();
|
|
94
94
|
#waitForInitiallyDiscoveredTargets = true;
|
|
95
95
|
|
|
96
96
|
#discoveryFilter: Protocol.Target.FilterEntry[] = [{}];
|
|
97
|
+
// IDs of tab targets detected while running the initial Target.setAutoAttach
|
|
98
|
+
// request. These are the targets whose initialization we want to await for
|
|
99
|
+
// before resolving puppeteer.connect() or launch() to avoid flakiness.
|
|
100
|
+
// Whenever a sub-target whose parent is a tab target is attached, we remove
|
|
101
|
+
// the tab target from this list. Once the list is empty, we resolve the
|
|
102
|
+
// initializeDeferred.
|
|
103
|
+
#targetsIdsForInit = new Set<string>();
|
|
104
|
+
// This is false until the connection-level Target.setAutoAttach request is
|
|
105
|
+
// done. It indicates whethere we are running the initial auto-attach step or
|
|
106
|
+
// if we are handling targets after that.
|
|
107
|
+
#initialAttachDone = false;
|
|
97
108
|
|
|
98
109
|
constructor(
|
|
99
110
|
connection: Connection,
|
|
@@ -117,45 +128,12 @@ export class TargetManager
|
|
|
117
128
|
this.#setupAttachmentListeners(this.#connection);
|
|
118
129
|
}
|
|
119
130
|
|
|
120
|
-
#storeExistingTargetsForInit = () => {
|
|
121
|
-
if (!this.#waitForInitiallyDiscoveredTargets) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
for (const [
|
|
125
|
-
targetId,
|
|
126
|
-
targetInfo,
|
|
127
|
-
] of this.#discoveredTargetsByTargetId.entries()) {
|
|
128
|
-
const targetForFilter = new CdpTarget(
|
|
129
|
-
targetInfo,
|
|
130
|
-
undefined,
|
|
131
|
-
undefined,
|
|
132
|
-
this,
|
|
133
|
-
undefined,
|
|
134
|
-
);
|
|
135
|
-
// Only wait for pages and frames (except those from extensions)
|
|
136
|
-
// to auto-attach.
|
|
137
|
-
const isPageOrFrame =
|
|
138
|
-
targetInfo.type === 'page' || targetInfo.type === 'iframe';
|
|
139
|
-
const isExtension = targetInfo.url.startsWith('chrome-extension://');
|
|
140
|
-
if (
|
|
141
|
-
(!this.#targetFilterCallback ||
|
|
142
|
-
this.#targetFilterCallback(targetForFilter)) &&
|
|
143
|
-
isPageOrFrame &&
|
|
144
|
-
!isExtension
|
|
145
|
-
) {
|
|
146
|
-
this.#targetsIdsForInit.add(targetId);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
|
|
151
131
|
async initialize(): Promise<void> {
|
|
152
132
|
await this.#connection.send('Target.setDiscoverTargets', {
|
|
153
133
|
discover: true,
|
|
154
134
|
filter: this.#discoveryFilter,
|
|
155
135
|
});
|
|
156
136
|
|
|
157
|
-
this.#storeExistingTargetsForInit();
|
|
158
|
-
|
|
159
137
|
await this.#connection.send('Target.setAutoAttach', {
|
|
160
138
|
waitForDebuggerOnStart: true,
|
|
161
139
|
flatten: true,
|
|
@@ -168,6 +146,7 @@ export class TargetManager
|
|
|
168
146
|
...this.#discoveryFilter,
|
|
169
147
|
],
|
|
170
148
|
});
|
|
149
|
+
this.#initialAttachDone = true;
|
|
171
150
|
this.#finishInitializationIfReady();
|
|
172
151
|
await this.#initializeDeferred.valueOrThrow();
|
|
173
152
|
}
|
|
@@ -346,7 +325,6 @@ export class TargetManager
|
|
|
346
325
|
// should determine if a target is auto-attached or not with the help of
|
|
347
326
|
// CDP.
|
|
348
327
|
if (targetInfo.type === 'service_worker') {
|
|
349
|
-
this.#finishInitializationIfReady(targetInfo.targetId);
|
|
350
328
|
await silentDetach();
|
|
351
329
|
if (this.#attachedTargetsByTargetId.has(targetInfo.targetId)) {
|
|
352
330
|
return;
|
|
@@ -370,13 +348,26 @@ export class TargetManager
|
|
|
370
348
|
parentSession instanceof CdpCDPSession ? parentSession : undefined,
|
|
371
349
|
);
|
|
372
350
|
|
|
351
|
+
const parentTarget =
|
|
352
|
+
parentSession instanceof CdpCDPSession ? parentSession.target() : null;
|
|
353
|
+
|
|
373
354
|
if (this.#targetFilterCallback && !this.#targetFilterCallback(target)) {
|
|
374
355
|
this.#ignoredTargets.add(targetInfo.targetId);
|
|
375
|
-
|
|
356
|
+
if (parentTarget?.type() === 'tab') {
|
|
357
|
+
this.#finishInitializationIfReady(parentTarget._targetId);
|
|
358
|
+
}
|
|
376
359
|
await silentDetach();
|
|
377
360
|
return;
|
|
378
361
|
}
|
|
379
362
|
|
|
363
|
+
if (
|
|
364
|
+
this.#waitForInitiallyDiscoveredTargets &&
|
|
365
|
+
event.targetInfo.type === 'tab' &&
|
|
366
|
+
!this.#initialAttachDone
|
|
367
|
+
) {
|
|
368
|
+
this.#targetsIdsForInit.add(event.targetInfo.targetId);
|
|
369
|
+
}
|
|
370
|
+
|
|
380
371
|
this.#setupAttachmentListeners(session);
|
|
381
372
|
|
|
382
373
|
if (isExistingTarget) {
|
|
@@ -391,19 +382,16 @@ export class TargetManager
|
|
|
391
382
|
this.#attachedTargetsBySessionId.set(session.id(), target);
|
|
392
383
|
}
|
|
393
384
|
|
|
394
|
-
const parentTarget =
|
|
395
|
-
parentSession instanceof CDPSession
|
|
396
|
-
? (parentSession as CdpCDPSession).target()
|
|
397
|
-
: null;
|
|
398
385
|
parentTarget?._addChildTarget(target);
|
|
399
386
|
|
|
400
387
|
parentSession.emit(CDPSessionEvent.Ready, session);
|
|
401
388
|
|
|
402
|
-
this.#targetsIdsForInit.delete(target._targetId);
|
|
403
389
|
if (!isExistingTarget) {
|
|
404
390
|
this.emit(TargetManagerEvent.TargetAvailable, target);
|
|
405
391
|
}
|
|
406
|
-
|
|
392
|
+
if (parentTarget?.type() === 'tab') {
|
|
393
|
+
this.#finishInitializationIfReady(parentTarget._targetId);
|
|
394
|
+
}
|
|
407
395
|
|
|
408
396
|
// TODO: the browser might be shutting down here. What do we do with the
|
|
409
397
|
// error?
|
|
@@ -422,6 +410,11 @@ export class TargetManager
|
|
|
422
410
|
if (targetId !== undefined) {
|
|
423
411
|
this.#targetsIdsForInit.delete(targetId);
|
|
424
412
|
}
|
|
413
|
+
// If we are still initializing it might be that we have not learned about
|
|
414
|
+
// some targets yet.
|
|
415
|
+
if (!this.#initialAttachDone) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
425
418
|
if (this.#targetsIdsForInit.size === 0) {
|
|
426
419
|
this.#initializeDeferred.resolve();
|
|
427
420
|
}
|
package/src/cdp/WebWorker.ts
CHANGED
|
@@ -114,9 +114,8 @@ export class CdpWebWorker extends WebWorker {
|
|
|
114
114
|
|
|
115
115
|
override async close(): Promise<void> {
|
|
116
116
|
switch (this.#targetType) {
|
|
117
|
-
case TargetType.SERVICE_WORKER:
|
|
118
|
-
|
|
119
|
-
// For service and shared workers we need to close the target and detach to allow
|
|
117
|
+
case TargetType.SERVICE_WORKER: {
|
|
118
|
+
// For service workers we need to close the target and detach to allow
|
|
120
119
|
// the worker to stop.
|
|
121
120
|
await this.client.connection()?.send('Target.closeTarget', {
|
|
122
121
|
targetId: this.#id,
|
|
@@ -126,6 +125,12 @@ export class CdpWebWorker extends WebWorker {
|
|
|
126
125
|
});
|
|
127
126
|
break;
|
|
128
127
|
}
|
|
128
|
+
case TargetType.SHARED_WORKER: {
|
|
129
|
+
await this.client.connection()?.send('Target.closeTarget', {
|
|
130
|
+
targetId: this.#id,
|
|
131
|
+
});
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
129
134
|
default:
|
|
130
135
|
await this.evaluate(() => {
|
|
131
136
|
self.close();
|
package/src/cdp/cdp.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type {Browser} from '../api/Browser.js';
|
|
8
8
|
import {_connectToBiDiBrowser} from '../bidi/BrowserConnector.js';
|
|
9
9
|
import {_connectToCdpBrowser} from '../cdp/BrowserConnector.js';
|
|
10
|
-
import {isNode} from '../environment.js';
|
|
10
|
+
import {environment, isNode} from '../environment.js';
|
|
11
11
|
import {assert} from '../util/assert.js';
|
|
12
12
|
import {isErrorLike} from '../util/ErrorLike.js';
|
|
13
13
|
|
|
@@ -57,12 +57,21 @@ export async function _connectToBrowser(
|
|
|
57
57
|
async function getConnectionTransport(
|
|
58
58
|
options: ConnectOptions,
|
|
59
59
|
): Promise<{connectionTransport: ConnectionTransport; endpointUrl: string}> {
|
|
60
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
browserWSEndpoint,
|
|
62
|
+
browserURL,
|
|
63
|
+
channel,
|
|
64
|
+
transport,
|
|
65
|
+
headers = {},
|
|
66
|
+
} = options;
|
|
61
67
|
|
|
62
68
|
assert(
|
|
63
|
-
Number(!!browserWSEndpoint) +
|
|
69
|
+
Number(!!browserWSEndpoint) +
|
|
70
|
+
Number(!!browserURL) +
|
|
71
|
+
Number(!!transport) +
|
|
72
|
+
Number(!!channel) ===
|
|
64
73
|
1,
|
|
65
|
-
'Exactly one of browserWSEndpoint, browserURL or
|
|
74
|
+
'Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to puppeteer.connect',
|
|
66
75
|
);
|
|
67
76
|
|
|
68
77
|
if (transport) {
|
|
@@ -84,6 +93,60 @@ async function getConnectionTransport(
|
|
|
84
93
|
connectionTransport: connectionTransport,
|
|
85
94
|
endpointUrl: connectionURL,
|
|
86
95
|
};
|
|
96
|
+
} else if (options.channel && isNode) {
|
|
97
|
+
const {detectBrowserPlatform, resolveDefaultUserDataDir, Browser} =
|
|
98
|
+
await import('@puppeteer/browsers');
|
|
99
|
+
const platform = detectBrowserPlatform();
|
|
100
|
+
if (!platform) {
|
|
101
|
+
throw new Error('Could not detect required browser platform');
|
|
102
|
+
}
|
|
103
|
+
const {convertPuppeteerChannelToBrowsersChannel} =
|
|
104
|
+
await import('../node/LaunchOptions.js');
|
|
105
|
+
const {join} = await import('node:path');
|
|
106
|
+
const userDataDir = resolveDefaultUserDataDir(
|
|
107
|
+
Browser.CHROME,
|
|
108
|
+
platform,
|
|
109
|
+
convertPuppeteerChannelToBrowsersChannel(options.channel),
|
|
110
|
+
);
|
|
111
|
+
const portPath = join(userDataDir, 'DevToolsActivePort');
|
|
112
|
+
try {
|
|
113
|
+
const fileContent = await environment.value.fs.promises.readFile(
|
|
114
|
+
portPath,
|
|
115
|
+
'ascii',
|
|
116
|
+
);
|
|
117
|
+
const [rawPort, rawPath] = fileContent
|
|
118
|
+
.split('\n')
|
|
119
|
+
.map(line => {
|
|
120
|
+
return line.trim();
|
|
121
|
+
})
|
|
122
|
+
.filter(line => {
|
|
123
|
+
return !!line;
|
|
124
|
+
});
|
|
125
|
+
if (!rawPort || !rawPath) {
|
|
126
|
+
throw new Error(`Invalid DevToolsActivePort '${fileContent}' found`);
|
|
127
|
+
}
|
|
128
|
+
const port = parseInt(rawPort, 10);
|
|
129
|
+
if (isNaN(port) || port <= 0 || port > 65535) {
|
|
130
|
+
throw new Error(`Invalid port '${rawPort}' found`);
|
|
131
|
+
}
|
|
132
|
+
const browserWSEndpoint = `ws://localhost:${port}${rawPath}`;
|
|
133
|
+
const WebSocketClass = await getWebSocketTransportClass();
|
|
134
|
+
const connectionTransport = await WebSocketClass.create(
|
|
135
|
+
browserWSEndpoint,
|
|
136
|
+
headers,
|
|
137
|
+
);
|
|
138
|
+
return {
|
|
139
|
+
connectionTransport: connectionTransport,
|
|
140
|
+
endpointUrl: browserWSEndpoint,
|
|
141
|
+
};
|
|
142
|
+
} catch (error) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`Could not find DevToolsActivePort for ${options.channel} at ${portPath}`,
|
|
145
|
+
{
|
|
146
|
+
cause: error,
|
|
147
|
+
},
|
|
148
|
+
);
|
|
149
|
+
}
|
|
87
150
|
}
|
|
88
151
|
throw new Error('Invalid connection options');
|
|
89
152
|
}
|
|
@@ -6,21 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
import {Deferred} from '../util/Deferred.js';
|
|
8
8
|
import {rewriteError} from '../util/ErrorLike.js';
|
|
9
|
-
import {
|
|
9
|
+
import type {GetIdFn} from '../util/incremental-id-generator.js';
|
|
10
10
|
|
|
11
11
|
import {ProtocolError, TargetCloseError} from './Errors.js';
|
|
12
12
|
import {debugError} from './util.js';
|
|
13
13
|
|
|
14
|
-
const idGenerator = createIncrementalIdGenerator();
|
|
15
|
-
|
|
16
14
|
/**
|
|
17
15
|
* Manages callbacks and their IDs for the protocol request/response communication.
|
|
18
16
|
*
|
|
19
17
|
* @internal
|
|
20
18
|
*/
|
|
21
19
|
export class CallbackRegistry {
|
|
22
|
-
#callbacks = new Map<number, Callback>();
|
|
23
|
-
#idGenerator
|
|
20
|
+
readonly #callbacks = new Map<number, Callback>();
|
|
21
|
+
readonly #idGenerator: GetIdFn;
|
|
22
|
+
|
|
23
|
+
constructor(idGenerator: GetIdFn) {
|
|
24
|
+
this.#idGenerator = idGenerator;
|
|
25
|
+
}
|
|
24
26
|
|
|
25
27
|
create(
|
|
26
28
|
label: string,
|
|
@@ -38,6 +38,15 @@ export interface SupportedWebDriverCapabilities {
|
|
|
38
38
|
alwaysMatch?: SupportedWebDriverCapability;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export type ChromeReleaseChannel =
|
|
45
|
+
| 'chrome'
|
|
46
|
+
| 'chrome-beta'
|
|
47
|
+
| 'chrome-canary'
|
|
48
|
+
| 'chrome-dev';
|
|
49
|
+
|
|
41
50
|
/**
|
|
42
51
|
* Generic browser options that can be passed when launching any browser or when
|
|
43
52
|
* connecting to an existing browser instance.
|
|
@@ -49,6 +58,17 @@ export interface ConnectOptions {
|
|
|
49
58
|
* @defaultValue `false`
|
|
50
59
|
*/
|
|
51
60
|
acceptInsecureCerts?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If specified, puppeteer looks for an open WebSocket at the well-known
|
|
63
|
+
* default user data directory for the specified channel and attempts to
|
|
64
|
+
* connect to it using ws://localhost:$ActivePort/devtools/browser. Only works
|
|
65
|
+
* for Chrome and when run in Node.js.
|
|
66
|
+
*
|
|
67
|
+
* This option is experimental when used with puppeteer.connect().
|
|
68
|
+
*
|
|
69
|
+
* @experimental
|
|
70
|
+
*/
|
|
71
|
+
channel?: ChromeReleaseChannel;
|
|
52
72
|
/**
|
|
53
73
|
* Experimental setting to disable monitoring network events by default. When
|
|
54
74
|
* set to `false`, parts of Puppeteer that depend on network events would not
|
|
@@ -112,6 +132,14 @@ export interface ConnectOptions {
|
|
|
112
132
|
browserWSEndpoint?: string;
|
|
113
133
|
browserURL?: string;
|
|
114
134
|
transport?: ConnectionTransport;
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*
|
|
138
|
+
* Custom ID generator for CDP / BiDi messages. Useful if the same transport
|
|
139
|
+
* is shared for multiple connections.
|
|
140
|
+
*/
|
|
141
|
+
idGenerator?: () => number;
|
|
142
|
+
|
|
115
143
|
/**
|
|
116
144
|
* Headers to use for the web socket connection.
|
|
117
145
|
* @remarks
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type {Protocol} from 'devtools-protocol';
|
|
8
|
+
|
|
7
9
|
import type {Frame} from '../api/Frame.js';
|
|
8
10
|
import type {JSHandle} from '../api/JSHandle.js';
|
|
9
11
|
|
|
@@ -62,6 +64,7 @@ export class ConsoleMessage {
|
|
|
62
64
|
#args: JSHandle[];
|
|
63
65
|
#stackTraceLocations: ConsoleMessageLocation[];
|
|
64
66
|
#frame?: Frame;
|
|
67
|
+
#rawStackTrace?: Protocol.Runtime.StackTrace;
|
|
65
68
|
|
|
66
69
|
/**
|
|
67
70
|
* @internal
|
|
@@ -72,12 +75,14 @@ export class ConsoleMessage {
|
|
|
72
75
|
args: JSHandle[],
|
|
73
76
|
stackTraceLocations: ConsoleMessageLocation[],
|
|
74
77
|
frame?: Frame,
|
|
78
|
+
rawStackTrace?: Protocol.Runtime.StackTrace,
|
|
75
79
|
) {
|
|
76
80
|
this.#type = type;
|
|
77
81
|
this.#text = text;
|
|
78
82
|
this.#args = args;
|
|
79
83
|
this.#stackTraceLocations = stackTraceLocations;
|
|
80
84
|
this.#frame = frame;
|
|
85
|
+
this.#rawStackTrace = rawStackTrace;
|
|
81
86
|
}
|
|
82
87
|
|
|
83
88
|
/**
|
|
@@ -117,4 +122,13 @@ export class ConsoleMessage {
|
|
|
117
122
|
stackTrace(): ConsoleMessageLocation[] {
|
|
118
123
|
return this.#stackTraceLocations;
|
|
119
124
|
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The underlying protocol stack trace if available.
|
|
128
|
+
*
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
_rawStackTrace(): Protocol.Runtime.StackTrace | undefined {
|
|
132
|
+
return this.#rawStackTrace;
|
|
133
|
+
}
|
|
120
134
|
}
|
|
@@ -56,9 +56,9 @@ export type EventsWithWildcard<Events extends Record<EventType, unknown>> =
|
|
|
56
56
|
*
|
|
57
57
|
* @public
|
|
58
58
|
*/
|
|
59
|
-
export class EventEmitter<
|
|
60
|
-
|
|
61
|
-
{
|
|
59
|
+
export class EventEmitter<
|
|
60
|
+
Events extends Record<EventType, unknown>,
|
|
61
|
+
> implements CommonEventEmitter<EventsWithWildcard<Events>> {
|
|
62
62
|
#emitter: Emitter<EventsWithWildcard<Events>> | EventEmitter<Events>;
|
|
63
63
|
#handlers = new Map<keyof Events | '*', Array<Handler<any>>>();
|
|
64
64
|
|
|
@@ -30,6 +30,10 @@ import {TimeoutError} from '../common/Errors.js';
|
|
|
30
30
|
import type {SupportedBrowser} from '../common/SupportedBrowser.js';
|
|
31
31
|
import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
|
|
32
32
|
import type {Viewport} from '../common/Viewport.js';
|
|
33
|
+
import {
|
|
34
|
+
createIncrementalIdGenerator,
|
|
35
|
+
type GetIdFn,
|
|
36
|
+
} from '../util/incremental-id-generator.js';
|
|
33
37
|
|
|
34
38
|
import type {ChromeReleaseChannel, LaunchOptions} from './LaunchOptions.js';
|
|
35
39
|
import {NodeWebSocketTransport as WebSocketTransport} from './NodeWebSocketTransport.js';
|
|
@@ -88,6 +92,7 @@ export abstract class BrowserLauncher {
|
|
|
88
92
|
waitForInitialPage = true,
|
|
89
93
|
protocolTimeout,
|
|
90
94
|
handleDevToolsAsPage,
|
|
95
|
+
idGenerator = createIncrementalIdGenerator(),
|
|
91
96
|
} = options;
|
|
92
97
|
|
|
93
98
|
let {protocol} = options;
|
|
@@ -166,6 +171,7 @@ export abstract class BrowserLauncher {
|
|
|
166
171
|
defaultViewport,
|
|
167
172
|
acceptInsecureCerts,
|
|
168
173
|
networkEnabled,
|
|
174
|
+
idGenerator,
|
|
169
175
|
},
|
|
170
176
|
);
|
|
171
177
|
} else {
|
|
@@ -174,12 +180,14 @@ export abstract class BrowserLauncher {
|
|
|
174
180
|
timeout,
|
|
175
181
|
protocolTimeout,
|
|
176
182
|
slowMo,
|
|
183
|
+
idGenerator,
|
|
177
184
|
});
|
|
178
185
|
} else {
|
|
179
186
|
cdpConnection = await this.createCdpSocketConnection(browserProcess, {
|
|
180
187
|
timeout,
|
|
181
188
|
protocolTimeout,
|
|
182
189
|
slowMo,
|
|
190
|
+
idGenerator,
|
|
183
191
|
});
|
|
184
192
|
}
|
|
185
193
|
|
|
@@ -342,6 +350,7 @@ export abstract class BrowserLauncher {
|
|
|
342
350
|
timeout: number;
|
|
343
351
|
protocolTimeout: number | undefined;
|
|
344
352
|
slowMo: number;
|
|
353
|
+
idGenerator: GetIdFn;
|
|
345
354
|
},
|
|
346
355
|
): Promise<Connection> {
|
|
347
356
|
const browserWSEndpoint = await browserProcess.waitForLineOutput(
|
|
@@ -354,6 +363,8 @@ export abstract class BrowserLauncher {
|
|
|
354
363
|
transport,
|
|
355
364
|
opts.slowMo,
|
|
356
365
|
opts.protocolTimeout,
|
|
366
|
+
/* rawErrors */ false,
|
|
367
|
+
opts.idGenerator,
|
|
357
368
|
);
|
|
358
369
|
}
|
|
359
370
|
|
|
@@ -366,6 +377,7 @@ export abstract class BrowserLauncher {
|
|
|
366
377
|
timeout: number;
|
|
367
378
|
protocolTimeout: number | undefined;
|
|
368
379
|
slowMo: number;
|
|
380
|
+
idGenerator: GetIdFn;
|
|
369
381
|
},
|
|
370
382
|
): Promise<Connection> {
|
|
371
383
|
// stdio was assigned during start(), and the 'pipe' option there adds the
|
|
@@ -375,7 +387,14 @@ export abstract class BrowserLauncher {
|
|
|
375
387
|
pipeWrite as NodeJS.WritableStream,
|
|
376
388
|
pipeRead as NodeJS.ReadableStream,
|
|
377
389
|
);
|
|
378
|
-
return new Connection(
|
|
390
|
+
return new Connection(
|
|
391
|
+
'',
|
|
392
|
+
transport,
|
|
393
|
+
opts.slowMo,
|
|
394
|
+
opts.protocolTimeout,
|
|
395
|
+
/* rawErrors */ false,
|
|
396
|
+
opts.idGenerator,
|
|
397
|
+
);
|
|
379
398
|
}
|
|
380
399
|
|
|
381
400
|
/**
|
|
@@ -417,6 +436,7 @@ export abstract class BrowserLauncher {
|
|
|
417
436
|
timeout: number;
|
|
418
437
|
protocolTimeout: number | undefined;
|
|
419
438
|
slowMo: number;
|
|
439
|
+
idGenerator: GetIdFn;
|
|
420
440
|
defaultViewport: Viewport | null;
|
|
421
441
|
acceptInsecureCerts?: boolean;
|
|
422
442
|
networkEnabled?: boolean;
|
|
@@ -432,6 +452,7 @@ export abstract class BrowserLauncher {
|
|
|
432
452
|
const bidiConnection = new BiDi.BidiConnection(
|
|
433
453
|
browserWSEndpoint,
|
|
434
454
|
transport,
|
|
455
|
+
opts.idGenerator,
|
|
435
456
|
opts.slowMo,
|
|
436
457
|
opts.protocolTimeout,
|
|
437
458
|
);
|
|
@@ -11,7 +11,6 @@ import path from 'node:path';
|
|
|
11
11
|
import {
|
|
12
12
|
computeSystemExecutablePath,
|
|
13
13
|
Browser as SupportedBrowsers,
|
|
14
|
-
ChromeReleaseChannel as BrowsersChromeReleaseChannel,
|
|
15
14
|
} from '@puppeteer/browsers';
|
|
16
15
|
|
|
17
16
|
import type {Browser} from '../api/Browser.js';
|
|
@@ -19,7 +18,11 @@ import {debugError} from '../common/util.js';
|
|
|
19
18
|
import {assert} from '../util/assert.js';
|
|
20
19
|
|
|
21
20
|
import {BrowserLauncher, type ResolvedLaunchArgs} from './BrowserLauncher.js';
|
|
22
|
-
import
|
|
21
|
+
import {
|
|
22
|
+
convertPuppeteerChannelToBrowsersChannel,
|
|
23
|
+
type ChromeReleaseChannel,
|
|
24
|
+
type LaunchOptions,
|
|
25
|
+
} from './LaunchOptions.js';
|
|
23
26
|
import type {PuppeteerNode} from './PuppeteerNode.js';
|
|
24
27
|
import {rm} from './util/fs.js';
|
|
25
28
|
|
|
@@ -285,21 +288,6 @@ export class ChromeLauncher extends BrowserLauncher {
|
|
|
285
288
|
}
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
function convertPuppeteerChannelToBrowsersChannel(
|
|
289
|
-
channel: ChromeReleaseChannel,
|
|
290
|
-
): BrowsersChromeReleaseChannel {
|
|
291
|
-
switch (channel) {
|
|
292
|
-
case 'chrome':
|
|
293
|
-
return BrowsersChromeReleaseChannel.STABLE;
|
|
294
|
-
case 'chrome-dev':
|
|
295
|
-
return BrowsersChromeReleaseChannel.DEV;
|
|
296
|
-
case 'chrome-beta':
|
|
297
|
-
return BrowsersChromeReleaseChannel.BETA;
|
|
298
|
-
case 'chrome-canary':
|
|
299
|
-
return BrowsersChromeReleaseChannel.CANARY;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
291
|
/**
|
|
304
292
|
* Extracts all features from the given command-line flag
|
|
305
293
|
* (e.g. `--enable-features`, `--enable-features=`).
|
|
@@ -4,17 +4,33 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import {ChromeReleaseChannel as BrowsersChromeReleaseChannel} from '@puppeteer/browsers';
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
ChromeReleaseChannel,
|
|
11
|
+
ConnectOptions,
|
|
12
|
+
} from '../common/ConnectOptions.js';
|
|
8
13
|
import type {SupportedBrowser} from '../common/SupportedBrowser.js';
|
|
9
14
|
|
|
15
|
+
export type {ChromeReleaseChannel};
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
|
-
* @
|
|
18
|
+
* @internal
|
|
12
19
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
export function convertPuppeteerChannelToBrowsersChannel(
|
|
21
|
+
channel: ChromeReleaseChannel,
|
|
22
|
+
): BrowsersChromeReleaseChannel {
|
|
23
|
+
switch (channel) {
|
|
24
|
+
case 'chrome':
|
|
25
|
+
return BrowsersChromeReleaseChannel.STABLE;
|
|
26
|
+
case 'chrome-dev':
|
|
27
|
+
return BrowsersChromeReleaseChannel.DEV;
|
|
28
|
+
case 'chrome-beta':
|
|
29
|
+
return BrowsersChromeReleaseChannel.BETA;
|
|
30
|
+
case 'chrome-canary':
|
|
31
|
+
return BrowsersChromeReleaseChannel.CANARY;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
18
34
|
|
|
19
35
|
/**
|
|
20
36
|
* Generic launch options that can be passed when launching any browser.
|
package/src/revisions.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '
|
|
12
|
-
'chrome-headless-shell': '
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '143.0.7499.42',
|
|
12
|
+
'chrome-headless-shell': '143.0.7499.42',
|
|
13
|
+
firefox: 'stable_146.0',
|
|
14
14
|
});
|
package/src/util/disposable.ts
CHANGED
|
@@ -45,7 +45,7 @@ export const asyncDisposeSymbol: typeof Symbol.asyncDispose =
|
|
|
45
45
|
/**
|
|
46
46
|
* @internal
|
|
47
47
|
*/
|
|
48
|
-
class DisposableStackPolyfill {
|
|
48
|
+
export class DisposableStackPolyfill {
|
|
49
49
|
#disposed = false;
|
|
50
50
|
#stack: Disposable[] = [];
|
|
51
51
|
|
|
@@ -194,7 +194,7 @@ export const DisposableStack: typeof DisposableStackPolyfill =
|
|
|
194
194
|
/**
|
|
195
195
|
* @internal
|
|
196
196
|
*/
|
|
197
|
-
class AsyncDisposableStackPolyfill {
|
|
197
|
+
export class AsyncDisposableStackPolyfill {
|
|
198
198
|
#disposed = false;
|
|
199
199
|
#stack: AsyncDisposable[] = [];
|
|
200
200
|
|
package/src/util/util.ts
CHANGED
package/src/util/version.ts
CHANGED