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,1081 @@
1
+ """Commands for the Page 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
+ AdScriptAncestry,
12
+ AppManifestError,
13
+ AppManifestParsedProperties,
14
+ CompilationCacheParams,
15
+ FontFamilies,
16
+ FontSizes,
17
+ FrameId,
18
+ FrameResourceTree,
19
+ FrameTree,
20
+ InstallabilityError,
21
+ LayoutViewport,
22
+ NavigationEntry,
23
+ OriginTrial,
24
+ PermissionsPolicyFeatureState,
25
+ ReferrerPolicy,
26
+ ScriptFontFamilies,
27
+ ScriptIdentifier,
28
+ TransitionType,
29
+ Viewport,
30
+ VisualViewport,
31
+ WebAppManifest,
32
+ )
33
+ from ..dom.types import Rect as DOM_Rect
34
+ from ..debugger.types import SearchMatch as Debugger_SearchMatch
35
+ from ..emulation.types import ScreenOrientation as Emulation_ScreenOrientation
36
+ from ..io.types import StreamHandle as IO_StreamHandle
37
+ from ..network.types import LoaderId as Network_LoaderId
38
+ from ..runtime.types import ExecutionContextId as Runtime_ExecutionContextId
39
+
40
+ @dataclass
41
+ class AddScriptToEvaluateOnLoadReturn(DataType):
42
+ """Return value of :meth:`Page.add_script_to_evaluate_on_load`."""
43
+ identifier: ScriptIdentifier
44
+ __FIELDS__: ClassVar[tuple] = (
45
+ FieldMeta('identifier', 'identifier', False, 'primitive'),
46
+ )
47
+
48
+
49
+ @dataclass
50
+ class AddScriptToEvaluateOnNewDocumentReturn(DataType):
51
+ """Return value of :meth:`Page.add_script_to_evaluate_on_new_document`."""
52
+ identifier: ScriptIdentifier
53
+ __FIELDS__: ClassVar[tuple] = (
54
+ FieldMeta('identifier', 'identifier', False, 'primitive'),
55
+ )
56
+
57
+
58
+ @dataclass
59
+ class CaptureScreenshotReturn(DataType):
60
+ """Return value of :meth:`Page.capture_screenshot`."""
61
+ data: str
62
+ __FIELDS__: ClassVar[tuple] = (
63
+ FieldMeta('data', 'data', False, 'primitive'),
64
+ )
65
+
66
+
67
+ @dataclass
68
+ class CaptureSnapshotReturn(DataType):
69
+ """Return value of :meth:`Page.capture_snapshot`."""
70
+ data: str
71
+ __FIELDS__: ClassVar[tuple] = (
72
+ FieldMeta('data', 'data', False, 'primitive'),
73
+ )
74
+
75
+
76
+ @dataclass
77
+ class CreateIsolatedWorldReturn(DataType):
78
+ """Return value of :meth:`Page.create_isolated_world`."""
79
+ execution_context_id: Runtime_ExecutionContextId
80
+ __FIELDS__: ClassVar[tuple] = (
81
+ FieldMeta('execution_context_id', 'executionContextId', False, 'primitive'),
82
+ )
83
+
84
+
85
+ @dataclass
86
+ class GetAppManifestReturn(DataType):
87
+ """Return value of :meth:`Page.get_app_manifest`."""
88
+ url: str
89
+ errors: List[AppManifestError]
90
+ manifest: WebAppManifest
91
+ data: Optional[str] = None
92
+ parsed: Optional[AppManifestParsedProperties] = None
93
+ __FIELDS__: ClassVar[tuple] = (
94
+ FieldMeta('url', 'url', False, 'primitive'),
95
+ FieldMeta('errors', 'errors', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.AppManifestError')),
96
+ FieldMeta('manifest', 'manifest', False, 'object', ref='Page.WebAppManifest'),
97
+ FieldMeta('data', 'data', True, 'primitive'),
98
+ FieldMeta('parsed', 'parsed', True, 'object', ref='Page.AppManifestParsedProperties'),
99
+ )
100
+
101
+
102
+ @dataclass
103
+ class GetInstallabilityErrorsReturn(DataType):
104
+ """Return value of :meth:`Page.get_installability_errors`."""
105
+ installability_errors: List[InstallabilityError]
106
+ __FIELDS__: ClassVar[tuple] = (
107
+ FieldMeta('installability_errors', 'installabilityErrors', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.InstallabilityError')),
108
+ )
109
+
110
+
111
+ @dataclass
112
+ class GetManifestIconsReturn(DataType):
113
+ """Return value of :meth:`Page.get_manifest_icons`."""
114
+ primary_icon: Optional[str] = None
115
+ __FIELDS__: ClassVar[tuple] = (
116
+ FieldMeta('primary_icon', 'primaryIcon', True, 'primitive'),
117
+ )
118
+
119
+
120
+ @dataclass
121
+ class GetAppIdReturn(DataType):
122
+ """Return value of :meth:`Page.get_app_id`."""
123
+ app_id: Optional[str] = None
124
+ recommended_id: Optional[str] = None
125
+ __FIELDS__: ClassVar[tuple] = (
126
+ FieldMeta('app_id', 'appId', True, 'primitive'),
127
+ FieldMeta('recommended_id', 'recommendedId', True, 'primitive'),
128
+ )
129
+
130
+
131
+ @dataclass
132
+ class GetAdScriptAncestryReturn(DataType):
133
+ """Return value of :meth:`Page.get_ad_script_ancestry`."""
134
+ ad_script_ancestry: Optional[AdScriptAncestry] = None
135
+ __FIELDS__: ClassVar[tuple] = (
136
+ FieldMeta('ad_script_ancestry', 'adScriptAncestry', True, 'object', ref='Page.AdScriptAncestry'),
137
+ )
138
+
139
+
140
+ @dataclass
141
+ class GetFrameTreeReturn(DataType):
142
+ """Return value of :meth:`Page.get_frame_tree`."""
143
+ frame_tree: FrameTree
144
+ __FIELDS__: ClassVar[tuple] = (
145
+ FieldMeta('frame_tree', 'frameTree', False, 'object', ref='Page.FrameTree'),
146
+ )
147
+
148
+
149
+ @dataclass
150
+ class GetLayoutMetricsReturn(DataType):
151
+ """Return value of :meth:`Page.get_layout_metrics`."""
152
+ layout_viewport: LayoutViewport
153
+ visual_viewport: VisualViewport
154
+ content_size: DOM_Rect
155
+ css_layout_viewport: LayoutViewport
156
+ css_visual_viewport: VisualViewport
157
+ css_content_size: DOM_Rect
158
+ __FIELDS__: ClassVar[tuple] = (
159
+ FieldMeta('layout_viewport', 'layoutViewport', False, 'object', ref='Page.LayoutViewport'),
160
+ FieldMeta('visual_viewport', 'visualViewport', False, 'object', ref='Page.VisualViewport'),
161
+ FieldMeta('content_size', 'contentSize', False, 'object', ref='DOM.Rect'),
162
+ FieldMeta('css_layout_viewport', 'cssLayoutViewport', False, 'object', ref='Page.LayoutViewport'),
163
+ FieldMeta('css_visual_viewport', 'cssVisualViewport', False, 'object', ref='Page.VisualViewport'),
164
+ FieldMeta('css_content_size', 'cssContentSize', False, 'object', ref='DOM.Rect'),
165
+ )
166
+
167
+
168
+ @dataclass
169
+ class GetNavigationHistoryReturn(DataType):
170
+ """Return value of :meth:`Page.get_navigation_history`."""
171
+ current_index: int
172
+ entries: List[NavigationEntry]
173
+ __FIELDS__: ClassVar[tuple] = (
174
+ FieldMeta('current_index', 'currentIndex', False, 'primitive'),
175
+ FieldMeta('entries', 'entries', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.NavigationEntry')),
176
+ )
177
+
178
+
179
+ @dataclass
180
+ class GetResourceContentReturn(DataType):
181
+ """Return value of :meth:`Page.get_resource_content`."""
182
+ content: str
183
+ base64_encoded: bool
184
+ __FIELDS__: ClassVar[tuple] = (
185
+ FieldMeta('content', 'content', False, 'primitive'),
186
+ FieldMeta('base64_encoded', 'base64Encoded', False, 'primitive'),
187
+ )
188
+
189
+
190
+ @dataclass
191
+ class GetResourceTreeReturn(DataType):
192
+ """Return value of :meth:`Page.get_resource_tree`."""
193
+ frame_tree: FrameResourceTree
194
+ __FIELDS__: ClassVar[tuple] = (
195
+ FieldMeta('frame_tree', 'frameTree', False, 'object', ref='Page.FrameResourceTree'),
196
+ )
197
+
198
+
199
+ @dataclass
200
+ class NavigateReturn(DataType):
201
+ """Return value of :meth:`Page.navigate`."""
202
+ frame_id: FrameId
203
+ loader_id: Optional[Network_LoaderId] = None
204
+ error_text: Optional[str] = None
205
+ is_download: Optional[bool] = None
206
+ __FIELDS__: ClassVar[tuple] = (
207
+ FieldMeta('frame_id', 'frameId', False, 'primitive'),
208
+ FieldMeta('loader_id', 'loaderId', True, 'primitive'),
209
+ FieldMeta('error_text', 'errorText', True, 'primitive'),
210
+ FieldMeta('is_download', 'isDownload', True, 'primitive'),
211
+ )
212
+
213
+
214
+ @dataclass
215
+ class PrintToPDFReturn(DataType):
216
+ """Return value of :meth:`Page.print_to_pdf`."""
217
+ data: str
218
+ stream: Optional[IO_StreamHandle] = None
219
+ __FIELDS__: ClassVar[tuple] = (
220
+ FieldMeta('data', 'data', False, 'primitive'),
221
+ FieldMeta('stream', 'stream', True, 'primitive'),
222
+ )
223
+
224
+
225
+ @dataclass
226
+ class SearchInResourceReturn(DataType):
227
+ """Return value of :meth:`Page.search_in_resource`."""
228
+ result: List[Debugger_SearchMatch]
229
+ __FIELDS__: ClassVar[tuple] = (
230
+ FieldMeta('result', 'result', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.SearchMatch')),
231
+ )
232
+
233
+
234
+ @dataclass
235
+ class GetPermissionsPolicyStateReturn(DataType):
236
+ """Return value of :meth:`Page.get_permissions_policy_state`."""
237
+ states: List[PermissionsPolicyFeatureState]
238
+ __FIELDS__: ClassVar[tuple] = (
239
+ FieldMeta('states', 'states', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.PermissionsPolicyFeatureState')),
240
+ )
241
+
242
+
243
+ @dataclass
244
+ class GetOriginTrialsReturn(DataType):
245
+ """Return value of :meth:`Page.get_origin_trials`."""
246
+ origin_trials: List[OriginTrial]
247
+ __FIELDS__: ClassVar[tuple] = (
248
+ FieldMeta('origin_trials', 'originTrials', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.OriginTrial')),
249
+ )
250
+
251
+
252
+ @dataclass
253
+ class GetAnnotatedPageContentReturn(DataType):
254
+ """Return value of :meth:`Page.get_annotated_page_content`."""
255
+ content: str
256
+ __FIELDS__: ClassVar[tuple] = (
257
+ FieldMeta('content', 'content', False, 'primitive'),
258
+ )
259
+
260
+
261
+ class Page:
262
+ """Commands of the Page domain, bound to a target."""
263
+
264
+ def __init__(self, target: Any) -> None:
265
+ self._target = target
266
+
267
+
268
+ async def add_script_to_evaluate_on_load(self, *, script_source: str) -> AddScriptToEvaluateOnLoadReturn:
269
+ """
270
+ Deprecated, please use addScriptToEvaluateOnNewDocument instead.
271
+
272
+ .. deprecated::
273
+ :param script_source:
274
+ """
275
+ _params: Dict[str, Any] = {}
276
+ _params['scriptSource'] = encode(FieldMeta('', '', False, 'primitive'), script_source)
277
+ _result = await self._target.send('Page.addScriptToEvaluateOnLoad', _params)
278
+ return AddScriptToEvaluateOnLoadReturn.from_json(_result)
279
+
280
+ async def add_script_to_evaluate_on_new_document(self, *, source: str, world_name: Optional[str] = None, include_command_line_api: Optional[bool] = None, run_immediately: Optional[bool] = None) -> AddScriptToEvaluateOnNewDocumentReturn:
281
+ """
282
+ Evaluates given script in every frame upon creation (before loading frame's scripts).
283
+ :param source:
284
+ :param world_name: If specified, creates an isolated world with the given name and evaluates given script in it.
285
+ This world name will be used as the ExecutionContextDescription::name when the corresponding
286
+ event is emitted.
287
+ :param include_command_line_api: Specifies whether command line API should be available to the script, defaults
288
+ to false.
289
+ :param run_immediately: If true, runs the script immediately on existing execution contexts or worlds.
290
+ Default: false.
291
+ """
292
+ _params: Dict[str, Any] = {}
293
+ _params['source'] = encode(FieldMeta('', '', False, 'primitive'), source)
294
+ if world_name is not None:
295
+ _params['worldName'] = encode(FieldMeta('', '', False, 'primitive'), world_name)
296
+ if include_command_line_api is not None:
297
+ _params['includeCommandLineAPI'] = encode(FieldMeta('', '', False, 'primitive'), include_command_line_api)
298
+ if run_immediately is not None:
299
+ _params['runImmediately'] = encode(FieldMeta('', '', False, 'primitive'), run_immediately)
300
+ _result = await self._target.send('Page.addScriptToEvaluateOnNewDocument', _params)
301
+ return AddScriptToEvaluateOnNewDocumentReturn.from_json(_result)
302
+
303
+ async def bring_to_front(self) -> None:
304
+ """Brings page to front (activates tab)."""
305
+ _params: Dict[str, Any] = {}
306
+ _result = await self._target.send('Page.bringToFront', _params)
307
+ return None
308
+
309
+ async def capture_screenshot(self, *, format: Optional[Literal['jpeg', 'png', 'webp']] = None, quality: Optional[int] = None, clip: Optional[Viewport] = None, from_surface: Optional[bool] = None, capture_beyond_viewport: Optional[bool] = None, optimize_for_speed: Optional[bool] = None) -> CaptureScreenshotReturn:
310
+ """
311
+ Capture page screenshot.
312
+ :param format: Image compression format (defaults to png).
313
+ :param quality: Compression quality from range [0..100] (jpeg only).
314
+ :param clip: Capture the screenshot of a given region only.
315
+ :param from_surface: Capture the screenshot from the surface, rather than the view. Defaults to true.
316
+ :param capture_beyond_viewport: Capture the screenshot beyond the viewport. Defaults to false.
317
+ :param optimize_for_speed: Optimize image encoding for speed, not for resulting size (defaults to false)
318
+ """
319
+ _params: Dict[str, Any] = {}
320
+ if format is not None:
321
+ _params['format'] = encode(FieldMeta('', '', False, 'primitive'), format)
322
+ if quality is not None:
323
+ _params['quality'] = encode(FieldMeta('', '', False, 'primitive'), quality)
324
+ if clip is not None:
325
+ _params['clip'] = encode(FieldMeta('', '', False, 'object', ref='Page.Viewport'), clip)
326
+ if from_surface is not None:
327
+ _params['fromSurface'] = encode(FieldMeta('', '', False, 'primitive'), from_surface)
328
+ if capture_beyond_viewport is not None:
329
+ _params['captureBeyondViewport'] = encode(FieldMeta('', '', False, 'primitive'), capture_beyond_viewport)
330
+ if optimize_for_speed is not None:
331
+ _params['optimizeForSpeed'] = encode(FieldMeta('', '', False, 'primitive'), optimize_for_speed)
332
+ _result = await self._target.send('Page.captureScreenshot', _params)
333
+ return CaptureScreenshotReturn.from_json(_result)
334
+
335
+ async def capture_snapshot(self, *, format: Optional[Literal['mhtml']] = None) -> CaptureSnapshotReturn:
336
+ """
337
+ Returns a snapshot of the page as a string. For MHTML format, the serialization includes
338
+ iframes, shadow DOM, external resources, and element-inline styles.
339
+ :param format: Format (defaults to mhtml).
340
+ """
341
+ _params: Dict[str, Any] = {}
342
+ if format is not None:
343
+ _params['format'] = encode(FieldMeta('', '', False, 'primitive'), format)
344
+ _result = await self._target.send('Page.captureSnapshot', _params)
345
+ return CaptureSnapshotReturn.from_json(_result)
346
+
347
+ async def clear_device_metrics_override(self) -> None:
348
+ """
349
+ Clears the overridden device metrics.
350
+
351
+ .. deprecated::
352
+ """
353
+ _params: Dict[str, Any] = {}
354
+ _result = await self._target.send('Page.clearDeviceMetricsOverride', _params)
355
+ return None
356
+
357
+ async def clear_device_orientation_override(self) -> None:
358
+ """
359
+ Clears the overridden Device Orientation.
360
+
361
+ .. deprecated::
362
+ """
363
+ _params: Dict[str, Any] = {}
364
+ _result = await self._target.send('Page.clearDeviceOrientationOverride', _params)
365
+ return None
366
+
367
+ async def clear_geolocation_override(self) -> None:
368
+ """
369
+ Clears the overridden Geolocation Position and Error.
370
+
371
+ .. deprecated::
372
+ """
373
+ _params: Dict[str, Any] = {}
374
+ _result = await self._target.send('Page.clearGeolocationOverride', _params)
375
+ return None
376
+
377
+ async def create_isolated_world(self, *, frame_id: FrameId, world_name: Optional[str] = None, grant_univeral_access: Optional[bool] = None) -> CreateIsolatedWorldReturn:
378
+ """
379
+ Creates an isolated world for the given frame.
380
+ :param frame_id: Id of the frame in which the isolated world should be created.
381
+ :param world_name: An optional name which is reported in the Execution Context.
382
+ :param grant_univeral_access: Whether or not universal access should be granted to the isolated world. This is a powerful
383
+ option, use with caution.
384
+ """
385
+ _params: Dict[str, Any] = {}
386
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
387
+ if world_name is not None:
388
+ _params['worldName'] = encode(FieldMeta('', '', False, 'primitive'), world_name)
389
+ if grant_univeral_access is not None:
390
+ _params['grantUniveralAccess'] = encode(FieldMeta('', '', False, 'primitive'), grant_univeral_access)
391
+ _result = await self._target.send('Page.createIsolatedWorld', _params)
392
+ return CreateIsolatedWorldReturn.from_json(_result)
393
+
394
+ async def delete_cookie(self, *, cookie_name: str, url: str) -> None:
395
+ """
396
+ Deletes browser cookie with given name, domain and path.
397
+
398
+ .. deprecated::
399
+ :param cookie_name: Name of the cookie to remove.
400
+ :param url: URL to match cooke domain and path.
401
+ """
402
+ _params: Dict[str, Any] = {}
403
+ _params['cookieName'] = encode(FieldMeta('', '', False, 'primitive'), cookie_name)
404
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
405
+ _result = await self._target.send('Page.deleteCookie', _params)
406
+ return None
407
+
408
+ async def disable(self) -> None:
409
+ """Disables page domain notifications."""
410
+ _params: Dict[str, Any] = {}
411
+ _result = await self._target.send('Page.disable', _params)
412
+ return None
413
+
414
+ async def enable(self, *, enable_file_chooser_opened_event: Optional[bool] = None) -> None:
415
+ """
416
+ Enables page domain notifications.
417
+ :param enable_file_chooser_opened_event: If true, the `Page.fileChooserOpened` event will be emitted regardless of the state set by
418
+ `Page.setInterceptFileChooserDialog` command (default: false).
419
+ """
420
+ _params: Dict[str, Any] = {}
421
+ if enable_file_chooser_opened_event is not None:
422
+ _params['enableFileChooserOpenedEvent'] = encode(FieldMeta('', '', False, 'primitive'), enable_file_chooser_opened_event)
423
+ _result = await self._target.send('Page.enable', _params)
424
+ return None
425
+
426
+ async def get_app_manifest(self, *, manifest_id: Optional[str] = None) -> GetAppManifestReturn:
427
+ """
428
+ Gets the processed manifest for this current document.
429
+ This API always waits for the manifest to be loaded.
430
+ If manifestId is provided, and it does not match the manifest of the
431
+ current document, this API errors out.
432
+ If there is not a loaded page, this API errors out immediately.
433
+ :param manifest_id:
434
+ """
435
+ _params: Dict[str, Any] = {}
436
+ if manifest_id is not None:
437
+ _params['manifestId'] = encode(FieldMeta('', '', False, 'primitive'), manifest_id)
438
+ _result = await self._target.send('Page.getAppManifest', _params)
439
+ return GetAppManifestReturn.from_json(_result)
440
+
441
+ async def get_installability_errors(self) -> GetInstallabilityErrorsReturn:
442
+ _params: Dict[str, Any] = {}
443
+ _result = await self._target.send('Page.getInstallabilityErrors', _params)
444
+ return GetInstallabilityErrorsReturn.from_json(_result)
445
+
446
+ async def get_manifest_icons(self) -> GetManifestIconsReturn:
447
+ """
448
+ Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
449
+
450
+ .. deprecated::
451
+ """
452
+ _params: Dict[str, Any] = {}
453
+ _result = await self._target.send('Page.getManifestIcons', _params)
454
+ return GetManifestIconsReturn.from_json(_result)
455
+
456
+ async def get_app_id(self) -> GetAppIdReturn:
457
+ """
458
+ Returns the unique (PWA) app id.
459
+ Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
460
+ """
461
+ _params: Dict[str, Any] = {}
462
+ _result = await self._target.send('Page.getAppId', _params)
463
+ return GetAppIdReturn.from_json(_result)
464
+
465
+ async def get_ad_script_ancestry(self, *, frame_id: FrameId) -> GetAdScriptAncestryReturn:
466
+ """:param frame_id:"""
467
+ _params: Dict[str, Any] = {}
468
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
469
+ _result = await self._target.send('Page.getAdScriptAncestry', _params)
470
+ return GetAdScriptAncestryReturn.from_json(_result)
471
+
472
+ async def get_frame_tree(self) -> GetFrameTreeReturn:
473
+ """Returns present frame tree structure."""
474
+ _params: Dict[str, Any] = {}
475
+ _result = await self._target.send('Page.getFrameTree', _params)
476
+ return GetFrameTreeReturn.from_json(_result)
477
+
478
+ async def get_layout_metrics(self) -> GetLayoutMetricsReturn:
479
+ """Returns metrics relating to the layouting of the page, such as viewport bounds/scale."""
480
+ _params: Dict[str, Any] = {}
481
+ _result = await self._target.send('Page.getLayoutMetrics', _params)
482
+ return GetLayoutMetricsReturn.from_json(_result)
483
+
484
+ async def get_navigation_history(self) -> GetNavigationHistoryReturn:
485
+ """Returns navigation history for the current page."""
486
+ _params: Dict[str, Any] = {}
487
+ _result = await self._target.send('Page.getNavigationHistory', _params)
488
+ return GetNavigationHistoryReturn.from_json(_result)
489
+
490
+ async def reset_navigation_history(self) -> None:
491
+ """Resets navigation history for the current page."""
492
+ _params: Dict[str, Any] = {}
493
+ _result = await self._target.send('Page.resetNavigationHistory', _params)
494
+ return None
495
+
496
+ async def get_resource_content(self, *, frame_id: FrameId, url: str) -> GetResourceContentReturn:
497
+ """
498
+ Returns content of the given resource.
499
+ :param frame_id: Frame id to get resource for.
500
+ :param url: URL of the resource to get content for.
501
+ """
502
+ _params: Dict[str, Any] = {}
503
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
504
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
505
+ _result = await self._target.send('Page.getResourceContent', _params)
506
+ return GetResourceContentReturn.from_json(_result)
507
+
508
+ async def get_resource_tree(self) -> GetResourceTreeReturn:
509
+ """Returns present frame / resource tree structure."""
510
+ _params: Dict[str, Any] = {}
511
+ _result = await self._target.send('Page.getResourceTree', _params)
512
+ return GetResourceTreeReturn.from_json(_result)
513
+
514
+ async def handle_java_script_dialog(self, *, accept: bool, prompt_text: Optional[str] = None) -> None:
515
+ """
516
+ Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
517
+ :param accept: Whether to accept or dismiss the dialog.
518
+ :param prompt_text: The text to enter into the dialog prompt before accepting. Used only if this is a prompt
519
+ dialog.
520
+ """
521
+ _params: Dict[str, Any] = {}
522
+ _params['accept'] = encode(FieldMeta('', '', False, 'primitive'), accept)
523
+ if prompt_text is not None:
524
+ _params['promptText'] = encode(FieldMeta('', '', False, 'primitive'), prompt_text)
525
+ _result = await self._target.send('Page.handleJavaScriptDialog', _params)
526
+ return None
527
+
528
+ async def navigate(self, *, url: str, referrer: Optional[str] = None, transition_type: Optional[TransitionType] = None, frame_id: Optional[FrameId] = None, referrer_policy: Optional[ReferrerPolicy] = None) -> NavigateReturn:
529
+ """
530
+ Navigates current page to the given URL.
531
+ :param url: URL to navigate the page to.
532
+ :param referrer: Referrer URL.
533
+ :param transition_type: Intended transition type.
534
+ :param frame_id: Frame id to navigate, if not specified navigates the top frame.
535
+ :param referrer_policy: Referrer-policy used for the navigation.
536
+ """
537
+ _params: Dict[str, Any] = {}
538
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
539
+ if referrer is not None:
540
+ _params['referrer'] = encode(FieldMeta('', '', False, 'primitive'), referrer)
541
+ if transition_type is not None:
542
+ _params['transitionType'] = encode(FieldMeta('', '', False, 'enum', ref='Page.TransitionType'), transition_type)
543
+ if frame_id is not None:
544
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
545
+ if referrer_policy is not None:
546
+ _params['referrerPolicy'] = encode(FieldMeta('', '', False, 'enum', ref='Page.ReferrerPolicy'), referrer_policy)
547
+ _result = await self._target.send('Page.navigate', _params)
548
+ return NavigateReturn.from_json(_result)
549
+
550
+ async def navigate_to_history_entry(self, *, entry_id: int) -> None:
551
+ """
552
+ Navigates current page to the given history entry.
553
+ :param entry_id: Unique id of the entry to navigate to.
554
+ """
555
+ _params: Dict[str, Any] = {}
556
+ _params['entryId'] = encode(FieldMeta('', '', False, 'primitive'), entry_id)
557
+ _result = await self._target.send('Page.navigateToHistoryEntry', _params)
558
+ return None
559
+
560
+ async def print_to_pdf(self, *, landscape: Optional[bool] = None, display_header_footer: Optional[bool] = None, print_background: Optional[bool] = None, scale: Optional[float] = None, paper_width: Optional[float] = None, paper_height: Optional[float] = None, margin_top: Optional[float] = None, margin_bottom: Optional[float] = None, margin_left: Optional[float] = None, margin_right: Optional[float] = None, page_ranges: Optional[str] = None, header_template: Optional[str] = None, footer_template: Optional[str] = None, prefer_css_page_size: Optional[bool] = None, transfer_mode: Optional[Literal['ReturnAsBase64', 'ReturnAsStream']] = None, generate_tagged_pdf: Optional[bool] = None, generate_document_outline: Optional[bool] = None) -> PrintToPDFReturn:
561
+ """
562
+ Print page as PDF.
563
+ :param landscape: Paper orientation. Defaults to false.
564
+ :param display_header_footer: Display header and footer. Defaults to false.
565
+ :param print_background: Print background graphics. Defaults to false.
566
+ :param scale: Scale of the webpage rendering. Defaults to 1.
567
+ :param paper_width: Paper width in inches. Defaults to 8.5 inches.
568
+ :param paper_height: Paper height in inches. Defaults to 11 inches.
569
+ :param margin_top: Top margin in inches. Defaults to 1cm (~0.4 inches).
570
+ :param margin_bottom: Bottom margin in inches. Defaults to 1cm (~0.4 inches).
571
+ :param margin_left: Left margin in inches. Defaults to 1cm (~0.4 inches).
572
+ :param margin_right: Right margin in inches. Defaults to 1cm (~0.4 inches).
573
+ :param page_ranges: Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are
574
+ printed in the document order, not in the order specified, and no
575
+ more than once.
576
+ Defaults to empty string, which implies the entire document is printed.
577
+ The page numbers are quietly capped to actual page count of the
578
+ document, and ranges beyond the end of the document are ignored.
579
+ If this results in no pages to print, an error is reported.
580
+ It is an error to specify a range with start greater than end.
581
+ :param header_template: HTML template for the print header. Should be valid HTML markup with following
582
+ classes used to inject printing values into them:
583
+ - `date`: formatted print date
584
+ - `title`: document title
585
+ - `url`: document location
586
+ - `pageNumber`: current page number
587
+ - `totalPages`: total pages in the document
588
+
589
+ For example, `<span class=title></span>` would generate span containing the title.
590
+ :param footer_template: HTML template for the print footer. Should use the same format as the `headerTemplate`.
591
+ :param prefer_css_page_size: Whether or not to prefer page size as defined by css. Defaults to false,
592
+ in which case the content will be scaled to fit the paper size.
593
+ :param transfer_mode: return as stream
594
+ :param generate_tagged_pdf: Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
595
+ :param generate_document_outline: Whether or not to embed the document outline into the PDF.
596
+ """
597
+ _params: Dict[str, Any] = {}
598
+ if landscape is not None:
599
+ _params['landscape'] = encode(FieldMeta('', '', False, 'primitive'), landscape)
600
+ if display_header_footer is not None:
601
+ _params['displayHeaderFooter'] = encode(FieldMeta('', '', False, 'primitive'), display_header_footer)
602
+ if print_background is not None:
603
+ _params['printBackground'] = encode(FieldMeta('', '', False, 'primitive'), print_background)
604
+ if scale is not None:
605
+ _params['scale'] = encode(FieldMeta('', '', False, 'primitive'), scale)
606
+ if paper_width is not None:
607
+ _params['paperWidth'] = encode(FieldMeta('', '', False, 'primitive'), paper_width)
608
+ if paper_height is not None:
609
+ _params['paperHeight'] = encode(FieldMeta('', '', False, 'primitive'), paper_height)
610
+ if margin_top is not None:
611
+ _params['marginTop'] = encode(FieldMeta('', '', False, 'primitive'), margin_top)
612
+ if margin_bottom is not None:
613
+ _params['marginBottom'] = encode(FieldMeta('', '', False, 'primitive'), margin_bottom)
614
+ if margin_left is not None:
615
+ _params['marginLeft'] = encode(FieldMeta('', '', False, 'primitive'), margin_left)
616
+ if margin_right is not None:
617
+ _params['marginRight'] = encode(FieldMeta('', '', False, 'primitive'), margin_right)
618
+ if page_ranges is not None:
619
+ _params['pageRanges'] = encode(FieldMeta('', '', False, 'primitive'), page_ranges)
620
+ if header_template is not None:
621
+ _params['headerTemplate'] = encode(FieldMeta('', '', False, 'primitive'), header_template)
622
+ if footer_template is not None:
623
+ _params['footerTemplate'] = encode(FieldMeta('', '', False, 'primitive'), footer_template)
624
+ if prefer_css_page_size is not None:
625
+ _params['preferCSSPageSize'] = encode(FieldMeta('', '', False, 'primitive'), prefer_css_page_size)
626
+ if transfer_mode is not None:
627
+ _params['transferMode'] = encode(FieldMeta('', '', False, 'primitive'), transfer_mode)
628
+ if generate_tagged_pdf is not None:
629
+ _params['generateTaggedPDF'] = encode(FieldMeta('', '', False, 'primitive'), generate_tagged_pdf)
630
+ if generate_document_outline is not None:
631
+ _params['generateDocumentOutline'] = encode(FieldMeta('', '', False, 'primitive'), generate_document_outline)
632
+ _result = await self._target.send('Page.printToPDF', _params)
633
+ return PrintToPDFReturn.from_json(_result)
634
+
635
+ async def reload(self, *, ignore_cache: Optional[bool] = None, script_to_evaluate_on_load: Optional[str] = None, loader_id: Optional[Network_LoaderId] = None) -> None:
636
+ """
637
+ Reloads given page optionally ignoring the cache.
638
+ :param ignore_cache: If true, browser cache is ignored (as if the user pressed Shift+refresh).
639
+ :param script_to_evaluate_on_load: If set, the script will be injected into all frames of the inspected page after reload.
640
+ Argument will be ignored if reloading dataURL origin.
641
+ :param loader_id: If set, an error will be thrown if the target page's main frame's
642
+ loader id does not match the provided id. This prevents accidentally
643
+ reloading an unintended target in case there's a racing navigation.
644
+ """
645
+ _params: Dict[str, Any] = {}
646
+ if ignore_cache is not None:
647
+ _params['ignoreCache'] = encode(FieldMeta('', '', False, 'primitive'), ignore_cache)
648
+ if script_to_evaluate_on_load is not None:
649
+ _params['scriptToEvaluateOnLoad'] = encode(FieldMeta('', '', False, 'primitive'), script_to_evaluate_on_load)
650
+ if loader_id is not None:
651
+ _params['loaderId'] = encode(FieldMeta('', '', False, 'primitive'), loader_id)
652
+ _result = await self._target.send('Page.reload', _params)
653
+ return None
654
+
655
+ async def remove_script_to_evaluate_on_load(self, *, identifier: ScriptIdentifier) -> None:
656
+ """
657
+ Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
658
+
659
+ .. deprecated::
660
+ :param identifier:
661
+ """
662
+ _params: Dict[str, Any] = {}
663
+ _params['identifier'] = encode(FieldMeta('', '', False, 'primitive'), identifier)
664
+ _result = await self._target.send('Page.removeScriptToEvaluateOnLoad', _params)
665
+ return None
666
+
667
+ async def remove_script_to_evaluate_on_new_document(self, *, identifier: ScriptIdentifier) -> None:
668
+ """
669
+ Removes given script from the list.
670
+ :param identifier:
671
+ """
672
+ _params: Dict[str, Any] = {}
673
+ _params['identifier'] = encode(FieldMeta('', '', False, 'primitive'), identifier)
674
+ _result = await self._target.send('Page.removeScriptToEvaluateOnNewDocument', _params)
675
+ return None
676
+
677
+ async def screencast_frame_ack(self, *, session_id: int) -> None:
678
+ """
679
+ Acknowledges that a screencast frame has been received by the frontend.
680
+ :param session_id: Frame number.
681
+ """
682
+ _params: Dict[str, Any] = {}
683
+ _params['sessionId'] = encode(FieldMeta('', '', False, 'primitive'), session_id)
684
+ _result = await self._target.send('Page.screencastFrameAck', _params)
685
+ return None
686
+
687
+ async def search_in_resource(self, *, frame_id: FrameId, url: str, query: str, case_sensitive: Optional[bool] = None, is_regex: Optional[bool] = None) -> SearchInResourceReturn:
688
+ """
689
+ Searches for given string in resource content.
690
+ :param frame_id: Frame id for resource to search in.
691
+ :param url: URL of the resource to search in.
692
+ :param query: String to search for.
693
+ :param case_sensitive: If true, search is case sensitive.
694
+ :param is_regex: If true, treats string parameter as regex.
695
+ """
696
+ _params: Dict[str, Any] = {}
697
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
698
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
699
+ _params['query'] = encode(FieldMeta('', '', False, 'primitive'), query)
700
+ if case_sensitive is not None:
701
+ _params['caseSensitive'] = encode(FieldMeta('', '', False, 'primitive'), case_sensitive)
702
+ if is_regex is not None:
703
+ _params['isRegex'] = encode(FieldMeta('', '', False, 'primitive'), is_regex)
704
+ _result = await self._target.send('Page.searchInResource', _params)
705
+ return SearchInResourceReturn.from_json(_result)
706
+
707
+ async def set_ad_blocking_enabled(self, *, enabled: bool) -> None:
708
+ """
709
+ Enable Chrome's experimental ad filter on all sites.
710
+ :param enabled: Whether to block ads.
711
+ """
712
+ _params: Dict[str, Any] = {}
713
+ _params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
714
+ _result = await self._target.send('Page.setAdBlockingEnabled', _params)
715
+ return None
716
+
717
+ async def set_bypass_csp(self, *, enabled: bool) -> None:
718
+ """
719
+ Enable page Content Security Policy by-passing.
720
+ :param enabled: Whether to bypass page CSP.
721
+ """
722
+ _params: Dict[str, Any] = {}
723
+ _params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
724
+ _result = await self._target.send('Page.setBypassCSP', _params)
725
+ return None
726
+
727
+ async def get_permissions_policy_state(self, *, frame_id: FrameId) -> GetPermissionsPolicyStateReturn:
728
+ """
729
+ Get Permissions Policy state on given frame.
730
+ :param frame_id:
731
+ """
732
+ _params: Dict[str, Any] = {}
733
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
734
+ _result = await self._target.send('Page.getPermissionsPolicyState', _params)
735
+ return GetPermissionsPolicyStateReturn.from_json(_result)
736
+
737
+ async def get_origin_trials(self, *, frame_id: FrameId) -> GetOriginTrialsReturn:
738
+ """
739
+ Get Origin Trials on given frame.
740
+ :param frame_id:
741
+ """
742
+ _params: Dict[str, Any] = {}
743
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
744
+ _result = await self._target.send('Page.getOriginTrials', _params)
745
+ return GetOriginTrialsReturn.from_json(_result)
746
+
747
+ async def set_device_metrics_override(self, *, width: int, height: int, device_scale_factor: float, mobile: bool, scale: Optional[float] = None, screen_width: Optional[int] = None, screen_height: Optional[int] = None, position_x: Optional[int] = None, position_y: Optional[int] = None, dont_set_visible_size: Optional[bool] = None, screen_orientation: Optional[Emulation_ScreenOrientation] = None, viewport: Optional[Viewport] = None) -> None:
748
+ """
749
+ Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
750
+ window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
751
+ query results).
752
+
753
+ .. deprecated::
754
+ :param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
755
+ :param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
756
+ :param device_scale_factor: Overriding device scale factor value. 0 disables the override.
757
+ :param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text
758
+ autosizing and more.
759
+ :param scale: Scale to apply to resulting view image.
760
+ :param screen_width: Overriding screen width value in pixels (minimum 0, maximum 10000000).
761
+ :param screen_height: Overriding screen height value in pixels (minimum 0, maximum 10000000).
762
+ :param position_x: Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
763
+ :param position_y: Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
764
+ :param dont_set_visible_size: Do not set visible view size, rely upon explicit setVisibleSize call.
765
+ :param screen_orientation: Screen orientation override.
766
+ :param viewport: The viewport dimensions and scale. If not set, the override is cleared.
767
+ """
768
+ _params: Dict[str, Any] = {}
769
+ _params['width'] = encode(FieldMeta('', '', False, 'primitive'), width)
770
+ _params['height'] = encode(FieldMeta('', '', False, 'primitive'), height)
771
+ _params['deviceScaleFactor'] = encode(FieldMeta('', '', False, 'primitive'), device_scale_factor)
772
+ _params['mobile'] = encode(FieldMeta('', '', False, 'primitive'), mobile)
773
+ if scale is not None:
774
+ _params['scale'] = encode(FieldMeta('', '', False, 'primitive'), scale)
775
+ if screen_width is not None:
776
+ _params['screenWidth'] = encode(FieldMeta('', '', False, 'primitive'), screen_width)
777
+ if screen_height is not None:
778
+ _params['screenHeight'] = encode(FieldMeta('', '', False, 'primitive'), screen_height)
779
+ if position_x is not None:
780
+ _params['positionX'] = encode(FieldMeta('', '', False, 'primitive'), position_x)
781
+ if position_y is not None:
782
+ _params['positionY'] = encode(FieldMeta('', '', False, 'primitive'), position_y)
783
+ if dont_set_visible_size is not None:
784
+ _params['dontSetVisibleSize'] = encode(FieldMeta('', '', False, 'primitive'), dont_set_visible_size)
785
+ if screen_orientation is not None:
786
+ _params['screenOrientation'] = encode(FieldMeta('', '', False, 'object', ref='Emulation.ScreenOrientation'), screen_orientation)
787
+ if viewport is not None:
788
+ _params['viewport'] = encode(FieldMeta('', '', False, 'object', ref='Page.Viewport'), viewport)
789
+ _result = await self._target.send('Page.setDeviceMetricsOverride', _params)
790
+ return None
791
+
792
+ async def set_device_orientation_override(self, *, alpha: float, beta: float, gamma: float) -> None:
793
+ """
794
+ Overrides the Device Orientation.
795
+
796
+ .. deprecated::
797
+ :param alpha: Mock alpha
798
+ :param beta: Mock beta
799
+ :param gamma: Mock gamma
800
+ """
801
+ _params: Dict[str, Any] = {}
802
+ _params['alpha'] = encode(FieldMeta('', '', False, 'primitive'), alpha)
803
+ _params['beta'] = encode(FieldMeta('', '', False, 'primitive'), beta)
804
+ _params['gamma'] = encode(FieldMeta('', '', False, 'primitive'), gamma)
805
+ _result = await self._target.send('Page.setDeviceOrientationOverride', _params)
806
+ return None
807
+
808
+ async def set_font_families(self, *, font_families: FontFamilies, for_scripts: Optional[List[ScriptFontFamilies]] = None) -> None:
809
+ """
810
+ Set generic font families.
811
+ :param font_families: Specifies font families to set. If a font family is not specified, it won't be changed.
812
+ :param for_scripts: Specifies font families to set for individual scripts.
813
+ """
814
+ _params: Dict[str, Any] = {}
815
+ _params['fontFamilies'] = encode(FieldMeta('', '', False, 'object', ref='Page.FontFamilies'), font_families)
816
+ if for_scripts is not None:
817
+ _params['forScripts'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.ScriptFontFamilies')), for_scripts)
818
+ _result = await self._target.send('Page.setFontFamilies', _params)
819
+ return None
820
+
821
+ async def set_font_sizes(self, *, font_sizes: FontSizes) -> None:
822
+ """
823
+ Set default font sizes.
824
+ :param font_sizes: Specifies font sizes to set. If a font size is not specified, it won't be changed.
825
+ """
826
+ _params: Dict[str, Any] = {}
827
+ _params['fontSizes'] = encode(FieldMeta('', '', False, 'object', ref='Page.FontSizes'), font_sizes)
828
+ _result = await self._target.send('Page.setFontSizes', _params)
829
+ return None
830
+
831
+ async def set_document_content(self, *, frame_id: FrameId, html: str) -> None:
832
+ """
833
+ Sets given markup as the document's HTML.
834
+ :param frame_id: Frame id to set HTML for.
835
+ :param html: HTML content to set.
836
+ """
837
+ _params: Dict[str, Any] = {}
838
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
839
+ _params['html'] = encode(FieldMeta('', '', False, 'primitive'), html)
840
+ _result = await self._target.send('Page.setDocumentContent', _params)
841
+ return None
842
+
843
+ async def set_download_behavior(self, *, behavior: Literal['deny', 'allow', 'default'], download_path: Optional[str] = None) -> None:
844
+ """
845
+ Set the behavior when downloading a file.
846
+
847
+ .. deprecated::
848
+ :param behavior: Whether to allow all or deny all download requests, or use default Chrome behavior if
849
+ available (otherwise deny).
850
+ :param download_path: The default path to save downloaded files to. This is required if behavior is set to 'allow'
851
+ """
852
+ _params: Dict[str, Any] = {}
853
+ _params['behavior'] = encode(FieldMeta('', '', False, 'primitive'), behavior)
854
+ if download_path is not None:
855
+ _params['downloadPath'] = encode(FieldMeta('', '', False, 'primitive'), download_path)
856
+ _result = await self._target.send('Page.setDownloadBehavior', _params)
857
+ return None
858
+
859
+ async def set_geolocation_override(self, *, latitude: Optional[float] = None, longitude: Optional[float] = None, accuracy: Optional[float] = None) -> None:
860
+ """
861
+ Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
862
+ unavailable.
863
+
864
+ .. deprecated::
865
+ :param latitude: Mock latitude
866
+ :param longitude: Mock longitude
867
+ :param accuracy: Mock accuracy
868
+ """
869
+ _params: Dict[str, Any] = {}
870
+ if latitude is not None:
871
+ _params['latitude'] = encode(FieldMeta('', '', False, 'primitive'), latitude)
872
+ if longitude is not None:
873
+ _params['longitude'] = encode(FieldMeta('', '', False, 'primitive'), longitude)
874
+ if accuracy is not None:
875
+ _params['accuracy'] = encode(FieldMeta('', '', False, 'primitive'), accuracy)
876
+ _result = await self._target.send('Page.setGeolocationOverride', _params)
877
+ return None
878
+
879
+ async def set_lifecycle_events_enabled(self, *, enabled: bool) -> None:
880
+ """
881
+ Controls whether page will emit lifecycle events.
882
+ :param enabled: If true, starts emitting lifecycle events.
883
+ """
884
+ _params: Dict[str, Any] = {}
885
+ _params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
886
+ _result = await self._target.send('Page.setLifecycleEventsEnabled', _params)
887
+ return None
888
+
889
+ async def set_touch_emulation_enabled(self, *, enabled: bool, configuration: Optional[Literal['mobile', 'desktop']] = None) -> None:
890
+ """
891
+ Toggles mouse event-based touch event emulation.
892
+
893
+ .. deprecated::
894
+ :param enabled: Whether the touch event emulation should be enabled.
895
+ :param configuration: Touch/gesture events configuration. Default: current platform.
896
+ """
897
+ _params: Dict[str, Any] = {}
898
+ _params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
899
+ if configuration is not None:
900
+ _params['configuration'] = encode(FieldMeta('', '', False, 'primitive'), configuration)
901
+ _result = await self._target.send('Page.setTouchEmulationEnabled', _params)
902
+ return None
903
+
904
+ async def start_screencast(self, *, format: Optional[Literal['jpeg', 'png']] = None, quality: Optional[int] = None, max_width: Optional[int] = None, max_height: Optional[int] = None, every_nth_frame: Optional[int] = None) -> None:
905
+ """
906
+ Starts sending each frame using the `screencastFrame` event.
907
+ :param format: Image compression format.
908
+ :param quality: Compression quality from range [0..100].
909
+ :param max_width: Maximum screenshot width.
910
+ :param max_height: Maximum screenshot height.
911
+ :param every_nth_frame: Send every n-th frame.
912
+ """
913
+ _params: Dict[str, Any] = {}
914
+ if format is not None:
915
+ _params['format'] = encode(FieldMeta('', '', False, 'primitive'), format)
916
+ if quality is not None:
917
+ _params['quality'] = encode(FieldMeta('', '', False, 'primitive'), quality)
918
+ if max_width is not None:
919
+ _params['maxWidth'] = encode(FieldMeta('', '', False, 'primitive'), max_width)
920
+ if max_height is not None:
921
+ _params['maxHeight'] = encode(FieldMeta('', '', False, 'primitive'), max_height)
922
+ if every_nth_frame is not None:
923
+ _params['everyNthFrame'] = encode(FieldMeta('', '', False, 'primitive'), every_nth_frame)
924
+ _result = await self._target.send('Page.startScreencast', _params)
925
+ return None
926
+
927
+ async def stop_loading(self) -> None:
928
+ """Force the page stop all navigations and pending resource fetches."""
929
+ _params: Dict[str, Any] = {}
930
+ _result = await self._target.send('Page.stopLoading', _params)
931
+ return None
932
+
933
+ async def crash(self) -> None:
934
+ """Crashes renderer on the IO thread, generates minidumps."""
935
+ _params: Dict[str, Any] = {}
936
+ _result = await self._target.send('Page.crash', _params)
937
+ return None
938
+
939
+ async def close(self) -> None:
940
+ """Tries to close page, running its beforeunload hooks, if any."""
941
+ _params: Dict[str, Any] = {}
942
+ _result = await self._target.send('Page.close', _params)
943
+ return None
944
+
945
+ async def set_web_lifecycle_state(self, *, state: Literal['frozen', 'active']) -> None:
946
+ """
947
+ Tries to update the web lifecycle state of the page.
948
+ It will transition the page to the given state according to:
949
+ https://github.com/WICG/web-lifecycle/
950
+ :param state: Target lifecycle state
951
+ """
952
+ _params: Dict[str, Any] = {}
953
+ _params['state'] = encode(FieldMeta('', '', False, 'primitive'), state)
954
+ _result = await self._target.send('Page.setWebLifecycleState', _params)
955
+ return None
956
+
957
+ async def stop_screencast(self) -> None:
958
+ """Stops sending each frame in the `screencastFrame`."""
959
+ _params: Dict[str, Any] = {}
960
+ _result = await self._target.send('Page.stopScreencast', _params)
961
+ return None
962
+
963
+ async def produce_compilation_cache(self, *, scripts: List[CompilationCacheParams]) -> None:
964
+ """
965
+ Requests backend to produce compilation cache for the specified scripts.
966
+ `scripts` are appended to the list of scripts for which the cache
967
+ would be produced. The list may be reset during page navigation.
968
+ When script with a matching URL is encountered, the cache is optionally
969
+ produced upon backend discretion, based on internal heuristics.
970
+ See also: `Page.compilationCacheProduced`.
971
+ :param scripts:
972
+ """
973
+ _params: Dict[str, Any] = {}
974
+ _params['scripts'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Page.CompilationCacheParams')), scripts)
975
+ _result = await self._target.send('Page.produceCompilationCache', _params)
976
+ return None
977
+
978
+ async def add_compilation_cache(self, *, url: str, data: str) -> None:
979
+ """
980
+ Seeds compilation cache for given url. Compilation cache does not survive
981
+ cross-process navigation.
982
+ :param url:
983
+ :param data: Base64-encoded data (Encoded as a base64 string when passed over JSON)
984
+ """
985
+ _params: Dict[str, Any] = {}
986
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
987
+ _params['data'] = encode(FieldMeta('', '', False, 'primitive'), data)
988
+ _result = await self._target.send('Page.addCompilationCache', _params)
989
+ return None
990
+
991
+ async def clear_compilation_cache(self) -> None:
992
+ """Clears seeded compilation cache."""
993
+ _params: Dict[str, Any] = {}
994
+ _result = await self._target.send('Page.clearCompilationCache', _params)
995
+ return None
996
+
997
+ async def set_spc_transaction_mode(self, *, mode: Literal['none', 'autoAccept', 'autoChooseToAuthAnotherWay', 'autoReject', 'autoOptOut']) -> None:
998
+ """
999
+ Sets the Secure Payment Confirmation transaction mode.
1000
+ https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
1001
+ :param mode:
1002
+ """
1003
+ _params: Dict[str, Any] = {}
1004
+ _params['mode'] = encode(FieldMeta('', '', False, 'primitive'), mode)
1005
+ _result = await self._target.send('Page.setSPCTransactionMode', _params)
1006
+ return None
1007
+
1008
+ async def set_rph_registration_mode(self, *, mode: Literal['none', 'autoAccept', 'autoReject']) -> None:
1009
+ """
1010
+ Extensions for Custom Handlers API:
1011
+ https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
1012
+ :param mode:
1013
+ """
1014
+ _params: Dict[str, Any] = {}
1015
+ _params['mode'] = encode(FieldMeta('', '', False, 'primitive'), mode)
1016
+ _result = await self._target.send('Page.setRPHRegistrationMode', _params)
1017
+ return None
1018
+
1019
+ async def generate_test_report(self, *, message: str, group: Optional[str] = None) -> None:
1020
+ """
1021
+ Generates a report for testing.
1022
+ :param message: Message to be displayed in the report.
1023
+ :param group: Specifies the endpoint group to deliver the report to.
1024
+ """
1025
+ _params: Dict[str, Any] = {}
1026
+ _params['message'] = encode(FieldMeta('', '', False, 'primitive'), message)
1027
+ if group is not None:
1028
+ _params['group'] = encode(FieldMeta('', '', False, 'primitive'), group)
1029
+ _result = await self._target.send('Page.generateTestReport', _params)
1030
+ return None
1031
+
1032
+ async def wait_for_debugger(self) -> None:
1033
+ """Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger."""
1034
+ _params: Dict[str, Any] = {}
1035
+ _result = await self._target.send('Page.waitForDebugger', _params)
1036
+ return None
1037
+
1038
+ async def set_intercept_file_chooser_dialog(self, *, enabled: bool, cancel: Optional[bool] = None) -> None:
1039
+ """
1040
+ Intercept file chooser requests and transfer control to protocol clients.
1041
+ When file chooser interception is enabled, native file chooser dialog is not shown.
1042
+ Instead, a protocol event `Page.fileChooserOpened` is emitted.
1043
+ :param enabled:
1044
+ :param cancel: If true, cancels the dialog by emitting relevant events (if any)
1045
+ in addition to not showing it if the interception is enabled
1046
+ (default: false).
1047
+ """
1048
+ _params: Dict[str, Any] = {}
1049
+ _params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
1050
+ if cancel is not None:
1051
+ _params['cancel'] = encode(FieldMeta('', '', False, 'primitive'), cancel)
1052
+ _result = await self._target.send('Page.setInterceptFileChooserDialog', _params)
1053
+ return None
1054
+
1055
+ async def set_prerendering_allowed(self, *, is_allowed: bool) -> None:
1056
+ """
1057
+ Enable/disable prerendering manually.
1058
+
1059
+ This command is a short-term solution for https://crbug.com/1440085.
1060
+ See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA
1061
+ for more details.
1062
+
1063
+ TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.
1064
+ :param is_allowed:
1065
+ """
1066
+ _params: Dict[str, Any] = {}
1067
+ _params['isAllowed'] = encode(FieldMeta('', '', False, 'primitive'), is_allowed)
1068
+ _result = await self._target.send('Page.setPrerenderingAllowed', _params)
1069
+ return None
1070
+
1071
+ async def get_annotated_page_content(self, *, include_actionable_information: Optional[bool] = None) -> GetAnnotatedPageContentReturn:
1072
+ """
1073
+ Get the annotated page content for the main frame.
1074
+ This is an experimental command that is subject to change.
1075
+ :param include_actionable_information: Whether to include actionable information. Defaults to true.
1076
+ """
1077
+ _params: Dict[str, Any] = {}
1078
+ if include_actionable_information is not None:
1079
+ _params['includeActionableInformation'] = encode(FieldMeta('', '', False, 'primitive'), include_actionable_information)
1080
+ _result = await self._target.send('Page.getAnnotatedPageContent', _params)
1081
+ return GetAnnotatedPageContentReturn.from_json(_result)