├── .python-version ├── cdp_use ├── __init__.py ├── generator │ ├── __main__.py │ ├── __init__.py │ ├── constants.py │ └── generate.py └── cdp │ ├── io │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ ├── commands.py │ └── library.py │ ├── pwa │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ └── commands.py │ ├── inspector │ ├── types.py │ ├── commands.py │ ├── __init__.py │ ├── events.py │ ├── library.py │ └── registration.py │ ├── media │ ├── commands.py │ ├── __init__.py │ ├── library.py │ ├── events.py │ └── types.py │ ├── memory │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ └── commands.py │ ├── schema │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ ├── commands.py │ └── library.py │ ├── tethering │ ├── types.py │ ├── __init__.py │ ├── commands.py │ ├── events.py │ ├── registration.py │ └── library.py │ ├── console │ ├── commands.py │ ├── __init__.py │ ├── events.py │ ├── types.py │ ├── registration.py │ └── library.py │ ├── extensions │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ └── commands.py │ ├── filesystem │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── commands.py │ ├── library.py │ └── types.py │ ├── indexeddb │ ├── events.py │ ├── registration.py │ └── __init__.py │ ├── preload │ ├── commands.py │ ├── __init__.py │ └── library.py │ ├── systeminfo │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── commands.py │ └── library.py │ ├── cachestorage │ ├── events.py │ ├── registration.py │ ├── __init__.py │ └── types.py │ ├── domdebugger │ ├── events.py │ ├── registration.py │ ├── __init__.py │ └── types.py │ ├── domsnapshot │ ├── events.py │ ├── registration.py │ └── __init__.py │ ├── deviceorientation │ ├── types.py │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── commands.py │ └── library.py │ ├── eventbreakpoints │ ├── types.py │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── commands.py │ └── library.py │ ├── headlessexperimental │ ├── events.py │ ├── registration.py │ ├── __init__.py │ ├── types.py │ ├── commands.py │ └── library.py │ ├── css │ ├── __init__.py │ └── events.py │ ├── dom │ └── __init__.py │ ├── log │ ├── __init__.py │ ├── events.py │ ├── commands.py │ ├── registration.py │ └── types.py │ ├── audits │ ├── __init__.py │ ├── events.py │ ├── registration.py │ └── commands.py │ ├── cast │ ├── __init__.py │ ├── types.py │ ├── commands.py │ ├── events.py │ └── registration.py │ ├── fedcm │ ├── __init__.py │ ├── events.py │ ├── commands.py │ ├── types.py │ └── registration.py │ ├── fetch │ ├── __init__.py │ ├── registration.py │ └── types.py │ ├── input │ ├── __init__.py │ ├── events.py │ └── registration.py │ ├── page │ └── __init__.py │ ├── target │ ├── __init__.py │ ├── events.py │ └── types.py │ ├── autofill │ ├── __init__.py │ ├── events.py │ ├── commands.py │ ├── registration.py │ └── library.py │ ├── browser │ ├── __init__.py │ ├── events.py │ └── registration.py │ ├── debugger │ └── __init__.py │ ├── network │ └── __init__.py │ ├── overlay │ ├── __init__.py │ └── events.py │ ├── profiler │ ├── __init__.py │ ├── commands.py │ └── events.py │ ├── runtime │ └── __init__.py │ ├── security │ ├── __init__.py │ ├── commands.py │ └── events.py │ ├── storage │ └── __init__.py │ ├── tracing │ ├── __init__.py │ ├── events.py │ ├── registration.py │ └── types.py │ ├── webaudio │ ├── __init__.py │ ├── commands.py │ └── library.py │ ├── webauthn │ ├── __init__.py │ └── events.py │ ├── animation │ ├── __init__.py │ ├── events.py │ └── commands.py │ ├── domstorage │ ├── __init__.py │ ├── types.py │ ├── events.py │ └── commands.py │ ├── emulation │ ├── __init__.py │ ├── events.py │ └── registration.py │ ├── layertree │ ├── __init__.py │ ├── events.py │ └── registration.py │ ├── performance │ ├── __init__.py │ ├── types.py │ ├── events.py │ ├── commands.py │ └── registration.py │ ├── accessibility │ ├── __init__.py │ ├── events.py │ └── registration.py │ ├── deviceaccess │ ├── __init__.py │ ├── commands.py │ ├── types.py │ ├── events.py │ ├── registration.py │ └── library.py │ ├── heapprofiler │ ├── __init__.py │ ├── events.py │ └── types.py │ ├── serviceworker │ ├── __init__.py │ ├── events.py │ ├── commands.py │ ├── types.py │ └── registration.py │ ├── backgroundservice │ ├── __init__.py │ ├── commands.py │ ├── events.py │ ├── types.py │ └── registration.py │ ├── bluetoothemulation │ ├── __init__.py │ └── events.py │ └── performancetimeline │ ├── __init__.py │ ├── events.py │ ├── commands.py │ ├── library.py │ ├── registration.py │ └── types.py ├── .gitignore ├── pyproject.toml ├── LICENSE ├── examples └── basic.py └── simple.py /.python-version: -------------------------------------------------------------------------------- 1 | 3.11 2 | -------------------------------------------------------------------------------- /cdp_use/__init__.py: -------------------------------------------------------------------------------- 1 | from cdp_use.client import CDPClient 2 | 3 | __all__ = ["CDPClient"] 4 | -------------------------------------------------------------------------------- /cdp_use/generator/__main__.py: -------------------------------------------------------------------------------- 1 | """Main entry point for running the CDP generator as a module.""" 2 | 3 | from .generate import main 4 | 5 | if __name__ == "__main__": 6 | main() 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python-generated files 2 | __pycache__/ 3 | *.py[oc] 4 | build/ 5 | dist/ 6 | wheels/ 7 | *.egg-info 8 | 9 | # Virtual environments 10 | .venv 11 | 12 | tmp 13 | 14 | .vscode -------------------------------------------------------------------------------- /cdp_use/generator/__init__.py: -------------------------------------------------------------------------------- 1 | """CDP Generator Package 2 | 3 | Type-safe Python bindings generator for Chrome DevTools Protocol. 4 | """ 5 | 6 | from .generator import CDPGenerator 7 | 8 | __all__ = ["CDPGenerator"] 9 | -------------------------------------------------------------------------------- /cdp_use/cdp/io/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/pwa/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PWA Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/generator/constants.py: -------------------------------------------------------------------------------- 1 | JS_PROTOCOL_FILE = "https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/refs/heads/master/json/js_protocol.json" 2 | 3 | BROWSER_PROTOCOL_FILE = "https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/refs/heads/master/json/browser_protocol.json" 4 | -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain Types""" 6 | 7 | 8 | # No types defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/media/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Media Domain Commands""" 6 | 7 | 8 | # No commands defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/memory/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Memory Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/schema/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain Types""" 6 | 7 | 8 | # No types defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/console/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain Commands""" 6 | 7 | 8 | # No commands defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/extensions/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Extensions Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/indexeddb/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IndexedDB Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/preload/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Preload Domain Commands""" 6 | 7 | 8 | # No commands defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/systeminfo/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP SystemInfo Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/cachestorage/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CacheStorage Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/domdebugger/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMDebugger Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/domsnapshot/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMSnapshot Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain Commands""" 6 | 7 | 8 | # No commands defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/io/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/pwa/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PWA Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain Types""" 6 | 7 | 8 | # No types defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain Types""" 6 | 7 | 8 | # No types defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/memory/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Memory Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/schema/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/indexeddb/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IndexedDB Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/domdebugger/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMDebugger Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/domsnapshot/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMSnapshot Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/extensions/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Extensions Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain Events""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/systeminfo/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP SystemInfo Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/cachestorage/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CacheStorage Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/css/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CSS Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/dom/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOM Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/io/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/log/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Log Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/pwa/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PWA Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/audits/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Audits Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/cast/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Cast Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/fedcm/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FedCm Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/fetch/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Fetch Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/input/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Input Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/media/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Media Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/memory/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Memory Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/page/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Page Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/schema/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/target/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Target Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/autofill/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Autofill Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/browser/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Browser Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/console/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/debugger/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Debugger Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain Event Registration""" 6 | 7 | 8 | # No events defined for this domain -------------------------------------------------------------------------------- /cdp_use/cdp/network/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Network Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/overlay/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Overlay Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/preload/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Preload Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/profiler/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Profiler Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/runtime/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Runtime Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/security/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Security Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/storage/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Storage Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/tracing/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tracing Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/webaudio/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP WebAudio Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/webauthn/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP WebAuthn Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/animation/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Animation Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/domdebugger/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMDebugger Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/domsnapshot/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMSnapshot Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/domstorage/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMStorage Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/emulation/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Emulation Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Extensions Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/indexeddb/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IndexedDB Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/layertree/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP LayerTree Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/performance/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Performance Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/systeminfo/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP SystemInfo Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/accessibility/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Accessibility Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/cachestorage/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CacheStorage Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/heapprofiler/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeapProfiler Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/serviceworker/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP ServiceWorker Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/backgroundservice/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BackgroundService Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/bluetoothemulation/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BluetoothEmulation Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain""" 6 | 7 | from .types import * 8 | from .commands import * 9 | from .events import * 10 | -------------------------------------------------------------------------------- /cdp_use/cdp/extensions/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Extensions Domain Types""" 6 | 7 | from typing_extensions import Literal 8 | 9 | StorageArea = Literal["session", "local", "sync", "managed"] 10 | """Storage areas.""" 11 | -------------------------------------------------------------------------------- /cdp_use/cdp/io/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain Types""" 6 | 7 | 8 | StreamHandle = str 9 | """This is either obtained from another method or specified as `blob:` where 10 | `` is an UUID of a Blob.""" 11 | -------------------------------------------------------------------------------- /cdp_use/cdp/emulation/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Emulation Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | """Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.""" 10 | class VirtualTimeBudgetExpiredEvent(TypedDict): 11 | pass 12 | -------------------------------------------------------------------------------- /cdp_use/cdp/audits/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Audits Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import InspectorIssue 13 | 14 | class IssueAddedEvent(TypedDict): 15 | issue: "InspectorIssue" 16 | -------------------------------------------------------------------------------- /cdp_use/cdp/performance/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Performance Domain Types""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class Metric(TypedDict): 10 | """Run-time execution metric.""" 11 | 12 | name: "str" 13 | """Metric name.""" 14 | value: "float" 15 | """Metric value.""" 16 | -------------------------------------------------------------------------------- /cdp_use/cdp/schema/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain Types""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class Domain(TypedDict): 10 | """Description of the protocol domain.""" 11 | 12 | name: "str" 13 | """Domain name.""" 14 | version: "str" 15 | """Domain version.""" 16 | -------------------------------------------------------------------------------- /cdp_use/cdp/cast/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Cast Domain Types""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | class Sink(TypedDict): 10 | name: "str" 11 | id: "str" 12 | session: "NotRequired[str]" 13 | """Text describing the current session. Present only if there is an active 14 | session on the sink.""" 15 | -------------------------------------------------------------------------------- /cdp_use/cdp/log/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Log Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import LogEntry 13 | 14 | """Issued when new message was logged.""" 15 | class EntryAddedEvent(TypedDict): 16 | entry: "LogEntry" 17 | """The entry.""" 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class BindParameters(TypedDict): 10 | port: "int" 11 | """Port number to bind.""" 12 | 13 | 14 | 15 | 16 | 17 | class UnbindParameters(TypedDict): 18 | port: "int" 19 | """Port number to unbind.""" 20 | 21 | 22 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class SetDeviceOrientationOverrideParameters(TypedDict): 10 | alpha: "float" 11 | """Mock alpha""" 12 | beta: "float" 13 | """Mock beta""" 14 | gamma: "float" 15 | """Mock gamma""" 16 | 17 | 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/schema/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Domain 14 | 15 | class GetDomainsReturns(TypedDict): 16 | domains: "List[Domain]" 17 | """List of supported domains.""" 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | """Informs that port was successfully bound and got a specified connection id.""" 10 | class AcceptedEvent(TypedDict): 11 | port: "int" 12 | """Port number that was successfully bound.""" 13 | connectionId: "str" 14 | """Connection id to be used.""" 15 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "cdp-use" 3 | version = "1.4.3" 4 | description = "Type safe generator/client library for CDP" 5 | readme = "README.md" 6 | requires-python = ">=3.11" 7 | dependencies = [ 8 | "httpx>=0.28.1", 9 | "websockets>=15.0.1", 10 | ] 11 | 12 | [build-system] 13 | requires = ["hatchling"] 14 | build-backend = "hatchling.build" 15 | 16 | [dependency-groups] 17 | dev = [ 18 | "build>=1.2.2.post1", 19 | "ruff>=0.12.2", 20 | ] 21 | 22 | [tool.hatch.build] 23 | include = [ 24 | "cdp_use/**/*.py" 25 | ] 26 | exclude = [ 27 | "cdp_use/generator/*.py" 28 | ] 29 | -------------------------------------------------------------------------------- /cdp_use/cdp/console/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import ConsoleMessage 13 | 14 | """Issued when new console message is added.""" 15 | class MessageAddedEvent(TypedDict): 16 | message: "ConsoleMessage" 17 | """Console message that has been added.""" 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/log/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Log Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import ViolationSetting 14 | 15 | class StartViolationsReportParameters(TypedDict): 16 | config: "List[ViolationSetting]" 17 | """Configuration for violations.""" 18 | 19 | 20 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import TimelineEvent 13 | 14 | """Sent when a performance timeline event is added. See reportPerformanceTimeline method.""" 15 | class TimelineEventAddedEvent(TypedDict): 16 | event: "TimelineEvent" 17 | -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class SetInstrumentationBreakpointParameters(TypedDict): 10 | eventName: "str" 11 | """Instrumentation name to stop on.""" 12 | 13 | 14 | 15 | 16 | 17 | class RemoveInstrumentationBreakpointParameters(TypedDict): 18 | eventName: "str" 19 | """Instrumentation name to stop on.""" 20 | 21 | 22 | -------------------------------------------------------------------------------- /cdp_use/cdp/input/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Input Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import DragData 13 | 14 | """Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to 15 | restore normal drag and drop behavior.""" 16 | class DragInterceptedEvent(TypedDict): 17 | data: "DragData" 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/performance/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Performance Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Metric 14 | 15 | """Current values of the metrics.""" 16 | class MetricsEvent(TypedDict): 17 | metrics: "List[Metric]" 18 | """Current values of the metrics.""" 19 | title: "str" 20 | """Timestamp title.""" 21 | -------------------------------------------------------------------------------- /cdp_use/cdp/webaudio/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP WebAudio Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import ContextRealtimeData 13 | from .types import GraphObjectId 14 | 15 | class GetRealtimeDataParameters(TypedDict): 16 | contextId: "GraphObjectId" 17 | 18 | 19 | class GetRealtimeDataReturns(TypedDict): 20 | realtimeData: "ContextRealtimeData" 21 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import DeviceId 13 | from .types import RequestId 14 | 15 | class SelectPromptParameters(TypedDict): 16 | id: "RequestId" 17 | deviceId: "DeviceId" 18 | 19 | 20 | 21 | 22 | 23 | class CancelPromptParameters(TypedDict): 24 | id: "RequestId" 25 | 26 | 27 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain Types""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | RequestId = str 10 | """Device request id.""" 11 | 12 | 13 | 14 | DeviceId = str 15 | """A device id.""" 16 | 17 | 18 | 19 | class PromptDevice(TypedDict): 20 | """Device information displayed in a user prompt to select a device.""" 21 | 22 | id: "DeviceId" 23 | name: "str" 24 | """Display name as it appears in a device request user prompt.""" 25 | -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import BucketFileSystemLocator 13 | from .types import Directory 14 | 15 | class GetDirectoryParameters(TypedDict): 16 | bucketFileSystemLocator: "BucketFileSystemLocator" 17 | 18 | 19 | class GetDirectoryReturns(TypedDict): 20 | directory: "Directory" 21 | """Returns the directory object at the path.""" 22 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import PromptDevice 14 | from .types import RequestId 15 | 16 | """A device request opened a user prompt to select a device. Respond with the 17 | selectPrompt or cancelPrompt command.""" 18 | class DeviceRequestPromptedEvent(TypedDict): 19 | id: "RequestId" 20 | devices: "List[PromptDevice]" 21 | -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain Types""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class ScreenshotParams(TypedDict, total=False): 10 | """Encoding options for a screenshot.""" 11 | 12 | format: "str" 13 | """Image compression format (defaults to png).""" 14 | quality: "int" 15 | """Compression quality from range [0..100] (jpeg and webp only).""" 16 | optimizeForSpeed: "bool" 17 | """Optimize image encoding for speed, not for resulting size (defaults to false)""" 18 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | class EnableParameters(TypedDict): 11 | eventTypes: "List[str]" 12 | """The types of event to report, as specified in 13 | https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype 14 | The specified filter overrides any previous filters, passing empty 15 | filter disables recording. 16 | Note that not all types exposed to the web platform are currently supported.""" 17 | 18 | 19 | -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | """Fired when remote debugging connection is about to be terminated. Contains detach reason.""" 10 | class DetachedEvent(TypedDict): 11 | reason: "str" 12 | """The reason why connection has been terminated.""" 13 | 14 | 15 | 16 | """Fired when debugging target has crashed""" 17 | class TargetCrashedEvent(TypedDict): 18 | pass 19 | 20 | 21 | 22 | """Fired when debugging target has reloaded after crash""" 23 | class TargetReloadedAfterCrashEvent(TypedDict): 24 | pass 25 | -------------------------------------------------------------------------------- /cdp_use/cdp/cast/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Cast Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | class EnableParameters(TypedDict, total=False): 10 | presentationUrl: "str" 11 | 12 | 13 | 14 | 15 | 16 | class SetSinkToUseParameters(TypedDict): 17 | sinkName: "str" 18 | 19 | 20 | 21 | 22 | 23 | class StartDesktopMirroringParameters(TypedDict): 24 | sinkName: "str" 25 | 26 | 27 | 28 | 29 | 30 | class StartTabMirroringParameters(TypedDict): 31 | sinkName: "str" 32 | 33 | 34 | 35 | 36 | 37 | class StopCastingParameters(TypedDict): 38 | sinkName: "str" 39 | 40 | 41 | -------------------------------------------------------------------------------- /cdp_use/cdp/cast/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Cast Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Sink 14 | 15 | """This is fired whenever the list of available sinks changes. A sink is a 16 | device or a software surface that you can cast to.""" 17 | class SinksUpdatedEvent(TypedDict): 18 | sinks: "List[Sink]" 19 | 20 | 21 | 22 | """This is fired whenever the outstanding issue/error message changes. 23 | |issueMessage| is empty if there is no issue.""" 24 | class IssueUpdatedEvent(TypedDict): 25 | issueMessage: "str" 26 | -------------------------------------------------------------------------------- /cdp_use/cdp/console/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain Types""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | class ConsoleMessage(TypedDict): 10 | """Console message.""" 11 | 12 | source: "str" 13 | """Message source.""" 14 | level: "str" 15 | """Message severity.""" 16 | text: "str" 17 | """Message text.""" 18 | url: "NotRequired[str]" 19 | """URL of the message origin.""" 20 | line: "NotRequired[int]" 21 | """Line number in the resource that generated this message (1-based).""" 22 | column: "NotRequired[int]" 23 | """Column number in the resource that generated this message (1-based).""" 24 | -------------------------------------------------------------------------------- /cdp_use/cdp/layertree/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP LayerTree Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..dom.types import Rect 14 | from .types import Layer 15 | from .types import LayerId 16 | 17 | class LayerPaintedEvent(TypedDict): 18 | layerId: "LayerId" 19 | """The id of the painted layer.""" 20 | clip: "Rect" 21 | """Clip rectangle.""" 22 | 23 | 24 | 25 | class LayerTreeDidChangeEvent(TypedDict, total=False): 26 | layers: "List[Layer]" 27 | """Layer tree, absent if not in the compositing mode.""" 28 | -------------------------------------------------------------------------------- /cdp_use/cdp/autofill/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Autofill Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import AddressUI 14 | from .types import FilledField 15 | 16 | """Emitted when an address form is filled.""" 17 | class AddressFormFilledEvent(TypedDict): 18 | filledFields: "List[FilledField]" 19 | """Information about the fields that were filled""" 20 | addressUi: "AddressUI" 21 | """An UI representation of the address used to fill the form. 22 | Consists of a 2D array where each child represents an address/profile line.""" 23 | -------------------------------------------------------------------------------- /cdp_use/cdp/backgroundservice/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BackgroundService Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import ServiceName 13 | 14 | class StartObservingParameters(TypedDict): 15 | service: "ServiceName" 16 | 17 | 18 | 19 | 20 | 21 | class StopObservingParameters(TypedDict): 22 | service: "ServiceName" 23 | 24 | 25 | 26 | 27 | 28 | class SetRecordingParameters(TypedDict): 29 | shouldRecord: "bool" 30 | service: "ServiceName" 31 | 32 | 33 | 34 | 35 | 36 | class ClearEventsParameters(TypedDict): 37 | service: "ServiceName" 38 | 39 | 40 | -------------------------------------------------------------------------------- /cdp_use/cdp/domstorage/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMStorage Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | SerializedStorageKey = str 11 | 12 | 13 | 14 | class StorageId(TypedDict): 15 | """DOM Storage identifier.""" 16 | 17 | securityOrigin: "NotRequired[str]" 18 | """Security origin for the storage.""" 19 | storageKey: "NotRequired[SerializedStorageKey]" 20 | """Represents a key by which DOM Storage keys its CachedStorageAreas""" 21 | isLocalStorage: "bool" 22 | """Whether the storage is local storage (not session storage).""" 23 | 24 | 25 | 26 | Item = List[str] 27 | """DOM Storage item.""" 28 | -------------------------------------------------------------------------------- /cdp_use/cdp/performance/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Performance Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Metric 14 | 15 | class EnableParameters(TypedDict, total=False): 16 | timeDomain: "str" 17 | """Time domain to use for collecting and reporting duration metrics.""" 18 | 19 | 20 | 21 | 22 | 23 | class SetTimeDomainParameters(TypedDict): 24 | timeDomain: "str" 25 | """Time domain""" 26 | 27 | 28 | 29 | 30 | 31 | class GetMetricsReturns(TypedDict): 32 | metrics: "List[Metric]" 33 | """Current values for run-time metrics.""" 34 | -------------------------------------------------------------------------------- /cdp_use/cdp/serviceworker/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP ServiceWorker Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import ServiceWorkerErrorMessage 14 | from .types import ServiceWorkerRegistration 15 | from .types import ServiceWorkerVersion 16 | 17 | class WorkerErrorReportedEvent(TypedDict): 18 | errorMessage: "ServiceWorkerErrorMessage" 19 | 20 | 21 | 22 | class WorkerRegistrationUpdatedEvent(TypedDict): 23 | registrations: "List[ServiceWorkerRegistration]" 24 | 25 | 26 | 27 | class WorkerVersionUpdatedEvent(TypedDict): 28 | versions: "List[ServiceWorkerVersion]" 29 | -------------------------------------------------------------------------------- /cdp_use/cdp/domstorage/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMStorage Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import StorageId 13 | 14 | class DomStorageItemAddedEvent(TypedDict): 15 | storageId: "StorageId" 16 | key: "str" 17 | newValue: "str" 18 | 19 | 20 | 21 | class DomStorageItemRemovedEvent(TypedDict): 22 | storageId: "StorageId" 23 | key: "str" 24 | 25 | 26 | 27 | class DomStorageItemUpdatedEvent(TypedDict): 28 | storageId: "StorageId" 29 | key: "str" 30 | oldValue: "str" 31 | newValue: "str" 32 | 33 | 34 | 35 | class DomStorageItemsClearedEvent(TypedDict): 36 | storageId: "StorageId" 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/accessibility/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Accessibility Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import AXNode 14 | 15 | """The loadComplete event mirrors the load complete event sent by the browser to assistive 16 | technology when the web page has finished loading.""" 17 | class LoadCompleteEvent(TypedDict): 18 | root: "AXNode" 19 | """New document root node.""" 20 | 21 | 22 | 23 | """The nodesUpdated event is sent every time a previously requested node has changed the in tree.""" 24 | class NodesUpdatedEvent(TypedDict): 25 | nodes: "List[AXNode]" 26 | """Updated node data.""" 27 | -------------------------------------------------------------------------------- /cdp_use/cdp/backgroundservice/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BackgroundService Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import BackgroundServiceEvent 13 | from .types import ServiceName 14 | 15 | """Called when the recording state for the service has been updated.""" 16 | class RecordingStateChangedEvent(TypedDict): 17 | isRecording: "bool" 18 | service: "ServiceName" 19 | 20 | 21 | 22 | """Called with all existing backgroundServiceEvents when enabled, and all new 23 | events afterwards if enabled and recording.""" 24 | class BackgroundServiceEventReceivedEvent(TypedDict): 25 | backgroundServiceEvent: "BackgroundServiceEvent" 26 | -------------------------------------------------------------------------------- /cdp_use/cdp/fedcm/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FedCm Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Account 14 | from .types import DialogType 15 | 16 | class DialogShownEvent(TypedDict): 17 | dialogId: "str" 18 | dialogType: "DialogType" 19 | accounts: "List[Account]" 20 | title: "str" 21 | """These exist primarily so that the caller can verify the 22 | RP context was used appropriately.""" 23 | subtitle: "NotRequired[str]" 24 | 25 | 26 | 27 | """Triggered when a dialog is closed, either by user action, JS abort, 28 | or a command below.""" 29 | class DialogClosedEvent(TypedDict): 30 | dialogId: "str" 31 | -------------------------------------------------------------------------------- /cdp_use/cdp/security/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Security Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import CertificateErrorAction 13 | 14 | class SetIgnoreCertificateErrorsParameters(TypedDict): 15 | ignore: "bool" 16 | """If true, all certificate errors will be ignored.""" 17 | 18 | 19 | 20 | 21 | 22 | class HandleCertificateErrorParameters(TypedDict): 23 | eventId: "int" 24 | """The ID of the event.""" 25 | action: "CertificateErrorAction" 26 | """The action to take on the certificate error.""" 27 | 28 | 29 | 30 | 31 | 32 | class SetOverrideCertificateErrorsParameters(TypedDict): 33 | override: "bool" 34 | """If true, certificate errors will be overridden.""" 35 | 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/domstorage/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMStorage Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Item 14 | from .types import StorageId 15 | 16 | class ClearParameters(TypedDict): 17 | storageId: "StorageId" 18 | 19 | 20 | 21 | 22 | 23 | class GetDOMStorageItemsParameters(TypedDict): 24 | storageId: "StorageId" 25 | 26 | 27 | class GetDOMStorageItemsReturns(TypedDict): 28 | entries: "List[Item]" 29 | 30 | 31 | 32 | class RemoveDOMStorageItemParameters(TypedDict): 33 | storageId: "StorageId" 34 | key: "str" 35 | 36 | 37 | 38 | 39 | 40 | class SetDOMStorageItemParameters(TypedDict): 41 | storageId: "StorageId" 42 | key: "str" 43 | value: "str" 44 | 45 | 46 | -------------------------------------------------------------------------------- /cdp_use/cdp/schema/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Schema Domain Library""" 6 | 7 | from typing import Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import GetDomainsReturns 14 | 15 | class SchemaClient: 16 | """Client for Schema domain commands.""" 17 | 18 | def __init__(self, client: 'CDPClient'): 19 | self._client = client 20 | 21 | async def getDomains( 22 | self, 23 | params: None = None, 24 | session_id: Optional[str] = None, 25 | ) -> "GetDomainsReturns": 26 | """Returns supported domains.""" 27 | return cast("GetDomainsReturns", await self._client.send_raw( 28 | method="Schema.getDomains", 29 | params=params, 30 | session_id=session_id, 31 | )) 32 | 33 | 34 | -------------------------------------------------------------------------------- /cdp_use/cdp/autofill/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Autofill Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..dom.types import BackendNodeId 14 | from ..page.types import FrameId 15 | from .types import Address 16 | from .types import CreditCard 17 | 18 | class TriggerParameters(TypedDict): 19 | fieldId: "BackendNodeId" 20 | """Identifies a field that serves as an anchor for autofill.""" 21 | frameId: "NotRequired[FrameId]" 22 | """Identifies the frame that field belongs to.""" 23 | card: "CreditCard" 24 | """Credit card information to fill out the form. Credit card data is not saved.""" 25 | 26 | 27 | 28 | 29 | 30 | class SetAddressesParameters(TypedDict): 31 | addresses: "List[Address]" 32 | 33 | 34 | -------------------------------------------------------------------------------- /cdp_use/cdp/pwa/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PWA Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import TypedDict 10 | 11 | class FileHandlerAccept(TypedDict): 12 | """The following types are the replica of 13 | https://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67""" 14 | 15 | mediaType: "str" 16 | """New name of the mimetype according to 17 | https://www.iana.org/assignments/media-types/media-types.xhtml""" 18 | fileExtensions: "List[str]" 19 | 20 | 21 | 22 | class FileHandler(TypedDict): 23 | action: "str" 24 | accepts: "List[FileHandlerAccept]" 25 | displayName: "str" 26 | 27 | 28 | 29 | DisplayMode = Literal["standalone", "browser"] 30 | """If user prefers opening the app in browser or an app window.""" 31 | -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain Library""" 6 | 7 | from typing import Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import GetDirectoryParameters 14 | from .commands import GetDirectoryReturns 15 | 16 | class FileSystemClient: 17 | """Client for FileSystem domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def getDirectory( 23 | self, 24 | params: "GetDirectoryParameters", 25 | session_id: Optional[str] = None, 26 | ) -> "GetDirectoryReturns": 27 | return cast("GetDirectoryReturns", await self._client.send_raw( 28 | method="FileSystem.getDirectory", 29 | params=params, 30 | session_id=session_id, 31 | )) 32 | 33 | 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Browser Use 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cdp_use/cdp/animation/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Animation Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import Animation 13 | 14 | """Event for when an animation has been cancelled.""" 15 | class AnimationCanceledEvent(TypedDict): 16 | id: "str" 17 | """Id of the animation that was cancelled.""" 18 | 19 | 20 | 21 | """Event for each animation that has been created.""" 22 | class AnimationCreatedEvent(TypedDict): 23 | id: "str" 24 | """Id of the animation that was created.""" 25 | 26 | 27 | 28 | """Event for animation that has been started.""" 29 | class AnimationStartedEvent(TypedDict): 30 | animation: "Animation" 31 | """Animation that was started.""" 32 | 33 | 34 | 35 | """Event for animation that has been updated.""" 36 | class AnimationUpdatedEvent(TypedDict): 37 | animation: "Animation" 38 | """Animation that was updated.""" 39 | -------------------------------------------------------------------------------- /cdp_use/cdp/audits/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Audits Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import IssueAddedEvent 14 | 15 | class AuditsRegistration: 16 | """Event registration interface for Audits domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Audits" 21 | 22 | def issueAdded( 23 | self, 24 | callback: Callable[['IssueAddedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for issueAdded events. 28 | 29 | Args: 30 | callback: Function to call when event occurs. 31 | Receives (event_data, session_id) as parameters. 32 | """ 33 | self._registry.register("Audits.issueAdded", callback) 34 | 35 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import EnableParameters 14 | 15 | class PerformanceTimelineClient: 16 | """Client for PerformanceTimeline domain commands.""" 17 | 18 | def __init__(self, client: 'CDPClient'): 19 | self._client = client 20 | 21 | async def enable( 22 | self, 23 | params: "EnableParameters", 24 | session_id: Optional[str] = None, 25 | ) -> "Dict[str, Any]": 26 | """Previously buffered events would be reported before method returns. 27 | See also: timelineEventAdded""" 28 | return cast("Dict[str, Any]", await self._client.send_raw( 29 | method="PerformanceTimeline.enable", 30 | params=params, 31 | session_id=session_id, 32 | )) 33 | 34 | 35 | -------------------------------------------------------------------------------- /cdp_use/cdp/log/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Log Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import EntryAddedEvent 14 | 15 | class LogRegistration: 16 | """Event registration interface for Log domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Log" 21 | 22 | def entryAdded( 23 | self, 24 | callback: Callable[['EntryAddedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for entryAdded events. 28 | 29 | Issued when new message was logged. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Log.entryAdded", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/performance/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Performance Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import MetricsEvent 14 | 15 | class PerformanceRegistration: 16 | """Event registration interface for Performance domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Performance" 21 | 22 | def metrics( 23 | self, 24 | callback: Callable[['MetricsEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for metrics events. 28 | 29 | Current values of the metrics. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Performance.metrics", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/console/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import MessageAddedEvent 14 | 15 | class ConsoleRegistration: 16 | """Event registration interface for Console domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Console" 21 | 22 | def messageAdded( 23 | self, 24 | callback: Callable[['MessageAddedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for messageAdded events. 28 | 29 | Issued when new console message is added. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Console.messageAdded", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/autofill/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Autofill Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import AddressFormFilledEvent 14 | 15 | class AutofillRegistration: 16 | """Event registration interface for Autofill domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Autofill" 21 | 22 | def addressFormFilled( 23 | self, 24 | callback: Callable[['AddressFormFilledEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for addressFormFilled events. 28 | 29 | Emitted when an address form is filled. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Autofill.addressFormFilled", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import AcceptedEvent 14 | 15 | class TetheringRegistration: 16 | """Event registration interface for Tethering domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Tethering" 21 | 22 | def accepted( 23 | self, 24 | callback: Callable[['AcceptedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for accepted events. 28 | 29 | Informs that port was successfully bound and got a specified connection id. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Tethering.accepted", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/preload/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Preload Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | 14 | class PreloadClient: 15 | """Client for Preload domain commands.""" 16 | 17 | def __init__(self, client: 'CDPClient'): 18 | self._client = client 19 | 20 | async def enable( 21 | self, 22 | params: None = None, 23 | session_id: Optional[str] = None, 24 | ) -> "Dict[str, Any]": 25 | return cast("Dict[str, Any]", await self._client.send_raw( 26 | method="Preload.enable", 27 | params=params, 28 | session_id=session_id, 29 | )) 30 | 31 | async def disable( 32 | self, 33 | params: None = None, 34 | session_id: Optional[str] = None, 35 | ) -> "Dict[str, Any]": 36 | return cast("Dict[str, Any]", await self._client.send_raw( 37 | method="Preload.disable", 38 | params=params, 39 | session_id=session_id, 40 | )) 41 | 42 | 43 | -------------------------------------------------------------------------------- /cdp_use/cdp/overlay/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Overlay Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..dom.types import BackendNodeId 13 | from ..dom.types import NodeId 14 | from ..page.types import Viewport 15 | 16 | """Fired when the node should be inspected. This happens after call to `setInspectMode` or when 17 | user manually inspects an element.""" 18 | class InspectNodeRequestedEvent(TypedDict): 19 | backendNodeId: "BackendNodeId" 20 | """Id of the node to inspect.""" 21 | 22 | 23 | 24 | """Fired when the node should be highlighted. This happens after call to `setInspectMode`.""" 25 | class NodeHighlightRequestedEvent(TypedDict): 26 | nodeId: "NodeId" 27 | 28 | 29 | 30 | """Fired when user asks to capture screenshot of some area on the page.""" 31 | class ScreenshotRequestedEvent(TypedDict): 32 | viewport: "Viewport" 33 | """Viewport to capture, in device independent pixels (dip).""" 34 | 35 | 36 | 37 | """Fired when user cancels the inspect mode.""" 38 | class InspectModeCanceledEvent(TypedDict): 39 | pass 40 | -------------------------------------------------------------------------------- /cdp_use/cdp/webauthn/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP WebAuthn Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import AuthenticatorId 13 | from .types import Credential 14 | 15 | """Triggered when a credential is added to an authenticator.""" 16 | class CredentialAddedEvent(TypedDict): 17 | authenticatorId: "AuthenticatorId" 18 | credential: "Credential" 19 | 20 | 21 | 22 | """Triggered when a credential is deleted, e.g. through 23 | PublicKeyCredential.signalUnknownCredential().""" 24 | class CredentialDeletedEvent(TypedDict): 25 | authenticatorId: "AuthenticatorId" 26 | credentialId: "str" 27 | 28 | 29 | 30 | """Triggered when a credential is updated, e.g. through 31 | PublicKeyCredential.signalCurrentUserDetails().""" 32 | class CredentialUpdatedEvent(TypedDict): 33 | authenticatorId: "AuthenticatorId" 34 | credential: "Credential" 35 | 36 | 37 | 38 | """Triggered when a credential is used in a webauthn assertion.""" 39 | class CredentialAssertedEvent(TypedDict): 40 | authenticatorId: "AuthenticatorId" 41 | credential: "Credential" 42 | -------------------------------------------------------------------------------- /cdp_use/cdp/input/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Input Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import DragInterceptedEvent 14 | 15 | class InputRegistration: 16 | """Event registration interface for Input domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Input" 21 | 22 | def dragIntercepted( 23 | self, 24 | callback: Callable[['DragInterceptedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for dragIntercepted events. 28 | 29 | Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to 30 | restore normal drag and drop behavior. 31 | 32 | Args: 33 | callback: Function to call when event occurs. 34 | Receives (event_data, session_id) as parameters. 35 | """ 36 | self._registry.register("Input.dragIntercepted", callback) 37 | 38 | -------------------------------------------------------------------------------- /cdp_use/cdp/fedcm/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FedCm Domain Commands""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import AccountUrlType 13 | from .types import DialogButton 14 | 15 | class EnableParameters(TypedDict, total=False): 16 | disableRejectionDelay: "bool" 17 | """Allows callers to disable the promise rejection delay that would 18 | normally happen, if this is unimportant to what's being tested. 19 | (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in)""" 20 | 21 | 22 | 23 | 24 | 25 | class SelectAccountParameters(TypedDict): 26 | dialogId: "str" 27 | accountIndex: "int" 28 | 29 | 30 | 31 | 32 | 33 | class ClickDialogButtonParameters(TypedDict): 34 | dialogId: "str" 35 | dialogButton: "DialogButton" 36 | 37 | 38 | 39 | 40 | 41 | class OpenUrlParameters(TypedDict): 42 | dialogId: "str" 43 | accountIndex: "int" 44 | accountUrlType: "AccountUrlType" 45 | 46 | 47 | 48 | 49 | 50 | class DismissDialogParameters(TypedDict): 51 | dialogId: "str" 52 | triggerCooldown: "NotRequired[bool]" 53 | 54 | 55 | -------------------------------------------------------------------------------- /cdp_use/cdp/filesystem/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FileSystem Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..network.types import TimeSinceEpoch 14 | from ..storage.types import SerializedStorageKey 15 | 16 | class File(TypedDict): 17 | name: "str" 18 | lastModified: "TimeSinceEpoch" 19 | """Timestamp""" 20 | size: "float" 21 | """Size in bytes""" 22 | type: "str" 23 | 24 | 25 | 26 | class Directory(TypedDict): 27 | name: "str" 28 | nestedDirectories: "List[str]" 29 | nestedFiles: "List[File]" 30 | """Files that are directly nested under this directory.""" 31 | 32 | 33 | 34 | class BucketFileSystemLocator(TypedDict): 35 | storageKey: "SerializedStorageKey" 36 | """Storage key""" 37 | bucketName: "NotRequired[str]" 38 | """Bucket name. Not passing a `bucketName` will retrieve the default Bucket. (https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#storage_buckets)""" 39 | pathComponents: "List[str]" 40 | """Path to the directory using each path component as an array item.""" 41 | -------------------------------------------------------------------------------- /cdp_use/cdp/emulation/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Emulation Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import VirtualTimeBudgetExpiredEvent 14 | 15 | class EmulationRegistration: 16 | """Event registration interface for Emulation domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Emulation" 21 | 22 | def virtualTimeBudgetExpired( 23 | self, 24 | callback: Callable[['VirtualTimeBudgetExpiredEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for virtualTimeBudgetExpired events. 28 | 29 | Notification sent after the virtual time budget for the current VirtualTimePolicy has run out. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Emulation.virtualTimeBudgetExpired", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/media/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Media Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | 14 | class MediaClient: 15 | """Client for Media domain commands.""" 16 | 17 | def __init__(self, client: 'CDPClient'): 18 | self._client = client 19 | 20 | async def enable( 21 | self, 22 | params: None = None, 23 | session_id: Optional[str] = None, 24 | ) -> "Dict[str, Any]": 25 | """Enables the Media domain""" 26 | return cast("Dict[str, Any]", await self._client.send_raw( 27 | method="Media.enable", 28 | params=params, 29 | session_id=session_id, 30 | )) 31 | 32 | async def disable( 33 | self, 34 | params: None = None, 35 | session_id: Optional[str] = None, 36 | ) -> "Dict[str, Any]": 37 | """Disables the Media domain.""" 38 | return cast("Dict[str, Any]", await self._client.send_raw( 39 | method="Media.disable", 40 | params=params, 41 | session_id=session_id, 42 | )) 43 | 44 | 45 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import TimelineEventAddedEvent 14 | 15 | class PerformanceTimelineRegistration: 16 | """Event registration interface for PerformanceTimeline domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "PerformanceTimeline" 21 | 22 | def timelineEventAdded( 23 | self, 24 | callback: Callable[['TimelineEventAddedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for timelineEventAdded events. 28 | 29 | Sent when a performance timeline event is added. See reportPerformanceTimeline method. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("PerformanceTimeline.timelineEventAdded", callback) 36 | 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import DeviceRequestPromptedEvent 14 | 15 | class DeviceAccessRegistration: 16 | """Event registration interface for DeviceAccess domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "DeviceAccess" 21 | 22 | def deviceRequestPrompted( 23 | self, 24 | callback: Callable[['DeviceRequestPromptedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for deviceRequestPrompted events. 28 | 29 | A device request opened a user prompt to select a device. Respond with the 30 | selectPrompt or cancelPrompt command. 31 | 32 | Args: 33 | callback: Function to call when event occurs. 34 | Receives (event_data, session_id) as parameters. 35 | """ 36 | self._registry.register("DeviceAccess.deviceRequestPrompted", callback) 37 | 38 | -------------------------------------------------------------------------------- /cdp_use/cdp/fedcm/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FedCm Domain Types""" 6 | 7 | from typing_extensions import Literal 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | LoginState = Literal["SignIn", "SignUp"] 11 | """Whether this is a sign-up or sign-in action for this account, i.e. 12 | whether this account has ever been used to sign in to this RP before.""" 13 | 14 | 15 | 16 | DialogType = Literal["AccountChooser", "AutoReauthn", "ConfirmIdpLogin", "Error"] 17 | """The types of FedCM dialogs.""" 18 | 19 | 20 | 21 | DialogButton = Literal["ConfirmIdpLoginContinue", "ErrorGotIt", "ErrorMoreDetails"] 22 | """The buttons on the FedCM dialog.""" 23 | 24 | 25 | 26 | AccountUrlType = Literal["TermsOfService", "PrivacyPolicy"] 27 | """The URLs that each account has""" 28 | 29 | 30 | 31 | class Account(TypedDict): 32 | """Corresponds to IdentityRequestAccount""" 33 | 34 | accountId: "str" 35 | email: "str" 36 | name: "str" 37 | givenName: "str" 38 | pictureUrl: "str" 39 | idpConfigUrl: "str" 40 | idpLoginUrl: "str" 41 | loginState: "LoginState" 42 | termsOfServiceUrl: "NotRequired[str]" 43 | """These two are only set if the loginState is signUp""" 44 | privacyPolicyUrl: "NotRequired[str]" 45 | -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | 14 | class InspectorClient: 15 | """Client for Inspector domain commands.""" 16 | 17 | def __init__(self, client: 'CDPClient'): 18 | self._client = client 19 | 20 | async def disable( 21 | self, 22 | params: None = None, 23 | session_id: Optional[str] = None, 24 | ) -> "Dict[str, Any]": 25 | """Disables inspector domain notifications.""" 26 | return cast("Dict[str, Any]", await self._client.send_raw( 27 | method="Inspector.disable", 28 | params=params, 29 | session_id=session_id, 30 | )) 31 | 32 | async def enable( 33 | self, 34 | params: None = None, 35 | session_id: Optional[str] = None, 36 | ) -> "Dict[str, Any]": 37 | """Enables inspector domain notifications.""" 38 | return cast("Dict[str, Any]", await self._client.send_raw( 39 | method="Inspector.enable", 40 | params=params, 41 | session_id=session_id, 42 | )) 43 | 44 | 45 | -------------------------------------------------------------------------------- /cdp_use/cdp/systeminfo/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP SystemInfo Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import GPUInfo 14 | from .types import ProcessInfo 15 | 16 | class GetInfoReturns(TypedDict): 17 | gpu: "GPUInfo" 18 | """Information about the GPUs on the system.""" 19 | modelName: "str" 20 | """A platform-dependent description of the model of the machine. On Mac OS, this is, for 21 | example, 'MacBookPro'. Will be the empty string if not supported.""" 22 | modelVersion: "str" 23 | """A platform-dependent description of the version of the machine. On Mac OS, this is, for 24 | example, '10.1'. Will be the empty string if not supported.""" 25 | commandLine: "str" 26 | """The command line string used to launch the browser. Will be the empty string if not 27 | supported.""" 28 | 29 | 30 | 31 | class GetFeatureStateParameters(TypedDict): 32 | featureState: "str" 33 | 34 | 35 | class GetFeatureStateReturns(TypedDict): 36 | featureEnabled: "bool" 37 | 38 | 39 | 40 | class GetProcessInfoReturns(TypedDict): 41 | processInfo: "List[ProcessInfo]" 42 | """An array of process info blocks.""" 43 | -------------------------------------------------------------------------------- /cdp_use/cdp/heapprofiler/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeapProfiler Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | class AddHeapSnapshotChunkEvent(TypedDict): 11 | chunk: "str" 12 | 13 | 14 | 15 | """If heap objects tracking has been started then backend may send update for one or more fragments""" 16 | class HeapStatsUpdateEvent(TypedDict): 17 | statsUpdate: "List[int]" 18 | """An array of triplets. Each triplet describes a fragment. The first integer is the fragment 19 | index, the second integer is a total count of objects for the fragment, the third integer is 20 | a total size of the objects for the fragment.""" 21 | 22 | 23 | 24 | """If heap objects tracking has been started then backend regularly sends a current value for last 25 | seen object id and corresponding timestamp. If the were changes in the heap since last event 26 | then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.""" 27 | class LastSeenObjectIdEvent(TypedDict): 28 | lastSeenObjectId: "int" 29 | timestamp: "float" 30 | 31 | 32 | 33 | class ReportHeapSnapshotProgressEvent(TypedDict): 34 | done: "int" 35 | total: "int" 36 | finished: "NotRequired[bool]" 37 | 38 | 39 | 40 | class ResetProfilesEvent(TypedDict): 41 | pass 42 | -------------------------------------------------------------------------------- /cdp_use/cdp/tethering/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tethering Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import BindParameters 14 | from .commands import UnbindParameters 15 | 16 | class TetheringClient: 17 | """Client for Tethering domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def bind( 23 | self, 24 | params: "BindParameters", 25 | session_id: Optional[str] = None, 26 | ) -> "Dict[str, Any]": 27 | """Request browser port binding.""" 28 | return cast("Dict[str, Any]", await self._client.send_raw( 29 | method="Tethering.bind", 30 | params=params, 31 | session_id=session_id, 32 | )) 33 | 34 | async def unbind( 35 | self, 36 | params: "UnbindParameters", 37 | session_id: Optional[str] = None, 38 | ) -> "Dict[str, Any]": 39 | """Request browser port unbinding.""" 40 | return cast("Dict[str, Any]", await self._client.send_raw( 41 | method="Tethering.unbind", 42 | params=params, 43 | session_id=session_id, 44 | )) 45 | 46 | 47 | -------------------------------------------------------------------------------- /cdp_use/cdp/browser/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Browser Domain Events""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..page.types import FrameId 13 | 14 | """Fired when page is about to start a download.""" 15 | class DownloadWillBeginEvent(TypedDict): 16 | frameId: "FrameId" 17 | """Id of the frame that caused the download to begin.""" 18 | guid: "str" 19 | """Global unique identifier of the download.""" 20 | url: "str" 21 | """URL of the resource being downloaded.""" 22 | suggestedFilename: "str" 23 | """Suggested file name of the resource (the actual name of the file saved on disk may differ).""" 24 | 25 | 26 | 27 | """Fired when download makes progress. Last call has |done| == true.""" 28 | class DownloadProgressEvent(TypedDict): 29 | guid: "str" 30 | """Global unique identifier of the download.""" 31 | totalBytes: "float" 32 | """Total expected bytes to download.""" 33 | receivedBytes: "float" 34 | """Total bytes received.""" 35 | state: "str" 36 | """Download status.""" 37 | filePath: "NotRequired[str]" 38 | """If download is \"completed\", provides the path of the downloaded file. 39 | Depending on the platform, it is not guaranteed to be set, nor the file 40 | is guaranteed to exist.""" 41 | -------------------------------------------------------------------------------- /cdp_use/cdp/serviceworker/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP ServiceWorker Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import RegistrationID 13 | 14 | class DeliverPushMessageParameters(TypedDict): 15 | origin: "str" 16 | registrationId: "RegistrationID" 17 | data: "str" 18 | 19 | 20 | 21 | 22 | 23 | class DispatchSyncEventParameters(TypedDict): 24 | origin: "str" 25 | registrationId: "RegistrationID" 26 | tag: "str" 27 | lastChance: "bool" 28 | 29 | 30 | 31 | 32 | 33 | class DispatchPeriodicSyncEventParameters(TypedDict): 34 | origin: "str" 35 | registrationId: "RegistrationID" 36 | tag: "str" 37 | 38 | 39 | 40 | 41 | 42 | class SetForceUpdateOnPageLoadParameters(TypedDict): 43 | forceUpdateOnPageLoad: "bool" 44 | 45 | 46 | 47 | 48 | 49 | class SkipWaitingParameters(TypedDict): 50 | scopeURL: "str" 51 | 52 | 53 | 54 | 55 | 56 | class StartWorkerParameters(TypedDict): 57 | scopeURL: "str" 58 | 59 | 60 | 61 | 62 | 63 | class StopWorkerParameters(TypedDict): 64 | versionId: "str" 65 | 66 | 67 | 68 | 69 | 70 | class UnregisterParameters(TypedDict): 71 | scopeURL: "str" 72 | 73 | 74 | 75 | 76 | 77 | class UpdateRegistrationParameters(TypedDict): 78 | scopeURL: "str" 79 | 80 | 81 | -------------------------------------------------------------------------------- /cdp_use/cdp/audits/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Audits Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..network.types import RequestId 14 | from .types import GenericIssueDetails 15 | 16 | class GetEncodedResponseParameters(TypedDict): 17 | requestId: "RequestId" 18 | """Identifier of the network request to get content for.""" 19 | encoding: "str" 20 | """The encoding to use.""" 21 | quality: "NotRequired[float]" 22 | """The quality of the encoding (0-1). (defaults to 1)""" 23 | sizeOnly: "NotRequired[bool]" 24 | """Whether to only return the size information (defaults to false).""" 25 | 26 | 27 | class GetEncodedResponseReturns(TypedDict): 28 | body: "str" 29 | """The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON)""" 30 | originalSize: "int" 31 | """Size before re-encoding.""" 32 | encodedSize: "int" 33 | """Size after re-encoding.""" 34 | 35 | 36 | 37 | class CheckContrastParameters(TypedDict, total=False): 38 | reportAAA: "bool" 39 | """Whether to report WCAG AAA level issues. Default is false.""" 40 | 41 | 42 | 43 | 44 | 45 | class CheckFormsIssuesReturns(TypedDict): 46 | formIssues: "List[GenericIssueDetails]" 47 | -------------------------------------------------------------------------------- /cdp_use/cdp/io/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain Commands""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..runtime.types import RemoteObjectId 13 | from .types import StreamHandle 14 | 15 | class CloseParameters(TypedDict): 16 | handle: "StreamHandle" 17 | """Handle of the stream to close.""" 18 | 19 | 20 | 21 | 22 | 23 | class ReadParameters(TypedDict): 24 | handle: "StreamHandle" 25 | """Handle of the stream to read.""" 26 | offset: "NotRequired[int]" 27 | """Seek to the specified offset before reading (if not specified, proceed with offset 28 | following the last read). Some types of streams may only support sequential reads.""" 29 | size: "NotRequired[int]" 30 | """Maximum number of bytes to read (left upon the agent discretion if not specified).""" 31 | 32 | 33 | class ReadReturns(TypedDict): 34 | base64Encoded: "bool" 35 | """Set if the data is base64-encoded""" 36 | data: "str" 37 | """Data that were read.""" 38 | eof: "bool" 39 | """Set if the end-of-file condition occurred while reading.""" 40 | 41 | 42 | 43 | class ResolveBlobParameters(TypedDict): 44 | objectId: "RemoteObjectId" 45 | """Object id of a Blob object wrapper.""" 46 | 47 | 48 | class ResolveBlobReturns(TypedDict): 49 | uuid: "str" 50 | """UUID of the specified Blob.""" 51 | -------------------------------------------------------------------------------- /cdp_use/cdp/bluetoothemulation/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BluetoothEmulation Domain Events""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import CharacteristicOperationType 13 | from .types import CharacteristicWriteType 14 | from .types import DescriptorOperationType 15 | from .types import GATTOperationType 16 | 17 | """Event for when a GATT operation of |type| to the peripheral with |address| 18 | happened.""" 19 | class GattOperationReceivedEvent(TypedDict): 20 | address: "str" 21 | type: "GATTOperationType" 22 | 23 | 24 | 25 | """Event for when a characteristic operation of |type| to the characteristic 26 | respresented by |characteristicId| happened. |data| and |writeType| is 27 | expected to exist when |type| is write.""" 28 | class CharacteristicOperationReceivedEvent(TypedDict): 29 | characteristicId: "str" 30 | type: "CharacteristicOperationType" 31 | data: "NotRequired[str]" 32 | writeType: "NotRequired[CharacteristicWriteType]" 33 | 34 | 35 | 36 | """Event for when a descriptor operation of |type| to the descriptor 37 | respresented by |descriptorId| happened. |data| is expected to exist when 38 | |type| is write.""" 39 | class DescriptorOperationReceivedEvent(TypedDict): 40 | descriptorId: "str" 41 | type: "DescriptorOperationType" 42 | data: "NotRequired[str]" 43 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceorientation/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceOrientation Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import SetDeviceOrientationOverrideParameters 14 | 15 | class DeviceOrientationClient: 16 | """Client for DeviceOrientation domain commands.""" 17 | 18 | def __init__(self, client: 'CDPClient'): 19 | self._client = client 20 | 21 | async def clearDeviceOrientationOverride( 22 | self, 23 | params: None = None, 24 | session_id: Optional[str] = None, 25 | ) -> "Dict[str, Any]": 26 | """Clears the overridden Device Orientation.""" 27 | return cast("Dict[str, Any]", await self._client.send_raw( 28 | method="DeviceOrientation.clearDeviceOrientationOverride", 29 | params=params, 30 | session_id=session_id, 31 | )) 32 | 33 | async def setDeviceOrientationOverride( 34 | self, 35 | params: "SetDeviceOrientationOverrideParameters", 36 | session_id: Optional[str] = None, 37 | ) -> "Dict[str, Any]": 38 | """Overrides the Device Orientation.""" 39 | return cast("Dict[str, Any]", await self._client.send_raw( 40 | method="DeviceOrientation.setDeviceOrientationOverride", 41 | params=params, 42 | session_id=session_id, 43 | )) 44 | 45 | 46 | -------------------------------------------------------------------------------- /cdp_use/cdp/heapprofiler/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeapProfiler Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..runtime.types import CallFrame 14 | 15 | HeapSnapshotObjectId = str 16 | """Heap snapshot object id.""" 17 | 18 | 19 | 20 | class SamplingHeapProfileNode(TypedDict): 21 | """Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.""" 22 | 23 | callFrame: "CallFrame" 24 | """Function location.""" 25 | selfSize: "float" 26 | """Allocations size in bytes for the node excluding children.""" 27 | id: "int" 28 | """Node id. Ids are unique across all profiles collected between startSampling and stopSampling.""" 29 | children: "List[SamplingHeapProfileNode]" 30 | """Child nodes.""" 31 | 32 | 33 | 34 | class SamplingHeapProfileSample(TypedDict): 35 | """A single sample from a sampling profile.""" 36 | 37 | size: "float" 38 | """Allocation size in bytes attributed to the sample.""" 39 | nodeId: "int" 40 | """Id of the corresponding profile tree node.""" 41 | ordinal: "float" 42 | """Time-ordered sample ordinal number. It is unique across all profiles retrieved 43 | between startSampling and stopSampling.""" 44 | 45 | 46 | 47 | class SamplingHeapProfile(TypedDict): 48 | """Sampling profile.""" 49 | 50 | head: "SamplingHeapProfileNode" 51 | samples: "List[SamplingHeapProfileSample]" 52 | -------------------------------------------------------------------------------- /cdp_use/cdp/log/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Log Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..network.types import RequestId 14 | from ..runtime.types import RemoteObject 15 | from ..runtime.types import StackTrace 16 | from ..runtime.types import Timestamp 17 | 18 | class LogEntry(TypedDict): 19 | """Log entry.""" 20 | 21 | source: "str" 22 | """Log entry source.""" 23 | level: "str" 24 | """Log entry severity.""" 25 | text: "str" 26 | """Logged text.""" 27 | category: "NotRequired[str]" 28 | timestamp: "Timestamp" 29 | """Timestamp when this entry was added.""" 30 | url: "NotRequired[str]" 31 | """URL of the resource if known.""" 32 | lineNumber: "NotRequired[int]" 33 | """Line number in the resource.""" 34 | stackTrace: "NotRequired[StackTrace]" 35 | """JavaScript stack trace.""" 36 | networkRequestId: "NotRequired[RequestId]" 37 | """Identifier of the network request associated with this entry.""" 38 | workerId: "NotRequired[str]" 39 | """Identifier of the worker associated with this entry.""" 40 | args: "NotRequired[List[RemoteObject]]" 41 | """Call arguments.""" 42 | 43 | 44 | 45 | class ViolationSetting(TypedDict): 46 | """Violation configuration setting.""" 47 | 48 | name: "str" 49 | """Violation type.""" 50 | threshold: "float" 51 | """Time threshold to trigger upon.""" 52 | -------------------------------------------------------------------------------- /cdp_use/cdp/memory/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Memory Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import TypedDict 10 | 11 | PressureLevel = Literal["moderate", "critical"] 12 | """Memory pressure level.""" 13 | 14 | 15 | 16 | class SamplingProfileNode(TypedDict): 17 | """Heap profile sample.""" 18 | 19 | size: "float" 20 | """Size of the sampled allocation.""" 21 | total: "float" 22 | """Total bytes attributed to this sample.""" 23 | stack: "List[str]" 24 | """Execution stack at the point of allocation.""" 25 | 26 | 27 | 28 | class SamplingProfile(TypedDict): 29 | """Array of heap profile samples.""" 30 | 31 | samples: "List[SamplingProfileNode]" 32 | modules: "List[Module]" 33 | 34 | 35 | 36 | class Module(TypedDict): 37 | """Executable module information""" 38 | 39 | name: "str" 40 | """Name of the module.""" 41 | uuid: "str" 42 | """UUID of the module.""" 43 | baseAddress: "str" 44 | """Base address where the module is loaded into memory. Encoded as a decimal 45 | or hexadecimal (0x prefixed) string.""" 46 | size: "float" 47 | """Size of the module in bytes.""" 48 | 49 | 50 | 51 | class DOMCounter(TypedDict): 52 | """DOM object counter data.""" 53 | 54 | name: "str" 55 | """Object name. Note: object names should be presumed volatile and clients should not expect 56 | the returned names to be consistent across runs.""" 57 | count: "int" 58 | """Object count.""" 59 | -------------------------------------------------------------------------------- /cdp_use/cdp/layertree/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP LayerTree Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import LayerPaintedEvent, LayerTreeDidChangeEvent 14 | 15 | class LayerTreeRegistration: 16 | """Event registration interface for LayerTree domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "LayerTree" 21 | 22 | def layerPainted( 23 | self, 24 | callback: Callable[['LayerPaintedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for layerPainted events. 28 | 29 | Args: 30 | callback: Function to call when event occurs. 31 | Receives (event_data, session_id) as parameters. 32 | """ 33 | self._registry.register("LayerTree.layerPainted", callback) 34 | 35 | def layerTreeDidChange( 36 | self, 37 | callback: Callable[['LayerTreeDidChangeEvent', Optional[str]], None], 38 | ) -> None: 39 | """ 40 | Register a callback for layerTreeDidChange events. 41 | 42 | Args: 43 | callback: Function to call when event occurs. 44 | Receives (event_data, session_id) as parameters. 45 | """ 46 | self._registry.register("LayerTree.layerTreeDidChange", callback) 47 | 48 | -------------------------------------------------------------------------------- /cdp_use/cdp/domdebugger/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DOMDebugger Domain Types""" 6 | 7 | from typing_extensions import Literal 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..dom.types import BackendNodeId 14 | from ..runtime.types import RemoteObject 15 | from ..runtime.types import ScriptId 16 | 17 | DOMBreakpointType = Literal["subtree-modified", "attribute-modified", "node-removed"] 18 | """DOM breakpoint type.""" 19 | 20 | 21 | 22 | CSPViolationType = Literal["trustedtype-sink-violation", "trustedtype-policy-violation"] 23 | """CSP Violation type.""" 24 | 25 | 26 | 27 | class EventListener(TypedDict): 28 | """Object event listener.""" 29 | 30 | type: "str" 31 | """`EventListener`'s type.""" 32 | useCapture: "bool" 33 | """`EventListener`'s useCapture.""" 34 | passive: "bool" 35 | """`EventListener`'s passive flag.""" 36 | once: "bool" 37 | """`EventListener`'s once flag.""" 38 | scriptId: "ScriptId" 39 | """Script id of the handler code.""" 40 | lineNumber: "int" 41 | """Line number in the script (0-based).""" 42 | columnNumber: "int" 43 | """Column number in the script (0-based).""" 44 | handler: "NotRequired[RemoteObject]" 45 | """Event handler function value.""" 46 | originalHandler: "NotRequired[RemoteObject]" 47 | """Event original handler function value.""" 48 | backendNodeId: "NotRequired[BackendNodeId]" 49 | """Node the listener is added to (if any).""" 50 | -------------------------------------------------------------------------------- /cdp_use/cdp/memory/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Memory Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import DOMCounter 14 | from .types import PressureLevel 15 | from .types import SamplingProfile 16 | 17 | class GetDOMCountersReturns(TypedDict): 18 | documents: "int" 19 | nodes: "int" 20 | jsEventListeners: "int" 21 | 22 | 23 | 24 | class GetDOMCountersForLeakDetectionReturns(TypedDict): 25 | counters: "List[DOMCounter]" 26 | """DOM object counters.""" 27 | 28 | 29 | 30 | class SetPressureNotificationsSuppressedParameters(TypedDict): 31 | suppressed: "bool" 32 | """If true, memory pressure notifications will be suppressed.""" 33 | 34 | 35 | 36 | 37 | 38 | class SimulatePressureNotificationParameters(TypedDict): 39 | level: "PressureLevel" 40 | """Memory pressure level of the notification.""" 41 | 42 | 43 | 44 | 45 | 46 | class StartSamplingParameters(TypedDict, total=False): 47 | samplingInterval: "int" 48 | """Average number of bytes between samples.""" 49 | suppressRandomness: "bool" 50 | """Do not randomize intervals between samples.""" 51 | 52 | 53 | 54 | 55 | 56 | class GetAllTimeSamplingProfileReturns(TypedDict): 57 | profile: "SamplingProfile" 58 | 59 | 60 | 61 | class GetBrowserSamplingProfileReturns(TypedDict): 62 | profile: "SamplingProfile" 63 | 64 | 65 | 66 | class GetSamplingProfileReturns(TypedDict): 67 | profile: "SamplingProfile" 68 | -------------------------------------------------------------------------------- /cdp_use/cdp/profiler/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Profiler Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import Profile 14 | from .types import ScriptCoverage 15 | 16 | class GetBestEffortCoverageReturns(TypedDict): 17 | result: "List[ScriptCoverage]" 18 | """Coverage data for the current isolate.""" 19 | 20 | 21 | 22 | class SetSamplingIntervalParameters(TypedDict): 23 | interval: "int" 24 | """New sampling interval in microseconds.""" 25 | 26 | 27 | 28 | 29 | 30 | class StartPreciseCoverageParameters(TypedDict, total=False): 31 | callCount: "bool" 32 | """Collect accurate call counts beyond simple 'covered' or 'not covered'.""" 33 | detailed: "bool" 34 | """Collect block-based coverage.""" 35 | allowTriggeredUpdates: "bool" 36 | """Allow the backend to send updates on its own initiative""" 37 | 38 | 39 | class StartPreciseCoverageReturns(TypedDict): 40 | timestamp: "float" 41 | """Monotonically increasing time (in seconds) when the coverage update was taken in the backend.""" 42 | 43 | 44 | 45 | class StopReturns(TypedDict): 46 | profile: "Profile" 47 | """Recorded profile.""" 48 | 49 | 50 | 51 | class TakePreciseCoverageReturns(TypedDict): 52 | result: "List[ScriptCoverage]" 53 | """Coverage data for the current isolate.""" 54 | timestamp: "float" 55 | """Monotonically increasing time (in seconds) when the coverage update was taken in the backend.""" 56 | -------------------------------------------------------------------------------- /cdp_use/cdp/fedcm/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP FedCm Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import DialogClosedEvent, DialogShownEvent 14 | 15 | class FedCmRegistration: 16 | """Event registration interface for FedCm domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "FedCm" 21 | 22 | def dialogShown( 23 | self, 24 | callback: Callable[['DialogShownEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for dialogShown events. 28 | 29 | Args: 30 | callback: Function to call when event occurs. 31 | Receives (event_data, session_id) as parameters. 32 | """ 33 | self._registry.register("FedCm.dialogShown", callback) 34 | 35 | def dialogClosed( 36 | self, 37 | callback: Callable[['DialogClosedEvent', Optional[str]], None], 38 | ) -> None: 39 | """ 40 | Register a callback for dialogClosed events. 41 | 42 | Triggered when a dialog is closed, either by user action, JS abort, 43 | or a command below. 44 | 45 | Args: 46 | callback: Function to call when event occurs. 47 | Receives (event_data, session_id) as parameters. 48 | """ 49 | self._registry.register("FedCm.dialogClosed", callback) 50 | 51 | -------------------------------------------------------------------------------- /cdp_use/cdp/css/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CSS Domain Events""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..dom.types import NodeId 13 | from .types import CSSStyleSheetHeader 14 | from .types import FontFace 15 | from .types import StyleSheetId 16 | 17 | """Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded 18 | web font.""" 19 | class FontsUpdatedEvent(TypedDict, total=False): 20 | font: "FontFace" 21 | """The web font that has loaded.""" 22 | 23 | 24 | 25 | """Fires whenever a MediaQuery result changes (for example, after a browser window has been 26 | resized.) The current implementation considers only viewport-dependent media features.""" 27 | class MediaQueryResultChangedEvent(TypedDict): 28 | pass 29 | 30 | 31 | 32 | """Fired whenever an active document stylesheet is added.""" 33 | class StyleSheetAddedEvent(TypedDict): 34 | header: "CSSStyleSheetHeader" 35 | """Added stylesheet metainfo.""" 36 | 37 | 38 | 39 | """Fired whenever a stylesheet is changed as a result of the client operation.""" 40 | class StyleSheetChangedEvent(TypedDict): 41 | styleSheetId: "StyleSheetId" 42 | 43 | 44 | 45 | """Fired whenever an active document stylesheet is removed.""" 46 | class StyleSheetRemovedEvent(TypedDict): 47 | styleSheetId: "StyleSheetId" 48 | """Identifier of the removed stylesheet.""" 49 | 50 | 51 | 52 | class ComputedStyleUpdatedEvent(TypedDict): 53 | nodeId: "NodeId" 54 | """The node id that has updated computed styles.""" 55 | -------------------------------------------------------------------------------- /cdp_use/cdp/backgroundservice/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BackgroundService Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import TypedDict 10 | 11 | from typing import TYPE_CHECKING 12 | 13 | if TYPE_CHECKING: 14 | from ..network.types import TimeSinceEpoch 15 | from ..serviceworker.types import RegistrationID 16 | 17 | ServiceName = Literal["backgroundFetch", "backgroundSync", "pushMessaging", "notifications", "paymentHandler", "periodicBackgroundSync"] 18 | """The Background Service that will be associated with the commands/events. 19 | Every Background Service operates independently, but they share the same 20 | API.""" 21 | 22 | 23 | 24 | class EventMetadata(TypedDict): 25 | """A key-value pair for additional event information to pass along.""" 26 | 27 | key: "str" 28 | value: "str" 29 | 30 | 31 | 32 | class BackgroundServiceEvent(TypedDict): 33 | timestamp: "TimeSinceEpoch" 34 | """Timestamp of the event (in seconds).""" 35 | origin: "str" 36 | """The origin this event belongs to.""" 37 | serviceWorkerRegistrationId: "RegistrationID" 38 | """The Service Worker ID that initiated the event.""" 39 | service: "ServiceName" 40 | """The Background Service this event belongs to.""" 41 | eventName: "str" 42 | """A description of the event.""" 43 | instanceId: "str" 44 | """An identifier that groups related events together.""" 45 | eventMetadata: "List[EventMetadata]" 46 | """A list of event-specific information.""" 47 | storageKey: "str" 48 | """Storage key this event belongs to.""" 49 | -------------------------------------------------------------------------------- /cdp_use/cdp/media/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Media Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import PlayerError 14 | from .types import PlayerEvent 15 | from .types import PlayerId 16 | from .types import PlayerMessage 17 | from .types import PlayerProperty 18 | 19 | """This can be called multiple times, and can be used to set / override / 20 | remove player properties. A null propValue indicates removal.""" 21 | class PlayerPropertiesChangedEvent(TypedDict): 22 | playerId: "PlayerId" 23 | properties: "List[PlayerProperty]" 24 | 25 | 26 | 27 | """Send events as a list, allowing them to be batched on the browser for less 28 | congestion. If batched, events must ALWAYS be in chronological order.""" 29 | class PlayerEventsAddedEvent(TypedDict): 30 | playerId: "PlayerId" 31 | events: "List[PlayerEvent]" 32 | 33 | 34 | 35 | """Send a list of any messages that need to be delivered.""" 36 | class PlayerMessagesLoggedEvent(TypedDict): 37 | playerId: "PlayerId" 38 | messages: "List[PlayerMessage]" 39 | 40 | 41 | 42 | """Send a list of any errors that need to be delivered.""" 43 | class PlayerErrorsRaisedEvent(TypedDict): 44 | playerId: "PlayerId" 45 | errors: "List[PlayerError]" 46 | 47 | 48 | 49 | """Called whenever a player is created, or when a new agent joins and receives 50 | a list of active players. If an agent is restored, it will receive the full 51 | list of player ids and all events again.""" 52 | class PlayersCreatedEvent(TypedDict): 53 | players: "List[PlayerId]" 54 | -------------------------------------------------------------------------------- /cdp_use/cdp/browser/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Browser Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import DownloadProgressEvent, DownloadWillBeginEvent 14 | 15 | class BrowserRegistration: 16 | """Event registration interface for Browser domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Browser" 21 | 22 | def downloadWillBegin( 23 | self, 24 | callback: Callable[['DownloadWillBeginEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for downloadWillBegin events. 28 | 29 | Fired when page is about to start a download. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Browser.downloadWillBegin", callback) 36 | 37 | def downloadProgress( 38 | self, 39 | callback: Callable[['DownloadProgressEvent', Optional[str]], None], 40 | ) -> None: 41 | """ 42 | Register a callback for downloadProgress events. 43 | 44 | Fired when download makes progress. Last call has |done| == true. 45 | 46 | Args: 47 | callback: Function to call when event occurs. 48 | Receives (event_data, session_id) as parameters. 49 | """ 50 | self._registry.register("Browser.downloadProgress", callback) 51 | 52 | -------------------------------------------------------------------------------- /cdp_use/cdp/profiler/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Profiler Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..debugger.types import Location 14 | from .types import Profile 15 | from .types import ScriptCoverage 16 | 17 | class ConsoleProfileFinishedEvent(TypedDict): 18 | id: "str" 19 | location: "Location" 20 | """Location of console.profileEnd().""" 21 | profile: "Profile" 22 | title: "NotRequired[str]" 23 | """Profile title passed as an argument to console.profile().""" 24 | 25 | 26 | 27 | """Sent when new profile recording is started using console.profile() call.""" 28 | class ConsoleProfileStartedEvent(TypedDict): 29 | id: "str" 30 | location: "Location" 31 | """Location of console.profile().""" 32 | title: "NotRequired[str]" 33 | """Profile title passed as an argument to console.profile().""" 34 | 35 | 36 | 37 | """Reports coverage delta since the last poll (either from an event like this, or from 38 | `takePreciseCoverage` for the current isolate. May only be sent if precise code 39 | coverage has been started. This event can be trigged by the embedder to, for example, 40 | trigger collection of coverage data immediately at a certain point in time.""" 41 | class PreciseCoverageDeltaUpdateEvent(TypedDict): 42 | timestamp: "float" 43 | """Monotonically increasing time (in seconds) when the coverage update was taken in the backend.""" 44 | occasion: "str" 45 | """Identifier for distinguishing coverage events.""" 46 | result: "List[ScriptCoverage]" 47 | """Coverage data for the current isolate.""" 48 | -------------------------------------------------------------------------------- /cdp_use/cdp/extensions/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Extensions Domain Commands""" 6 | 7 | from typing import Any, Dict, List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import StorageArea 14 | 15 | class LoadUnpackedParameters(TypedDict): 16 | path: "str" 17 | """Absolute file path.""" 18 | 19 | 20 | class LoadUnpackedReturns(TypedDict): 21 | id: "str" 22 | """Extension id.""" 23 | 24 | 25 | 26 | class UninstallParameters(TypedDict): 27 | id: "str" 28 | """Extension id.""" 29 | 30 | 31 | 32 | 33 | 34 | class GetStorageItemsParameters(TypedDict): 35 | id: "str" 36 | """ID of extension.""" 37 | storageArea: "StorageArea" 38 | """StorageArea to retrieve data from.""" 39 | keys: "NotRequired[List[str]]" 40 | """Keys to retrieve.""" 41 | 42 | 43 | class GetStorageItemsReturns(TypedDict): 44 | data: "Dict[str, Any]" 45 | 46 | 47 | 48 | class RemoveStorageItemsParameters(TypedDict): 49 | id: "str" 50 | """ID of extension.""" 51 | storageArea: "StorageArea" 52 | """StorageArea to remove data from.""" 53 | keys: "List[str]" 54 | """Keys to remove.""" 55 | 56 | 57 | 58 | 59 | 60 | class ClearStorageItemsParameters(TypedDict): 61 | id: "str" 62 | """ID of extension.""" 63 | storageArea: "StorageArea" 64 | """StorageArea to remove data from.""" 65 | 66 | 67 | 68 | 69 | 70 | class SetStorageItemsParameters(TypedDict): 71 | id: "str" 72 | """ID of extension.""" 73 | storageArea: "StorageArea" 74 | """StorageArea to set data in.""" 75 | values: "Dict[str, Any]" 76 | """Values to set.""" 77 | 78 | 79 | -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain Commands""" 6 | 7 | from typing_extensions import TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import ScreenshotParams 13 | 14 | class BeginFrameParameters(TypedDict, total=False): 15 | frameTimeTicks: "float" 16 | """Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, 17 | the current time will be used.""" 18 | interval: "float" 19 | """The interval between BeginFrames that is reported to the compositor, in milliseconds. 20 | Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.""" 21 | noDisplayUpdates: "bool" 22 | """Whether updates should not be committed and drawn onto the display. False by default. If 23 | true, only side effects of the BeginFrame will be run, such as layout and animations, but 24 | any visual updates may not be visible on the display or in screenshots.""" 25 | screenshot: "ScreenshotParams" 26 | """If set, a screenshot of the frame will be captured and returned in the response. Otherwise, 27 | no screenshot will be captured. Note that capturing a screenshot can fail, for example, 28 | during renderer initialization. In such a case, no screenshot data will be returned.""" 29 | 30 | 31 | class BeginFrameReturns(TypedDict): 32 | hasDamage: "bool" 33 | """Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the 34 | display. Reported for diagnostic uses, may be removed in the future.""" 35 | screenshotData: "str" 36 | """Base64-encoded image data of the screenshot, if one was requested and successfully taken. (Encoded as a base64 string when passed over JSON)""" 37 | -------------------------------------------------------------------------------- /cdp_use/cdp/cast/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Cast Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import IssueUpdatedEvent, SinksUpdatedEvent 14 | 15 | class CastRegistration: 16 | """Event registration interface for Cast domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Cast" 21 | 22 | def sinksUpdated( 23 | self, 24 | callback: Callable[['SinksUpdatedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for sinksUpdated events. 28 | 29 | This is fired whenever the list of available sinks changes. A sink is a 30 | device or a software surface that you can cast to. 31 | 32 | Args: 33 | callback: Function to call when event occurs. 34 | Receives (event_data, session_id) as parameters. 35 | """ 36 | self._registry.register("Cast.sinksUpdated", callback) 37 | 38 | def issueUpdated( 39 | self, 40 | callback: Callable[['IssueUpdatedEvent', Optional[str]], None], 41 | ) -> None: 42 | """ 43 | Register a callback for issueUpdated events. 44 | 45 | This is fired whenever the outstanding issue/error message changes. 46 | |issueMessage| is empty if there is no issue. 47 | 48 | Args: 49 | callback: Function to call when event occurs. 50 | Receives (event_data, session_id) as parameters. 51 | """ 52 | self._registry.register("Cast.issueUpdated", callback) 53 | 54 | -------------------------------------------------------------------------------- /cdp_use/cdp/tracing/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tracing Domain Events""" 6 | 7 | from typing import Any, Dict, List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..io.types import StreamHandle 14 | from .types import StreamCompression 15 | from .types import StreamFormat 16 | 17 | class BufferUsageEvent(TypedDict, total=False): 18 | percentFull: "float" 19 | """A number in range [0..1] that indicates the used size of event buffer as a fraction of its 20 | total size.""" 21 | eventCount: "float" 22 | """An approximate number of events in the trace log.""" 23 | value: "float" 24 | """A number in range [0..1] that indicates the used size of event buffer as a fraction of its 25 | total size.""" 26 | 27 | 28 | 29 | """Contains a bucket of collected trace events. When tracing is stopped collected events will be 30 | sent as a sequence of dataCollected events followed by tracingComplete event.""" 31 | class DataCollectedEvent(TypedDict): 32 | value: "List[Dict[str, Any]]" 33 | 34 | 35 | 36 | """Signals that tracing is stopped and there is no trace buffers pending flush, all data were 37 | delivered via dataCollected events.""" 38 | class TracingCompleteEvent(TypedDict): 39 | dataLossOccurred: "bool" 40 | """Indicates whether some trace data is known to have been lost, e.g. because the trace ring 41 | buffer wrapped around.""" 42 | stream: "NotRequired[StreamHandle]" 43 | """A handle of the stream that holds resulting trace data.""" 44 | traceFormat: "NotRequired[StreamFormat]" 45 | """Trace data format of returned stream.""" 46 | streamCompression: "NotRequired[StreamCompression]" 47 | """Compression format of returned stream.""" 48 | -------------------------------------------------------------------------------- /cdp_use/cdp/console/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Console Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | 14 | class ConsoleClient: 15 | """Client for Console domain commands.""" 16 | 17 | def __init__(self, client: 'CDPClient'): 18 | self._client = client 19 | 20 | async def clearMessages( 21 | self, 22 | params: None = None, 23 | session_id: Optional[str] = None, 24 | ) -> "Dict[str, Any]": 25 | """Does nothing.""" 26 | return cast("Dict[str, Any]", await self._client.send_raw( 27 | method="Console.clearMessages", 28 | params=params, 29 | session_id=session_id, 30 | )) 31 | 32 | async def disable( 33 | self, 34 | params: None = None, 35 | session_id: Optional[str] = None, 36 | ) -> "Dict[str, Any]": 37 | """Disables console domain, prevents further console messages from being reported to the client.""" 38 | return cast("Dict[str, Any]", await self._client.send_raw( 39 | method="Console.disable", 40 | params=params, 41 | session_id=session_id, 42 | )) 43 | 44 | async def enable( 45 | self, 46 | params: None = None, 47 | session_id: Optional[str] = None, 48 | ) -> "Dict[str, Any]": 49 | """Enables console domain, sends the messages collected so far to the client by means of the 50 | `messageAdded` notification.""" 51 | return cast("Dict[str, Any]", await self._client.send_raw( 52 | method="Console.enable", 53 | params=params, 54 | session_id=session_id, 55 | )) 56 | 57 | 58 | -------------------------------------------------------------------------------- /cdp_use/cdp/accessibility/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Accessibility Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import LoadCompleteEvent, NodesUpdatedEvent 14 | 15 | class AccessibilityRegistration: 16 | """Event registration interface for Accessibility domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Accessibility" 21 | 22 | def loadComplete( 23 | self, 24 | callback: Callable[['LoadCompleteEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for loadComplete events. 28 | 29 | The loadComplete event mirrors the load complete event sent by the browser to assistive 30 | technology when the web page has finished loading. 31 | 32 | Args: 33 | callback: Function to call when event occurs. 34 | Receives (event_data, session_id) as parameters. 35 | """ 36 | self._registry.register("Accessibility.loadComplete", callback) 37 | 38 | def nodesUpdated( 39 | self, 40 | callback: Callable[['NodesUpdatedEvent', Optional[str]], None], 41 | ) -> None: 42 | """ 43 | Register a callback for nodesUpdated events. 44 | 45 | The nodesUpdated event is sent every time a previously requested node has changed the in tree. 46 | 47 | Args: 48 | callback: Function to call when event occurs. 49 | Receives (event_data, session_id) as parameters. 50 | """ 51 | self._registry.register("Accessibility.nodesUpdated", callback) 52 | 53 | -------------------------------------------------------------------------------- /cdp_use/cdp/serviceworker/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP ServiceWorker Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import NotRequired, TypedDict 10 | 11 | from typing import TYPE_CHECKING 12 | 13 | if TYPE_CHECKING: 14 | from ..target.types import TargetID 15 | 16 | RegistrationID = str 17 | 18 | 19 | 20 | class ServiceWorkerRegistration(TypedDict): 21 | """ServiceWorker registration.""" 22 | 23 | registrationId: "RegistrationID" 24 | scopeURL: "str" 25 | isDeleted: "bool" 26 | 27 | 28 | 29 | ServiceWorkerVersionRunningStatus = Literal["stopped", "starting", "running", "stopping"] 30 | 31 | 32 | 33 | ServiceWorkerVersionStatus = Literal["new", "installing", "installed", "activating", "activated", "redundant"] 34 | 35 | 36 | 37 | class ServiceWorkerVersion(TypedDict): 38 | """ServiceWorker version.""" 39 | 40 | versionId: "str" 41 | registrationId: "RegistrationID" 42 | scriptURL: "str" 43 | runningStatus: "ServiceWorkerVersionRunningStatus" 44 | status: "ServiceWorkerVersionStatus" 45 | scriptLastModified: "NotRequired[float]" 46 | """The Last-Modified header value of the main script.""" 47 | scriptResponseTime: "NotRequired[float]" 48 | """The time at which the response headers of the main script were received from the server. 49 | For cached script it is the last time the cache entry was validated.""" 50 | controlledClients: "NotRequired[List[TargetID]]" 51 | targetId: "NotRequired[TargetID]" 52 | routerRules: "NotRequired[str]" 53 | 54 | 55 | 56 | class ServiceWorkerErrorMessage(TypedDict): 57 | """ServiceWorker error message.""" 58 | 59 | errorMessage: "str" 60 | registrationId: "RegistrationID" 61 | versionId: "str" 62 | sourceURL: "str" 63 | lineNumber: "int" 64 | columnNumber: "int" 65 | -------------------------------------------------------------------------------- /cdp_use/cdp/webaudio/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP WebAudio Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import GetRealtimeDataParameters 14 | from .commands import GetRealtimeDataReturns 15 | 16 | class WebAudioClient: 17 | """Client for WebAudio domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def enable( 23 | self, 24 | params: None = None, 25 | session_id: Optional[str] = None, 26 | ) -> "Dict[str, Any]": 27 | """Enables the WebAudio domain and starts sending context lifetime events.""" 28 | return cast("Dict[str, Any]", await self._client.send_raw( 29 | method="WebAudio.enable", 30 | params=params, 31 | session_id=session_id, 32 | )) 33 | 34 | async def disable( 35 | self, 36 | params: None = None, 37 | session_id: Optional[str] = None, 38 | ) -> "Dict[str, Any]": 39 | """Disables the WebAudio domain.""" 40 | return cast("Dict[str, Any]", await self._client.send_raw( 41 | method="WebAudio.disable", 42 | params=params, 43 | session_id=session_id, 44 | )) 45 | 46 | async def getRealtimeData( 47 | self, 48 | params: "GetRealtimeDataParameters", 49 | session_id: Optional[str] = None, 50 | ) -> "GetRealtimeDataReturns": 51 | """Fetch the realtime data from the registered contexts.""" 52 | return cast("GetRealtimeDataReturns", await self._client.send_raw( 53 | method="WebAudio.getRealtimeData", 54 | params=params, 55 | session_id=session_id, 56 | )) 57 | 58 | 59 | -------------------------------------------------------------------------------- /cdp_use/generator/generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | CDP Protocol Downloader and Generator 4 | 5 | Downloads the latest Chrome DevTools Protocol specifications and generates 6 | type-safe Python bindings. 7 | """ 8 | 9 | import tempfile 10 | from pathlib import Path 11 | from urllib.request import urlretrieve 12 | 13 | from .constants import BROWSER_PROTOCOL_FILE, JS_PROTOCOL_FILE 14 | from .generator import CDPGenerator 15 | 16 | 17 | def download_protocol_files() -> tuple[str, str]: 18 | """Download the latest protocol files from the official repository.""" 19 | temp_dir = Path(tempfile.mkdtemp()) 20 | 21 | print("Downloading Chrome DevTools Protocol specifications...") 22 | 23 | # Download JavaScript protocol 24 | js_protocol_path = temp_dir / "js_protocol.json" 25 | print(f" Downloading JS protocol from {JS_PROTOCOL_FILE}") 26 | urlretrieve(JS_PROTOCOL_FILE, js_protocol_path) 27 | 28 | # Download Browser protocol 29 | browser_protocol_path = temp_dir / "browser_protocol.json" 30 | print(f" Downloading Browser protocol from {BROWSER_PROTOCOL_FILE}") 31 | urlretrieve(BROWSER_PROTOCOL_FILE, browser_protocol_path) 32 | 33 | print("✅ Protocol files downloaded successfully") 34 | 35 | return str(js_protocol_path), str(browser_protocol_path) 36 | 37 | 38 | def main(): 39 | """Main entry point for the generator.""" 40 | try: 41 | # Download protocol files 42 | js_file, browser_file = download_protocol_files() 43 | 44 | # Create generator and run it 45 | generator = CDPGenerator() 46 | generator.generate_all(protocol_files=[js_file, browser_file]) 47 | 48 | print("🎉 CDP type-safe client generation completed!") 49 | print("") 50 | print("📖 Usage:") 51 | print(" from cdp_use.client import CDPClient") 52 | print(" # cdp.send.Target.getTargets() - fully type safe!") 53 | 54 | except Exception as e: 55 | print(f"❌ Error during generation: {e}") 56 | raise 57 | 58 | 59 | if __name__ == "__main__": 60 | main() 61 | -------------------------------------------------------------------------------- /cdp_use/cdp/io/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP IO Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import CloseParameters 14 | from .commands import ReadParameters 15 | from .commands import ReadReturns 16 | from .commands import ResolveBlobParameters 17 | from .commands import ResolveBlobReturns 18 | 19 | class IOClient: 20 | """Client for IO domain commands.""" 21 | 22 | def __init__(self, client: 'CDPClient'): 23 | self._client = client 24 | 25 | async def close( 26 | self, 27 | params: "CloseParameters", 28 | session_id: Optional[str] = None, 29 | ) -> "Dict[str, Any]": 30 | """Close the stream, discard any temporary backing storage.""" 31 | return cast("Dict[str, Any]", await self._client.send_raw( 32 | method="IO.close", 33 | params=params, 34 | session_id=session_id, 35 | )) 36 | 37 | async def read( 38 | self, 39 | params: "ReadParameters", 40 | session_id: Optional[str] = None, 41 | ) -> "ReadReturns": 42 | """Read a chunk of the stream""" 43 | return cast("ReadReturns", await self._client.send_raw( 44 | method="IO.read", 45 | params=params, 46 | session_id=session_id, 47 | )) 48 | 49 | async def resolveBlob( 50 | self, 51 | params: "ResolveBlobParameters", 52 | session_id: Optional[str] = None, 53 | ) -> "ResolveBlobReturns": 54 | """Return UUID of Blob object specified by a remote object id.""" 55 | return cast("ResolveBlobReturns", await self._client.send_raw( 56 | method="IO.resolveBlob", 57 | params=params, 58 | session_id=session_id, 59 | )) 60 | 61 | 62 | -------------------------------------------------------------------------------- /cdp_use/cdp/animation/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Animation Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..runtime.types import RemoteObject 14 | 15 | class GetCurrentTimeParameters(TypedDict): 16 | id: "str" 17 | """Id of animation.""" 18 | 19 | 20 | class GetCurrentTimeReturns(TypedDict): 21 | currentTime: "float" 22 | """Current time of the page.""" 23 | 24 | 25 | 26 | class GetPlaybackRateReturns(TypedDict): 27 | playbackRate: "float" 28 | """Playback rate for animations on page.""" 29 | 30 | 31 | 32 | class ReleaseAnimationsParameters(TypedDict): 33 | animations: "List[str]" 34 | """List of animation ids to seek.""" 35 | 36 | 37 | 38 | 39 | 40 | class ResolveAnimationParameters(TypedDict): 41 | animationId: "str" 42 | """Animation id.""" 43 | 44 | 45 | class ResolveAnimationReturns(TypedDict): 46 | remoteObject: "RemoteObject" 47 | """Corresponding remote object.""" 48 | 49 | 50 | 51 | class SeekAnimationsParameters(TypedDict): 52 | animations: "List[str]" 53 | """List of animation ids to seek.""" 54 | currentTime: "float" 55 | """Set the current time of each animation.""" 56 | 57 | 58 | 59 | 60 | 61 | class SetPausedParameters(TypedDict): 62 | animations: "List[str]" 63 | """Animations to set the pause state of.""" 64 | paused: "bool" 65 | """Paused state to set to.""" 66 | 67 | 68 | 69 | 70 | 71 | class SetPlaybackRateParameters(TypedDict): 72 | playbackRate: "float" 73 | """Playback rate for animations on page""" 74 | 75 | 76 | 77 | 78 | 79 | class SetTimingParameters(TypedDict): 80 | animationId: "str" 81 | """Animation id.""" 82 | duration: "float" 83 | """Duration of the animation.""" 84 | delay: "float" 85 | """Delay of the animation.""" 86 | 87 | 88 | -------------------------------------------------------------------------------- /cdp_use/cdp/security/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Security Domain Events""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from .types import InsecureContentStatus 14 | from .types import SecurityState 15 | from .types import SecurityStateExplanation 16 | from .types import VisibleSecurityState 17 | 18 | """There is a certificate error. If overriding certificate errors is enabled, then it should be 19 | handled with the `handleCertificateError` command. Note: this event does not fire if the 20 | certificate error has been allowed internally. Only one client per target should override 21 | certificate errors at the same time.""" 22 | class CertificateErrorEvent(TypedDict): 23 | eventId: "int" 24 | """The ID of the event.""" 25 | errorType: "str" 26 | """The type of the error.""" 27 | requestURL: "str" 28 | """The url that was requested.""" 29 | 30 | 31 | 32 | """The security state of the page changed.""" 33 | class VisibleSecurityStateChangedEvent(TypedDict): 34 | visibleSecurityState: "VisibleSecurityState" 35 | """Security state information about the page.""" 36 | 37 | 38 | 39 | """The security state of the page changed. No longer being sent.""" 40 | class SecurityStateChangedEvent(TypedDict): 41 | securityState: "SecurityState" 42 | """Security state.""" 43 | schemeIsCryptographic: "bool" 44 | """True if the page was loaded over cryptographic transport such as HTTPS.""" 45 | explanations: "List[SecurityStateExplanation]" 46 | """Previously a list of explanations for the security state. Now always 47 | empty.""" 48 | insecureContentStatus: "InsecureContentStatus" 49 | """Information about insecure content on the page.""" 50 | summary: "NotRequired[str]" 51 | """Overrides user-visible description of the state. Always omitted.""" 52 | -------------------------------------------------------------------------------- /cdp_use/cdp/backgroundservice/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP BackgroundService Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import BackgroundServiceEventReceivedEvent, RecordingStateChangedEvent 14 | 15 | class BackgroundServiceRegistration: 16 | """Event registration interface for BackgroundService domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "BackgroundService" 21 | 22 | def recordingStateChanged( 23 | self, 24 | callback: Callable[['RecordingStateChangedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for recordingStateChanged events. 28 | 29 | Called when the recording state for the service has been updated. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("BackgroundService.recordingStateChanged", callback) 36 | 37 | def backgroundServiceEventReceived( 38 | self, 39 | callback: Callable[['BackgroundServiceEventReceivedEvent', Optional[str]], None], 40 | ) -> None: 41 | """ 42 | Register a callback for backgroundServiceEventReceived events. 43 | 44 | Called with all existing backgroundServiceEvents when enabled, and all new 45 | events afterwards if enabled and recording. 46 | 47 | Args: 48 | callback: Function to call when event occurs. 49 | Receives (event_data, session_id) as parameters. 50 | """ 51 | self._registry.register("BackgroundService.backgroundServiceEventReceived", callback) 52 | 53 | -------------------------------------------------------------------------------- /cdp_use/cdp/cachestorage/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP CacheStorage Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import NotRequired, TypedDict 10 | 11 | from typing import TYPE_CHECKING 12 | 13 | if TYPE_CHECKING: 14 | from ..storage.types import StorageBucket 15 | 16 | CacheId = str 17 | """Unique identifier of the Cache object.""" 18 | 19 | 20 | 21 | CachedResponseType = Literal["basic", "cors", "default", "error", "opaqueResponse", "opaqueRedirect"] 22 | """type of HTTP response cached""" 23 | 24 | 25 | 26 | class DataEntry(TypedDict): 27 | """Data entry.""" 28 | 29 | requestURL: "str" 30 | """Request URL.""" 31 | requestMethod: "str" 32 | """Request method.""" 33 | requestHeaders: "List[Header]" 34 | """Request headers""" 35 | responseTime: "float" 36 | """Number of seconds since epoch.""" 37 | responseStatus: "int" 38 | """HTTP response status code.""" 39 | responseStatusText: "str" 40 | """HTTP response status text.""" 41 | responseType: "CachedResponseType" 42 | """HTTP response type""" 43 | responseHeaders: "List[Header]" 44 | """Response headers""" 45 | 46 | 47 | 48 | class Cache(TypedDict): 49 | """Cache identifier.""" 50 | 51 | cacheId: "CacheId" 52 | """An opaque unique id of the cache.""" 53 | securityOrigin: "str" 54 | """Security origin of the cache.""" 55 | storageKey: "str" 56 | """Storage key of the cache.""" 57 | storageBucket: "NotRequired[StorageBucket]" 58 | """Storage bucket of the cache.""" 59 | cacheName: "str" 60 | """The name of the cache.""" 61 | 62 | 63 | 64 | class Header(TypedDict): 65 | name: "str" 66 | value: "str" 67 | 68 | 69 | 70 | class CachedResponse(TypedDict): 71 | """Cached response""" 72 | 73 | body: "str" 74 | """Entry content, base64-encoded. (Encoded as a base64 string when passed over JSON)""" 75 | -------------------------------------------------------------------------------- /cdp_use/cdp/systeminfo/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP SystemInfo Domain Library""" 6 | 7 | from typing import Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import GetFeatureStateParameters 14 | from .commands import GetFeatureStateReturns 15 | from .commands import GetInfoReturns 16 | from .commands import GetProcessInfoReturns 17 | 18 | class SystemInfoClient: 19 | """Client for SystemInfo domain commands.""" 20 | 21 | def __init__(self, client: 'CDPClient'): 22 | self._client = client 23 | 24 | async def getInfo( 25 | self, 26 | params: None = None, 27 | session_id: Optional[str] = None, 28 | ) -> "GetInfoReturns": 29 | """Returns information about the system.""" 30 | return cast("GetInfoReturns", await self._client.send_raw( 31 | method="SystemInfo.getInfo", 32 | params=params, 33 | session_id=session_id, 34 | )) 35 | 36 | async def getFeatureState( 37 | self, 38 | params: "GetFeatureStateParameters", 39 | session_id: Optional[str] = None, 40 | ) -> "GetFeatureStateReturns": 41 | """Returns information about the feature state.""" 42 | return cast("GetFeatureStateReturns", await self._client.send_raw( 43 | method="SystemInfo.getFeatureState", 44 | params=params, 45 | session_id=session_id, 46 | )) 47 | 48 | async def getProcessInfo( 49 | self, 50 | params: None = None, 51 | session_id: Optional[str] = None, 52 | ) -> "GetProcessInfoReturns": 53 | """Returns information about all running processes.""" 54 | return cast("GetProcessInfoReturns", await self._client.send_raw( 55 | method="SystemInfo.getProcessInfo", 56 | params=params, 57 | session_id=session_id, 58 | )) 59 | 60 | 61 | -------------------------------------------------------------------------------- /cdp_use/cdp/eventbreakpoints/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP EventBreakpoints Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import RemoveInstrumentationBreakpointParameters 14 | from .commands import SetInstrumentationBreakpointParameters 15 | 16 | class EventBreakpointsClient: 17 | """Client for EventBreakpoints domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def setInstrumentationBreakpoint( 23 | self, 24 | params: "SetInstrumentationBreakpointParameters", 25 | session_id: Optional[str] = None, 26 | ) -> "Dict[str, Any]": 27 | """Sets breakpoint on particular native event.""" 28 | return cast("Dict[str, Any]", await self._client.send_raw( 29 | method="EventBreakpoints.setInstrumentationBreakpoint", 30 | params=params, 31 | session_id=session_id, 32 | )) 33 | 34 | async def removeInstrumentationBreakpoint( 35 | self, 36 | params: "RemoveInstrumentationBreakpointParameters", 37 | session_id: Optional[str] = None, 38 | ) -> "Dict[str, Any]": 39 | """Removes breakpoint on particular native event.""" 40 | return cast("Dict[str, Any]", await self._client.send_raw( 41 | method="EventBreakpoints.removeInstrumentationBreakpoint", 42 | params=params, 43 | session_id=session_id, 44 | )) 45 | 46 | async def disable( 47 | self, 48 | params: None = None, 49 | session_id: Optional[str] = None, 50 | ) -> "Dict[str, Any]": 51 | """Removes all breakpoints""" 52 | return cast("Dict[str, Any]", await self._client.send_raw( 53 | method="EventBreakpoints.disable", 54 | params=params, 55 | session_id=session_id, 56 | )) 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/basic.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from typing import Optional 3 | 4 | from cdp_use.cdp.page.events import DomContentEventFiredEvent 5 | from cdp_use.cdp.runtime.events import ConsoleAPICalledEvent 6 | from cdp_use.cdp.target.events import AttachedToTargetEvent 7 | from cdp_use.client import CDPClient 8 | 9 | 10 | def on_attached_to_target( 11 | event: AttachedToTargetEvent, session_id: Optional[str] 12 | ) -> None: 13 | print( 14 | f"Attached to target: {event['targetInfo']['title']}, session_id: {session_id}" 15 | ) 16 | 17 | 18 | def on_dom_content_loaded( 19 | event: DomContentEventFiredEvent, session_id: Optional[str] 20 | ) -> None: 21 | print(f"DOM content loaded at: {event['timestamp']}, session_id: {session_id}") 22 | 23 | 24 | def on_console_message(event: ConsoleAPICalledEvent, session_id: Optional[str]) -> None: 25 | print(f"Console: {event['type']}, session_id: {session_id}") 26 | 27 | 28 | async def main(): 29 | async with CDPClient("ws://127.0.0.1:9222/devtools/browser/...") as client: 30 | # Register event handlers with camelCase method names (matching CDP) 31 | client.register.Target.attachedToTarget(on_attached_to_target) 32 | client.register.Page.domContentEventFired(on_dom_content_loaded) 33 | client.register.Runtime.consoleAPICalled(on_console_message) 34 | 35 | targets = await client.send.Target.getTargets() 36 | print(targets) 37 | 38 | target_id = targets["targetInfos"][0]["targetId"] 39 | attach_to_target_response = await client.send.Target.attachToTarget( 40 | params={"targetId": target_id, "flatten": True} 41 | ) 42 | 43 | session_id = attach_to_target_response["sessionId"] 44 | 45 | if session_id is None: 46 | raise ValueError("Session ID is None") 47 | 48 | # Enable domains to start receiving events 49 | # await client.send.Page.enable() 50 | # await client.send.Runtime.enable() 51 | 52 | # Navigate and receive events 53 | await client.send.Page.navigate( 54 | {"url": "https://example.com"}, session_id=session_id 55 | ) 56 | await asyncio.sleep(20) # Keep listening for events 57 | 58 | 59 | if __name__ == "__main__": 60 | asyncio.run(main()) 61 | -------------------------------------------------------------------------------- /cdp_use/cdp/serviceworker/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP ServiceWorker Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import WorkerErrorReportedEvent, WorkerRegistrationUpdatedEvent, WorkerVersionUpdatedEvent 14 | 15 | class ServiceWorkerRegistration: 16 | """Event registration interface for ServiceWorker domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "ServiceWorker" 21 | 22 | def workerErrorReported( 23 | self, 24 | callback: Callable[['WorkerErrorReportedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for workerErrorReported events. 28 | 29 | Args: 30 | callback: Function to call when event occurs. 31 | Receives (event_data, session_id) as parameters. 32 | """ 33 | self._registry.register("ServiceWorker.workerErrorReported", callback) 34 | 35 | def workerRegistrationUpdated( 36 | self, 37 | callback: Callable[['WorkerRegistrationUpdatedEvent', Optional[str]], None], 38 | ) -> None: 39 | """ 40 | Register a callback for workerRegistrationUpdated events. 41 | 42 | Args: 43 | callback: Function to call when event occurs. 44 | Receives (event_data, session_id) as parameters. 45 | """ 46 | self._registry.register("ServiceWorker.workerRegistrationUpdated", callback) 47 | 48 | def workerVersionUpdated( 49 | self, 50 | callback: Callable[['WorkerVersionUpdatedEvent', Optional[str]], None], 51 | ) -> None: 52 | """ 53 | Register a callback for workerVersionUpdated events. 54 | 55 | Args: 56 | callback: Function to call when event occurs. 57 | Receives (event_data, session_id) as parameters. 58 | """ 59 | self._registry.register("ServiceWorker.workerVersionUpdated", callback) 60 | 61 | -------------------------------------------------------------------------------- /cdp_use/cdp/target/events.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Target Domain Events""" 6 | 7 | from typing_extensions import NotRequired, TypedDict 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from .types import SessionID 13 | from .types import TargetID 14 | from .types import TargetInfo 15 | 16 | """Issued when attached to target because of auto-attach or `attachToTarget` command.""" 17 | class AttachedToTargetEvent(TypedDict): 18 | sessionId: "SessionID" 19 | """Identifier assigned to the session used to send/receive messages.""" 20 | targetInfo: "TargetInfo" 21 | waitingForDebugger: "bool" 22 | 23 | 24 | 25 | """Issued when detached from target for any reason (including `detachFromTarget` command). Can be 26 | issued multiple times per target if multiple sessions have been attached to it.""" 27 | class DetachedFromTargetEvent(TypedDict): 28 | sessionId: "SessionID" 29 | """Detached session identifier.""" 30 | targetId: "NotRequired[TargetID]" 31 | """Deprecated.""" 32 | 33 | 34 | 35 | """Notifies about a new protocol message received from the session (as reported in 36 | `attachedToTarget` event).""" 37 | class ReceivedMessageFromTargetEvent(TypedDict): 38 | sessionId: "SessionID" 39 | """Identifier of a session which sends a message.""" 40 | message: "str" 41 | targetId: "NotRequired[TargetID]" 42 | """Deprecated.""" 43 | 44 | 45 | 46 | """Issued when a possible inspection target is created.""" 47 | class TargetCreatedEvent(TypedDict): 48 | targetInfo: "TargetInfo" 49 | 50 | 51 | 52 | """Issued when a target is destroyed.""" 53 | class TargetDestroyedEvent(TypedDict): 54 | targetId: "TargetID" 55 | 56 | 57 | 58 | """Issued when a target has crashed.""" 59 | class TargetCrashedEvent(TypedDict): 60 | targetId: "TargetID" 61 | status: "str" 62 | """Termination status type.""" 63 | errorCode: "int" 64 | """Termination error code.""" 65 | 66 | 67 | 68 | """Issued when some information about a target has changed. This only happens between 69 | `targetCreated` and `targetDestroyed`.""" 70 | class TargetInfoChangedEvent(TypedDict): 71 | targetInfo: "TargetInfo" 72 | -------------------------------------------------------------------------------- /cdp_use/cdp/headlessexperimental/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP HeadlessExperimental Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import BeginFrameParameters 14 | from .commands import BeginFrameReturns 15 | 16 | class HeadlessExperimentalClient: 17 | """Client for HeadlessExperimental domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def beginFrame( 23 | self, 24 | params: Optional["BeginFrameParameters"] = None, 25 | session_id: Optional[str] = None, 26 | ) -> "BeginFrameReturns": 27 | """Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a 28 | screenshot from the resulting frame. Requires that the target was created with enabled 29 | BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also 30 | https://goo.gle/chrome-headless-rendering for more background.""" 31 | return cast("BeginFrameReturns", await self._client.send_raw( 32 | method="HeadlessExperimental.beginFrame", 33 | params=params, 34 | session_id=session_id, 35 | )) 36 | 37 | async def disable( 38 | self, 39 | params: None = None, 40 | session_id: Optional[str] = None, 41 | ) -> "Dict[str, Any]": 42 | """Disables headless events for the target.""" 43 | return cast("Dict[str, Any]", await self._client.send_raw( 44 | method="HeadlessExperimental.disable", 45 | params=params, 46 | session_id=session_id, 47 | )) 48 | 49 | async def enable( 50 | self, 51 | params: None = None, 52 | session_id: Optional[str] = None, 53 | ) -> "Dict[str, Any]": 54 | """Enables headless events for the target.""" 55 | return cast("Dict[str, Any]", await self._client.send_raw( 56 | method="HeadlessExperimental.enable", 57 | params=params, 58 | session_id=session_id, 59 | )) 60 | 61 | 62 | -------------------------------------------------------------------------------- /cdp_use/cdp/performancetimeline/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PerformanceTimeline Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..dom.types import BackendNodeId 14 | from ..dom.types import Rect 15 | from ..network.types import TimeSinceEpoch 16 | from ..page.types import FrameId 17 | 18 | class LargestContentfulPaint(TypedDict): 19 | """See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl""" 20 | 21 | renderTime: "TimeSinceEpoch" 22 | loadTime: "TimeSinceEpoch" 23 | size: "float" 24 | """The number of pixels being painted.""" 25 | elementId: "NotRequired[str]" 26 | """The id attribute of the element, if available.""" 27 | url: "NotRequired[str]" 28 | """The URL of the image (may be trimmed).""" 29 | nodeId: "NotRequired[BackendNodeId]" 30 | 31 | 32 | 33 | class LayoutShiftAttribution(TypedDict): 34 | previousRect: "Rect" 35 | currentRect: "Rect" 36 | nodeId: "NotRequired[BackendNodeId]" 37 | 38 | 39 | 40 | class LayoutShift(TypedDict): 41 | """See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl""" 42 | 43 | value: "float" 44 | """Score increment produced by this event.""" 45 | hadRecentInput: "bool" 46 | lastInputTime: "TimeSinceEpoch" 47 | sources: "List[LayoutShiftAttribution]" 48 | 49 | 50 | 51 | class TimelineEvent(TypedDict): 52 | frameId: "FrameId" 53 | """Identifies the frame that this event is related to. Empty for non-frame targets.""" 54 | type: "str" 55 | """The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype 56 | This determines which of the optional \"details\" fields is present.""" 57 | name: "str" 58 | """Name may be empty depending on the type.""" 59 | time: "TimeSinceEpoch" 60 | """Time in seconds since Epoch, monotonically increasing within document lifetime.""" 61 | duration: "NotRequired[float]" 62 | """Event duration, if applicable.""" 63 | lcpDetails: "NotRequired[LargestContentfulPaint]" 64 | layoutShiftDetails: "NotRequired[LayoutShift]" 65 | -------------------------------------------------------------------------------- /cdp_use/cdp/inspector/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Inspector Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import DetachedEvent, TargetCrashedEvent, TargetReloadedAfterCrashEvent 14 | 15 | class InspectorRegistration: 16 | """Event registration interface for Inspector domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Inspector" 21 | 22 | def detached( 23 | self, 24 | callback: Callable[['DetachedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for detached events. 28 | 29 | Fired when remote debugging connection is about to be terminated. Contains detach reason. 30 | 31 | Args: 32 | callback: Function to call when event occurs. 33 | Receives (event_data, session_id) as parameters. 34 | """ 35 | self._registry.register("Inspector.detached", callback) 36 | 37 | def targetCrashed( 38 | self, 39 | callback: Callable[['TargetCrashedEvent', Optional[str]], None], 40 | ) -> None: 41 | """ 42 | Register a callback for targetCrashed events. 43 | 44 | Fired when debugging target has crashed 45 | 46 | Args: 47 | callback: Function to call when event occurs. 48 | Receives (event_data, session_id) as parameters. 49 | """ 50 | self._registry.register("Inspector.targetCrashed", callback) 51 | 52 | def targetReloadedAfterCrash( 53 | self, 54 | callback: Callable[['TargetReloadedAfterCrashEvent', Optional[str]], None], 55 | ) -> None: 56 | """ 57 | Register a callback for targetReloadedAfterCrash events. 58 | 59 | Fired when debugging target has reloaded after crash 60 | 61 | Args: 62 | callback: Function to call when event occurs. 63 | Receives (event_data, session_id) as parameters. 64 | """ 65 | self._registry.register("Inspector.targetReloadedAfterCrash", callback) 66 | 67 | -------------------------------------------------------------------------------- /cdp_use/cdp/deviceaccess/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP DeviceAccess Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import CancelPromptParameters 14 | from .commands import SelectPromptParameters 15 | 16 | class DeviceAccessClient: 17 | """Client for DeviceAccess domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def enable( 23 | self, 24 | params: None = None, 25 | session_id: Optional[str] = None, 26 | ) -> "Dict[str, Any]": 27 | """Enable events in this domain.""" 28 | return cast("Dict[str, Any]", await self._client.send_raw( 29 | method="DeviceAccess.enable", 30 | params=params, 31 | session_id=session_id, 32 | )) 33 | 34 | async def disable( 35 | self, 36 | params: None = None, 37 | session_id: Optional[str] = None, 38 | ) -> "Dict[str, Any]": 39 | """Disable events in this domain.""" 40 | return cast("Dict[str, Any]", await self._client.send_raw( 41 | method="DeviceAccess.disable", 42 | params=params, 43 | session_id=session_id, 44 | )) 45 | 46 | async def selectPrompt( 47 | self, 48 | params: "SelectPromptParameters", 49 | session_id: Optional[str] = None, 50 | ) -> "Dict[str, Any]": 51 | """Select a device in response to a DeviceAccess.deviceRequestPrompted event.""" 52 | return cast("Dict[str, Any]", await self._client.send_raw( 53 | method="DeviceAccess.selectPrompt", 54 | params=params, 55 | session_id=session_id, 56 | )) 57 | 58 | async def cancelPrompt( 59 | self, 60 | params: "CancelPromptParameters", 61 | session_id: Optional[str] = None, 62 | ) -> "Dict[str, Any]": 63 | """Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event.""" 64 | return cast("Dict[str, Any]", await self._client.send_raw( 65 | method="DeviceAccess.cancelPrompt", 66 | params=params, 67 | session_id=session_id, 68 | )) 69 | 70 | 71 | -------------------------------------------------------------------------------- /cdp_use/cdp/media/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Media Domain Types""" 6 | 7 | from typing import Any, Dict, List 8 | from typing_extensions import TypedDict 9 | 10 | PlayerId = str 11 | """Players will get an ID that is unique within the agent context.""" 12 | 13 | 14 | 15 | Timestamp = float 16 | 17 | 18 | 19 | class PlayerMessage(TypedDict): 20 | """Have one type per entry in MediaLogRecord::Type 21 | Corresponds to kMessage""" 22 | 23 | level: "str" 24 | """Keep in sync with MediaLogMessageLevel 25 | We are currently keeping the message level 'error' separate from the 26 | PlayerError type because right now they represent different things, 27 | this one being a DVLOG(ERROR) style log message that gets printed 28 | based on what log level is selected in the UI, and the other is a 29 | representation of a media::PipelineStatus object. Soon however we're 30 | going to be moving away from using PipelineStatus for errors and 31 | introducing a new error type which should hopefully let us integrate 32 | the error log level into the PlayerError type.""" 33 | message: "str" 34 | 35 | 36 | 37 | class PlayerProperty(TypedDict): 38 | """Corresponds to kMediaPropertyChange""" 39 | 40 | name: "str" 41 | value: "str" 42 | 43 | 44 | 45 | class PlayerEvent(TypedDict): 46 | """Corresponds to kMediaEventTriggered""" 47 | 48 | timestamp: "Timestamp" 49 | value: "str" 50 | 51 | 52 | 53 | class PlayerErrorSourceLocation(TypedDict): 54 | """Represents logged source line numbers reported in an error. 55 | NOTE: file and line are from chromium c++ implementation code, not js.""" 56 | 57 | file: "str" 58 | line: "int" 59 | 60 | 61 | 62 | class PlayerError(TypedDict): 63 | """Corresponds to kMediaError""" 64 | 65 | errorType: "str" 66 | code: "int" 67 | """Code is the numeric enum entry for a specific set of error codes, such 68 | as PipelineStatusCodes in media/base/pipeline_status.h""" 69 | stack: "List[PlayerErrorSourceLocation]" 70 | """A trace of where this error was caused / where it passed through.""" 71 | cause: "List[PlayerError]" 72 | """Errors potentially have a root cause error, ie, a DecoderError might be 73 | caused by an WindowsError""" 74 | data: "Dict[str, Any]" 75 | """Extra data attached to an error, such as an HRESULT, Video Codec, etc.""" 76 | -------------------------------------------------------------------------------- /cdp_use/cdp/autofill/library.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Autofill Domain Library""" 6 | 7 | from typing import Any, Dict, Optional, cast 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ...client import CDPClient 13 | from .commands import SetAddressesParameters 14 | from .commands import TriggerParameters 15 | 16 | class AutofillClient: 17 | """Client for Autofill domain commands.""" 18 | 19 | def __init__(self, client: 'CDPClient'): 20 | self._client = client 21 | 22 | async def trigger( 23 | self, 24 | params: "TriggerParameters", 25 | session_id: Optional[str] = None, 26 | ) -> "Dict[str, Any]": 27 | """Trigger autofill on a form identified by the fieldId. 28 | If the field and related form cannot be autofilled, returns an error.""" 29 | return cast("Dict[str, Any]", await self._client.send_raw( 30 | method="Autofill.trigger", 31 | params=params, 32 | session_id=session_id, 33 | )) 34 | 35 | async def setAddresses( 36 | self, 37 | params: "SetAddressesParameters", 38 | session_id: Optional[str] = None, 39 | ) -> "Dict[str, Any]": 40 | """Set addresses so that developers can verify their forms implementation.""" 41 | return cast("Dict[str, Any]", await self._client.send_raw( 42 | method="Autofill.setAddresses", 43 | params=params, 44 | session_id=session_id, 45 | )) 46 | 47 | async def disable( 48 | self, 49 | params: None = None, 50 | session_id: Optional[str] = None, 51 | ) -> "Dict[str, Any]": 52 | """Disables autofill domain notifications.""" 53 | return cast("Dict[str, Any]", await self._client.send_raw( 54 | method="Autofill.disable", 55 | params=params, 56 | session_id=session_id, 57 | )) 58 | 59 | async def enable( 60 | self, 61 | params: None = None, 62 | session_id: Optional[str] = None, 63 | ) -> "Dict[str, Any]": 64 | """Enables autofill domain notifications.""" 65 | return cast("Dict[str, Any]", await self._client.send_raw( 66 | method="Autofill.enable", 67 | params=params, 68 | session_id=session_id, 69 | )) 70 | 71 | 72 | -------------------------------------------------------------------------------- /cdp_use/cdp/tracing/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tracing Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import BufferUsageEvent, DataCollectedEvent, TracingCompleteEvent 14 | 15 | class TracingRegistration: 16 | """Event registration interface for Tracing domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Tracing" 21 | 22 | def bufferUsage( 23 | self, 24 | callback: Callable[['BufferUsageEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for bufferUsage events. 28 | 29 | Args: 30 | callback: Function to call when event occurs. 31 | Receives (event_data, session_id) as parameters. 32 | """ 33 | self._registry.register("Tracing.bufferUsage", callback) 34 | 35 | def dataCollected( 36 | self, 37 | callback: Callable[['DataCollectedEvent', Optional[str]], None], 38 | ) -> None: 39 | """ 40 | Register a callback for dataCollected events. 41 | 42 | Contains a bucket of collected trace events. When tracing is stopped collected events will be 43 | sent as a sequence of dataCollected events followed by tracingComplete event. 44 | 45 | Args: 46 | callback: Function to call when event occurs. 47 | Receives (event_data, session_id) as parameters. 48 | """ 49 | self._registry.register("Tracing.dataCollected", callback) 50 | 51 | def tracingComplete( 52 | self, 53 | callback: Callable[['TracingCompleteEvent', Optional[str]], None], 54 | ) -> None: 55 | """ 56 | Register a callback for tracingComplete events. 57 | 58 | Signals that tracing is stopped and there is no trace buffers pending flush, all data were 59 | delivered via dataCollected events. 60 | 61 | Args: 62 | callback: Function to call when event occurs. 63 | Receives (event_data, session_id) as parameters. 64 | """ 65 | self._registry.register("Tracing.tracingComplete", callback) 66 | 67 | -------------------------------------------------------------------------------- /cdp_use/cdp/tracing/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Tracing Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import TypedDict 10 | 11 | class MemoryDumpConfig(TypedDict): 12 | """Configuration for memory dump. Used only when \"memory-infra\" category is enabled.""" 13 | 14 | 15 | 16 | class TraceConfig(TypedDict, total=False): 17 | recordMode: "str" 18 | """Controls how the trace buffer stores data. The default is `recordUntilFull`.""" 19 | traceBufferSizeInKb: "float" 20 | """Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value 21 | of 200 MB would be used.""" 22 | enableSampling: "bool" 23 | """Turns on JavaScript stack sampling.""" 24 | enableSystrace: "bool" 25 | """Turns on system tracing.""" 26 | enableArgumentFilter: "bool" 27 | """Turns on argument filter.""" 28 | includedCategories: "List[str]" 29 | """Included category filters.""" 30 | excludedCategories: "List[str]" 31 | """Excluded category filters.""" 32 | syntheticDelays: "List[str]" 33 | """Configuration to synthesize the delays in tracing.""" 34 | memoryDumpConfig: "MemoryDumpConfig" 35 | """Configuration for memory dump triggers. Used only when \"memory-infra\" category is enabled.""" 36 | 37 | 38 | 39 | StreamFormat = Literal["json", "proto"] 40 | """Data format of a trace. Can be either the legacy JSON format or the 41 | protocol buffer format. Note that the JSON format will be deprecated soon.""" 42 | 43 | 44 | 45 | StreamCompression = Literal["none", "gzip"] 46 | """Compression type to use for traces returned via streams.""" 47 | 48 | 49 | 50 | MemoryDumpLevelOfDetail = Literal["background", "light", "detailed"] 51 | """Details exposed when memory request explicitly declared. 52 | Keep consistent with memory_dump_request_args.h and 53 | memory_instrumentation.mojom""" 54 | 55 | 56 | 57 | TracingBackend = Literal["auto", "chrome", "system"] 58 | """Backend type to use for tracing. `chrome` uses the Chrome-integrated 59 | tracing service and is supported on all platforms. `system` is only 60 | supported on Chrome OS and uses the Perfetto system tracing service. 61 | `auto` chooses `system` when the perfettoConfig provided to Tracing.start 62 | specifies at least one non-Chrome data source; otherwise uses `chrome`.""" 63 | -------------------------------------------------------------------------------- /simple.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import logging 3 | 4 | import httpx 5 | 6 | from cdp_use.client import CDPClient 7 | 8 | # Configure logging to see what's happening 9 | logging.basicConfig( 10 | level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" 11 | ) 12 | logger = logging.getLogger(__name__) 13 | 14 | 15 | async def main(): 16 | # Get WebSocket URL using async HTTPX 17 | async with httpx.AsyncClient() as client: 18 | version_info = await client.get("http://localhost:9222/json/version") 19 | browser_ws_url = version_info.json()["webSocketDebuggerUrl"] 20 | # browser_ws_url = "ws://localhost:3000" 21 | 22 | # Connect to Chrome DevTools with type-safe CDP client 23 | async with CDPClient(browser_ws_url) as cdp: 24 | # List all targets (tabs, extensions, etc.) - fully type-safe! 25 | targets_result = await cdp.send.Target.getTargets() 26 | page_targets = [t for t in targets_result["targetInfos"] if t["type"] == "page"] 27 | 28 | if not page_targets: 29 | raise RuntimeError("No page targets found.") 30 | 31 | target_id = page_targets[0]["targetId"] 32 | 33 | print(target_id, targets_result) 34 | 35 | # Attach to selected tab 36 | attach_result = await cdp.send.Target.attachToTarget( 37 | params={"targetId": target_id, "flatten": True} 38 | ) 39 | session_id = attach_result["sessionId"] 40 | 41 | # Enable DOM domain 42 | await cdp.send.DOM.enable(session_id=session_id) 43 | 44 | await cdp.send.Page.navigate( 45 | params={"url": "https://www.google.com"}, session_id=session_id 46 | ) 47 | 48 | # Get full DOM tree 49 | dom_result = await cdp.send.DOM.getDocument( 50 | params={"depth": -1, "pierce": True}, session_id=session_id 51 | ) 52 | 53 | ax_tree = await cdp.send.Accessibility.getFullAXTree( 54 | params={}, session_id=session_id 55 | ) 56 | print(ax_tree) 57 | 58 | print("Root node ID:", dom_result["root"]["nodeId"]) 59 | 60 | # Execute 10 concurrent CDP requests with full type safety 61 | tasks = [ 62 | cdp.send.DOM.getDocument( 63 | params={"depth": -1, "pierce": True}, session_id=session_id 64 | ) 65 | for _ in range(10) 66 | ] 67 | results = await asyncio.gather(*tasks) 68 | print(len(results)) 69 | 70 | # print(results[-1]) 71 | 72 | 73 | asyncio.run(main()) 74 | -------------------------------------------------------------------------------- /cdp_use/cdp/pwa/commands.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP PWA Domain Commands""" 6 | 7 | from typing import List 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..target.types import TargetID 14 | from .types import DisplayMode 15 | from .types import FileHandler 16 | 17 | class GetOsAppStateParameters(TypedDict): 18 | manifestId: "str" 19 | """The id from the webapp's manifest file, commonly it's the url of the 20 | site installing the webapp. See 21 | https://web.dev/learn/pwa/web-app-manifest.""" 22 | 23 | 24 | class GetOsAppStateReturns(TypedDict): 25 | badgeCount: "int" 26 | fileHandlers: "List[FileHandler]" 27 | 28 | 29 | 30 | class InstallParameters(TypedDict): 31 | manifestId: "str" 32 | installUrlOrBundleUrl: "NotRequired[str]" 33 | """The location of the app or bundle overriding the one derived from the 34 | manifestId.""" 35 | 36 | 37 | 38 | 39 | 40 | class UninstallParameters(TypedDict): 41 | manifestId: "str" 42 | 43 | 44 | 45 | 46 | 47 | class LaunchParameters(TypedDict): 48 | manifestId: "str" 49 | url: "NotRequired[str]" 50 | 51 | 52 | class LaunchReturns(TypedDict): 53 | targetId: "TargetID" 54 | """ID of the tab target created as a result.""" 55 | 56 | 57 | 58 | class LaunchFilesInAppParameters(TypedDict): 59 | manifestId: "str" 60 | files: "List[str]" 61 | 62 | 63 | class LaunchFilesInAppReturns(TypedDict): 64 | targetIds: "List[TargetID]" 65 | """IDs of the tab targets created as the result.""" 66 | 67 | 68 | 69 | class OpenCurrentPageInAppParameters(TypedDict): 70 | manifestId: "str" 71 | 72 | 73 | 74 | 75 | 76 | class ChangeAppUserSettingsParameters(TypedDict): 77 | manifestId: "str" 78 | linkCapturing: "NotRequired[bool]" 79 | """If user allows the links clicked on by the user in the app's scope, or 80 | extended scope if the manifest has scope extensions and the flags 81 | `DesktopPWAsLinkCapturingWithScopeExtensions` and 82 | `WebAppEnableScopeExtensions` are enabled. 83 | 84 | Note, the API does not support resetting the linkCapturing to the 85 | initial value, uninstalling and installing the web app again will reset 86 | it. 87 | 88 | TODO(crbug.com/339453269): Setting this value on ChromeOS is not 89 | supported yet.""" 90 | displayMode: "NotRequired[DisplayMode]" 91 | 92 | 93 | -------------------------------------------------------------------------------- /cdp_use/cdp/target/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Target Domain Types""" 6 | 7 | from typing import List 8 | from typing_extensions import Literal 9 | from typing_extensions import NotRequired, TypedDict 10 | 11 | from typing import TYPE_CHECKING 12 | 13 | if TYPE_CHECKING: 14 | from ..browser.types import BrowserContextID 15 | from ..page.types import FrameId 16 | 17 | TargetID = str 18 | 19 | 20 | 21 | SessionID = str 22 | """Unique identifier of attached debugging session.""" 23 | 24 | 25 | 26 | class TargetInfo(TypedDict): 27 | targetId: "TargetID" 28 | type: "str" 29 | """List of types: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_agent_host_impl.cc?ss=chromium&q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22""" 30 | title: "str" 31 | url: "str" 32 | attached: "bool" 33 | """Whether the target has an attached client.""" 34 | openerId: "NotRequired[TargetID]" 35 | """Opener target Id""" 36 | canAccessOpener: "bool" 37 | """Whether the target has access to the originating window.""" 38 | openerFrameId: "NotRequired[FrameId]" 39 | """Frame id of originating window (is only set if target has an opener).""" 40 | browserContextId: "NotRequired[BrowserContextID]" 41 | subtype: "NotRequired[str]" 42 | """Provides additional details for specific target types. For example, for 43 | the type of \"page\", this may be set to \"prerender\".""" 44 | 45 | 46 | 47 | class FilterEntry(TypedDict, total=False): 48 | """A filter used by target query/discovery/auto-attach operations.""" 49 | 50 | exclude: "bool" 51 | """If set, causes exclusion of matching targets from the list.""" 52 | type: "str" 53 | """If not present, matches any type.""" 54 | 55 | 56 | 57 | TargetFilter = List[FilterEntry] 58 | """The entries in TargetFilter are matched sequentially against targets and 59 | the first entry that matches determines if the target is included or not, 60 | depending on the value of `exclude` field in the entry. 61 | If filter is not specified, the one assumed is 62 | [{type: "browser", exclude: true}, {type: "tab", exclude: true}, {}] 63 | (i.e. include everything but `browser` and `tab`).""" 64 | 65 | 66 | 67 | class RemoteLocation(TypedDict): 68 | host: "str" 69 | port: "int" 70 | 71 | 72 | 73 | WindowState = Literal["normal", "minimized", "maximized", "fullscreen"] 74 | """The state of the target window.""" 75 | -------------------------------------------------------------------------------- /cdp_use/cdp/fetch/registration.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Fetch Domain Event Registration""" 6 | 7 | from typing import Callable, Optional 8 | 9 | from typing import TYPE_CHECKING 10 | 11 | if TYPE_CHECKING: 12 | from ..registry import EventRegistry 13 | from .events import AuthRequiredEvent, RequestPausedEvent 14 | 15 | class FetchRegistration: 16 | """Event registration interface for Fetch domain.""" 17 | 18 | def __init__(self, registry: 'EventRegistry'): 19 | self._registry = registry 20 | self._domain = "Fetch" 21 | 22 | def requestPaused( 23 | self, 24 | callback: Callable[['RequestPausedEvent', Optional[str]], None], 25 | ) -> None: 26 | """ 27 | Register a callback for requestPaused events. 28 | 29 | Issued when the domain is enabled and the request URL matches the 30 | specified filter. The request is paused until the client responds 31 | with one of continueRequest, failRequest or fulfillRequest. 32 | The stage of the request can be determined by presence of responseErrorReason 33 | and responseStatusCode -- the request is at the response stage if either 34 | of these fields is present and in the request stage otherwise. 35 | Redirect responses and subsequent requests are reported similarly to regular 36 | responses and requests. Redirect responses may be distinguished by the value 37 | of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with 38 | presence of the `location` header. Requests resulting from a redirect will 39 | have `redirectedRequestId` field set. 40 | 41 | Args: 42 | callback: Function to call when event occurs. 43 | Receives (event_data, session_id) as parameters. 44 | """ 45 | self._registry.register("Fetch.requestPaused", callback) 46 | 47 | def authRequired( 48 | self, 49 | callback: Callable[['AuthRequiredEvent', Optional[str]], None], 50 | ) -> None: 51 | """ 52 | Register a callback for authRequired events. 53 | 54 | Issued when the domain is enabled with handleAuthRequests set to true. 55 | The request is paused until client responds with continueWithAuth. 56 | 57 | Args: 58 | callback: Function to call when event occurs. 59 | Receives (event_data, session_id) as parameters. 60 | """ 61 | self._registry.register("Fetch.authRequired", callback) 62 | 63 | -------------------------------------------------------------------------------- /cdp_use/cdp/fetch/types.py: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by the CDP protocol generator. 2 | # Do not edit this file manually as your changes will be overwritten. 3 | # Generated from Chrome DevTools Protocol specifications. 4 | 5 | """CDP Fetch Domain Types""" 6 | 7 | from typing_extensions import Literal 8 | from typing_extensions import NotRequired, TypedDict 9 | 10 | from typing import TYPE_CHECKING 11 | 12 | if TYPE_CHECKING: 13 | from ..network.types import ResourceType 14 | 15 | RequestId = str 16 | """Unique request identifier. 17 | Note that this does not identify individual HTTP requests that are part of 18 | a network request.""" 19 | 20 | 21 | 22 | RequestStage = Literal["Request", "Response"] 23 | """Stages of the request to handle. Request will intercept before the request is 24 | sent. Response will intercept after the response is received (but before response 25 | body is received).""" 26 | 27 | 28 | 29 | class RequestPattern(TypedDict, total=False): 30 | urlPattern: "str" 31 | """Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is 32 | backslash. Omitting is equivalent to `\"*\"`.""" 33 | resourceType: "ResourceType" 34 | """If set, only requests for matching resource types will be intercepted.""" 35 | requestStage: "RequestStage" 36 | """Stage at which to begin intercepting requests. Default is Request.""" 37 | 38 | 39 | 40 | class HeaderEntry(TypedDict): 41 | """Response HTTP header entry""" 42 | 43 | name: "str" 44 | value: "str" 45 | 46 | 47 | 48 | class AuthChallenge(TypedDict): 49 | """Authorization challenge for HTTP status code 401 or 407.""" 50 | 51 | source: "NotRequired[str]" 52 | """Source of the authentication challenge.""" 53 | origin: "str" 54 | """Origin of the challenger.""" 55 | scheme: "str" 56 | """The authentication scheme used, such as basic or digest""" 57 | realm: "str" 58 | """The realm of the challenge. May be empty.""" 59 | 60 | 61 | 62 | class AuthChallengeResponse(TypedDict): 63 | """Response to an AuthChallenge.""" 64 | 65 | response: "str" 66 | """The decision on what to do in response to the authorization challenge. Default means 67 | deferring to the default behavior of the net stack, which will likely either the Cancel 68 | authentication or display a popup dialog box.""" 69 | username: "NotRequired[str]" 70 | """The username to provide, possibly empty. Should only be set if response is 71 | ProvideCredentials.""" 72 | password: "NotRequired[str]" 73 | """The password to provide, possibly empty. Should only be set if response is 74 | ProvideCredentials.""" 75 | --------------------------------------------------------------------------------