parsek-cdp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parsek_cdp/__init__.py +55 -0
- parsek_cdp/_logging.py +49 -0
- parsek_cdp/cdp/__init__.py +247 -0
- parsek_cdp/cdp/accessibility/__init__.py +15 -0
- parsek_cdp/cdp/accessibility/events.py +35 -0
- parsek_cdp/cdp/accessibility/functions.py +202 -0
- parsek_cdp/cdp/accessibility/types.py +235 -0
- parsek_cdp/cdp/animation/__init__.py +15 -0
- parsek_cdp/cdp/animation/events.py +52 -0
- parsek_cdp/cdp/animation/functions.py +140 -0
- parsek_cdp/cdp/animation/types.py +113 -0
- parsek_cdp/cdp/audits/__init__.py +15 -0
- parsek_cdp/cdp/audits/events.py +21 -0
- parsek_cdp/cdp/audits/functions.py +95 -0
- parsek_cdp/cdp/audits/types.py +1051 -0
- parsek_cdp/cdp/autofill/__init__.py +15 -0
- parsek_cdp/cdp/autofill/events.py +27 -0
- parsek_cdp/cdp/autofill/functions.py +64 -0
- parsek_cdp/cdp/autofill/types.py +108 -0
- parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
- parsek_cdp/cdp/backgroundservice/events.py +40 -0
- parsek_cdp/cdp/backgroundservice/functions.py +59 -0
- parsek_cdp/cdp/backgroundservice/types.py +63 -0
- parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
- parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
- parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
- parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
- parsek_cdp/cdp/browser/__init__.py +15 -0
- parsek_cdp/cdp/browser/events.py +46 -0
- parsek_cdp/cdp/browser/functions.py +350 -0
- parsek_cdp/cdp/browser/types.py +158 -0
- parsek_cdp/cdp/cachestorage/__init__.py +15 -0
- parsek_cdp/cdp/cachestorage/events.py +13 -0
- parsek_cdp/cdp/cachestorage/functions.py +126 -0
- parsek_cdp/cdp/cachestorage/types.py +89 -0
- parsek_cdp/cdp/cast/__init__.py +15 -0
- parsek_cdp/cdp/cast/events.py +38 -0
- parsek_cdp/cdp/cast/functions.py +77 -0
- parsek_cdp/cdp/cast/types.py +23 -0
- parsek_cdp/cdp/console/__init__.py +15 -0
- parsek_cdp/cdp/console/events.py +22 -0
- parsek_cdp/cdp/console/functions.py +36 -0
- parsek_cdp/cdp/console/types.py +30 -0
- parsek_cdp/cdp/css/__init__.py +15 -0
- parsek_cdp/cdp/css/events.py +79 -0
- parsek_cdp/cdp/css/functions.py +788 -0
- parsek_cdp/cdp/css/types.py +742 -0
- parsek_cdp/cdp/debugger/__init__.py +15 -0
- parsek_cdp/cdp/debugger/events.py +164 -0
- parsek_cdp/cdp/debugger/functions.py +663 -0
- parsek_cdp/cdp/debugger/types.py +171 -0
- parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
- parsek_cdp/cdp/deviceaccess/events.py +30 -0
- parsek_cdp/cdp/deviceaccess/functions.py +54 -0
- parsek_cdp/cdp/deviceaccess/types.py +28 -0
- parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
- parsek_cdp/cdp/deviceorientation/events.py +13 -0
- parsek_cdp/cdp/deviceorientation/functions.py +35 -0
- parsek_cdp/cdp/deviceorientation/types.py +10 -0
- parsek_cdp/cdp/dom/__init__.py +15 -0
- parsek_cdp/cdp/dom/events.py +228 -0
- parsek_cdp/cdp/dom/functions.py +1033 -0
- parsek_cdp/cdp/dom/types.py +293 -0
- parsek_cdp/cdp/domdebugger/__init__.py +15 -0
- parsek_cdp/cdp/domdebugger/events.py +13 -0
- parsek_cdp/cdp/domdebugger/functions.py +155 -0
- parsek_cdp/cdp/domdebugger/types.py +57 -0
- parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
- parsek_cdp/cdp/domsnapshot/events.py +13 -0
- parsek_cdp/cdp/domsnapshot/functions.py +111 -0
- parsek_cdp/cdp/domsnapshot/types.py +312 -0
- parsek_cdp/cdp/domstorage/__init__.py +15 -0
- parsek_cdp/cdp/domstorage/events.py +60 -0
- parsek_cdp/cdp/domstorage/functions.py +79 -0
- parsek_cdp/cdp/domstorage/types.py +30 -0
- parsek_cdp/cdp/emulation/__init__.py +15 -0
- parsek_cdp/cdp/emulation/events.py +17 -0
- parsek_cdp/cdp/emulation/functions.py +688 -0
- parsek_cdp/cdp/emulation/types.py +305 -0
- parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
- parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
- parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
- parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
- parsek_cdp/cdp/extensions/__init__.py +15 -0
- parsek_cdp/cdp/extensions/events.py +13 -0
- parsek_cdp/cdp/extensions/functions.py +118 -0
- parsek_cdp/cdp/extensions/types.py +19 -0
- parsek_cdp/cdp/fedcm/__init__.py +15 -0
- parsek_cdp/cdp/fedcm/events.py +45 -0
- parsek_cdp/cdp/fedcm/functions.py +93 -0
- parsek_cdp/cdp/fedcm/types.py +72 -0
- parsek_cdp/cdp/fetch/__init__.py +15 -0
- parsek_cdp/cdp/fetch/events.py +82 -0
- parsek_cdp/cdp/fetch/functions.py +215 -0
- parsek_cdp/cdp/fetch/types.py +81 -0
- parsek_cdp/cdp/filesystem/__init__.py +15 -0
- parsek_cdp/cdp/filesystem/events.py +13 -0
- parsek_cdp/cdp/filesystem/functions.py +36 -0
- parsek_cdp/cdp/filesystem/types.py +54 -0
- parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
- parsek_cdp/cdp/headlessexperimental/events.py +13 -0
- parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
- parsek_cdp/cdp/headlessexperimental/types.py +24 -0
- parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
- parsek_cdp/cdp/heapprofiler/events.py +65 -0
- parsek_cdp/cdp/heapprofiler/functions.py +193 -0
- parsek_cdp/cdp/heapprofiler/types.py +57 -0
- parsek_cdp/cdp/indexeddb/__init__.py +15 -0
- parsek_cdp/cdp/indexeddb/events.py +13 -0
- parsek_cdp/cdp/indexeddb/functions.py +232 -0
- parsek_cdp/cdp/indexeddb/types.py +120 -0
- parsek_cdp/cdp/input/__init__.py +15 -0
- parsek_cdp/cdp/input/events.py +25 -0
- parsek_cdp/cdp/input/functions.py +361 -0
- parsek_cdp/cdp/input/types.py +87 -0
- parsek_cdp/cdp/inspector/__init__.py +15 -0
- parsek_cdp/cdp/inspector/events.py +41 -0
- parsek_cdp/cdp/inspector/functions.py +27 -0
- parsek_cdp/cdp/inspector/types.py +10 -0
- parsek_cdp/cdp/io/__init__.py +15 -0
- parsek_cdp/cdp/io/events.py +13 -0
- parsek_cdp/cdp/io/functions.py +77 -0
- parsek_cdp/cdp/io/types.py +13 -0
- parsek_cdp/cdp/layertree/__init__.py +15 -0
- parsek_cdp/cdp/layertree/events.py +36 -0
- parsek_cdp/cdp/layertree/functions.py +178 -0
- parsek_cdp/cdp/layertree/types.py +104 -0
- parsek_cdp/cdp/log/__init__.py +15 -0
- parsek_cdp/cdp/log/events.py +22 -0
- parsek_cdp/cdp/log/functions.py +54 -0
- parsek_cdp/cdp/log/types.py +57 -0
- parsek_cdp/cdp/media/__init__.py +15 -0
- parsek_cdp/cdp/media/events.py +87 -0
- parsek_cdp/cdp/media/functions.py +27 -0
- parsek_cdp/cdp/media/types.py +101 -0
- parsek_cdp/cdp/memory/__init__.py +15 -0
- parsek_cdp/cdp/memory/events.py +13 -0
- parsek_cdp/cdp/memory/functions.py +164 -0
- parsek_cdp/cdp/memory/types.py +71 -0
- parsek_cdp/cdp/mixins/__init__.py +21 -0
- parsek_cdp/cdp/mixins/datatype.py +123 -0
- parsek_cdp/cdp/mixins/event.py +78 -0
- parsek_cdp/cdp/mixins/namespace.py +31 -0
- parsek_cdp/cdp/network/__init__.py +15 -0
- parsek_cdp/cdp/network/events.py +726 -0
- parsek_cdp/cdp/network/functions.py +734 -0
- parsek_cdp/cdp/network/types.py +1247 -0
- parsek_cdp/cdp/overlay/__init__.py +15 -0
- parsek_cdp/cdp/overlay/events.py +54 -0
- parsek_cdp/cdp/overlay/functions.py +407 -0
- parsek_cdp/cdp/overlay/types.py +328 -0
- parsek_cdp/cdp/page/__init__.py +15 -0
- parsek_cdp/cdp/page/events.py +416 -0
- parsek_cdp/cdp/page/functions.py +1081 -0
- parsek_cdp/cdp/page/types.py +1088 -0
- parsek_cdp/cdp/performance/__init__.py +15 -0
- parsek_cdp/cdp/performance/events.py +24 -0
- parsek_cdp/cdp/performance/functions.py +63 -0
- parsek_cdp/cdp/performance/types.py +22 -0
- parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
- parsek_cdp/cdp/performancetimeline/events.py +22 -0
- parsek_cdp/cdp/performancetimeline/functions.py +30 -0
- parsek_cdp/cdp/performancetimeline/types.py +85 -0
- parsek_cdp/cdp/preload/__init__.py +15 -0
- parsek_cdp/cdp/preload/events.py +116 -0
- parsek_cdp/cdp/preload/functions.py +25 -0
- parsek_cdp/cdp/preload/types.py +267 -0
- parsek_cdp/cdp/profiler/__init__.py +15 -0
- parsek_cdp/cdp/profiler/events.py +64 -0
- parsek_cdp/cdp/profiler/functions.py +134 -0
- parsek_cdp/cdp/profiler/types.py +105 -0
- parsek_cdp/cdp/pwa/__init__.py +15 -0
- parsek_cdp/cdp/pwa/events.py +13 -0
- parsek_cdp/cdp/pwa/functions.py +196 -0
- parsek_cdp/cdp/pwa/types.py +45 -0
- parsek_cdp/cdp/runtime/__init__.py +15 -0
- parsek_cdp/cdp/runtime/events.py +123 -0
- parsek_cdp/cdp/runtime/functions.py +552 -0
- parsek_cdp/cdp/runtime/types.py +319 -0
- parsek_cdp/cdp/schema/__init__.py +15 -0
- parsek_cdp/cdp/schema/events.py +13 -0
- parsek_cdp/cdp/schema/functions.py +32 -0
- parsek_cdp/cdp/schema/types.py +22 -0
- parsek_cdp/cdp/security/__init__.py +15 -0
- parsek_cdp/cdp/security/events.py +64 -0
- parsek_cdp/cdp/security/functions.py +66 -0
- parsek_cdp/cdp/security/types.py +168 -0
- parsek_cdp/cdp/serviceworker/__init__.py +15 -0
- parsek_cdp/cdp/serviceworker/events.py +43 -0
- parsek_cdp/cdp/serviceworker/functions.py +115 -0
- parsek_cdp/cdp/serviceworker/types.py +95 -0
- parsek_cdp/cdp/storage/__init__.py +15 -0
- parsek_cdp/cdp/storage/events.py +288 -0
- parsek_cdp/cdp/storage/functions.py +571 -0
- parsek_cdp/cdp/storage/types.py +656 -0
- parsek_cdp/cdp/systeminfo/__init__.py +15 -0
- parsek_cdp/cdp/systeminfo/events.py +13 -0
- parsek_cdp/cdp/systeminfo/functions.py +75 -0
- parsek_cdp/cdp/systeminfo/types.py +132 -0
- parsek_cdp/cdp/target/__init__.py +15 -0
- parsek_cdp/cdp/target/events.py +109 -0
- parsek_cdp/cdp/target/functions.py +424 -0
- parsek_cdp/cdp/target/types.py +83 -0
- parsek_cdp/cdp/tethering/__init__.py +15 -0
- parsek_cdp/cdp/tethering/events.py +22 -0
- parsek_cdp/cdp/tethering/functions.py +35 -0
- parsek_cdp/cdp/tethering/types.py +10 -0
- parsek_cdp/cdp/tracing/__init__.py +15 -0
- parsek_cdp/cdp/tracing/events.py +61 -0
- parsek_cdp/cdp/tracing/functions.py +119 -0
- parsek_cdp/cdp/tracing/types.py +81 -0
- parsek_cdp/cdp/webaudio/__init__.py +15 -0
- parsek_cdp/cdp/webaudio/events.py +184 -0
- parsek_cdp/cdp/webaudio/functions.py +51 -0
- parsek_cdp/cdp/webaudio/types.py +155 -0
- parsek_cdp/cdp/webauthn/__init__.py +15 -0
- parsek_cdp/cdp/webauthn/events.py +69 -0
- parsek_cdp/cdp/webauthn/functions.py +214 -0
- parsek_cdp/cdp/webauthn/types.py +96 -0
- parsek_cdp/core/__init__.py +18 -0
- parsek_cdp/core/browser.py +240 -0
- parsek_cdp/core/browser_context.py +58 -0
- parsek_cdp/core/element.py +405 -0
- parsek_cdp/core/feature.py +376 -0
- parsek_cdp/core/frame.py +351 -0
- parsek_cdp/core/pagable.py +175 -0
- parsek_cdp/core/page.py +163 -0
- parsek_cdp/core/target.py +490 -0
- parsek_cdp/features/__init__.py +14 -0
- parsek_cdp/features/request_listener/__init__.py +256 -0
- parsek_cdp/features/request_listener/events.py +48 -0
- parsek_cdp/features/request_listener/types.py +235 -0
- parsek_cdp/generate.py +642 -0
- parsek_cdp/parsek/__init__.py +18 -0
- parsek_cdp/parsek/events.py +38 -0
- parsek_cdp/parsek/types.py +36 -0
- parsek_cdp/py.typed +0 -0
- parsek_cdp-0.1.0.dist-info/METADATA +277 -0
- parsek_cdp-0.1.0.dist-info/RECORD +242 -0
- parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
- parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
- parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
"""Commands for the Target domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import DataType, FieldMeta, encode
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from .types import (
|
|
11
|
+
RemoteLocation,
|
|
12
|
+
SessionID,
|
|
13
|
+
TargetFilter,
|
|
14
|
+
TargetID,
|
|
15
|
+
TargetInfo,
|
|
16
|
+
WindowState,
|
|
17
|
+
)
|
|
18
|
+
from ..browser.types import BrowserContextID as Browser_BrowserContextID
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class AttachToTargetReturn(DataType):
|
|
22
|
+
"""Return value of :meth:`Target.attach_to_target`."""
|
|
23
|
+
session_id: SessionID
|
|
24
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
25
|
+
FieldMeta('session_id', 'sessionId', False, 'primitive'),
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class AttachToBrowserTargetReturn(DataType):
|
|
31
|
+
"""Return value of :meth:`Target.attach_to_browser_target`."""
|
|
32
|
+
session_id: SessionID
|
|
33
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
34
|
+
FieldMeta('session_id', 'sessionId', False, 'primitive'),
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclass
|
|
39
|
+
class CloseTargetReturn(DataType):
|
|
40
|
+
"""Return value of :meth:`Target.close_target`."""
|
|
41
|
+
success: bool
|
|
42
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
43
|
+
FieldMeta('success', 'success', False, 'primitive'),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass
|
|
48
|
+
class CreateBrowserContextReturn(DataType):
|
|
49
|
+
"""Return value of :meth:`Target.create_browser_context`."""
|
|
50
|
+
browser_context_id: Browser_BrowserContextID
|
|
51
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
52
|
+
FieldMeta('browser_context_id', 'browserContextId', False, 'primitive'),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass
|
|
57
|
+
class GetBrowserContextsReturn(DataType):
|
|
58
|
+
"""Return value of :meth:`Target.get_browser_contexts`."""
|
|
59
|
+
browser_context_ids: List[Browser_BrowserContextID]
|
|
60
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
61
|
+
FieldMeta('browser_context_ids', 'browserContextIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass
|
|
66
|
+
class CreateTargetReturn(DataType):
|
|
67
|
+
"""Return value of :meth:`Target.create_target`."""
|
|
68
|
+
target_id: TargetID
|
|
69
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
70
|
+
FieldMeta('target_id', 'targetId', False, 'primitive'),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass
|
|
75
|
+
class GetTargetInfoReturn(DataType):
|
|
76
|
+
"""Return value of :meth:`Target.get_target_info`."""
|
|
77
|
+
target_info: TargetInfo
|
|
78
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
79
|
+
FieldMeta('target_info', 'targetInfo', False, 'object', ref='Target.TargetInfo'),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass
|
|
84
|
+
class GetTargetsReturn(DataType):
|
|
85
|
+
"""Return value of :meth:`Target.get_targets`."""
|
|
86
|
+
target_infos: List[TargetInfo]
|
|
87
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
88
|
+
FieldMeta('target_infos', 'targetInfos', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.TargetInfo')),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@dataclass
|
|
93
|
+
class GetDevToolsTargetReturn(DataType):
|
|
94
|
+
"""Return value of :meth:`Target.get_dev_tools_target`."""
|
|
95
|
+
target_id: Optional[TargetID] = None
|
|
96
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
97
|
+
FieldMeta('target_id', 'targetId', True, 'primitive'),
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@dataclass
|
|
102
|
+
class OpenDevToolsReturn(DataType):
|
|
103
|
+
"""Return value of :meth:`Target.open_dev_tools`."""
|
|
104
|
+
target_id: TargetID
|
|
105
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
106
|
+
FieldMeta('target_id', 'targetId', False, 'primitive'),
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class Target:
|
|
111
|
+
"""Commands of the Target domain, bound to a target."""
|
|
112
|
+
|
|
113
|
+
def __init__(self, target: Any) -> None:
|
|
114
|
+
self._target = target
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def activate_target(self, *, target_id: TargetID) -> None:
|
|
118
|
+
"""
|
|
119
|
+
Activates (focuses) the target.
|
|
120
|
+
:param target_id:
|
|
121
|
+
"""
|
|
122
|
+
_params: Dict[str, Any] = {}
|
|
123
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
124
|
+
_result = await self._target.send('Target.activateTarget', _params)
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
async def attach_to_target(self, *, target_id: TargetID, flatten: Optional[bool] = None) -> AttachToTargetReturn:
|
|
128
|
+
"""
|
|
129
|
+
Attaches to the target with given id.
|
|
130
|
+
:param target_id:
|
|
131
|
+
:param flatten: Enables "flat" access to the session via specifying sessionId attribute in the commands.
|
|
132
|
+
We plan to make this the default, deprecate non-flattened mode,
|
|
133
|
+
and eventually retire it. See crbug.com/991325.
|
|
134
|
+
"""
|
|
135
|
+
_params: Dict[str, Any] = {}
|
|
136
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
137
|
+
if flatten is not None:
|
|
138
|
+
_params['flatten'] = encode(FieldMeta('', '', False, 'primitive'), flatten)
|
|
139
|
+
_result = await self._target.send('Target.attachToTarget', _params)
|
|
140
|
+
return AttachToTargetReturn.from_json(_result)
|
|
141
|
+
|
|
142
|
+
async def attach_to_browser_target(self) -> AttachToBrowserTargetReturn:
|
|
143
|
+
"""Attaches to the browser target, only uses flat sessionId mode."""
|
|
144
|
+
_params: Dict[str, Any] = {}
|
|
145
|
+
_result = await self._target.send('Target.attachToBrowserTarget', _params)
|
|
146
|
+
return AttachToBrowserTargetReturn.from_json(_result)
|
|
147
|
+
|
|
148
|
+
async def close_target(self, *, target_id: TargetID) -> CloseTargetReturn:
|
|
149
|
+
"""
|
|
150
|
+
Closes the target. If the target is a page that gets closed too.
|
|
151
|
+
:param target_id:
|
|
152
|
+
"""
|
|
153
|
+
_params: Dict[str, Any] = {}
|
|
154
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
155
|
+
_result = await self._target.send('Target.closeTarget', _params)
|
|
156
|
+
return CloseTargetReturn.from_json(_result)
|
|
157
|
+
|
|
158
|
+
async def expose_dev_tools_protocol(self, *, target_id: TargetID, binding_name: Optional[str] = None, inherit_permissions: Optional[bool] = None) -> None:
|
|
159
|
+
"""
|
|
160
|
+
Inject object to the target's main frame that provides a communication
|
|
161
|
+
channel with browser target.
|
|
162
|
+
|
|
163
|
+
Injected object will be available as `window[bindingName]`.
|
|
164
|
+
|
|
165
|
+
The object has the following API:
|
|
166
|
+
- `binding.send(json)` - a method to send messages over the remote debugging protocol
|
|
167
|
+
- `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.
|
|
168
|
+
:param target_id:
|
|
169
|
+
:param binding_name: Binding name, 'cdp' if not specified.
|
|
170
|
+
:param inherit_permissions: If true, inherits the current root session's permissions (default: false).
|
|
171
|
+
"""
|
|
172
|
+
_params: Dict[str, Any] = {}
|
|
173
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
174
|
+
if binding_name is not None:
|
|
175
|
+
_params['bindingName'] = encode(FieldMeta('', '', False, 'primitive'), binding_name)
|
|
176
|
+
if inherit_permissions is not None:
|
|
177
|
+
_params['inheritPermissions'] = encode(FieldMeta('', '', False, 'primitive'), inherit_permissions)
|
|
178
|
+
_result = await self._target.send('Target.exposeDevToolsProtocol', _params)
|
|
179
|
+
return None
|
|
180
|
+
|
|
181
|
+
async def create_browser_context(self, *, dispose_on_detach: Optional[bool] = None, proxy_server: Optional[str] = None, proxy_bypass_list: Optional[str] = None, origins_with_universal_network_access: Optional[List[str]] = None) -> CreateBrowserContextReturn:
|
|
182
|
+
"""
|
|
183
|
+
Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than
|
|
184
|
+
one.
|
|
185
|
+
:param dispose_on_detach: If specified, disposes this context when debugging session disconnects.
|
|
186
|
+
:param proxy_server: Proxy server, similar to the one passed to --proxy-server
|
|
187
|
+
:param proxy_bypass_list: Proxy bypass list, similar to the one passed to --proxy-bypass-list
|
|
188
|
+
:param origins_with_universal_network_access: An optional list of origins to grant unlimited cross-origin access to.
|
|
189
|
+
Parts of the URL other than those constituting origin are ignored.
|
|
190
|
+
"""
|
|
191
|
+
_params: Dict[str, Any] = {}
|
|
192
|
+
if dispose_on_detach is not None:
|
|
193
|
+
_params['disposeOnDetach'] = encode(FieldMeta('', '', False, 'primitive'), dispose_on_detach)
|
|
194
|
+
if proxy_server is not None:
|
|
195
|
+
_params['proxyServer'] = encode(FieldMeta('', '', False, 'primitive'), proxy_server)
|
|
196
|
+
if proxy_bypass_list is not None:
|
|
197
|
+
_params['proxyBypassList'] = encode(FieldMeta('', '', False, 'primitive'), proxy_bypass_list)
|
|
198
|
+
if origins_with_universal_network_access is not None:
|
|
199
|
+
_params['originsWithUniversalNetworkAccess'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), origins_with_universal_network_access)
|
|
200
|
+
_result = await self._target.send('Target.createBrowserContext', _params)
|
|
201
|
+
return CreateBrowserContextReturn.from_json(_result)
|
|
202
|
+
|
|
203
|
+
async def get_browser_contexts(self) -> GetBrowserContextsReturn:
|
|
204
|
+
"""Returns all browser contexts created with `Target.createBrowserContext` method."""
|
|
205
|
+
_params: Dict[str, Any] = {}
|
|
206
|
+
_result = await self._target.send('Target.getBrowserContexts', _params)
|
|
207
|
+
return GetBrowserContextsReturn.from_json(_result)
|
|
208
|
+
|
|
209
|
+
async def create_target(self, *, url: str, left: Optional[int] = None, top: Optional[int] = None, width: Optional[int] = None, height: Optional[int] = None, window_state: Optional[WindowState] = None, browser_context_id: Optional[Browser_BrowserContextID] = None, enable_begin_frame_control: Optional[bool] = None, new_window: Optional[bool] = None, background: Optional[bool] = None, for_tab: Optional[bool] = None, hidden: Optional[bool] = None) -> CreateTargetReturn:
|
|
210
|
+
"""
|
|
211
|
+
Creates a new page.
|
|
212
|
+
:param url: The initial URL the page will be navigated to. An empty string indicates about:blank.
|
|
213
|
+
:param left: Frame left origin in DIP (requires newWindow to be true or headless shell).
|
|
214
|
+
:param top: Frame top origin in DIP (requires newWindow to be true or headless shell).
|
|
215
|
+
:param width: Frame width in DIP (requires newWindow to be true or headless shell).
|
|
216
|
+
:param height: Frame height in DIP (requires newWindow to be true or headless shell).
|
|
217
|
+
:param window_state: Frame window state (requires newWindow to be true or headless shell).
|
|
218
|
+
Default is normal.
|
|
219
|
+
:param browser_context_id: The browser context to create the page in.
|
|
220
|
+
:param enable_begin_frame_control: Whether BeginFrames for this target will be controlled via DevTools (headless shell only,
|
|
221
|
+
not supported on MacOS yet, false by default).
|
|
222
|
+
:param new_window: Whether to create a new Window or Tab (false by default, not supported by headless shell).
|
|
223
|
+
:param background: Whether to create the target in background or foreground (false by default, not supported
|
|
224
|
+
by headless shell).
|
|
225
|
+
:param for_tab: Whether to create the target of type "tab".
|
|
226
|
+
:param hidden: Whether to create a hidden target. The hidden target is observable via protocol, but not
|
|
227
|
+
present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or
|
|
228
|
+
`background: false`. The life-time of the tab is limited to the life-time of the session.
|
|
229
|
+
"""
|
|
230
|
+
_params: Dict[str, Any] = {}
|
|
231
|
+
_params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
|
|
232
|
+
if left is not None:
|
|
233
|
+
_params['left'] = encode(FieldMeta('', '', False, 'primitive'), left)
|
|
234
|
+
if top is not None:
|
|
235
|
+
_params['top'] = encode(FieldMeta('', '', False, 'primitive'), top)
|
|
236
|
+
if width is not None:
|
|
237
|
+
_params['width'] = encode(FieldMeta('', '', False, 'primitive'), width)
|
|
238
|
+
if height is not None:
|
|
239
|
+
_params['height'] = encode(FieldMeta('', '', False, 'primitive'), height)
|
|
240
|
+
if window_state is not None:
|
|
241
|
+
_params['windowState'] = encode(FieldMeta('', '', False, 'enum', ref='Target.WindowState'), window_state)
|
|
242
|
+
if browser_context_id is not None:
|
|
243
|
+
_params['browserContextId'] = encode(FieldMeta('', '', False, 'primitive'), browser_context_id)
|
|
244
|
+
if enable_begin_frame_control is not None:
|
|
245
|
+
_params['enableBeginFrameControl'] = encode(FieldMeta('', '', False, 'primitive'), enable_begin_frame_control)
|
|
246
|
+
if new_window is not None:
|
|
247
|
+
_params['newWindow'] = encode(FieldMeta('', '', False, 'primitive'), new_window)
|
|
248
|
+
if background is not None:
|
|
249
|
+
_params['background'] = encode(FieldMeta('', '', False, 'primitive'), background)
|
|
250
|
+
if for_tab is not None:
|
|
251
|
+
_params['forTab'] = encode(FieldMeta('', '', False, 'primitive'), for_tab)
|
|
252
|
+
if hidden is not None:
|
|
253
|
+
_params['hidden'] = encode(FieldMeta('', '', False, 'primitive'), hidden)
|
|
254
|
+
_result = await self._target.send('Target.createTarget', _params)
|
|
255
|
+
return CreateTargetReturn.from_json(_result)
|
|
256
|
+
|
|
257
|
+
async def detach_from_target(self, *, session_id: Optional[SessionID] = None, target_id: Optional[TargetID] = None) -> None:
|
|
258
|
+
"""
|
|
259
|
+
Detaches session with given id.
|
|
260
|
+
:param session_id: Session to detach.
|
|
261
|
+
:param target_id: Deprecated.
|
|
262
|
+
"""
|
|
263
|
+
_params: Dict[str, Any] = {}
|
|
264
|
+
if session_id is not None:
|
|
265
|
+
_params['sessionId'] = encode(FieldMeta('', '', False, 'primitive'), session_id)
|
|
266
|
+
if target_id is not None:
|
|
267
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
268
|
+
_result = await self._target.send('Target.detachFromTarget', _params)
|
|
269
|
+
return None
|
|
270
|
+
|
|
271
|
+
async def dispose_browser_context(self, *, browser_context_id: Browser_BrowserContextID) -> None:
|
|
272
|
+
"""
|
|
273
|
+
Deletes a BrowserContext. All the belonging pages will be closed without calling their
|
|
274
|
+
beforeunload hooks.
|
|
275
|
+
:param browser_context_id:
|
|
276
|
+
"""
|
|
277
|
+
_params: Dict[str, Any] = {}
|
|
278
|
+
_params['browserContextId'] = encode(FieldMeta('', '', False, 'primitive'), browser_context_id)
|
|
279
|
+
_result = await self._target.send('Target.disposeBrowserContext', _params)
|
|
280
|
+
return None
|
|
281
|
+
|
|
282
|
+
async def get_target_info(self, *, target_id: Optional[TargetID] = None) -> GetTargetInfoReturn:
|
|
283
|
+
"""
|
|
284
|
+
Returns information about a target.
|
|
285
|
+
:param target_id:
|
|
286
|
+
"""
|
|
287
|
+
_params: Dict[str, Any] = {}
|
|
288
|
+
if target_id is not None:
|
|
289
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
290
|
+
_result = await self._target.send('Target.getTargetInfo', _params)
|
|
291
|
+
return GetTargetInfoReturn.from_json(_result)
|
|
292
|
+
|
|
293
|
+
async def get_targets(self, *, filter: Optional[TargetFilter] = None) -> GetTargetsReturn:
|
|
294
|
+
"""
|
|
295
|
+
Retrieves a list of available targets.
|
|
296
|
+
:param filter: Only targets matching filter will be reported. If filter is not specified
|
|
297
|
+
and target discovery is currently enabled, a filter used for target discovery
|
|
298
|
+
is used for consistency.
|
|
299
|
+
"""
|
|
300
|
+
_params: Dict[str, Any] = {}
|
|
301
|
+
if filter is not None:
|
|
302
|
+
_params['filter'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.FilterEntry')), filter)
|
|
303
|
+
_result = await self._target.send('Target.getTargets', _params)
|
|
304
|
+
return GetTargetsReturn.from_json(_result)
|
|
305
|
+
|
|
306
|
+
async def send_message_to_target(self, *, message: str, session_id: Optional[SessionID] = None, target_id: Optional[TargetID] = None) -> None:
|
|
307
|
+
"""
|
|
308
|
+
Sends protocol message over session with given id.
|
|
309
|
+
Consider using flat mode instead; see commands attachToTarget, setAutoAttach,
|
|
310
|
+
and crbug.com/991325.
|
|
311
|
+
|
|
312
|
+
.. deprecated::
|
|
313
|
+
:param message:
|
|
314
|
+
:param session_id: Identifier of the session.
|
|
315
|
+
:param target_id: Deprecated.
|
|
316
|
+
"""
|
|
317
|
+
_params: Dict[str, Any] = {}
|
|
318
|
+
_params['message'] = encode(FieldMeta('', '', False, 'primitive'), message)
|
|
319
|
+
if session_id is not None:
|
|
320
|
+
_params['sessionId'] = encode(FieldMeta('', '', False, 'primitive'), session_id)
|
|
321
|
+
if target_id is not None:
|
|
322
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
323
|
+
_result = await self._target.send('Target.sendMessageToTarget', _params)
|
|
324
|
+
return None
|
|
325
|
+
|
|
326
|
+
async def set_auto_attach(self, *, auto_attach: bool, wait_for_debugger_on_start: bool, flatten: Optional[bool] = None, filter: Optional[TargetFilter] = None) -> None:
|
|
327
|
+
"""
|
|
328
|
+
Controls whether to automatically attach to new targets which are considered
|
|
329
|
+
to be directly related to this one (for example, iframes or workers).
|
|
330
|
+
When turned on, attaches to all existing related targets as well. When turned off,
|
|
331
|
+
automatically detaches from all currently attached targets.
|
|
332
|
+
This also clears all targets added by `autoAttachRelated` from the list of targets to watch
|
|
333
|
+
for creation of related targets.
|
|
334
|
+
You might want to call this recursively for auto-attached targets to attach
|
|
335
|
+
to all available targets.
|
|
336
|
+
:param auto_attach: Whether to auto-attach to related targets.
|
|
337
|
+
:param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`
|
|
338
|
+
to run paused targets.
|
|
339
|
+
:param flatten: Enables "flat" access to the session via specifying sessionId attribute in the commands.
|
|
340
|
+
We plan to make this the default, deprecate non-flattened mode,
|
|
341
|
+
and eventually retire it. See crbug.com/991325.
|
|
342
|
+
:param filter: Only targets matching filter will be attached.
|
|
343
|
+
"""
|
|
344
|
+
_params: Dict[str, Any] = {}
|
|
345
|
+
_params['autoAttach'] = encode(FieldMeta('', '', False, 'primitive'), auto_attach)
|
|
346
|
+
_params['waitForDebuggerOnStart'] = encode(FieldMeta('', '', False, 'primitive'), wait_for_debugger_on_start)
|
|
347
|
+
if flatten is not None:
|
|
348
|
+
_params['flatten'] = encode(FieldMeta('', '', False, 'primitive'), flatten)
|
|
349
|
+
if filter is not None:
|
|
350
|
+
_params['filter'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.FilterEntry')), filter)
|
|
351
|
+
_result = await self._target.send('Target.setAutoAttach', _params)
|
|
352
|
+
return None
|
|
353
|
+
|
|
354
|
+
async def auto_attach_related(self, *, target_id: TargetID, wait_for_debugger_on_start: bool, filter: Optional[TargetFilter] = None) -> None:
|
|
355
|
+
"""
|
|
356
|
+
Adds the specified target to the list of targets that will be monitored for any related target
|
|
357
|
+
creation (such as child frames, child workers and new versions of service worker) and reported
|
|
358
|
+
through `attachedToTarget`. The specified target is also auto-attached.
|
|
359
|
+
This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent
|
|
360
|
+
`setAutoAttach`. Only available at the Browser target.
|
|
361
|
+
:param target_id:
|
|
362
|
+
:param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`
|
|
363
|
+
to run paused targets.
|
|
364
|
+
:param filter: Only targets matching filter will be attached.
|
|
365
|
+
"""
|
|
366
|
+
_params: Dict[str, Any] = {}
|
|
367
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
368
|
+
_params['waitForDebuggerOnStart'] = encode(FieldMeta('', '', False, 'primitive'), wait_for_debugger_on_start)
|
|
369
|
+
if filter is not None:
|
|
370
|
+
_params['filter'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.FilterEntry')), filter)
|
|
371
|
+
_result = await self._target.send('Target.autoAttachRelated', _params)
|
|
372
|
+
return None
|
|
373
|
+
|
|
374
|
+
async def set_discover_targets(self, *, discover: bool, filter: Optional[TargetFilter] = None) -> None:
|
|
375
|
+
"""
|
|
376
|
+
Controls whether to discover available targets and notify via
|
|
377
|
+
`targetCreated/targetInfoChanged/targetDestroyed` events.
|
|
378
|
+
:param discover: Whether to discover available targets.
|
|
379
|
+
:param filter: Only targets matching filter will be attached. If `discover` is false,
|
|
380
|
+
`filter` must be omitted or empty.
|
|
381
|
+
"""
|
|
382
|
+
_params: Dict[str, Any] = {}
|
|
383
|
+
_params['discover'] = encode(FieldMeta('', '', False, 'primitive'), discover)
|
|
384
|
+
if filter is not None:
|
|
385
|
+
_params['filter'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.FilterEntry')), filter)
|
|
386
|
+
_result = await self._target.send('Target.setDiscoverTargets', _params)
|
|
387
|
+
return None
|
|
388
|
+
|
|
389
|
+
async def set_remote_locations(self, *, locations: List[RemoteLocation]) -> None:
|
|
390
|
+
"""
|
|
391
|
+
Enables target discovery for the specified locations, when `setDiscoverTargets` was set to
|
|
392
|
+
`true`.
|
|
393
|
+
:param locations: List of remote locations.
|
|
394
|
+
"""
|
|
395
|
+
_params: Dict[str, Any] = {}
|
|
396
|
+
_params['locations'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Target.RemoteLocation')), locations)
|
|
397
|
+
_result = await self._target.send('Target.setRemoteLocations', _params)
|
|
398
|
+
return None
|
|
399
|
+
|
|
400
|
+
async def get_dev_tools_target(self, *, target_id: TargetID) -> GetDevToolsTargetReturn:
|
|
401
|
+
"""
|
|
402
|
+
Gets the targetId of the DevTools page target opened for the given target
|
|
403
|
+
(if any).
|
|
404
|
+
:param target_id: Page or tab target ID.
|
|
405
|
+
"""
|
|
406
|
+
_params: Dict[str, Any] = {}
|
|
407
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
408
|
+
_result = await self._target.send('Target.getDevToolsTarget', _params)
|
|
409
|
+
return GetDevToolsTargetReturn.from_json(_result)
|
|
410
|
+
|
|
411
|
+
async def open_dev_tools(self, *, target_id: TargetID, panel_id: Optional[str] = None) -> OpenDevToolsReturn:
|
|
412
|
+
"""
|
|
413
|
+
Opens a DevTools window for the target.
|
|
414
|
+
:param target_id: This can be the page or tab target ID.
|
|
415
|
+
:param panel_id: The id of the panel we want DevTools to open initially. Currently
|
|
416
|
+
supported panels are elements, console, network, sources, resources
|
|
417
|
+
and performance.
|
|
418
|
+
"""
|
|
419
|
+
_params: Dict[str, Any] = {}
|
|
420
|
+
_params['targetId'] = encode(FieldMeta('', '', False, 'primitive'), target_id)
|
|
421
|
+
if panel_id is not None:
|
|
422
|
+
_params['panelId'] = encode(FieldMeta('', '', False, 'primitive'), panel_id)
|
|
423
|
+
_result = await self._target.send('Target.openDevTools', _params)
|
|
424
|
+
return OpenDevToolsReturn.from_json(_result)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""Custom types and enums for the Target domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from ..mixins.datatype import DataType, FieldMeta, register
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from ..browser.types import BrowserContextID as Browser_BrowserContextID
|
|
12
|
+
from ..page.types import FrameId as Page_FrameId
|
|
13
|
+
|
|
14
|
+
type TargetID = str
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
type SessionID = str # Unique identifier of attached debugging session.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@register("Target.TargetInfo")
|
|
21
|
+
@dataclass
|
|
22
|
+
class TargetInfo(DataType):
|
|
23
|
+
target_id: TargetID
|
|
24
|
+
type_: str
|
|
25
|
+
title: str
|
|
26
|
+
url: str
|
|
27
|
+
attached: bool
|
|
28
|
+
can_access_opener: bool
|
|
29
|
+
opener_id: Optional[TargetID] = None
|
|
30
|
+
opener_frame_id: Optional[Page_FrameId] = None
|
|
31
|
+
parent_frame_id: Optional[Page_FrameId] = None
|
|
32
|
+
browser_context_id: Optional[Browser_BrowserContextID] = None
|
|
33
|
+
subtype: Optional[str] = None
|
|
34
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
35
|
+
FieldMeta('target_id', 'targetId', False, 'primitive'),
|
|
36
|
+
FieldMeta('type_', 'type', False, 'primitive'),
|
|
37
|
+
FieldMeta('title', 'title', False, 'primitive'),
|
|
38
|
+
FieldMeta('url', 'url', False, 'primitive'),
|
|
39
|
+
FieldMeta('attached', 'attached', False, 'primitive'),
|
|
40
|
+
FieldMeta('can_access_opener', 'canAccessOpener', False, 'primitive'),
|
|
41
|
+
FieldMeta('opener_id', 'openerId', True, 'primitive'),
|
|
42
|
+
FieldMeta('opener_frame_id', 'openerFrameId', True, 'primitive'),
|
|
43
|
+
FieldMeta('parent_frame_id', 'parentFrameId', True, 'primitive'),
|
|
44
|
+
FieldMeta('browser_context_id', 'browserContextId', True, 'primitive'),
|
|
45
|
+
FieldMeta('subtype', 'subtype', True, 'primitive'),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@register("Target.FilterEntry")
|
|
50
|
+
@dataclass
|
|
51
|
+
class FilterEntry(DataType):
|
|
52
|
+
"""A filter used by target query/discovery/auto-attach operations."""
|
|
53
|
+
exclude: Optional[bool] = None
|
|
54
|
+
type_: Optional[str] = None
|
|
55
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
56
|
+
FieldMeta('exclude', 'exclude', True, 'primitive'),
|
|
57
|
+
FieldMeta('type_', 'type', True, 'primitive'),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
type TargetFilter = List[FilterEntry] # The entries in TargetFilter are matched sequentially against targets and
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@register("Target.RemoteLocation")
|
|
65
|
+
@dataclass
|
|
66
|
+
class RemoteLocation(DataType):
|
|
67
|
+
host: str
|
|
68
|
+
port: int
|
|
69
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
70
|
+
FieldMeta('host', 'host', False, 'primitive'),
|
|
71
|
+
FieldMeta('port', 'port', False, 'primitive'),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@register("Target.WindowState")
|
|
76
|
+
class WindowState(str, Enum):
|
|
77
|
+
"""The state of the target window."""
|
|
78
|
+
NORMAL = 'normal'
|
|
79
|
+
MINIMIZED = 'minimized'
|
|
80
|
+
MAXIMIZED = 'maximized'
|
|
81
|
+
FULLSCREEN = 'fullscreen'
|
|
82
|
+
|
|
83
|
+
__all__ = ["FilterEntry", "RemoteLocation", "SessionID", "TargetFilter", "TargetID", "TargetInfo", "WindowState"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""The Tethering CDP domain (generated).
|
|
2
|
+
|
|
3
|
+
Importing ``Tethering`` from ``parsek_cdp.cdp`` gives a namespace with this
|
|
4
|
+
domain's events and types as attributes (``Tethering.SomeEvent`` /
|
|
5
|
+
``Tethering.SomeType``); commands run on a target via ``page.cdp.Tethering``.
|
|
6
|
+
"""
|
|
7
|
+
from . import events, functions, types
|
|
8
|
+
from .functions import Tethering
|
|
9
|
+
from .events import * # noqa: F401,F403 -- expose events on the namespace
|
|
10
|
+
from .types import * # noqa: F401,F403 -- expose types on the namespace
|
|
11
|
+
|
|
12
|
+
#: Protocol domain name (used by features that declare ``domains=(Tethering,)``).
|
|
13
|
+
DOMAIN = "Tethering"
|
|
14
|
+
|
|
15
|
+
__all__ = ["events", "functions", "types", "Tethering", "DOMAIN"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Events for the Tethering domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import FieldMeta
|
|
8
|
+
from ..mixins.event import Event, register_event
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@register_event("Tethering.accepted")
|
|
12
|
+
@dataclass
|
|
13
|
+
class Accepted(Event):
|
|
14
|
+
"""Informs that port was successfully bound and got a specified connection id."""
|
|
15
|
+
port: int
|
|
16
|
+
connection_id: str
|
|
17
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
18
|
+
FieldMeta('port', 'port', False, 'primitive'),
|
|
19
|
+
FieldMeta('connection_id', 'connectionId', False, 'primitive'),
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = ["Accepted"]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Commands for the Tethering domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import DataType, FieldMeta, encode
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Tethering:
|
|
11
|
+
"""Commands of the Tethering domain, bound to a target."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, target: Any) -> None:
|
|
14
|
+
self._target = target
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
async def bind(self, *, port: int) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Request browser port binding.
|
|
20
|
+
:param port: Port number to bind.
|
|
21
|
+
"""
|
|
22
|
+
_params: Dict[str, Any] = {}
|
|
23
|
+
_params['port'] = encode(FieldMeta('', '', False, 'primitive'), port)
|
|
24
|
+
_result = await self._target.send('Tethering.bind', _params)
|
|
25
|
+
return None
|
|
26
|
+
|
|
27
|
+
async def unbind(self, *, port: int) -> None:
|
|
28
|
+
"""
|
|
29
|
+
Request browser port unbinding.
|
|
30
|
+
:param port: Port number to unbind.
|
|
31
|
+
"""
|
|
32
|
+
_params: Dict[str, Any] = {}
|
|
33
|
+
_params['port'] = encode(FieldMeta('', '', False, 'primitive'), port)
|
|
34
|
+
_result = await self._target.send('Tethering.unbind', _params)
|
|
35
|
+
return None
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Custom types and enums for the Tethering domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from ..mixins.datatype import DataType, FieldMeta, register
|
|
9
|
+
|
|
10
|
+
__all__ = []
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""The Tracing CDP domain (generated).
|
|
2
|
+
|
|
3
|
+
Importing ``Tracing`` from ``parsek_cdp.cdp`` gives a namespace with this
|
|
4
|
+
domain's events and types as attributes (``Tracing.SomeEvent`` /
|
|
5
|
+
``Tracing.SomeType``); commands run on a target via ``page.cdp.Tracing``.
|
|
6
|
+
"""
|
|
7
|
+
from . import events, functions, types
|
|
8
|
+
from .functions import Tracing
|
|
9
|
+
from .events import * # noqa: F401,F403 -- expose events on the namespace
|
|
10
|
+
from .types import * # noqa: F401,F403 -- expose types on the namespace
|
|
11
|
+
|
|
12
|
+
#: Protocol domain name (used by features that declare ``domains=(Tracing,)``).
|
|
13
|
+
DOMAIN = "Tracing"
|
|
14
|
+
|
|
15
|
+
__all__ = ["events", "functions", "types", "Tracing", "DOMAIN"]
|