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.
Files changed (242) hide show
  1. parsek_cdp/__init__.py +55 -0
  2. parsek_cdp/_logging.py +49 -0
  3. parsek_cdp/cdp/__init__.py +247 -0
  4. parsek_cdp/cdp/accessibility/__init__.py +15 -0
  5. parsek_cdp/cdp/accessibility/events.py +35 -0
  6. parsek_cdp/cdp/accessibility/functions.py +202 -0
  7. parsek_cdp/cdp/accessibility/types.py +235 -0
  8. parsek_cdp/cdp/animation/__init__.py +15 -0
  9. parsek_cdp/cdp/animation/events.py +52 -0
  10. parsek_cdp/cdp/animation/functions.py +140 -0
  11. parsek_cdp/cdp/animation/types.py +113 -0
  12. parsek_cdp/cdp/audits/__init__.py +15 -0
  13. parsek_cdp/cdp/audits/events.py +21 -0
  14. parsek_cdp/cdp/audits/functions.py +95 -0
  15. parsek_cdp/cdp/audits/types.py +1051 -0
  16. parsek_cdp/cdp/autofill/__init__.py +15 -0
  17. parsek_cdp/cdp/autofill/events.py +27 -0
  18. parsek_cdp/cdp/autofill/functions.py +64 -0
  19. parsek_cdp/cdp/autofill/types.py +108 -0
  20. parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
  21. parsek_cdp/cdp/backgroundservice/events.py +40 -0
  22. parsek_cdp/cdp/backgroundservice/functions.py +59 -0
  23. parsek_cdp/cdp/backgroundservice/types.py +63 -0
  24. parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
  25. parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
  26. parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
  27. parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
  28. parsek_cdp/cdp/browser/__init__.py +15 -0
  29. parsek_cdp/cdp/browser/events.py +46 -0
  30. parsek_cdp/cdp/browser/functions.py +350 -0
  31. parsek_cdp/cdp/browser/types.py +158 -0
  32. parsek_cdp/cdp/cachestorage/__init__.py +15 -0
  33. parsek_cdp/cdp/cachestorage/events.py +13 -0
  34. parsek_cdp/cdp/cachestorage/functions.py +126 -0
  35. parsek_cdp/cdp/cachestorage/types.py +89 -0
  36. parsek_cdp/cdp/cast/__init__.py +15 -0
  37. parsek_cdp/cdp/cast/events.py +38 -0
  38. parsek_cdp/cdp/cast/functions.py +77 -0
  39. parsek_cdp/cdp/cast/types.py +23 -0
  40. parsek_cdp/cdp/console/__init__.py +15 -0
  41. parsek_cdp/cdp/console/events.py +22 -0
  42. parsek_cdp/cdp/console/functions.py +36 -0
  43. parsek_cdp/cdp/console/types.py +30 -0
  44. parsek_cdp/cdp/css/__init__.py +15 -0
  45. parsek_cdp/cdp/css/events.py +79 -0
  46. parsek_cdp/cdp/css/functions.py +788 -0
  47. parsek_cdp/cdp/css/types.py +742 -0
  48. parsek_cdp/cdp/debugger/__init__.py +15 -0
  49. parsek_cdp/cdp/debugger/events.py +164 -0
  50. parsek_cdp/cdp/debugger/functions.py +663 -0
  51. parsek_cdp/cdp/debugger/types.py +171 -0
  52. parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
  53. parsek_cdp/cdp/deviceaccess/events.py +30 -0
  54. parsek_cdp/cdp/deviceaccess/functions.py +54 -0
  55. parsek_cdp/cdp/deviceaccess/types.py +28 -0
  56. parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
  57. parsek_cdp/cdp/deviceorientation/events.py +13 -0
  58. parsek_cdp/cdp/deviceorientation/functions.py +35 -0
  59. parsek_cdp/cdp/deviceorientation/types.py +10 -0
  60. parsek_cdp/cdp/dom/__init__.py +15 -0
  61. parsek_cdp/cdp/dom/events.py +228 -0
  62. parsek_cdp/cdp/dom/functions.py +1033 -0
  63. parsek_cdp/cdp/dom/types.py +293 -0
  64. parsek_cdp/cdp/domdebugger/__init__.py +15 -0
  65. parsek_cdp/cdp/domdebugger/events.py +13 -0
  66. parsek_cdp/cdp/domdebugger/functions.py +155 -0
  67. parsek_cdp/cdp/domdebugger/types.py +57 -0
  68. parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
  69. parsek_cdp/cdp/domsnapshot/events.py +13 -0
  70. parsek_cdp/cdp/domsnapshot/functions.py +111 -0
  71. parsek_cdp/cdp/domsnapshot/types.py +312 -0
  72. parsek_cdp/cdp/domstorage/__init__.py +15 -0
  73. parsek_cdp/cdp/domstorage/events.py +60 -0
  74. parsek_cdp/cdp/domstorage/functions.py +79 -0
  75. parsek_cdp/cdp/domstorage/types.py +30 -0
  76. parsek_cdp/cdp/emulation/__init__.py +15 -0
  77. parsek_cdp/cdp/emulation/events.py +17 -0
  78. parsek_cdp/cdp/emulation/functions.py +688 -0
  79. parsek_cdp/cdp/emulation/types.py +305 -0
  80. parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
  81. parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
  82. parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
  83. parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
  84. parsek_cdp/cdp/extensions/__init__.py +15 -0
  85. parsek_cdp/cdp/extensions/events.py +13 -0
  86. parsek_cdp/cdp/extensions/functions.py +118 -0
  87. parsek_cdp/cdp/extensions/types.py +19 -0
  88. parsek_cdp/cdp/fedcm/__init__.py +15 -0
  89. parsek_cdp/cdp/fedcm/events.py +45 -0
  90. parsek_cdp/cdp/fedcm/functions.py +93 -0
  91. parsek_cdp/cdp/fedcm/types.py +72 -0
  92. parsek_cdp/cdp/fetch/__init__.py +15 -0
  93. parsek_cdp/cdp/fetch/events.py +82 -0
  94. parsek_cdp/cdp/fetch/functions.py +215 -0
  95. parsek_cdp/cdp/fetch/types.py +81 -0
  96. parsek_cdp/cdp/filesystem/__init__.py +15 -0
  97. parsek_cdp/cdp/filesystem/events.py +13 -0
  98. parsek_cdp/cdp/filesystem/functions.py +36 -0
  99. parsek_cdp/cdp/filesystem/types.py +54 -0
  100. parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
  101. parsek_cdp/cdp/headlessexperimental/events.py +13 -0
  102. parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
  103. parsek_cdp/cdp/headlessexperimental/types.py +24 -0
  104. parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
  105. parsek_cdp/cdp/heapprofiler/events.py +65 -0
  106. parsek_cdp/cdp/heapprofiler/functions.py +193 -0
  107. parsek_cdp/cdp/heapprofiler/types.py +57 -0
  108. parsek_cdp/cdp/indexeddb/__init__.py +15 -0
  109. parsek_cdp/cdp/indexeddb/events.py +13 -0
  110. parsek_cdp/cdp/indexeddb/functions.py +232 -0
  111. parsek_cdp/cdp/indexeddb/types.py +120 -0
  112. parsek_cdp/cdp/input/__init__.py +15 -0
  113. parsek_cdp/cdp/input/events.py +25 -0
  114. parsek_cdp/cdp/input/functions.py +361 -0
  115. parsek_cdp/cdp/input/types.py +87 -0
  116. parsek_cdp/cdp/inspector/__init__.py +15 -0
  117. parsek_cdp/cdp/inspector/events.py +41 -0
  118. parsek_cdp/cdp/inspector/functions.py +27 -0
  119. parsek_cdp/cdp/inspector/types.py +10 -0
  120. parsek_cdp/cdp/io/__init__.py +15 -0
  121. parsek_cdp/cdp/io/events.py +13 -0
  122. parsek_cdp/cdp/io/functions.py +77 -0
  123. parsek_cdp/cdp/io/types.py +13 -0
  124. parsek_cdp/cdp/layertree/__init__.py +15 -0
  125. parsek_cdp/cdp/layertree/events.py +36 -0
  126. parsek_cdp/cdp/layertree/functions.py +178 -0
  127. parsek_cdp/cdp/layertree/types.py +104 -0
  128. parsek_cdp/cdp/log/__init__.py +15 -0
  129. parsek_cdp/cdp/log/events.py +22 -0
  130. parsek_cdp/cdp/log/functions.py +54 -0
  131. parsek_cdp/cdp/log/types.py +57 -0
  132. parsek_cdp/cdp/media/__init__.py +15 -0
  133. parsek_cdp/cdp/media/events.py +87 -0
  134. parsek_cdp/cdp/media/functions.py +27 -0
  135. parsek_cdp/cdp/media/types.py +101 -0
  136. parsek_cdp/cdp/memory/__init__.py +15 -0
  137. parsek_cdp/cdp/memory/events.py +13 -0
  138. parsek_cdp/cdp/memory/functions.py +164 -0
  139. parsek_cdp/cdp/memory/types.py +71 -0
  140. parsek_cdp/cdp/mixins/__init__.py +21 -0
  141. parsek_cdp/cdp/mixins/datatype.py +123 -0
  142. parsek_cdp/cdp/mixins/event.py +78 -0
  143. parsek_cdp/cdp/mixins/namespace.py +31 -0
  144. parsek_cdp/cdp/network/__init__.py +15 -0
  145. parsek_cdp/cdp/network/events.py +726 -0
  146. parsek_cdp/cdp/network/functions.py +734 -0
  147. parsek_cdp/cdp/network/types.py +1247 -0
  148. parsek_cdp/cdp/overlay/__init__.py +15 -0
  149. parsek_cdp/cdp/overlay/events.py +54 -0
  150. parsek_cdp/cdp/overlay/functions.py +407 -0
  151. parsek_cdp/cdp/overlay/types.py +328 -0
  152. parsek_cdp/cdp/page/__init__.py +15 -0
  153. parsek_cdp/cdp/page/events.py +416 -0
  154. parsek_cdp/cdp/page/functions.py +1081 -0
  155. parsek_cdp/cdp/page/types.py +1088 -0
  156. parsek_cdp/cdp/performance/__init__.py +15 -0
  157. parsek_cdp/cdp/performance/events.py +24 -0
  158. parsek_cdp/cdp/performance/functions.py +63 -0
  159. parsek_cdp/cdp/performance/types.py +22 -0
  160. parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
  161. parsek_cdp/cdp/performancetimeline/events.py +22 -0
  162. parsek_cdp/cdp/performancetimeline/functions.py +30 -0
  163. parsek_cdp/cdp/performancetimeline/types.py +85 -0
  164. parsek_cdp/cdp/preload/__init__.py +15 -0
  165. parsek_cdp/cdp/preload/events.py +116 -0
  166. parsek_cdp/cdp/preload/functions.py +25 -0
  167. parsek_cdp/cdp/preload/types.py +267 -0
  168. parsek_cdp/cdp/profiler/__init__.py +15 -0
  169. parsek_cdp/cdp/profiler/events.py +64 -0
  170. parsek_cdp/cdp/profiler/functions.py +134 -0
  171. parsek_cdp/cdp/profiler/types.py +105 -0
  172. parsek_cdp/cdp/pwa/__init__.py +15 -0
  173. parsek_cdp/cdp/pwa/events.py +13 -0
  174. parsek_cdp/cdp/pwa/functions.py +196 -0
  175. parsek_cdp/cdp/pwa/types.py +45 -0
  176. parsek_cdp/cdp/runtime/__init__.py +15 -0
  177. parsek_cdp/cdp/runtime/events.py +123 -0
  178. parsek_cdp/cdp/runtime/functions.py +552 -0
  179. parsek_cdp/cdp/runtime/types.py +319 -0
  180. parsek_cdp/cdp/schema/__init__.py +15 -0
  181. parsek_cdp/cdp/schema/events.py +13 -0
  182. parsek_cdp/cdp/schema/functions.py +32 -0
  183. parsek_cdp/cdp/schema/types.py +22 -0
  184. parsek_cdp/cdp/security/__init__.py +15 -0
  185. parsek_cdp/cdp/security/events.py +64 -0
  186. parsek_cdp/cdp/security/functions.py +66 -0
  187. parsek_cdp/cdp/security/types.py +168 -0
  188. parsek_cdp/cdp/serviceworker/__init__.py +15 -0
  189. parsek_cdp/cdp/serviceworker/events.py +43 -0
  190. parsek_cdp/cdp/serviceworker/functions.py +115 -0
  191. parsek_cdp/cdp/serviceworker/types.py +95 -0
  192. parsek_cdp/cdp/storage/__init__.py +15 -0
  193. parsek_cdp/cdp/storage/events.py +288 -0
  194. parsek_cdp/cdp/storage/functions.py +571 -0
  195. parsek_cdp/cdp/storage/types.py +656 -0
  196. parsek_cdp/cdp/systeminfo/__init__.py +15 -0
  197. parsek_cdp/cdp/systeminfo/events.py +13 -0
  198. parsek_cdp/cdp/systeminfo/functions.py +75 -0
  199. parsek_cdp/cdp/systeminfo/types.py +132 -0
  200. parsek_cdp/cdp/target/__init__.py +15 -0
  201. parsek_cdp/cdp/target/events.py +109 -0
  202. parsek_cdp/cdp/target/functions.py +424 -0
  203. parsek_cdp/cdp/target/types.py +83 -0
  204. parsek_cdp/cdp/tethering/__init__.py +15 -0
  205. parsek_cdp/cdp/tethering/events.py +22 -0
  206. parsek_cdp/cdp/tethering/functions.py +35 -0
  207. parsek_cdp/cdp/tethering/types.py +10 -0
  208. parsek_cdp/cdp/tracing/__init__.py +15 -0
  209. parsek_cdp/cdp/tracing/events.py +61 -0
  210. parsek_cdp/cdp/tracing/functions.py +119 -0
  211. parsek_cdp/cdp/tracing/types.py +81 -0
  212. parsek_cdp/cdp/webaudio/__init__.py +15 -0
  213. parsek_cdp/cdp/webaudio/events.py +184 -0
  214. parsek_cdp/cdp/webaudio/functions.py +51 -0
  215. parsek_cdp/cdp/webaudio/types.py +155 -0
  216. parsek_cdp/cdp/webauthn/__init__.py +15 -0
  217. parsek_cdp/cdp/webauthn/events.py +69 -0
  218. parsek_cdp/cdp/webauthn/functions.py +214 -0
  219. parsek_cdp/cdp/webauthn/types.py +96 -0
  220. parsek_cdp/core/__init__.py +18 -0
  221. parsek_cdp/core/browser.py +240 -0
  222. parsek_cdp/core/browser_context.py +58 -0
  223. parsek_cdp/core/element.py +405 -0
  224. parsek_cdp/core/feature.py +376 -0
  225. parsek_cdp/core/frame.py +351 -0
  226. parsek_cdp/core/pagable.py +175 -0
  227. parsek_cdp/core/page.py +163 -0
  228. parsek_cdp/core/target.py +490 -0
  229. parsek_cdp/features/__init__.py +14 -0
  230. parsek_cdp/features/request_listener/__init__.py +256 -0
  231. parsek_cdp/features/request_listener/events.py +48 -0
  232. parsek_cdp/features/request_listener/types.py +235 -0
  233. parsek_cdp/generate.py +642 -0
  234. parsek_cdp/parsek/__init__.py +18 -0
  235. parsek_cdp/parsek/events.py +38 -0
  236. parsek_cdp/parsek/types.py +36 -0
  237. parsek_cdp/py.typed +0 -0
  238. parsek_cdp-0.1.0.dist-info/METADATA +277 -0
  239. parsek_cdp-0.1.0.dist-info/RECORD +242 -0
  240. parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
  241. parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
  242. parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,54 @@
1
+ """Custom types and enums for the FileSystem 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 ..network.types import TimeSinceEpoch as Network_TimeSinceEpoch
12
+ from ..storage.types import SerializedStorageKey as Storage_SerializedStorageKey
13
+
14
+ @register("FileSystem.File")
15
+ @dataclass
16
+ class File(DataType):
17
+ name: str
18
+ last_modified: Network_TimeSinceEpoch
19
+ size: float
20
+ type_: str
21
+ __FIELDS__: ClassVar[tuple] = (
22
+ FieldMeta('name', 'name', False, 'primitive'),
23
+ FieldMeta('last_modified', 'lastModified', False, 'primitive'),
24
+ FieldMeta('size', 'size', False, 'primitive'),
25
+ FieldMeta('type_', 'type', False, 'primitive'),
26
+ )
27
+
28
+
29
+ @register("FileSystem.Directory")
30
+ @dataclass
31
+ class Directory(DataType):
32
+ name: str
33
+ nested_directories: List[str]
34
+ nested_files: List[File]
35
+ __FIELDS__: ClassVar[tuple] = (
36
+ FieldMeta('name', 'name', False, 'primitive'),
37
+ FieldMeta('nested_directories', 'nestedDirectories', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
38
+ FieldMeta('nested_files', 'nestedFiles', False, 'array', inner=FieldMeta('', '', False, 'object', ref='FileSystem.File')),
39
+ )
40
+
41
+
42
+ @register("FileSystem.BucketFileSystemLocator")
43
+ @dataclass
44
+ class BucketFileSystemLocator(DataType):
45
+ storage_key: Storage_SerializedStorageKey
46
+ path_components: List[str]
47
+ bucket_name: Optional[str] = None
48
+ __FIELDS__: ClassVar[tuple] = (
49
+ FieldMeta('storage_key', 'storageKey', False, 'primitive'),
50
+ FieldMeta('path_components', 'pathComponents', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
51
+ FieldMeta('bucket_name', 'bucketName', True, 'primitive'),
52
+ )
53
+
54
+ __all__ = ["BucketFileSystemLocator", "Directory", "File"]
@@ -0,0 +1,15 @@
1
+ """The HeadlessExperimental CDP domain (generated).
2
+
3
+ Importing ``HeadlessExperimental`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``HeadlessExperimental.SomeEvent`` /
5
+ ``HeadlessExperimental.SomeType``); commands run on a target via ``page.cdp.HeadlessExperimental``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import HeadlessExperimental
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=(HeadlessExperimental,)``).
13
+ DOMAIN = "HeadlessExperimental"
14
+
15
+ __all__ = ["events", "functions", "types", "HeadlessExperimental", "DOMAIN"]
@@ -0,0 +1,13 @@
1
+ """Events for the HeadlessExperimental 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
+ # This domain defines no events.
12
+
13
+ __all__ = []
@@ -0,0 +1,77 @@
1
+ """Commands for the HeadlessExperimental 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 ScreenshotParams
11
+
12
+ @dataclass
13
+ class BeginFrameReturn(DataType):
14
+ """Return value of :meth:`HeadlessExperimental.begin_frame`."""
15
+ has_damage: bool
16
+ screenshot_data: Optional[str] = None
17
+ __FIELDS__: ClassVar[tuple] = (
18
+ FieldMeta('has_damage', 'hasDamage', False, 'primitive'),
19
+ FieldMeta('screenshot_data', 'screenshotData', True, 'primitive'),
20
+ )
21
+
22
+
23
+ class HeadlessExperimental:
24
+ """Commands of the HeadlessExperimental domain, bound to a target."""
25
+
26
+ def __init__(self, target: Any) -> None:
27
+ self._target = target
28
+
29
+
30
+ async def begin_frame(self, *, frame_time_ticks: Optional[float] = None, interval: Optional[float] = None, no_display_updates: Optional[bool] = None, screenshot: Optional[ScreenshotParams] = None) -> BeginFrameReturn:
31
+ """
32
+ Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a
33
+ screenshot from the resulting frame. Requires that the target was created with enabled
34
+ BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also
35
+ https://goo.gle/chrome-headless-rendering for more background.
36
+ :param frame_time_ticks: Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set,
37
+ the current time will be used.
38
+ :param interval: The interval between BeginFrames that is reported to the compositor, in milliseconds.
39
+ Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.
40
+ :param no_display_updates: Whether updates should not be committed and drawn onto the display. False by default. If
41
+ true, only side effects of the BeginFrame will be run, such as layout and animations, but
42
+ any visual updates may not be visible on the display or in screenshots.
43
+ :param screenshot: If set, a screenshot of the frame will be captured and returned in the response. Otherwise,
44
+ no screenshot will be captured. Note that capturing a screenshot can fail, for example,
45
+ during renderer initialization. In such a case, no screenshot data will be returned.
46
+ """
47
+ _params: Dict[str, Any] = {}
48
+ if frame_time_ticks is not None:
49
+ _params['frameTimeTicks'] = encode(FieldMeta('', '', False, 'primitive'), frame_time_ticks)
50
+ if interval is not None:
51
+ _params['interval'] = encode(FieldMeta('', '', False, 'primitive'), interval)
52
+ if no_display_updates is not None:
53
+ _params['noDisplayUpdates'] = encode(FieldMeta('', '', False, 'primitive'), no_display_updates)
54
+ if screenshot is not None:
55
+ _params['screenshot'] = encode(FieldMeta('', '', False, 'object', ref='HeadlessExperimental.ScreenshotParams'), screenshot)
56
+ _result = await self._target.send('HeadlessExperimental.beginFrame', _params)
57
+ return BeginFrameReturn.from_json(_result)
58
+
59
+ async def disable(self) -> None:
60
+ """
61
+ Disables headless events for the target.
62
+
63
+ .. deprecated::
64
+ """
65
+ _params: Dict[str, Any] = {}
66
+ _result = await self._target.send('HeadlessExperimental.disable', _params)
67
+ return None
68
+
69
+ async def enable(self) -> None:
70
+ """
71
+ Enables headless events for the target.
72
+
73
+ .. deprecated::
74
+ """
75
+ _params: Dict[str, Any] = {}
76
+ _result = await self._target.send('HeadlessExperimental.enable', _params)
77
+ return None
@@ -0,0 +1,24 @@
1
+ """Custom types and enums for the HeadlessExperimental 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
+
11
+ @register("HeadlessExperimental.ScreenshotParams")
12
+ @dataclass
13
+ class ScreenshotParams(DataType):
14
+ """Encoding options for a screenshot."""
15
+ format: Optional[Literal['jpeg', 'png', 'webp']] = None
16
+ quality: Optional[int] = None
17
+ optimize_for_speed: Optional[bool] = None
18
+ __FIELDS__: ClassVar[tuple] = (
19
+ FieldMeta('format', 'format', True, 'primitive'),
20
+ FieldMeta('quality', 'quality', True, 'primitive'),
21
+ FieldMeta('optimize_for_speed', 'optimizeForSpeed', True, 'primitive'),
22
+ )
23
+
24
+ __all__ = ["ScreenshotParams"]
@@ -0,0 +1,15 @@
1
+ """The HeapProfiler CDP domain (generated).
2
+
3
+ Importing ``HeapProfiler`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``HeapProfiler.SomeEvent`` /
5
+ ``HeapProfiler.SomeType``); commands run on a target via ``page.cdp.HeapProfiler``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import HeapProfiler
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=(HeapProfiler,)``).
13
+ DOMAIN = "HeapProfiler"
14
+
15
+ __all__ = ["events", "functions", "types", "HeapProfiler", "DOMAIN"]
@@ -0,0 +1,65 @@
1
+ """Events for the HeapProfiler 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("HeapProfiler.addHeapSnapshotChunk")
12
+ @dataclass
13
+ class AddHeapSnapshotChunk(Event):
14
+ chunk: str
15
+ __FIELDS__: ClassVar[tuple] = (
16
+ FieldMeta('chunk', 'chunk', False, 'primitive'),
17
+ )
18
+
19
+
20
+ @register_event("HeapProfiler.heapStatsUpdate")
21
+ @dataclass
22
+ class HeapStatsUpdate(Event):
23
+ """If heap objects tracking has been started then backend may send update for one or more fragments"""
24
+ stats_update: List[int]
25
+ __FIELDS__: ClassVar[tuple] = (
26
+ FieldMeta('stats_update', 'statsUpdate', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
27
+ )
28
+
29
+
30
+ @register_event("HeapProfiler.lastSeenObjectId")
31
+ @dataclass
32
+ class LastSeenObjectId(Event):
33
+ """
34
+ If heap objects tracking has been started then backend regularly sends a current value for last
35
+ seen object id and corresponding timestamp. If the were changes in the heap since last event
36
+ then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
37
+ """
38
+ last_seen_object_id: int
39
+ timestamp: float
40
+ __FIELDS__: ClassVar[tuple] = (
41
+ FieldMeta('last_seen_object_id', 'lastSeenObjectId', False, 'primitive'),
42
+ FieldMeta('timestamp', 'timestamp', False, 'primitive'),
43
+ )
44
+
45
+
46
+ @register_event("HeapProfiler.reportHeapSnapshotProgress")
47
+ @dataclass
48
+ class ReportHeapSnapshotProgress(Event):
49
+ done: int
50
+ total: int
51
+ finished: Optional[bool] = None
52
+ __FIELDS__: ClassVar[tuple] = (
53
+ FieldMeta('done', 'done', False, 'primitive'),
54
+ FieldMeta('total', 'total', False, 'primitive'),
55
+ FieldMeta('finished', 'finished', True, 'primitive'),
56
+ )
57
+
58
+
59
+ @register_event("HeapProfiler.resetProfiles")
60
+ @dataclass
61
+ class ResetProfiles(Event):
62
+ pass
63
+ __FIELDS__: ClassVar[tuple] = ()
64
+
65
+ __all__ = ["AddHeapSnapshotChunk", "HeapStatsUpdate", "LastSeenObjectId", "ReportHeapSnapshotProgress", "ResetProfiles"]
@@ -0,0 +1,193 @@
1
+ """Commands for the HeapProfiler 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
+ HeapSnapshotObjectId,
12
+ SamplingHeapProfile,
13
+ )
14
+ from ..runtime.types import RemoteObject as Runtime_RemoteObject
15
+ from ..runtime.types import RemoteObjectId as Runtime_RemoteObjectId
16
+
17
+ @dataclass
18
+ class GetHeapObjectIdReturn(DataType):
19
+ """Return value of :meth:`HeapProfiler.get_heap_object_id`."""
20
+ heap_snapshot_object_id: HeapSnapshotObjectId
21
+ __FIELDS__: ClassVar[tuple] = (
22
+ FieldMeta('heap_snapshot_object_id', 'heapSnapshotObjectId', False, 'primitive'),
23
+ )
24
+
25
+
26
+ @dataclass
27
+ class GetObjectByHeapObjectIdReturn(DataType):
28
+ """Return value of :meth:`HeapProfiler.get_object_by_heap_object_id`."""
29
+ result: Runtime_RemoteObject
30
+ __FIELDS__: ClassVar[tuple] = (
31
+ FieldMeta('result', 'result', False, 'object', ref='Runtime.RemoteObject'),
32
+ )
33
+
34
+
35
+ @dataclass
36
+ class GetSamplingProfileReturn(DataType):
37
+ """Return value of :meth:`HeapProfiler.get_sampling_profile`."""
38
+ profile: SamplingHeapProfile
39
+ __FIELDS__: ClassVar[tuple] = (
40
+ FieldMeta('profile', 'profile', False, 'object', ref='HeapProfiler.SamplingHeapProfile'),
41
+ )
42
+
43
+
44
+ @dataclass
45
+ class StopSamplingReturn(DataType):
46
+ """Return value of :meth:`HeapProfiler.stop_sampling`."""
47
+ profile: SamplingHeapProfile
48
+ __FIELDS__: ClassVar[tuple] = (
49
+ FieldMeta('profile', 'profile', False, 'object', ref='HeapProfiler.SamplingHeapProfile'),
50
+ )
51
+
52
+
53
+ class HeapProfiler:
54
+ """Commands of the HeapProfiler domain, bound to a target."""
55
+
56
+ def __init__(self, target: Any) -> None:
57
+ self._target = target
58
+
59
+
60
+ async def add_inspected_heap_object(self, *, heap_object_id: HeapSnapshotObjectId) -> None:
61
+ """
62
+ Enables console to refer to the node with given id via $x (see Command Line API for more details
63
+ $x functions).
64
+ :param heap_object_id: Heap snapshot object id to be accessible by means of $x command line API.
65
+ """
66
+ _params: Dict[str, Any] = {}
67
+ _params['heapObjectId'] = encode(FieldMeta('', '', False, 'primitive'), heap_object_id)
68
+ _result = await self._target.send('HeapProfiler.addInspectedHeapObject', _params)
69
+ return None
70
+
71
+ async def collect_garbage(self) -> None:
72
+ _params: Dict[str, Any] = {}
73
+ _result = await self._target.send('HeapProfiler.collectGarbage', _params)
74
+ return None
75
+
76
+ async def disable(self) -> None:
77
+ _params: Dict[str, Any] = {}
78
+ _result = await self._target.send('HeapProfiler.disable', _params)
79
+ return None
80
+
81
+ async def enable(self) -> None:
82
+ _params: Dict[str, Any] = {}
83
+ _result = await self._target.send('HeapProfiler.enable', _params)
84
+ return None
85
+
86
+ async def get_heap_object_id(self, *, object_id: Runtime_RemoteObjectId) -> GetHeapObjectIdReturn:
87
+ """:param object_id: Identifier of the object to get heap object id for."""
88
+ _params: Dict[str, Any] = {}
89
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
90
+ _result = await self._target.send('HeapProfiler.getHeapObjectId', _params)
91
+ return GetHeapObjectIdReturn.from_json(_result)
92
+
93
+ async def get_object_by_heap_object_id(self, *, object_id: HeapSnapshotObjectId, object_group: Optional[str] = None) -> GetObjectByHeapObjectIdReturn:
94
+ """
95
+ :param object_id:
96
+ :param object_group: Symbolic group name that can be used to release multiple objects.
97
+ """
98
+ _params: Dict[str, Any] = {}
99
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
100
+ if object_group is not None:
101
+ _params['objectGroup'] = encode(FieldMeta('', '', False, 'primitive'), object_group)
102
+ _result = await self._target.send('HeapProfiler.getObjectByHeapObjectId', _params)
103
+ return GetObjectByHeapObjectIdReturn.from_json(_result)
104
+
105
+ async def get_sampling_profile(self) -> GetSamplingProfileReturn:
106
+ _params: Dict[str, Any] = {}
107
+ _result = await self._target.send('HeapProfiler.getSamplingProfile', _params)
108
+ return GetSamplingProfileReturn.from_json(_result)
109
+
110
+ async def start_sampling(self, *, sampling_interval: Optional[float] = None, stack_depth: Optional[float] = None, include_objects_collected_by_major_gc: Optional[bool] = None, include_objects_collected_by_minor_gc: Optional[bool] = None) -> None:
111
+ """
112
+ :param sampling_interval: Average sample interval in bytes. Poisson distribution is used for the intervals. The
113
+ default value is 32768 bytes.
114
+ :param stack_depth: Maximum stack depth. The default value is 128.
115
+ :param include_objects_collected_by_major_gc: By default, the sampling heap profiler reports only objects which are
116
+ still alive when the profile is returned via getSamplingProfile or
117
+ stopSampling, which is useful for determining what functions contribute
118
+ the most to steady-state memory usage. This flag instructs the sampling
119
+ heap profiler to also include information about objects discarded by
120
+ major GC, which will show which functions cause large temporary memory
121
+ usage or long GC pauses.
122
+ :param include_objects_collected_by_minor_gc: By default, the sampling heap profiler reports only objects which are
123
+ still alive when the profile is returned via getSamplingProfile or
124
+ stopSampling, which is useful for determining what functions contribute
125
+ the most to steady-state memory usage. This flag instructs the sampling
126
+ heap profiler to also include information about objects discarded by
127
+ minor GC, which is useful when tuning a latency-sensitive application
128
+ for minimal GC activity.
129
+ """
130
+ _params: Dict[str, Any] = {}
131
+ if sampling_interval is not None:
132
+ _params['samplingInterval'] = encode(FieldMeta('', '', False, 'primitive'), sampling_interval)
133
+ if stack_depth is not None:
134
+ _params['stackDepth'] = encode(FieldMeta('', '', False, 'primitive'), stack_depth)
135
+ if include_objects_collected_by_major_gc is not None:
136
+ _params['includeObjectsCollectedByMajorGC'] = encode(FieldMeta('', '', False, 'primitive'), include_objects_collected_by_major_gc)
137
+ if include_objects_collected_by_minor_gc is not None:
138
+ _params['includeObjectsCollectedByMinorGC'] = encode(FieldMeta('', '', False, 'primitive'), include_objects_collected_by_minor_gc)
139
+ _result = await self._target.send('HeapProfiler.startSampling', _params)
140
+ return None
141
+
142
+ async def start_tracking_heap_objects(self, *, track_allocations: Optional[bool] = None) -> None:
143
+ """:param track_allocations:"""
144
+ _params: Dict[str, Any] = {}
145
+ if track_allocations is not None:
146
+ _params['trackAllocations'] = encode(FieldMeta('', '', False, 'primitive'), track_allocations)
147
+ _result = await self._target.send('HeapProfiler.startTrackingHeapObjects', _params)
148
+ return None
149
+
150
+ async def stop_sampling(self) -> StopSamplingReturn:
151
+ _params: Dict[str, Any] = {}
152
+ _result = await self._target.send('HeapProfiler.stopSampling', _params)
153
+ return StopSamplingReturn.from_json(_result)
154
+
155
+ async def stop_tracking_heap_objects(self, *, report_progress: Optional[bool] = None, treat_global_objects_as_roots: Optional[bool] = None, capture_numeric_value: Optional[bool] = None, expose_internals: Optional[bool] = None) -> None:
156
+ """
157
+ :param report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken
158
+ when the tracking is stopped.
159
+ :param treat_global_objects_as_roots: Deprecated in favor of `exposeInternals`.
160
+ :param capture_numeric_value: If true, numerical values are included in the snapshot
161
+ :param expose_internals: If true, exposes internals of the snapshot.
162
+ """
163
+ _params: Dict[str, Any] = {}
164
+ if report_progress is not None:
165
+ _params['reportProgress'] = encode(FieldMeta('', '', False, 'primitive'), report_progress)
166
+ if treat_global_objects_as_roots is not None:
167
+ _params['treatGlobalObjectsAsRoots'] = encode(FieldMeta('', '', False, 'primitive'), treat_global_objects_as_roots)
168
+ if capture_numeric_value is not None:
169
+ _params['captureNumericValue'] = encode(FieldMeta('', '', False, 'primitive'), capture_numeric_value)
170
+ if expose_internals is not None:
171
+ _params['exposeInternals'] = encode(FieldMeta('', '', False, 'primitive'), expose_internals)
172
+ _result = await self._target.send('HeapProfiler.stopTrackingHeapObjects', _params)
173
+ return None
174
+
175
+ async def take_heap_snapshot(self, *, report_progress: Optional[bool] = None, treat_global_objects_as_roots: Optional[bool] = None, capture_numeric_value: Optional[bool] = None, expose_internals: Optional[bool] = None) -> None:
176
+ """
177
+ :param report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
178
+ :param treat_global_objects_as_roots: If true, a raw snapshot without artificial roots will be generated.
179
+ Deprecated in favor of `exposeInternals`.
180
+ :param capture_numeric_value: If true, numerical values are included in the snapshot
181
+ :param expose_internals: If true, exposes internals of the snapshot.
182
+ """
183
+ _params: Dict[str, Any] = {}
184
+ if report_progress is not None:
185
+ _params['reportProgress'] = encode(FieldMeta('', '', False, 'primitive'), report_progress)
186
+ if treat_global_objects_as_roots is not None:
187
+ _params['treatGlobalObjectsAsRoots'] = encode(FieldMeta('', '', False, 'primitive'), treat_global_objects_as_roots)
188
+ if capture_numeric_value is not None:
189
+ _params['captureNumericValue'] = encode(FieldMeta('', '', False, 'primitive'), capture_numeric_value)
190
+ if expose_internals is not None:
191
+ _params['exposeInternals'] = encode(FieldMeta('', '', False, 'primitive'), expose_internals)
192
+ _result = await self._target.send('HeapProfiler.takeHeapSnapshot', _params)
193
+ return None
@@ -0,0 +1,57 @@
1
+ """Custom types and enums for the HeapProfiler 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 ..runtime.types import CallFrame as Runtime_CallFrame
12
+
13
+ type HeapSnapshotObjectId = str # Heap snapshot object id.
14
+
15
+
16
+ @register("HeapProfiler.SamplingHeapProfileNode")
17
+ @dataclass
18
+ class SamplingHeapProfileNode(DataType):
19
+ """Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes."""
20
+ call_frame: Runtime_CallFrame
21
+ self_size: float
22
+ id: int
23
+ children: List[SamplingHeapProfileNode]
24
+ __FIELDS__: ClassVar[tuple] = (
25
+ FieldMeta('call_frame', 'callFrame', False, 'object', ref='Runtime.CallFrame'),
26
+ FieldMeta('self_size', 'selfSize', False, 'primitive'),
27
+ FieldMeta('id', 'id', False, 'primitive'),
28
+ FieldMeta('children', 'children', False, 'array', inner=FieldMeta('', '', False, 'object', ref='HeapProfiler.SamplingHeapProfileNode')),
29
+ )
30
+
31
+
32
+ @register("HeapProfiler.SamplingHeapProfileSample")
33
+ @dataclass
34
+ class SamplingHeapProfileSample(DataType):
35
+ """A single sample from a sampling profile."""
36
+ size: float
37
+ node_id: int
38
+ ordinal: float
39
+ __FIELDS__: ClassVar[tuple] = (
40
+ FieldMeta('size', 'size', False, 'primitive'),
41
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
42
+ FieldMeta('ordinal', 'ordinal', False, 'primitive'),
43
+ )
44
+
45
+
46
+ @register("HeapProfiler.SamplingHeapProfile")
47
+ @dataclass
48
+ class SamplingHeapProfile(DataType):
49
+ """Sampling profile."""
50
+ head: SamplingHeapProfileNode
51
+ samples: List[SamplingHeapProfileSample]
52
+ __FIELDS__: ClassVar[tuple] = (
53
+ FieldMeta('head', 'head', False, 'object', ref='HeapProfiler.SamplingHeapProfileNode'),
54
+ FieldMeta('samples', 'samples', False, 'array', inner=FieldMeta('', '', False, 'object', ref='HeapProfiler.SamplingHeapProfileSample')),
55
+ )
56
+
57
+ __all__ = ["HeapSnapshotObjectId", "SamplingHeapProfile", "SamplingHeapProfileNode", "SamplingHeapProfileSample"]
@@ -0,0 +1,15 @@
1
+ """The IndexedDB CDP domain (generated).
2
+
3
+ Importing ``IndexedDB`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``IndexedDB.SomeEvent`` /
5
+ ``IndexedDB.SomeType``); commands run on a target via ``page.cdp.IndexedDB``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import IndexedDB
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=(IndexedDB,)``).
13
+ DOMAIN = "IndexedDB"
14
+
15
+ __all__ = ["events", "functions", "types", "IndexedDB", "DOMAIN"]
@@ -0,0 +1,13 @@
1
+ """Events for the IndexedDB 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
+ # This domain defines no events.
12
+
13
+ __all__ = []