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,15 @@
1
+ """The Performance CDP domain (generated).
2
+
3
+ Importing ``Performance`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``Performance.SomeEvent`` /
5
+ ``Performance.SomeType``); commands run on a target via ``page.cdp.Performance``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import Performance
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=(Performance,)``).
13
+ DOMAIN = "Performance"
14
+
15
+ __all__ = ["events", "functions", "types", "Performance", "DOMAIN"]
@@ -0,0 +1,24 @@
1
+ """Events for the Performance 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 FieldMeta
8
+ from ..mixins.event import Event, register_event
9
+
10
+ if TYPE_CHECKING:
11
+ from .types import Metric
12
+
13
+ @register_event("Performance.metrics")
14
+ @dataclass
15
+ class Metrics(Event):
16
+ """Current values of the metrics."""
17
+ metrics: List[Metric]
18
+ title: str
19
+ __FIELDS__: ClassVar[tuple] = (
20
+ FieldMeta('metrics', 'metrics', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Performance.Metric')),
21
+ FieldMeta('title', 'title', False, 'primitive'),
22
+ )
23
+
24
+ __all__ = ["Metrics"]
@@ -0,0 +1,63 @@
1
+ """Commands for the Performance 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 Metric
11
+
12
+ @dataclass
13
+ class GetMetricsReturn(DataType):
14
+ """Return value of :meth:`Performance.get_metrics`."""
15
+ metrics: List[Metric]
16
+ __FIELDS__: ClassVar[tuple] = (
17
+ FieldMeta('metrics', 'metrics', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Performance.Metric')),
18
+ )
19
+
20
+
21
+ class Performance:
22
+ """Commands of the Performance domain, bound to a target."""
23
+
24
+ def __init__(self, target: Any) -> None:
25
+ self._target = target
26
+
27
+
28
+ async def disable(self) -> None:
29
+ """Disable collecting and reporting metrics."""
30
+ _params: Dict[str, Any] = {}
31
+ _result = await self._target.send('Performance.disable', _params)
32
+ return None
33
+
34
+ async def enable(self, *, time_domain: Optional[Literal['timeTicks', 'threadTicks']] = None) -> None:
35
+ """
36
+ Enable collecting and reporting metrics.
37
+ :param time_domain: Time domain to use for collecting and reporting duration metrics.
38
+ """
39
+ _params: Dict[str, Any] = {}
40
+ if time_domain is not None:
41
+ _params['timeDomain'] = encode(FieldMeta('', '', False, 'primitive'), time_domain)
42
+ _result = await self._target.send('Performance.enable', _params)
43
+ return None
44
+
45
+ async def set_time_domain(self, *, time_domain: Literal['timeTicks', 'threadTicks']) -> None:
46
+ """
47
+ Sets time domain to use for collecting and reporting duration metrics.
48
+ Note that this must be called before enabling metrics collection. Calling
49
+ this method while metrics collection is enabled returns an error.
50
+
51
+ .. deprecated::
52
+ :param time_domain: Time domain
53
+ """
54
+ _params: Dict[str, Any] = {}
55
+ _params['timeDomain'] = encode(FieldMeta('', '', False, 'primitive'), time_domain)
56
+ _result = await self._target.send('Performance.setTimeDomain', _params)
57
+ return None
58
+
59
+ async def get_metrics(self) -> GetMetricsReturn:
60
+ """Retrieve current values of run-time metrics."""
61
+ _params: Dict[str, Any] = {}
62
+ _result = await self._target.send('Performance.getMetrics', _params)
63
+ return GetMetricsReturn.from_json(_result)
@@ -0,0 +1,22 @@
1
+ """Custom types and enums for the Performance 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("Performance.Metric")
12
+ @dataclass
13
+ class Metric(DataType):
14
+ """Run-time execution metric."""
15
+ name: str
16
+ value: float
17
+ __FIELDS__: ClassVar[tuple] = (
18
+ FieldMeta('name', 'name', False, 'primitive'),
19
+ FieldMeta('value', 'value', False, 'primitive'),
20
+ )
21
+
22
+ __all__ = ["Metric"]
@@ -0,0 +1,15 @@
1
+ """The PerformanceTimeline CDP domain (generated).
2
+
3
+ Importing ``PerformanceTimeline`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``PerformanceTimeline.SomeEvent`` /
5
+ ``PerformanceTimeline.SomeType``); commands run on a target via ``page.cdp.PerformanceTimeline``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import PerformanceTimeline
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=(PerformanceTimeline,)``).
13
+ DOMAIN = "PerformanceTimeline"
14
+
15
+ __all__ = ["events", "functions", "types", "PerformanceTimeline", "DOMAIN"]
@@ -0,0 +1,22 @@
1
+ """Events for the PerformanceTimeline 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 FieldMeta
8
+ from ..mixins.event import Event, register_event
9
+
10
+ if TYPE_CHECKING:
11
+ from .types import TimelineEvent
12
+
13
+ @register_event("PerformanceTimeline.timelineEventAdded")
14
+ @dataclass
15
+ class TimelineEventAdded(Event):
16
+ """Sent when a performance timeline event is added. See reportPerformanceTimeline method."""
17
+ event: TimelineEvent
18
+ __FIELDS__: ClassVar[tuple] = (
19
+ FieldMeta('event', 'event', False, 'object', ref='PerformanceTimeline.TimelineEvent'),
20
+ )
21
+
22
+ __all__ = ["TimelineEventAdded"]
@@ -0,0 +1,30 @@
1
+ """Commands for the PerformanceTimeline 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 PerformanceTimeline:
11
+ """Commands of the PerformanceTimeline domain, bound to a target."""
12
+
13
+ def __init__(self, target: Any) -> None:
14
+ self._target = target
15
+
16
+
17
+ async def enable(self, *, event_types: List[str]) -> None:
18
+ """
19
+ Previously buffered events would be reported before method returns.
20
+ See also: timelineEventAdded
21
+ :param event_types: The types of event to report, as specified in
22
+ https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype
23
+ The specified filter overrides any previous filters, passing empty
24
+ filter disables recording.
25
+ Note that not all types exposed to the web platform are currently supported.
26
+ """
27
+ _params: Dict[str, Any] = {}
28
+ _params['eventTypes'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), event_types)
29
+ _result = await self._target.send('PerformanceTimeline.enable', _params)
30
+ return None
@@ -0,0 +1,85 @@
1
+ """Custom types and enums for the PerformanceTimeline 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 ..dom.types import BackendNodeId as DOM_BackendNodeId
12
+ from ..dom.types import Rect as DOM_Rect
13
+ from ..network.types import TimeSinceEpoch as Network_TimeSinceEpoch
14
+ from ..page.types import FrameId as Page_FrameId
15
+
16
+ @register("PerformanceTimeline.LargestContentfulPaint")
17
+ @dataclass
18
+ class LargestContentfulPaint(DataType):
19
+ """See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl"""
20
+ render_time: Network_TimeSinceEpoch
21
+ load_time: Network_TimeSinceEpoch
22
+ size: float
23
+ element_id: Optional[str] = None
24
+ url: Optional[str] = None
25
+ node_id: Optional[DOM_BackendNodeId] = None
26
+ __FIELDS__: ClassVar[tuple] = (
27
+ FieldMeta('render_time', 'renderTime', False, 'primitive'),
28
+ FieldMeta('load_time', 'loadTime', False, 'primitive'),
29
+ FieldMeta('size', 'size', False, 'primitive'),
30
+ FieldMeta('element_id', 'elementId', True, 'primitive'),
31
+ FieldMeta('url', 'url', True, 'primitive'),
32
+ FieldMeta('node_id', 'nodeId', True, 'primitive'),
33
+ )
34
+
35
+
36
+ @register("PerformanceTimeline.LayoutShiftAttribution")
37
+ @dataclass
38
+ class LayoutShiftAttribution(DataType):
39
+ previous_rect: DOM_Rect
40
+ current_rect: DOM_Rect
41
+ node_id: Optional[DOM_BackendNodeId] = None
42
+ __FIELDS__: ClassVar[tuple] = (
43
+ FieldMeta('previous_rect', 'previousRect', False, 'object', ref='DOM.Rect'),
44
+ FieldMeta('current_rect', 'currentRect', False, 'object', ref='DOM.Rect'),
45
+ FieldMeta('node_id', 'nodeId', True, 'primitive'),
46
+ )
47
+
48
+
49
+ @register("PerformanceTimeline.LayoutShift")
50
+ @dataclass
51
+ class LayoutShift(DataType):
52
+ """See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl"""
53
+ value: float
54
+ had_recent_input: bool
55
+ last_input_time: Network_TimeSinceEpoch
56
+ sources: List[LayoutShiftAttribution]
57
+ __FIELDS__: ClassVar[tuple] = (
58
+ FieldMeta('value', 'value', False, 'primitive'),
59
+ FieldMeta('had_recent_input', 'hadRecentInput', False, 'primitive'),
60
+ FieldMeta('last_input_time', 'lastInputTime', False, 'primitive'),
61
+ FieldMeta('sources', 'sources', False, 'array', inner=FieldMeta('', '', False, 'object', ref='PerformanceTimeline.LayoutShiftAttribution')),
62
+ )
63
+
64
+
65
+ @register("PerformanceTimeline.TimelineEvent")
66
+ @dataclass
67
+ class TimelineEvent(DataType):
68
+ frame_id: Page_FrameId
69
+ type_: str
70
+ name: str
71
+ time: Network_TimeSinceEpoch
72
+ duration: Optional[float] = None
73
+ lcp_details: Optional[LargestContentfulPaint] = None
74
+ layout_shift_details: Optional[LayoutShift] = None
75
+ __FIELDS__: ClassVar[tuple] = (
76
+ FieldMeta('frame_id', 'frameId', False, 'primitive'),
77
+ FieldMeta('type_', 'type', False, 'primitive'),
78
+ FieldMeta('name', 'name', False, 'primitive'),
79
+ FieldMeta('time', 'time', False, 'primitive'),
80
+ FieldMeta('duration', 'duration', True, 'primitive'),
81
+ FieldMeta('lcp_details', 'lcpDetails', True, 'object', ref='PerformanceTimeline.LargestContentfulPaint'),
82
+ FieldMeta('layout_shift_details', 'layoutShiftDetails', True, 'object', ref='PerformanceTimeline.LayoutShift'),
83
+ )
84
+
85
+ __all__ = ["LargestContentfulPaint", "LayoutShift", "LayoutShiftAttribution", "TimelineEvent"]
@@ -0,0 +1,15 @@
1
+ """The Preload CDP domain (generated).
2
+
3
+ Importing ``Preload`` from ``parsek_cdp.cdp`` gives a namespace with this
4
+ domain's events and types as attributes (``Preload.SomeEvent`` /
5
+ ``Preload.SomeType``); commands run on a target via ``page.cdp.Preload``.
6
+ """
7
+ from . import events, functions, types
8
+ from .functions import Preload
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=(Preload,)``).
13
+ DOMAIN = "Preload"
14
+
15
+ __all__ = ["events", "functions", "types", "Preload", "DOMAIN"]
@@ -0,0 +1,116 @@
1
+ """Events for the Preload 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 FieldMeta
8
+ from ..mixins.event import Event, register_event
9
+
10
+ if TYPE_CHECKING:
11
+ from .types import (
12
+ PrefetchStatus,
13
+ PreloadPipelineId,
14
+ PreloadingAttemptKey,
15
+ PreloadingAttemptSource,
16
+ PreloadingStatus,
17
+ PrerenderFinalStatus,
18
+ PrerenderMismatchedHeaders,
19
+ RuleSet,
20
+ RuleSetId,
21
+ )
22
+ from ..network.types import LoaderId as Network_LoaderId
23
+ from ..network.types import RequestId as Network_RequestId
24
+ from ..page.types import FrameId as Page_FrameId
25
+
26
+ @register_event("Preload.ruleSetUpdated")
27
+ @dataclass
28
+ class RuleSetUpdated(Event):
29
+ """Upsert. Currently, it is only emitted when a rule set added."""
30
+ rule_set: RuleSet
31
+ __FIELDS__: ClassVar[tuple] = (
32
+ FieldMeta('rule_set', 'ruleSet', False, 'object', ref='Preload.RuleSet'),
33
+ )
34
+
35
+
36
+ @register_event("Preload.ruleSetRemoved")
37
+ @dataclass
38
+ class RuleSetRemoved(Event):
39
+ id: RuleSetId
40
+ __FIELDS__: ClassVar[tuple] = (
41
+ FieldMeta('id', 'id', False, 'primitive'),
42
+ )
43
+
44
+
45
+ @register_event("Preload.preloadEnabledStateUpdated")
46
+ @dataclass
47
+ class PreloadEnabledStateUpdated(Event):
48
+ """Fired when a preload enabled state is updated."""
49
+ disabled_by_preference: bool
50
+ disabled_by_data_saver: bool
51
+ disabled_by_battery_saver: bool
52
+ disabled_by_holdback_prefetch_speculation_rules: bool
53
+ disabled_by_holdback_prerender_speculation_rules: bool
54
+ __FIELDS__: ClassVar[tuple] = (
55
+ FieldMeta('disabled_by_preference', 'disabledByPreference', False, 'primitive'),
56
+ FieldMeta('disabled_by_data_saver', 'disabledByDataSaver', False, 'primitive'),
57
+ FieldMeta('disabled_by_battery_saver', 'disabledByBatterySaver', False, 'primitive'),
58
+ FieldMeta('disabled_by_holdback_prefetch_speculation_rules', 'disabledByHoldbackPrefetchSpeculationRules', False, 'primitive'),
59
+ FieldMeta('disabled_by_holdback_prerender_speculation_rules', 'disabledByHoldbackPrerenderSpeculationRules', False, 'primitive'),
60
+ )
61
+
62
+
63
+ @register_event("Preload.prefetchStatusUpdated")
64
+ @dataclass
65
+ class PrefetchStatusUpdated(Event):
66
+ """Fired when a prefetch attempt is updated."""
67
+ key: PreloadingAttemptKey
68
+ pipeline_id: PreloadPipelineId
69
+ initiating_frame_id: Page_FrameId
70
+ prefetch_url: str
71
+ status: PreloadingStatus
72
+ prefetch_status: PrefetchStatus
73
+ request_id: Network_RequestId
74
+ __FIELDS__: ClassVar[tuple] = (
75
+ FieldMeta('key', 'key', False, 'object', ref='Preload.PreloadingAttemptKey'),
76
+ FieldMeta('pipeline_id', 'pipelineId', False, 'primitive'),
77
+ FieldMeta('initiating_frame_id', 'initiatingFrameId', False, 'primitive'),
78
+ FieldMeta('prefetch_url', 'prefetchUrl', False, 'primitive'),
79
+ FieldMeta('status', 'status', False, 'enum', ref='Preload.PreloadingStatus'),
80
+ FieldMeta('prefetch_status', 'prefetchStatus', False, 'enum', ref='Preload.PrefetchStatus'),
81
+ FieldMeta('request_id', 'requestId', False, 'primitive'),
82
+ )
83
+
84
+
85
+ @register_event("Preload.prerenderStatusUpdated")
86
+ @dataclass
87
+ class PrerenderStatusUpdated(Event):
88
+ """Fired when a prerender attempt is updated."""
89
+ key: PreloadingAttemptKey
90
+ pipeline_id: PreloadPipelineId
91
+ status: PreloadingStatus
92
+ prerender_status: Optional[PrerenderFinalStatus] = None
93
+ disallowed_mojo_interface: Optional[str] = None
94
+ mismatched_headers: Optional[List[PrerenderMismatchedHeaders]] = None
95
+ __FIELDS__: ClassVar[tuple] = (
96
+ FieldMeta('key', 'key', False, 'object', ref='Preload.PreloadingAttemptKey'),
97
+ FieldMeta('pipeline_id', 'pipelineId', False, 'primitive'),
98
+ FieldMeta('status', 'status', False, 'enum', ref='Preload.PreloadingStatus'),
99
+ FieldMeta('prerender_status', 'prerenderStatus', True, 'enum', ref='Preload.PrerenderFinalStatus'),
100
+ FieldMeta('disallowed_mojo_interface', 'disallowedMojoInterface', True, 'primitive'),
101
+ FieldMeta('mismatched_headers', 'mismatchedHeaders', True, 'array', inner=FieldMeta('', '', False, 'object', ref='Preload.PrerenderMismatchedHeaders')),
102
+ )
103
+
104
+
105
+ @register_event("Preload.preloadingAttemptSourcesUpdated")
106
+ @dataclass
107
+ class PreloadingAttemptSourcesUpdated(Event):
108
+ """Send a list of sources for all preloading attempts in a document."""
109
+ loader_id: Network_LoaderId
110
+ preloading_attempt_sources: List[PreloadingAttemptSource]
111
+ __FIELDS__: ClassVar[tuple] = (
112
+ FieldMeta('loader_id', 'loaderId', False, 'primitive'),
113
+ FieldMeta('preloading_attempt_sources', 'preloadingAttemptSources', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Preload.PreloadingAttemptSource')),
114
+ )
115
+
116
+ __all__ = ["PrefetchStatusUpdated", "PreloadEnabledStateUpdated", "PreloadingAttemptSourcesUpdated", "PrerenderStatusUpdated", "RuleSetRemoved", "RuleSetUpdated"]
@@ -0,0 +1,25 @@
1
+ """Commands for the Preload 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 Preload:
11
+ """Commands of the Preload domain, bound to a target."""
12
+
13
+ def __init__(self, target: Any) -> None:
14
+ self._target = target
15
+
16
+
17
+ async def enable(self) -> None:
18
+ _params: Dict[str, Any] = {}
19
+ _result = await self._target.send('Preload.enable', _params)
20
+ return None
21
+
22
+ async def disable(self) -> None:
23
+ _params: Dict[str, Any] = {}
24
+ _result = await self._target.send('Preload.disable', _params)
25
+ return None