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,663 @@
1
+ """Commands for the Debugger 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
+ BreakLocation,
12
+ BreakpointId,
13
+ CallFrame,
14
+ CallFrameId,
15
+ Location,
16
+ LocationRange,
17
+ ScriptPosition,
18
+ SearchMatch,
19
+ WasmDisassemblyChunk,
20
+ )
21
+ from ..runtime.types import CallArgument as Runtime_CallArgument
22
+ from ..runtime.types import ExceptionDetails as Runtime_ExceptionDetails
23
+ from ..runtime.types import RemoteObject as Runtime_RemoteObject
24
+ from ..runtime.types import RemoteObjectId as Runtime_RemoteObjectId
25
+ from ..runtime.types import ScriptId as Runtime_ScriptId
26
+ from ..runtime.types import StackTrace as Runtime_StackTrace
27
+ from ..runtime.types import StackTraceId as Runtime_StackTraceId
28
+ from ..runtime.types import TimeDelta as Runtime_TimeDelta
29
+ from ..runtime.types import UniqueDebuggerId as Runtime_UniqueDebuggerId
30
+
31
+ @dataclass
32
+ class EnableReturn(DataType):
33
+ """Return value of :meth:`Debugger.enable`."""
34
+ debugger_id: Runtime_UniqueDebuggerId
35
+ __FIELDS__: ClassVar[tuple] = (
36
+ FieldMeta('debugger_id', 'debuggerId', False, 'primitive'),
37
+ )
38
+
39
+
40
+ @dataclass
41
+ class EvaluateOnCallFrameReturn(DataType):
42
+ """Return value of :meth:`Debugger.evaluate_on_call_frame`."""
43
+ result: Runtime_RemoteObject
44
+ exception_details: Optional[Runtime_ExceptionDetails] = None
45
+ __FIELDS__: ClassVar[tuple] = (
46
+ FieldMeta('result', 'result', False, 'object', ref='Runtime.RemoteObject'),
47
+ FieldMeta('exception_details', 'exceptionDetails', True, 'object', ref='Runtime.ExceptionDetails'),
48
+ )
49
+
50
+
51
+ @dataclass
52
+ class GetPossibleBreakpointsReturn(DataType):
53
+ """Return value of :meth:`Debugger.get_possible_breakpoints`."""
54
+ locations: List[BreakLocation]
55
+ __FIELDS__: ClassVar[tuple] = (
56
+ FieldMeta('locations', 'locations', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.BreakLocation')),
57
+ )
58
+
59
+
60
+ @dataclass
61
+ class GetScriptSourceReturn(DataType):
62
+ """Return value of :meth:`Debugger.get_script_source`."""
63
+ script_source: str
64
+ bytecode: Optional[str] = None
65
+ __FIELDS__: ClassVar[tuple] = (
66
+ FieldMeta('script_source', 'scriptSource', False, 'primitive'),
67
+ FieldMeta('bytecode', 'bytecode', True, 'primitive'),
68
+ )
69
+
70
+
71
+ @dataclass
72
+ class DisassembleWasmModuleReturn(DataType):
73
+ """Return value of :meth:`Debugger.disassemble_wasm_module`."""
74
+ total_number_of_lines: int
75
+ function_body_offsets: List[int]
76
+ chunk: WasmDisassemblyChunk
77
+ stream_id: Optional[str] = None
78
+ __FIELDS__: ClassVar[tuple] = (
79
+ FieldMeta('total_number_of_lines', 'totalNumberOfLines', False, 'primitive'),
80
+ FieldMeta('function_body_offsets', 'functionBodyOffsets', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
81
+ FieldMeta('chunk', 'chunk', False, 'object', ref='Debugger.WasmDisassemblyChunk'),
82
+ FieldMeta('stream_id', 'streamId', True, 'primitive'),
83
+ )
84
+
85
+
86
+ @dataclass
87
+ class NextWasmDisassemblyChunkReturn(DataType):
88
+ """Return value of :meth:`Debugger.next_wasm_disassembly_chunk`."""
89
+ chunk: WasmDisassemblyChunk
90
+ __FIELDS__: ClassVar[tuple] = (
91
+ FieldMeta('chunk', 'chunk', False, 'object', ref='Debugger.WasmDisassemblyChunk'),
92
+ )
93
+
94
+
95
+ @dataclass
96
+ class GetWasmBytecodeReturn(DataType):
97
+ """Return value of :meth:`Debugger.get_wasm_bytecode`."""
98
+ bytecode: str
99
+ __FIELDS__: ClassVar[tuple] = (
100
+ FieldMeta('bytecode', 'bytecode', False, 'primitive'),
101
+ )
102
+
103
+
104
+ @dataclass
105
+ class GetStackTraceReturn(DataType):
106
+ """Return value of :meth:`Debugger.get_stack_trace`."""
107
+ stack_trace: Runtime_StackTrace
108
+ __FIELDS__: ClassVar[tuple] = (
109
+ FieldMeta('stack_trace', 'stackTrace', False, 'object', ref='Runtime.StackTrace'),
110
+ )
111
+
112
+
113
+ @dataclass
114
+ class RestartFrameReturn(DataType):
115
+ """Return value of :meth:`Debugger.restart_frame`."""
116
+ call_frames: List[CallFrame]
117
+ async_stack_trace: Optional[Runtime_StackTrace] = None
118
+ async_stack_trace_id: Optional[Runtime_StackTraceId] = None
119
+ __FIELDS__: ClassVar[tuple] = (
120
+ FieldMeta('call_frames', 'callFrames', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.CallFrame')),
121
+ FieldMeta('async_stack_trace', 'asyncStackTrace', True, 'object', ref='Runtime.StackTrace'),
122
+ FieldMeta('async_stack_trace_id', 'asyncStackTraceId', True, 'object', ref='Runtime.StackTraceId'),
123
+ )
124
+
125
+
126
+ @dataclass
127
+ class SearchInContentReturn(DataType):
128
+ """Return value of :meth:`Debugger.search_in_content`."""
129
+ result: List[SearchMatch]
130
+ __FIELDS__: ClassVar[tuple] = (
131
+ FieldMeta('result', 'result', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.SearchMatch')),
132
+ )
133
+
134
+
135
+ @dataclass
136
+ class SetBreakpointReturn(DataType):
137
+ """Return value of :meth:`Debugger.set_breakpoint`."""
138
+ breakpoint_id: BreakpointId
139
+ actual_location: Location
140
+ __FIELDS__: ClassVar[tuple] = (
141
+ FieldMeta('breakpoint_id', 'breakpointId', False, 'primitive'),
142
+ FieldMeta('actual_location', 'actualLocation', False, 'object', ref='Debugger.Location'),
143
+ )
144
+
145
+
146
+ @dataclass
147
+ class SetInstrumentationBreakpointReturn(DataType):
148
+ """Return value of :meth:`Debugger.set_instrumentation_breakpoint`."""
149
+ breakpoint_id: BreakpointId
150
+ __FIELDS__: ClassVar[tuple] = (
151
+ FieldMeta('breakpoint_id', 'breakpointId', False, 'primitive'),
152
+ )
153
+
154
+
155
+ @dataclass
156
+ class SetBreakpointByUrlReturn(DataType):
157
+ """Return value of :meth:`Debugger.set_breakpoint_by_url`."""
158
+ breakpoint_id: BreakpointId
159
+ locations: List[Location]
160
+ __FIELDS__: ClassVar[tuple] = (
161
+ FieldMeta('breakpoint_id', 'breakpointId', False, 'primitive'),
162
+ FieldMeta('locations', 'locations', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.Location')),
163
+ )
164
+
165
+
166
+ @dataclass
167
+ class SetBreakpointOnFunctionCallReturn(DataType):
168
+ """Return value of :meth:`Debugger.set_breakpoint_on_function_call`."""
169
+ breakpoint_id: BreakpointId
170
+ __FIELDS__: ClassVar[tuple] = (
171
+ FieldMeta('breakpoint_id', 'breakpointId', False, 'primitive'),
172
+ )
173
+
174
+
175
+ @dataclass
176
+ class SetScriptSourceReturn(DataType):
177
+ """Return value of :meth:`Debugger.set_script_source`."""
178
+ status: Literal['Ok', 'CompileError', 'BlockedByActiveGenerator', 'BlockedByActiveFunction', 'BlockedByTopLevelEsModuleChange']
179
+ call_frames: Optional[List[CallFrame]] = None
180
+ stack_changed: Optional[bool] = None
181
+ async_stack_trace: Optional[Runtime_StackTrace] = None
182
+ async_stack_trace_id: Optional[Runtime_StackTraceId] = None
183
+ exception_details: Optional[Runtime_ExceptionDetails] = None
184
+ __FIELDS__: ClassVar[tuple] = (
185
+ FieldMeta('status', 'status', False, 'primitive'),
186
+ FieldMeta('call_frames', 'callFrames', True, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.CallFrame')),
187
+ FieldMeta('stack_changed', 'stackChanged', True, 'primitive'),
188
+ FieldMeta('async_stack_trace', 'asyncStackTrace', True, 'object', ref='Runtime.StackTrace'),
189
+ FieldMeta('async_stack_trace_id', 'asyncStackTraceId', True, 'object', ref='Runtime.StackTraceId'),
190
+ FieldMeta('exception_details', 'exceptionDetails', True, 'object', ref='Runtime.ExceptionDetails'),
191
+ )
192
+
193
+
194
+ class Debugger:
195
+ """Commands of the Debugger domain, bound to a target."""
196
+
197
+ def __init__(self, target: Any) -> None:
198
+ self._target = target
199
+
200
+
201
+ async def continue_to_location(self, *, location: Location, target_call_frames: Optional[Literal['any', 'current']] = None) -> None:
202
+ """
203
+ Continues execution until specific location is reached.
204
+ :param location: Location to continue to.
205
+ :param target_call_frames:
206
+ """
207
+ _params: Dict[str, Any] = {}
208
+ _params['location'] = encode(FieldMeta('', '', False, 'object', ref='Debugger.Location'), location)
209
+ if target_call_frames is not None:
210
+ _params['targetCallFrames'] = encode(FieldMeta('', '', False, 'primitive'), target_call_frames)
211
+ _result = await self._target.send('Debugger.continueToLocation', _params)
212
+ return None
213
+
214
+ async def disable(self) -> None:
215
+ """Disables debugger for given page."""
216
+ _params: Dict[str, Any] = {}
217
+ _result = await self._target.send('Debugger.disable', _params)
218
+ return None
219
+
220
+ async def enable(self, *, max_scripts_cache_size: Optional[float] = None) -> EnableReturn:
221
+ """
222
+ Enables debugger for the given page. Clients should not assume that the debugging has been
223
+ enabled until the result for this command is received.
224
+ :param max_scripts_cache_size: The maximum size in bytes of collected scripts (not referenced by other heap objects)
225
+ the debugger can hold. Puts no limit if parameter is omitted.
226
+ """
227
+ _params: Dict[str, Any] = {}
228
+ if max_scripts_cache_size is not None:
229
+ _params['maxScriptsCacheSize'] = encode(FieldMeta('', '', False, 'primitive'), max_scripts_cache_size)
230
+ _result = await self._target.send('Debugger.enable', _params)
231
+ return EnableReturn.from_json(_result)
232
+
233
+ async def evaluate_on_call_frame(self, *, call_frame_id: CallFrameId, expression: str, object_group: Optional[str] = None, include_command_line_api: Optional[bool] = None, silent: Optional[bool] = None, return_by_value: Optional[bool] = None, generate_preview: Optional[bool] = None, throw_on_side_effect: Optional[bool] = None, timeout: Optional[Runtime_TimeDelta] = None) -> EvaluateOnCallFrameReturn:
234
+ """
235
+ Evaluates expression on a given call frame.
236
+ :param call_frame_id: Call frame identifier to evaluate on.
237
+ :param expression: Expression to evaluate.
238
+ :param object_group: String object group name to put result into (allows rapid releasing resulting object handles
239
+ using `releaseObjectGroup`).
240
+ :param include_command_line_api: Specifies whether command line API should be available to the evaluated expression, defaults
241
+ to false.
242
+ :param silent: In silent mode exceptions thrown during evaluation are not reported and do not pause
243
+ execution. Overrides `setPauseOnException` state.
244
+ :param return_by_value: Whether the result is expected to be a JSON object that should be sent by value.
245
+ :param generate_preview: Whether preview should be generated for the result.
246
+ :param throw_on_side_effect: Whether to throw an exception if side effect cannot be ruled out during evaluation.
247
+ :param timeout: Terminate execution after timing out (number of milliseconds).
248
+ """
249
+ _params: Dict[str, Any] = {}
250
+ _params['callFrameId'] = encode(FieldMeta('', '', False, 'primitive'), call_frame_id)
251
+ _params['expression'] = encode(FieldMeta('', '', False, 'primitive'), expression)
252
+ if object_group is not None:
253
+ _params['objectGroup'] = encode(FieldMeta('', '', False, 'primitive'), object_group)
254
+ if include_command_line_api is not None:
255
+ _params['includeCommandLineAPI'] = encode(FieldMeta('', '', False, 'primitive'), include_command_line_api)
256
+ if silent is not None:
257
+ _params['silent'] = encode(FieldMeta('', '', False, 'primitive'), silent)
258
+ if return_by_value is not None:
259
+ _params['returnByValue'] = encode(FieldMeta('', '', False, 'primitive'), return_by_value)
260
+ if generate_preview is not None:
261
+ _params['generatePreview'] = encode(FieldMeta('', '', False, 'primitive'), generate_preview)
262
+ if throw_on_side_effect is not None:
263
+ _params['throwOnSideEffect'] = encode(FieldMeta('', '', False, 'primitive'), throw_on_side_effect)
264
+ if timeout is not None:
265
+ _params['timeout'] = encode(FieldMeta('', '', False, 'primitive'), timeout)
266
+ _result = await self._target.send('Debugger.evaluateOnCallFrame', _params)
267
+ return EvaluateOnCallFrameReturn.from_json(_result)
268
+
269
+ async def get_possible_breakpoints(self, *, start: Location, end: Optional[Location] = None, restrict_to_function: Optional[bool] = None) -> GetPossibleBreakpointsReturn:
270
+ """
271
+ Returns possible locations for breakpoint. scriptId in start and end range locations should be
272
+ the same.
273
+ :param start: Start of range to search possible breakpoint locations in.
274
+ :param end: End of range to search possible breakpoint locations in (excluding). When not specified, end
275
+ of scripts is used as end of range.
276
+ :param restrict_to_function: Only consider locations which are in the same (non-nested) function as start.
277
+ """
278
+ _params: Dict[str, Any] = {}
279
+ _params['start'] = encode(FieldMeta('', '', False, 'object', ref='Debugger.Location'), start)
280
+ if end is not None:
281
+ _params['end'] = encode(FieldMeta('', '', False, 'object', ref='Debugger.Location'), end)
282
+ if restrict_to_function is not None:
283
+ _params['restrictToFunction'] = encode(FieldMeta('', '', False, 'primitive'), restrict_to_function)
284
+ _result = await self._target.send('Debugger.getPossibleBreakpoints', _params)
285
+ return GetPossibleBreakpointsReturn.from_json(_result)
286
+
287
+ async def get_script_source(self, *, script_id: Runtime_ScriptId) -> GetScriptSourceReturn:
288
+ """
289
+ Returns source for the script with given id.
290
+ :param script_id: Id of the script to get source for.
291
+ """
292
+ _params: Dict[str, Any] = {}
293
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
294
+ _result = await self._target.send('Debugger.getScriptSource', _params)
295
+ return GetScriptSourceReturn.from_json(_result)
296
+
297
+ async def disassemble_wasm_module(self, *, script_id: Runtime_ScriptId) -> DisassembleWasmModuleReturn:
298
+ """:param script_id: Id of the script to disassemble"""
299
+ _params: Dict[str, Any] = {}
300
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
301
+ _result = await self._target.send('Debugger.disassembleWasmModule', _params)
302
+ return DisassembleWasmModuleReturn.from_json(_result)
303
+
304
+ async def next_wasm_disassembly_chunk(self, *, stream_id: str) -> NextWasmDisassemblyChunkReturn:
305
+ """
306
+ Disassemble the next chunk of lines for the module corresponding to the
307
+ stream. If disassembly is complete, this API will invalidate the streamId
308
+ and return an empty chunk. Any subsequent calls for the now invalid stream
309
+ will return errors.
310
+ :param stream_id:
311
+ """
312
+ _params: Dict[str, Any] = {}
313
+ _params['streamId'] = encode(FieldMeta('', '', False, 'primitive'), stream_id)
314
+ _result = await self._target.send('Debugger.nextWasmDisassemblyChunk', _params)
315
+ return NextWasmDisassemblyChunkReturn.from_json(_result)
316
+
317
+ async def get_wasm_bytecode(self, *, script_id: Runtime_ScriptId) -> GetWasmBytecodeReturn:
318
+ """
319
+ This command is deprecated. Use getScriptSource instead.
320
+
321
+ .. deprecated::
322
+ :param script_id: Id of the Wasm script to get source for.
323
+ """
324
+ _params: Dict[str, Any] = {}
325
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
326
+ _result = await self._target.send('Debugger.getWasmBytecode', _params)
327
+ return GetWasmBytecodeReturn.from_json(_result)
328
+
329
+ async def get_stack_trace(self, *, stack_trace_id: Runtime_StackTraceId) -> GetStackTraceReturn:
330
+ """
331
+ Returns stack trace with given `stackTraceId`.
332
+ :param stack_trace_id:
333
+ """
334
+ _params: Dict[str, Any] = {}
335
+ _params['stackTraceId'] = encode(FieldMeta('', '', False, 'object', ref='Runtime.StackTraceId'), stack_trace_id)
336
+ _result = await self._target.send('Debugger.getStackTrace', _params)
337
+ return GetStackTraceReturn.from_json(_result)
338
+
339
+ async def pause(self) -> None:
340
+ """Stops on the next JavaScript statement."""
341
+ _params: Dict[str, Any] = {}
342
+ _result = await self._target.send('Debugger.pause', _params)
343
+ return None
344
+
345
+ async def pause_on_async_call(self, *, parent_stack_trace_id: Runtime_StackTraceId) -> None:
346
+ """
347
+
348
+ .. deprecated::
349
+ :param parent_stack_trace_id: Debugger will pause when async call with given stack trace is started.
350
+ """
351
+ _params: Dict[str, Any] = {}
352
+ _params['parentStackTraceId'] = encode(FieldMeta('', '', False, 'object', ref='Runtime.StackTraceId'), parent_stack_trace_id)
353
+ _result = await self._target.send('Debugger.pauseOnAsyncCall', _params)
354
+ return None
355
+
356
+ async def remove_breakpoint(self, *, breakpoint_id: BreakpointId) -> None:
357
+ """
358
+ Removes JavaScript breakpoint.
359
+ :param breakpoint_id:
360
+ """
361
+ _params: Dict[str, Any] = {}
362
+ _params['breakpointId'] = encode(FieldMeta('', '', False, 'primitive'), breakpoint_id)
363
+ _result = await self._target.send('Debugger.removeBreakpoint', _params)
364
+ return None
365
+
366
+ async def restart_frame(self, *, call_frame_id: CallFrameId, mode: Optional[Literal['StepInto']] = None) -> RestartFrameReturn:
367
+ """
368
+ Restarts particular call frame from the beginning. The old, deprecated
369
+ behavior of `restartFrame` is to stay paused and allow further CDP commands
370
+ after a restart was scheduled. This can cause problems with restarting, so
371
+ we now continue execution immediatly after it has been scheduled until we
372
+ reach the beginning of the restarted frame.
373
+
374
+ To stay back-wards compatible, `restartFrame` now expects a `mode`
375
+ parameter to be present. If the `mode` parameter is missing, `restartFrame`
376
+ errors out.
377
+
378
+ The various return values are deprecated and `callFrames` is always empty.
379
+ Use the call frames from the `Debugger#paused` events instead, that fires
380
+ once V8 pauses at the beginning of the restarted function.
381
+ :param call_frame_id: Call frame identifier to evaluate on.
382
+ :param mode: The `mode` parameter must be present and set to 'StepInto', otherwise
383
+ `restartFrame` will error out.
384
+ """
385
+ _params: Dict[str, Any] = {}
386
+ _params['callFrameId'] = encode(FieldMeta('', '', False, 'primitive'), call_frame_id)
387
+ if mode is not None:
388
+ _params['mode'] = encode(FieldMeta('', '', False, 'primitive'), mode)
389
+ _result = await self._target.send('Debugger.restartFrame', _params)
390
+ return RestartFrameReturn.from_json(_result)
391
+
392
+ async def resume(self, *, terminate_on_resume: Optional[bool] = None) -> None:
393
+ """
394
+ Resumes JavaScript execution.
395
+ :param terminate_on_resume: Set to true to terminate execution upon resuming execution. In contrast
396
+ to Runtime.terminateExecution, this will allows to execute further
397
+ JavaScript (i.e. via evaluation) until execution of the paused code
398
+ is actually resumed, at which point termination is triggered.
399
+ If execution is currently not paused, this parameter has no effect.
400
+ """
401
+ _params: Dict[str, Any] = {}
402
+ if terminate_on_resume is not None:
403
+ _params['terminateOnResume'] = encode(FieldMeta('', '', False, 'primitive'), terminate_on_resume)
404
+ _result = await self._target.send('Debugger.resume', _params)
405
+ return None
406
+
407
+ async def search_in_content(self, *, script_id: Runtime_ScriptId, query: str, case_sensitive: Optional[bool] = None, is_regex: Optional[bool] = None) -> SearchInContentReturn:
408
+ """
409
+ Searches for given string in script content.
410
+ :param script_id: Id of the script to search in.
411
+ :param query: String to search for.
412
+ :param case_sensitive: If true, search is case sensitive.
413
+ :param is_regex: If true, treats string parameter as regex.
414
+ """
415
+ _params: Dict[str, Any] = {}
416
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
417
+ _params['query'] = encode(FieldMeta('', '', False, 'primitive'), query)
418
+ if case_sensitive is not None:
419
+ _params['caseSensitive'] = encode(FieldMeta('', '', False, 'primitive'), case_sensitive)
420
+ if is_regex is not None:
421
+ _params['isRegex'] = encode(FieldMeta('', '', False, 'primitive'), is_regex)
422
+ _result = await self._target.send('Debugger.searchInContent', _params)
423
+ return SearchInContentReturn.from_json(_result)
424
+
425
+ async def set_async_call_stack_depth(self, *, max_depth: int) -> None:
426
+ """
427
+ Enables or disables async call stacks tracking.
428
+ :param max_depth: Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
429
+ call stacks (default).
430
+ """
431
+ _params: Dict[str, Any] = {}
432
+ _params['maxDepth'] = encode(FieldMeta('', '', False, 'primitive'), max_depth)
433
+ _result = await self._target.send('Debugger.setAsyncCallStackDepth', _params)
434
+ return None
435
+
436
+ async def set_blackbox_execution_contexts(self, *, unique_ids: List[str]) -> None:
437
+ """
438
+ Replace previous blackbox execution contexts with passed ones. Forces backend to skip
439
+ stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by
440
+ performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
441
+ :param unique_ids: Array of execution context unique ids for the debugger to ignore.
442
+ """
443
+ _params: Dict[str, Any] = {}
444
+ _params['uniqueIds'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), unique_ids)
445
+ _result = await self._target.send('Debugger.setBlackboxExecutionContexts', _params)
446
+ return None
447
+
448
+ async def set_blackbox_patterns(self, *, patterns: List[str], skip_anonymous: Optional[bool] = None) -> None:
449
+ """
450
+ Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
451
+ scripts with url matching one of the patterns. VM will try to leave blackboxed script by
452
+ performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
453
+ :param patterns: Array of regexps that will be used to check script url for blackbox state.
454
+ :param skip_anonymous: If true, also ignore scripts with no source url.
455
+ """
456
+ _params: Dict[str, Any] = {}
457
+ _params['patterns'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), patterns)
458
+ if skip_anonymous is not None:
459
+ _params['skipAnonymous'] = encode(FieldMeta('', '', False, 'primitive'), skip_anonymous)
460
+ _result = await self._target.send('Debugger.setBlackboxPatterns', _params)
461
+ return None
462
+
463
+ async def set_blackboxed_ranges(self, *, script_id: Runtime_ScriptId, positions: List[ScriptPosition]) -> None:
464
+ """
465
+ Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
466
+ scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
467
+ Positions array contains positions where blackbox state is changed. First interval isn't
468
+ blackboxed. Array should be sorted.
469
+ :param script_id: Id of the script.
470
+ :param positions:
471
+ """
472
+ _params: Dict[str, Any] = {}
473
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
474
+ _params['positions'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.ScriptPosition')), positions)
475
+ _result = await self._target.send('Debugger.setBlackboxedRanges', _params)
476
+ return None
477
+
478
+ async def set_breakpoint(self, *, location: Location, condition: Optional[str] = None) -> SetBreakpointReturn:
479
+ """
480
+ Sets JavaScript breakpoint at a given location.
481
+ :param location: Location to set breakpoint in.
482
+ :param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the
483
+ breakpoint if this expression evaluates to true.
484
+ """
485
+ _params: Dict[str, Any] = {}
486
+ _params['location'] = encode(FieldMeta('', '', False, 'object', ref='Debugger.Location'), location)
487
+ if condition is not None:
488
+ _params['condition'] = encode(FieldMeta('', '', False, 'primitive'), condition)
489
+ _result = await self._target.send('Debugger.setBreakpoint', _params)
490
+ return SetBreakpointReturn.from_json(_result)
491
+
492
+ async def set_instrumentation_breakpoint(self, *, instrumentation: Literal['beforeScriptExecution', 'beforeScriptWithSourceMapExecution']) -> SetInstrumentationBreakpointReturn:
493
+ """
494
+ Sets instrumentation breakpoint.
495
+ :param instrumentation: Instrumentation name.
496
+ """
497
+ _params: Dict[str, Any] = {}
498
+ _params['instrumentation'] = encode(FieldMeta('', '', False, 'primitive'), instrumentation)
499
+ _result = await self._target.send('Debugger.setInstrumentationBreakpoint', _params)
500
+ return SetInstrumentationBreakpointReturn.from_json(_result)
501
+
502
+ async def set_breakpoint_by_url(self, *, line_number: int, url: Optional[str] = None, url_regex: Optional[str] = None, script_hash: Optional[str] = None, column_number: Optional[int] = None, condition: Optional[str] = None) -> SetBreakpointByUrlReturn:
503
+ """
504
+ Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
505
+ command is issued, all existing parsed scripts will have breakpoints resolved and returned in
506
+ `locations` property. Further matching script parsing will result in subsequent
507
+ `breakpointResolved` events issued. This logical breakpoint will survive page reloads.
508
+ :param line_number: Line number to set breakpoint at.
509
+ :param url: URL of the resources to set breakpoint on.
510
+ :param url_regex: Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
511
+ `urlRegex` must be specified.
512
+ :param script_hash: Script hash of the resources to set breakpoint on.
513
+ :param column_number: Offset in the line to set breakpoint at.
514
+ :param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the
515
+ breakpoint if this expression evaluates to true.
516
+ """
517
+ _params: Dict[str, Any] = {}
518
+ _params['lineNumber'] = encode(FieldMeta('', '', False, 'primitive'), line_number)
519
+ if url is not None:
520
+ _params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
521
+ if url_regex is not None:
522
+ _params['urlRegex'] = encode(FieldMeta('', '', False, 'primitive'), url_regex)
523
+ if script_hash is not None:
524
+ _params['scriptHash'] = encode(FieldMeta('', '', False, 'primitive'), script_hash)
525
+ if column_number is not None:
526
+ _params['columnNumber'] = encode(FieldMeta('', '', False, 'primitive'), column_number)
527
+ if condition is not None:
528
+ _params['condition'] = encode(FieldMeta('', '', False, 'primitive'), condition)
529
+ _result = await self._target.send('Debugger.setBreakpointByUrl', _params)
530
+ return SetBreakpointByUrlReturn.from_json(_result)
531
+
532
+ async def set_breakpoint_on_function_call(self, *, object_id: Runtime_RemoteObjectId, condition: Optional[str] = None) -> SetBreakpointOnFunctionCallReturn:
533
+ """
534
+ Sets JavaScript breakpoint before each call to the given function.
535
+ If another function was created from the same source as a given one,
536
+ calling it will also trigger the breakpoint.
537
+ :param object_id: Function object id.
538
+ :param condition: Expression to use as a breakpoint condition. When specified, debugger will
539
+ stop on the breakpoint if this expression evaluates to true.
540
+ """
541
+ _params: Dict[str, Any] = {}
542
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
543
+ if condition is not None:
544
+ _params['condition'] = encode(FieldMeta('', '', False, 'primitive'), condition)
545
+ _result = await self._target.send('Debugger.setBreakpointOnFunctionCall', _params)
546
+ return SetBreakpointOnFunctionCallReturn.from_json(_result)
547
+
548
+ async def set_breakpoints_active(self, *, active: bool) -> None:
549
+ """
550
+ Activates / deactivates all breakpoints on the page.
551
+ :param active: New value for breakpoints active state.
552
+ """
553
+ _params: Dict[str, Any] = {}
554
+ _params['active'] = encode(FieldMeta('', '', False, 'primitive'), active)
555
+ _result = await self._target.send('Debugger.setBreakpointsActive', _params)
556
+ return None
557
+
558
+ async def set_pause_on_exceptions(self, *, state: Literal['none', 'caught', 'uncaught', 'all']) -> None:
559
+ """
560
+ Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,
561
+ or caught exceptions, no exceptions. Initial pause on exceptions state is `none`.
562
+ :param state: Pause on exceptions mode.
563
+ """
564
+ _params: Dict[str, Any] = {}
565
+ _params['state'] = encode(FieldMeta('', '', False, 'primitive'), state)
566
+ _result = await self._target.send('Debugger.setPauseOnExceptions', _params)
567
+ return None
568
+
569
+ async def set_return_value(self, *, new_value: Runtime_CallArgument) -> None:
570
+ """
571
+ Changes return value in top frame. Available only at return break position.
572
+ :param new_value: New return value.
573
+ """
574
+ _params: Dict[str, Any] = {}
575
+ _params['newValue'] = encode(FieldMeta('', '', False, 'object', ref='Runtime.CallArgument'), new_value)
576
+ _result = await self._target.send('Debugger.setReturnValue', _params)
577
+ return None
578
+
579
+ async def set_script_source(self, *, script_id: Runtime_ScriptId, script_source: str, dry_run: Optional[bool] = None, allow_top_frame_editing: Optional[bool] = None) -> SetScriptSourceReturn:
580
+ """
581
+ Edits JavaScript source live.
582
+
583
+ In general, functions that are currently on the stack can not be edited with
584
+ a single exception: If the edited function is the top-most stack frame and
585
+ that is the only activation of that function on the stack. In this case
586
+ the live edit will be successful and a `Debugger.restartFrame` for the
587
+ top-most function is automatically triggered.
588
+ :param script_id: Id of the script to edit.
589
+ :param script_source: New content of the script.
590
+ :param dry_run: If true the change will not actually be applied. Dry run may be used to get result
591
+ description without actually modifying the code.
592
+ :param allow_top_frame_editing: If true, then `scriptSource` is allowed to change the function on top of the stack
593
+ as long as the top-most stack frame is the only activation of that function.
594
+ """
595
+ _params: Dict[str, Any] = {}
596
+ _params['scriptId'] = encode(FieldMeta('', '', False, 'primitive'), script_id)
597
+ _params['scriptSource'] = encode(FieldMeta('', '', False, 'primitive'), script_source)
598
+ if dry_run is not None:
599
+ _params['dryRun'] = encode(FieldMeta('', '', False, 'primitive'), dry_run)
600
+ if allow_top_frame_editing is not None:
601
+ _params['allowTopFrameEditing'] = encode(FieldMeta('', '', False, 'primitive'), allow_top_frame_editing)
602
+ _result = await self._target.send('Debugger.setScriptSource', _params)
603
+ return SetScriptSourceReturn.from_json(_result)
604
+
605
+ async def set_skip_all_pauses(self, *, skip: bool) -> None:
606
+ """
607
+ Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
608
+ :param skip: New value for skip pauses state.
609
+ """
610
+ _params: Dict[str, Any] = {}
611
+ _params['skip'] = encode(FieldMeta('', '', False, 'primitive'), skip)
612
+ _result = await self._target.send('Debugger.setSkipAllPauses', _params)
613
+ return None
614
+
615
+ async def set_variable_value(self, *, scope_number: int, variable_name: str, new_value: Runtime_CallArgument, call_frame_id: CallFrameId) -> None:
616
+ """
617
+ Changes value of variable in a callframe. Object-based scopes are not supported and must be
618
+ mutated manually.
619
+ :param scope_number: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
620
+ scope types are allowed. Other scopes could be manipulated manually.
621
+ :param variable_name: Variable name.
622
+ :param new_value: New variable value.
623
+ :param call_frame_id: Id of callframe that holds variable.
624
+ """
625
+ _params: Dict[str, Any] = {}
626
+ _params['scopeNumber'] = encode(FieldMeta('', '', False, 'primitive'), scope_number)
627
+ _params['variableName'] = encode(FieldMeta('', '', False, 'primitive'), variable_name)
628
+ _params['newValue'] = encode(FieldMeta('', '', False, 'object', ref='Runtime.CallArgument'), new_value)
629
+ _params['callFrameId'] = encode(FieldMeta('', '', False, 'primitive'), call_frame_id)
630
+ _result = await self._target.send('Debugger.setVariableValue', _params)
631
+ return None
632
+
633
+ async def step_into(self, *, break_on_async_call: Optional[bool] = None, skip_list: Optional[List[LocationRange]] = None) -> None:
634
+ """
635
+ Steps into the function call.
636
+ :param break_on_async_call: Debugger will pause on the execution of the first async task which was scheduled
637
+ before next pause.
638
+ :param skip_list: The skipList specifies location ranges that should be skipped on step into.
639
+ """
640
+ _params: Dict[str, Any] = {}
641
+ if break_on_async_call is not None:
642
+ _params['breakOnAsyncCall'] = encode(FieldMeta('', '', False, 'primitive'), break_on_async_call)
643
+ if skip_list is not None:
644
+ _params['skipList'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.LocationRange')), skip_list)
645
+ _result = await self._target.send('Debugger.stepInto', _params)
646
+ return None
647
+
648
+ async def step_out(self) -> None:
649
+ """Steps out of the function call."""
650
+ _params: Dict[str, Any] = {}
651
+ _result = await self._target.send('Debugger.stepOut', _params)
652
+ return None
653
+
654
+ async def step_over(self, *, skip_list: Optional[List[LocationRange]] = None) -> None:
655
+ """
656
+ Steps over the statement.
657
+ :param skip_list: The skipList specifies location ranges that should be skipped on step over.
658
+ """
659
+ _params: Dict[str, Any] = {}
660
+ if skip_list is not None:
661
+ _params['skipList'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.LocationRange')), skip_list)
662
+ _result = await self._target.send('Debugger.stepOver', _params)
663
+ return None