brave-real-puppeteer-core 24.25.0 → 24.33.0-patch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/advanced-stealth.js +1 -1
- package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
- package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/api/Browser.d.ts +111 -2
- package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Browser.js +4 -2
- package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/api/BrowserContext.d.ts +5 -3
- package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +38 -0
- package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/cjs/puppeteer/api/Frame.d.ts +1 -1
- package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Frame.js +4 -4
- package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/cjs/puppeteer/api/Page.d.ts +41 -7
- package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/lib/cjs/puppeteer/api/api.d.ts +2 -0
- package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/lib/cjs/puppeteer/api/api.js +1 -0
- package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
- package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/bidi/Browser.d.ts +6 -1
- package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Browser.js +36 -14
- package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
- package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +3 -3
- package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/BrowserContext.js +6 -3
- package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
- package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.js +19 -2
- package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
- package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
- package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
- package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js +2 -29
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/Page.d.ts +10 -8
- package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Page.js +63 -47
- package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +55 -2
- package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Request.js +30 -4
- package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/util.js +7 -0
- package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +10 -0
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.js +30 -3
- package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
- package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/lib/cjs/puppeteer/cdp/Browser.d.ts +10 -5
- package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Browser.js +61 -8
- package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
- package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +3 -2
- package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/BrowserContext.js +4 -4
- package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
- package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
- package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
- package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +10 -76
- package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/lib/cjs/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js +6 -2
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/lib/cjs/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.js +25 -1
- package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Page.d.ts +9 -4
- package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Page.js +30 -7
- package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/TargetManager.js +29 -27
- package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
- package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/BrowserConnector.js +47 -3
- package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
- package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +22 -0
- package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
- package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
- package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
- package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
- package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
- package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/lib/cjs/puppeteer/revisions.js +3 -3
- package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/lib/cjs/puppeteer/util/disposable.d.ts +2 -2
- package/lib/cjs/puppeteer/util/disposable.d.ts.map +1 -1
- package/lib/cjs/puppeteer/util/disposable.js +3 -1
- package/lib/cjs/puppeteer/util/disposable.js.map +1 -1
- package/lib/cjs/puppeteer/util/util.d.ts +1 -0
- package/lib/cjs/puppeteer/util/util.d.ts.map +1 -1
- package/lib/cjs/puppeteer/util/util.js +1 -0
- package/lib/cjs/puppeteer/util/util.js.map +1 -1
- package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/lib/cjs/puppeteer/util/version.js +1 -1
- package/lib/es5-iife/puppeteer-core-browser.d.ts +304 -22
- package/lib/es5-iife/puppeteer-core-browser.js +484 -224
- package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
- package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/api/Browser.d.ts +111 -2
- package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Browser.js +4 -2
- package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/lib/esm/puppeteer/api/BrowserContext.d.ts +5 -3
- package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +62 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +34 -0
- package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -0
- package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/ElementHandle.js +1 -1
- package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/esm/puppeteer/api/Frame.d.ts +1 -1
- package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Frame.js +4 -4
- package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/lib/esm/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/esm/puppeteer/api/Input.d.ts +1 -1
- package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Page.d.ts +41 -7
- package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/lib/esm/puppeteer/api/api.d.ts +2 -0
- package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/lib/esm/puppeteer/api/api.js +1 -0
- package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
- package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/bidi/Browser.d.ts +6 -1
- package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Browser.js +36 -14
- package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
- package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +3 -3
- package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/BrowserContext.js +6 -3
- package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
- package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.js +19 -2
- package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
- package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
- package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Frame.js +3 -2
- package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.js +2 -29
- package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/bidi/Page.d.ts +10 -8
- package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Page.js +64 -48
- package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +8 -0
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +55 -2
- package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Realm.d.ts +1 -12
- package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.js +31 -5
- package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/util.js +7 -0
- package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts +10 -0
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.js +30 -3
- package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
- package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/lib/esm/puppeteer/cdp/Browser.d.ts +10 -5
- package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Browser.js +61 -8
- package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
- package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +3 -2
- package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/BrowserContext.js +4 -4
- package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
- package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
- package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Connection.js +11 -2
- package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +5 -64
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +7 -72
- package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.js +5 -1
- package/lib/esm/puppeteer/cdp/ExtensionTransport.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Frame.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
- package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.js +6 -2
- package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/lib/esm/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.js +25 -1
- package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Page.d.ts +9 -4
- package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Page.js +30 -7
- package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/TargetManager.js +30 -28
- package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
- package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/lib/esm/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/BrowserConnector.js +48 -4
- package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
- package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/lib/esm/puppeteer/common/ConnectOptions.d.ts +22 -0
- package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +8 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
- package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
- package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
- package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
- package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
- package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/lib/esm/puppeteer/revisions.js +3 -3
- package/lib/esm/puppeteer/util/disposable.d.ts +2 -2
- package/lib/esm/puppeteer/util/disposable.d.ts.map +1 -1
- package/lib/esm/puppeteer/util/disposable.js +2 -2
- package/lib/esm/puppeteer/util/disposable.js.map +1 -1
- package/lib/esm/puppeteer/util/util.d.ts +1 -0
- package/lib/esm/puppeteer/util/util.d.ts.map +1 -1
- package/lib/esm/puppeteer/util/util.js +1 -0
- package/lib/esm/puppeteer/util/util.js.map +1 -1
- package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/lib/esm/puppeteer/util/version.js +1 -1
- package/lib/types.d.ts +304 -22
- package/package.json +15 -15
- package/src/api/BluetoothEmulation.ts +103 -0
- package/src/api/Browser.ts +130 -3
- package/src/api/BrowserContext.ts +10 -3
- package/src/api/CDPSession.ts +1 -2
- package/src/api/DeviceRequestPrompt.ts +71 -0
- package/src/api/ElementHandle.ts +3 -5
- package/src/api/Frame.ts +7 -9
- package/src/api/HTTPRequest.ts +1 -1
- package/src/api/Page.ts +48 -11
- package/src/api/api.ts +2 -0
- package/src/bidi/BidiOverCdp.ts +1 -0
- package/src/bidi/BluetoothEmulation.ts +52 -0
- package/src/bidi/Browser.ts +52 -14
- package/src/bidi/BrowserConnector.ts +8 -1
- package/src/bidi/BrowserContext.ts +9 -6
- package/src/bidi/Connection.ts +20 -1
- package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/src/bidi/Frame.ts +7 -3
- package/src/bidi/HTTPRequest.ts +2 -45
- package/src/bidi/Page.ts +86 -71
- package/src/bidi/core/BrowsingContext.ts +80 -2
- package/src/bidi/core/Connection.ts +3 -2
- package/src/bidi/core/Request.ts +35 -5
- package/src/bidi/util.ts +8 -0
- package/src/cdp/Accessibility.ts +45 -4
- package/src/cdp/BluetoothEmulation.ts +47 -0
- package/src/cdp/Browser.ts +95 -10
- package/src/cdp/BrowserConnector.ts +4 -0
- package/src/cdp/BrowserContext.ts +5 -4
- package/src/cdp/CdpSession.ts +3 -2
- package/src/cdp/Connection.ts +15 -1
- package/src/cdp/DeviceRequestPrompt.ts +8 -79
- package/src/cdp/EmulationManager.ts +30 -0
- package/src/cdp/ExecutionContext.ts +6 -2
- package/src/cdp/ExtensionTransport.ts +5 -1
- package/src/cdp/Frame.ts +3 -5
- package/src/cdp/FrameManager.ts +9 -4
- package/src/cdp/HTTPRequest.ts +7 -2
- package/src/cdp/HTTPResponse.ts +1 -1
- package/src/cdp/JSHandle.ts +1 -1
- package/src/cdp/NetworkEventManager.ts +16 -1
- package/src/cdp/NetworkManager.ts +31 -1
- package/src/cdp/Page.ts +49 -14
- package/src/cdp/TargetManager.ts +36 -43
- package/src/cdp/WebWorker.ts +8 -3
- package/src/cdp/cdp.ts +1 -0
- package/src/cdp/utils.ts +2 -2
- package/src/common/BrowserConnector.ts +67 -4
- package/src/common/CallbackRegistry.ts +7 -5
- package/src/common/ConnectOptions.ts +28 -0
- package/src/common/ConsoleMessage.ts +14 -0
- package/src/common/EventEmitter.ts +3 -3
- package/src/node/BrowserLauncher.ts +22 -1
- package/src/node/ChromeLauncher.ts +5 -17
- package/src/node/LaunchOptions.ts +23 -7
- package/src/revisions.ts +3 -3
- package/src/util/disposable.ts +2 -2
- package/src/util/util.ts +1 -0
- package/src/util/version.ts +1 -1
- package/src/templates/version.ts.tmpl +0 -4
|
@@ -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
|
}
|
|
@@ -859,7 +888,7 @@ export class CdpPage extends Page {
|
|
|
859
888
|
}
|
|
860
889
|
const textTokens = [];
|
|
861
890
|
// eslint-disable-next-line max-len -- The comment is long.
|
|
862
|
-
// eslint-disable-next-line
|
|
891
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
863
892
|
for (const arg of args) {
|
|
864
893
|
const remoteObject = arg.remoteObject();
|
|
865
894
|
if (remoteObject.objectId) {
|
|
@@ -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>([
|
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
package/src/cdp/utils.ts
CHANGED
|
@@ -94,7 +94,7 @@ const getErrorDetails = (details: Protocol.Runtime.ExceptionDetails) => {
|
|
|
94
94
|
*/
|
|
95
95
|
export function createClientError(
|
|
96
96
|
details: Protocol.Runtime.ExceptionDetails,
|
|
97
|
-
): Error {
|
|
97
|
+
): Error | unknown {
|
|
98
98
|
let name: string;
|
|
99
99
|
let message: string;
|
|
100
100
|
if (!details.exception) {
|
|
@@ -141,7 +141,7 @@ export function createClientError(
|
|
|
141
141
|
*/
|
|
142
142
|
export function valueFromRemoteObject(
|
|
143
143
|
remoteObject: Protocol.Runtime.RemoteObject,
|
|
144
|
-
):
|
|
144
|
+
): unknown {
|
|
145
145
|
assert(!remoteObject.objectId, 'Cannot extract value when objectId is given');
|
|
146
146
|
if (remoteObject.unserializableValue) {
|
|
147
147
|
if (remoteObject.type === 'bigint') {
|
|
@@ -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
|
|