parsek-cdp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parsek_cdp/__init__.py +55 -0
- parsek_cdp/_logging.py +49 -0
- parsek_cdp/cdp/__init__.py +247 -0
- parsek_cdp/cdp/accessibility/__init__.py +15 -0
- parsek_cdp/cdp/accessibility/events.py +35 -0
- parsek_cdp/cdp/accessibility/functions.py +202 -0
- parsek_cdp/cdp/accessibility/types.py +235 -0
- parsek_cdp/cdp/animation/__init__.py +15 -0
- parsek_cdp/cdp/animation/events.py +52 -0
- parsek_cdp/cdp/animation/functions.py +140 -0
- parsek_cdp/cdp/animation/types.py +113 -0
- parsek_cdp/cdp/audits/__init__.py +15 -0
- parsek_cdp/cdp/audits/events.py +21 -0
- parsek_cdp/cdp/audits/functions.py +95 -0
- parsek_cdp/cdp/audits/types.py +1051 -0
- parsek_cdp/cdp/autofill/__init__.py +15 -0
- parsek_cdp/cdp/autofill/events.py +27 -0
- parsek_cdp/cdp/autofill/functions.py +64 -0
- parsek_cdp/cdp/autofill/types.py +108 -0
- parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
- parsek_cdp/cdp/backgroundservice/events.py +40 -0
- parsek_cdp/cdp/backgroundservice/functions.py +59 -0
- parsek_cdp/cdp/backgroundservice/types.py +63 -0
- parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
- parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
- parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
- parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
- parsek_cdp/cdp/browser/__init__.py +15 -0
- parsek_cdp/cdp/browser/events.py +46 -0
- parsek_cdp/cdp/browser/functions.py +350 -0
- parsek_cdp/cdp/browser/types.py +158 -0
- parsek_cdp/cdp/cachestorage/__init__.py +15 -0
- parsek_cdp/cdp/cachestorage/events.py +13 -0
- parsek_cdp/cdp/cachestorage/functions.py +126 -0
- parsek_cdp/cdp/cachestorage/types.py +89 -0
- parsek_cdp/cdp/cast/__init__.py +15 -0
- parsek_cdp/cdp/cast/events.py +38 -0
- parsek_cdp/cdp/cast/functions.py +77 -0
- parsek_cdp/cdp/cast/types.py +23 -0
- parsek_cdp/cdp/console/__init__.py +15 -0
- parsek_cdp/cdp/console/events.py +22 -0
- parsek_cdp/cdp/console/functions.py +36 -0
- parsek_cdp/cdp/console/types.py +30 -0
- parsek_cdp/cdp/css/__init__.py +15 -0
- parsek_cdp/cdp/css/events.py +79 -0
- parsek_cdp/cdp/css/functions.py +788 -0
- parsek_cdp/cdp/css/types.py +742 -0
- parsek_cdp/cdp/debugger/__init__.py +15 -0
- parsek_cdp/cdp/debugger/events.py +164 -0
- parsek_cdp/cdp/debugger/functions.py +663 -0
- parsek_cdp/cdp/debugger/types.py +171 -0
- parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
- parsek_cdp/cdp/deviceaccess/events.py +30 -0
- parsek_cdp/cdp/deviceaccess/functions.py +54 -0
- parsek_cdp/cdp/deviceaccess/types.py +28 -0
- parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
- parsek_cdp/cdp/deviceorientation/events.py +13 -0
- parsek_cdp/cdp/deviceorientation/functions.py +35 -0
- parsek_cdp/cdp/deviceorientation/types.py +10 -0
- parsek_cdp/cdp/dom/__init__.py +15 -0
- parsek_cdp/cdp/dom/events.py +228 -0
- parsek_cdp/cdp/dom/functions.py +1033 -0
- parsek_cdp/cdp/dom/types.py +293 -0
- parsek_cdp/cdp/domdebugger/__init__.py +15 -0
- parsek_cdp/cdp/domdebugger/events.py +13 -0
- parsek_cdp/cdp/domdebugger/functions.py +155 -0
- parsek_cdp/cdp/domdebugger/types.py +57 -0
- parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
- parsek_cdp/cdp/domsnapshot/events.py +13 -0
- parsek_cdp/cdp/domsnapshot/functions.py +111 -0
- parsek_cdp/cdp/domsnapshot/types.py +312 -0
- parsek_cdp/cdp/domstorage/__init__.py +15 -0
- parsek_cdp/cdp/domstorage/events.py +60 -0
- parsek_cdp/cdp/domstorage/functions.py +79 -0
- parsek_cdp/cdp/domstorage/types.py +30 -0
- parsek_cdp/cdp/emulation/__init__.py +15 -0
- parsek_cdp/cdp/emulation/events.py +17 -0
- parsek_cdp/cdp/emulation/functions.py +688 -0
- parsek_cdp/cdp/emulation/types.py +305 -0
- parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
- parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
- parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
- parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
- parsek_cdp/cdp/extensions/__init__.py +15 -0
- parsek_cdp/cdp/extensions/events.py +13 -0
- parsek_cdp/cdp/extensions/functions.py +118 -0
- parsek_cdp/cdp/extensions/types.py +19 -0
- parsek_cdp/cdp/fedcm/__init__.py +15 -0
- parsek_cdp/cdp/fedcm/events.py +45 -0
- parsek_cdp/cdp/fedcm/functions.py +93 -0
- parsek_cdp/cdp/fedcm/types.py +72 -0
- parsek_cdp/cdp/fetch/__init__.py +15 -0
- parsek_cdp/cdp/fetch/events.py +82 -0
- parsek_cdp/cdp/fetch/functions.py +215 -0
- parsek_cdp/cdp/fetch/types.py +81 -0
- parsek_cdp/cdp/filesystem/__init__.py +15 -0
- parsek_cdp/cdp/filesystem/events.py +13 -0
- parsek_cdp/cdp/filesystem/functions.py +36 -0
- parsek_cdp/cdp/filesystem/types.py +54 -0
- parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
- parsek_cdp/cdp/headlessexperimental/events.py +13 -0
- parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
- parsek_cdp/cdp/headlessexperimental/types.py +24 -0
- parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
- parsek_cdp/cdp/heapprofiler/events.py +65 -0
- parsek_cdp/cdp/heapprofiler/functions.py +193 -0
- parsek_cdp/cdp/heapprofiler/types.py +57 -0
- parsek_cdp/cdp/indexeddb/__init__.py +15 -0
- parsek_cdp/cdp/indexeddb/events.py +13 -0
- parsek_cdp/cdp/indexeddb/functions.py +232 -0
- parsek_cdp/cdp/indexeddb/types.py +120 -0
- parsek_cdp/cdp/input/__init__.py +15 -0
- parsek_cdp/cdp/input/events.py +25 -0
- parsek_cdp/cdp/input/functions.py +361 -0
- parsek_cdp/cdp/input/types.py +87 -0
- parsek_cdp/cdp/inspector/__init__.py +15 -0
- parsek_cdp/cdp/inspector/events.py +41 -0
- parsek_cdp/cdp/inspector/functions.py +27 -0
- parsek_cdp/cdp/inspector/types.py +10 -0
- parsek_cdp/cdp/io/__init__.py +15 -0
- parsek_cdp/cdp/io/events.py +13 -0
- parsek_cdp/cdp/io/functions.py +77 -0
- parsek_cdp/cdp/io/types.py +13 -0
- parsek_cdp/cdp/layertree/__init__.py +15 -0
- parsek_cdp/cdp/layertree/events.py +36 -0
- parsek_cdp/cdp/layertree/functions.py +178 -0
- parsek_cdp/cdp/layertree/types.py +104 -0
- parsek_cdp/cdp/log/__init__.py +15 -0
- parsek_cdp/cdp/log/events.py +22 -0
- parsek_cdp/cdp/log/functions.py +54 -0
- parsek_cdp/cdp/log/types.py +57 -0
- parsek_cdp/cdp/media/__init__.py +15 -0
- parsek_cdp/cdp/media/events.py +87 -0
- parsek_cdp/cdp/media/functions.py +27 -0
- parsek_cdp/cdp/media/types.py +101 -0
- parsek_cdp/cdp/memory/__init__.py +15 -0
- parsek_cdp/cdp/memory/events.py +13 -0
- parsek_cdp/cdp/memory/functions.py +164 -0
- parsek_cdp/cdp/memory/types.py +71 -0
- parsek_cdp/cdp/mixins/__init__.py +21 -0
- parsek_cdp/cdp/mixins/datatype.py +123 -0
- parsek_cdp/cdp/mixins/event.py +78 -0
- parsek_cdp/cdp/mixins/namespace.py +31 -0
- parsek_cdp/cdp/network/__init__.py +15 -0
- parsek_cdp/cdp/network/events.py +726 -0
- parsek_cdp/cdp/network/functions.py +734 -0
- parsek_cdp/cdp/network/types.py +1247 -0
- parsek_cdp/cdp/overlay/__init__.py +15 -0
- parsek_cdp/cdp/overlay/events.py +54 -0
- parsek_cdp/cdp/overlay/functions.py +407 -0
- parsek_cdp/cdp/overlay/types.py +328 -0
- parsek_cdp/cdp/page/__init__.py +15 -0
- parsek_cdp/cdp/page/events.py +416 -0
- parsek_cdp/cdp/page/functions.py +1081 -0
- parsek_cdp/cdp/page/types.py +1088 -0
- parsek_cdp/cdp/performance/__init__.py +15 -0
- parsek_cdp/cdp/performance/events.py +24 -0
- parsek_cdp/cdp/performance/functions.py +63 -0
- parsek_cdp/cdp/performance/types.py +22 -0
- parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
- parsek_cdp/cdp/performancetimeline/events.py +22 -0
- parsek_cdp/cdp/performancetimeline/functions.py +30 -0
- parsek_cdp/cdp/performancetimeline/types.py +85 -0
- parsek_cdp/cdp/preload/__init__.py +15 -0
- parsek_cdp/cdp/preload/events.py +116 -0
- parsek_cdp/cdp/preload/functions.py +25 -0
- parsek_cdp/cdp/preload/types.py +267 -0
- parsek_cdp/cdp/profiler/__init__.py +15 -0
- parsek_cdp/cdp/profiler/events.py +64 -0
- parsek_cdp/cdp/profiler/functions.py +134 -0
- parsek_cdp/cdp/profiler/types.py +105 -0
- parsek_cdp/cdp/pwa/__init__.py +15 -0
- parsek_cdp/cdp/pwa/events.py +13 -0
- parsek_cdp/cdp/pwa/functions.py +196 -0
- parsek_cdp/cdp/pwa/types.py +45 -0
- parsek_cdp/cdp/runtime/__init__.py +15 -0
- parsek_cdp/cdp/runtime/events.py +123 -0
- parsek_cdp/cdp/runtime/functions.py +552 -0
- parsek_cdp/cdp/runtime/types.py +319 -0
- parsek_cdp/cdp/schema/__init__.py +15 -0
- parsek_cdp/cdp/schema/events.py +13 -0
- parsek_cdp/cdp/schema/functions.py +32 -0
- parsek_cdp/cdp/schema/types.py +22 -0
- parsek_cdp/cdp/security/__init__.py +15 -0
- parsek_cdp/cdp/security/events.py +64 -0
- parsek_cdp/cdp/security/functions.py +66 -0
- parsek_cdp/cdp/security/types.py +168 -0
- parsek_cdp/cdp/serviceworker/__init__.py +15 -0
- parsek_cdp/cdp/serviceworker/events.py +43 -0
- parsek_cdp/cdp/serviceworker/functions.py +115 -0
- parsek_cdp/cdp/serviceworker/types.py +95 -0
- parsek_cdp/cdp/storage/__init__.py +15 -0
- parsek_cdp/cdp/storage/events.py +288 -0
- parsek_cdp/cdp/storage/functions.py +571 -0
- parsek_cdp/cdp/storage/types.py +656 -0
- parsek_cdp/cdp/systeminfo/__init__.py +15 -0
- parsek_cdp/cdp/systeminfo/events.py +13 -0
- parsek_cdp/cdp/systeminfo/functions.py +75 -0
- parsek_cdp/cdp/systeminfo/types.py +132 -0
- parsek_cdp/cdp/target/__init__.py +15 -0
- parsek_cdp/cdp/target/events.py +109 -0
- parsek_cdp/cdp/target/functions.py +424 -0
- parsek_cdp/cdp/target/types.py +83 -0
- parsek_cdp/cdp/tethering/__init__.py +15 -0
- parsek_cdp/cdp/tethering/events.py +22 -0
- parsek_cdp/cdp/tethering/functions.py +35 -0
- parsek_cdp/cdp/tethering/types.py +10 -0
- parsek_cdp/cdp/tracing/__init__.py +15 -0
- parsek_cdp/cdp/tracing/events.py +61 -0
- parsek_cdp/cdp/tracing/functions.py +119 -0
- parsek_cdp/cdp/tracing/types.py +81 -0
- parsek_cdp/cdp/webaudio/__init__.py +15 -0
- parsek_cdp/cdp/webaudio/events.py +184 -0
- parsek_cdp/cdp/webaudio/functions.py +51 -0
- parsek_cdp/cdp/webaudio/types.py +155 -0
- parsek_cdp/cdp/webauthn/__init__.py +15 -0
- parsek_cdp/cdp/webauthn/events.py +69 -0
- parsek_cdp/cdp/webauthn/functions.py +214 -0
- parsek_cdp/cdp/webauthn/types.py +96 -0
- parsek_cdp/core/__init__.py +18 -0
- parsek_cdp/core/browser.py +240 -0
- parsek_cdp/core/browser_context.py +58 -0
- parsek_cdp/core/element.py +405 -0
- parsek_cdp/core/feature.py +376 -0
- parsek_cdp/core/frame.py +351 -0
- parsek_cdp/core/pagable.py +175 -0
- parsek_cdp/core/page.py +163 -0
- parsek_cdp/core/target.py +490 -0
- parsek_cdp/features/__init__.py +14 -0
- parsek_cdp/features/request_listener/__init__.py +256 -0
- parsek_cdp/features/request_listener/events.py +48 -0
- parsek_cdp/features/request_listener/types.py +235 -0
- parsek_cdp/generate.py +642 -0
- parsek_cdp/parsek/__init__.py +18 -0
- parsek_cdp/parsek/events.py +38 -0
- parsek_cdp/parsek/types.py +36 -0
- parsek_cdp/py.typed +0 -0
- parsek_cdp-0.1.0.dist-info/METADATA +277 -0
- parsek_cdp-0.1.0.dist-info/RECORD +242 -0
- parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
- parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
- parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
"""Commands for the Network 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
|
+
AuthChallengeResponse,
|
|
12
|
+
BlockPattern,
|
|
13
|
+
ConnectionType,
|
|
14
|
+
ContentEncoding,
|
|
15
|
+
Cookie,
|
|
16
|
+
CookieParam,
|
|
17
|
+
CookiePartitionKey,
|
|
18
|
+
CookiePriority,
|
|
19
|
+
CookieSameSite,
|
|
20
|
+
CookieSourceScheme,
|
|
21
|
+
ErrorReason,
|
|
22
|
+
Headers,
|
|
23
|
+
InterceptionId,
|
|
24
|
+
LoadNetworkResourceOptions,
|
|
25
|
+
LoadNetworkResourcePageResult,
|
|
26
|
+
NetworkConditions,
|
|
27
|
+
RequestId,
|
|
28
|
+
RequestPattern,
|
|
29
|
+
SecurityIsolationStatus,
|
|
30
|
+
TimeSinceEpoch,
|
|
31
|
+
)
|
|
32
|
+
from ..debugger.types import SearchMatch as Debugger_SearchMatch
|
|
33
|
+
from ..emulation.types import UserAgentMetadata as Emulation_UserAgentMetadata
|
|
34
|
+
from ..io.types import StreamHandle as IO_StreamHandle
|
|
35
|
+
from ..page.types import FrameId as Page_FrameId
|
|
36
|
+
|
|
37
|
+
@dataclass
|
|
38
|
+
class CanClearBrowserCacheReturn(DataType):
|
|
39
|
+
"""Return value of :meth:`Network.can_clear_browser_cache`."""
|
|
40
|
+
result: bool
|
|
41
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
42
|
+
FieldMeta('result', 'result', False, 'primitive'),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass
|
|
47
|
+
class CanClearBrowserCookiesReturn(DataType):
|
|
48
|
+
"""Return value of :meth:`Network.can_clear_browser_cookies`."""
|
|
49
|
+
result: bool
|
|
50
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
51
|
+
FieldMeta('result', 'result', False, 'primitive'),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass
|
|
56
|
+
class CanEmulateNetworkConditionsReturn(DataType):
|
|
57
|
+
"""Return value of :meth:`Network.can_emulate_network_conditions`."""
|
|
58
|
+
result: bool
|
|
59
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
60
|
+
FieldMeta('result', 'result', False, 'primitive'),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass
|
|
65
|
+
class EmulateNetworkConditionsByRuleReturn(DataType):
|
|
66
|
+
"""Return value of :meth:`Network.emulate_network_conditions_by_rule`."""
|
|
67
|
+
rule_ids: List[str]
|
|
68
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
69
|
+
FieldMeta('rule_ids', 'ruleIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@dataclass
|
|
74
|
+
class GetAllCookiesReturn(DataType):
|
|
75
|
+
"""Return value of :meth:`Network.get_all_cookies`."""
|
|
76
|
+
cookies: List[Cookie]
|
|
77
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
78
|
+
FieldMeta('cookies', 'cookies', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.Cookie')),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@dataclass
|
|
83
|
+
class GetCertificateReturn(DataType):
|
|
84
|
+
"""Return value of :meth:`Network.get_certificate`."""
|
|
85
|
+
table_names: List[str]
|
|
86
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
87
|
+
FieldMeta('table_names', 'tableNames', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@dataclass
|
|
92
|
+
class GetCookiesReturn(DataType):
|
|
93
|
+
"""Return value of :meth:`Network.get_cookies`."""
|
|
94
|
+
cookies: List[Cookie]
|
|
95
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
96
|
+
FieldMeta('cookies', 'cookies', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.Cookie')),
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@dataclass
|
|
101
|
+
class GetResponseBodyReturn(DataType):
|
|
102
|
+
"""Return value of :meth:`Network.get_response_body`."""
|
|
103
|
+
body: str
|
|
104
|
+
base64_encoded: bool
|
|
105
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
106
|
+
FieldMeta('body', 'body', False, 'primitive'),
|
|
107
|
+
FieldMeta('base64_encoded', 'base64Encoded', False, 'primitive'),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@dataclass
|
|
112
|
+
class GetRequestPostDataReturn(DataType):
|
|
113
|
+
"""Return value of :meth:`Network.get_request_post_data`."""
|
|
114
|
+
post_data: str
|
|
115
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
116
|
+
FieldMeta('post_data', 'postData', False, 'primitive'),
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@dataclass
|
|
121
|
+
class GetResponseBodyForInterceptionReturn(DataType):
|
|
122
|
+
"""Return value of :meth:`Network.get_response_body_for_interception`."""
|
|
123
|
+
body: str
|
|
124
|
+
base64_encoded: bool
|
|
125
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
126
|
+
FieldMeta('body', 'body', False, 'primitive'),
|
|
127
|
+
FieldMeta('base64_encoded', 'base64Encoded', False, 'primitive'),
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@dataclass
|
|
132
|
+
class TakeResponseBodyForInterceptionAsStreamReturn(DataType):
|
|
133
|
+
"""Return value of :meth:`Network.take_response_body_for_interception_as_stream`."""
|
|
134
|
+
stream: IO_StreamHandle
|
|
135
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
136
|
+
FieldMeta('stream', 'stream', False, 'primitive'),
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
@dataclass
|
|
141
|
+
class SearchInResponseBodyReturn(DataType):
|
|
142
|
+
"""Return value of :meth:`Network.search_in_response_body`."""
|
|
143
|
+
result: List[Debugger_SearchMatch]
|
|
144
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
145
|
+
FieldMeta('result', 'result', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Debugger.SearchMatch')),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@dataclass
|
|
150
|
+
class SetCookieReturn(DataType):
|
|
151
|
+
"""Return value of :meth:`Network.set_cookie`."""
|
|
152
|
+
success: bool
|
|
153
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
154
|
+
FieldMeta('success', 'success', False, 'primitive'),
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
@dataclass
|
|
159
|
+
class StreamResourceContentReturn(DataType):
|
|
160
|
+
"""Return value of :meth:`Network.stream_resource_content`."""
|
|
161
|
+
buffered_data: str
|
|
162
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
163
|
+
FieldMeta('buffered_data', 'bufferedData', False, 'primitive'),
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
@dataclass
|
|
168
|
+
class GetSecurityIsolationStatusReturn(DataType):
|
|
169
|
+
"""Return value of :meth:`Network.get_security_isolation_status`."""
|
|
170
|
+
status: SecurityIsolationStatus
|
|
171
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
172
|
+
FieldMeta('status', 'status', False, 'object', ref='Network.SecurityIsolationStatus'),
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@dataclass
|
|
177
|
+
class LoadNetworkResourceReturn(DataType):
|
|
178
|
+
"""Return value of :meth:`Network.load_network_resource`."""
|
|
179
|
+
resource: LoadNetworkResourcePageResult
|
|
180
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
181
|
+
FieldMeta('resource', 'resource', False, 'object', ref='Network.LoadNetworkResourcePageResult'),
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class Network:
|
|
186
|
+
"""Commands of the Network domain, bound to a target."""
|
|
187
|
+
|
|
188
|
+
def __init__(self, target: Any) -> None:
|
|
189
|
+
self._target = target
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async def set_accepted_encodings(self, *, encodings: List[ContentEncoding]) -> None:
|
|
193
|
+
"""
|
|
194
|
+
Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
|
|
195
|
+
:param encodings: List of accepted content encodings.
|
|
196
|
+
"""
|
|
197
|
+
_params: Dict[str, Any] = {}
|
|
198
|
+
_params['encodings'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'enum', ref='Network.ContentEncoding')), encodings)
|
|
199
|
+
_result = await self._target.send('Network.setAcceptedEncodings', _params)
|
|
200
|
+
return None
|
|
201
|
+
|
|
202
|
+
async def clear_accepted_encodings_override(self) -> None:
|
|
203
|
+
"""Clears accepted encodings set by setAcceptedEncodings"""
|
|
204
|
+
_params: Dict[str, Any] = {}
|
|
205
|
+
_result = await self._target.send('Network.clearAcceptedEncodingsOverride', _params)
|
|
206
|
+
return None
|
|
207
|
+
|
|
208
|
+
async def can_clear_browser_cache(self) -> CanClearBrowserCacheReturn:
|
|
209
|
+
"""
|
|
210
|
+
Tells whether clearing browser cache is supported.
|
|
211
|
+
|
|
212
|
+
.. deprecated::
|
|
213
|
+
"""
|
|
214
|
+
_params: Dict[str, Any] = {}
|
|
215
|
+
_result = await self._target.send('Network.canClearBrowserCache', _params)
|
|
216
|
+
return CanClearBrowserCacheReturn.from_json(_result)
|
|
217
|
+
|
|
218
|
+
async def can_clear_browser_cookies(self) -> CanClearBrowserCookiesReturn:
|
|
219
|
+
"""
|
|
220
|
+
Tells whether clearing browser cookies is supported.
|
|
221
|
+
|
|
222
|
+
.. deprecated::
|
|
223
|
+
"""
|
|
224
|
+
_params: Dict[str, Any] = {}
|
|
225
|
+
_result = await self._target.send('Network.canClearBrowserCookies', _params)
|
|
226
|
+
return CanClearBrowserCookiesReturn.from_json(_result)
|
|
227
|
+
|
|
228
|
+
async def can_emulate_network_conditions(self) -> CanEmulateNetworkConditionsReturn:
|
|
229
|
+
"""
|
|
230
|
+
Tells whether emulation of network conditions is supported.
|
|
231
|
+
|
|
232
|
+
.. deprecated::
|
|
233
|
+
"""
|
|
234
|
+
_params: Dict[str, Any] = {}
|
|
235
|
+
_result = await self._target.send('Network.canEmulateNetworkConditions', _params)
|
|
236
|
+
return CanEmulateNetworkConditionsReturn.from_json(_result)
|
|
237
|
+
|
|
238
|
+
async def clear_browser_cache(self) -> None:
|
|
239
|
+
"""Clears browser cache."""
|
|
240
|
+
_params: Dict[str, Any] = {}
|
|
241
|
+
_result = await self._target.send('Network.clearBrowserCache', _params)
|
|
242
|
+
return None
|
|
243
|
+
|
|
244
|
+
async def clear_browser_cookies(self) -> None:
|
|
245
|
+
"""Clears browser cookies."""
|
|
246
|
+
_params: Dict[str, Any] = {}
|
|
247
|
+
_result = await self._target.send('Network.clearBrowserCookies', _params)
|
|
248
|
+
return None
|
|
249
|
+
|
|
250
|
+
async def continue_intercepted_request(self, *, interception_id: InterceptionId, error_reason: Optional[ErrorReason] = None, raw_response: Optional[str] = None, url: Optional[str] = None, method: Optional[str] = None, post_data: Optional[str] = None, headers: Optional[Headers] = None, auth_challenge_response: Optional[AuthChallengeResponse] = None) -> None:
|
|
251
|
+
"""
|
|
252
|
+
Response to Network.requestIntercepted which either modifies the request to continue with any
|
|
253
|
+
modifications, or blocks it, or completes it with the provided response bytes. If a network
|
|
254
|
+
fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted
|
|
255
|
+
event will be sent with the same InterceptionId.
|
|
256
|
+
Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.
|
|
257
|
+
|
|
258
|
+
.. deprecated::
|
|
259
|
+
:param interception_id:
|
|
260
|
+
:param error_reason: If set this causes the request to fail with the given reason. Passing `Aborted` for requests
|
|
261
|
+
marked with `isNavigationRequest` also cancels the navigation. Must not be set in response
|
|
262
|
+
to an authChallenge.
|
|
263
|
+
:param raw_response: If set the requests completes using with the provided base64 encoded raw response, including
|
|
264
|
+
HTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)
|
|
265
|
+
:param url: If set the request url will be modified in a way that's not observable by page. Must not be
|
|
266
|
+
set in response to an authChallenge.
|
|
267
|
+
:param method: If set this allows the request method to be overridden. Must not be set in response to an
|
|
268
|
+
authChallenge.
|
|
269
|
+
:param post_data: If set this allows postData to be set. Must not be set in response to an authChallenge.
|
|
270
|
+
:param headers: If set this allows the request headers to be changed. Must not be set in response to an
|
|
271
|
+
authChallenge.
|
|
272
|
+
:param auth_challenge_response: Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
|
|
273
|
+
"""
|
|
274
|
+
_params: Dict[str, Any] = {}
|
|
275
|
+
_params['interceptionId'] = encode(FieldMeta('', '', False, 'primitive'), interception_id)
|
|
276
|
+
if error_reason is not None:
|
|
277
|
+
_params['errorReason'] = encode(FieldMeta('', '', False, 'enum', ref='Network.ErrorReason'), error_reason)
|
|
278
|
+
if raw_response is not None:
|
|
279
|
+
_params['rawResponse'] = encode(FieldMeta('', '', False, 'primitive'), raw_response)
|
|
280
|
+
if url is not None:
|
|
281
|
+
_params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
|
|
282
|
+
if method is not None:
|
|
283
|
+
_params['method'] = encode(FieldMeta('', '', False, 'primitive'), method)
|
|
284
|
+
if post_data is not None:
|
|
285
|
+
_params['postData'] = encode(FieldMeta('', '', False, 'primitive'), post_data)
|
|
286
|
+
if headers is not None:
|
|
287
|
+
_params['headers'] = encode(FieldMeta('', '', False, 'primitive'), headers)
|
|
288
|
+
if auth_challenge_response is not None:
|
|
289
|
+
_params['authChallengeResponse'] = encode(FieldMeta('', '', False, 'object', ref='Network.AuthChallengeResponse'), auth_challenge_response)
|
|
290
|
+
_result = await self._target.send('Network.continueInterceptedRequest', _params)
|
|
291
|
+
return None
|
|
292
|
+
|
|
293
|
+
async def delete_cookies(self, *, name: str, url: Optional[str] = None, domain: Optional[str] = None, path: Optional[str] = None, partition_key: Optional[CookiePartitionKey] = None) -> None:
|
|
294
|
+
"""
|
|
295
|
+
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.
|
|
296
|
+
:param name: Name of the cookies to remove.
|
|
297
|
+
:param url: If specified, deletes all the cookies with the given name where domain and path match
|
|
298
|
+
provided URL.
|
|
299
|
+
:param domain: If specified, deletes only cookies with the exact domain.
|
|
300
|
+
:param path: If specified, deletes only cookies with the exact path.
|
|
301
|
+
:param partition_key: If specified, deletes only cookies with the the given name and partitionKey where
|
|
302
|
+
all partition key attributes match the cookie partition key attribute.
|
|
303
|
+
"""
|
|
304
|
+
_params: Dict[str, Any] = {}
|
|
305
|
+
_params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
|
|
306
|
+
if url is not None:
|
|
307
|
+
_params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
|
|
308
|
+
if domain is not None:
|
|
309
|
+
_params['domain'] = encode(FieldMeta('', '', False, 'primitive'), domain)
|
|
310
|
+
if path is not None:
|
|
311
|
+
_params['path'] = encode(FieldMeta('', '', False, 'primitive'), path)
|
|
312
|
+
if partition_key is not None:
|
|
313
|
+
_params['partitionKey'] = encode(FieldMeta('', '', False, 'object', ref='Network.CookiePartitionKey'), partition_key)
|
|
314
|
+
_result = await self._target.send('Network.deleteCookies', _params)
|
|
315
|
+
return None
|
|
316
|
+
|
|
317
|
+
async def disable(self) -> None:
|
|
318
|
+
"""Disables network tracking, prevents network events from being sent to the client."""
|
|
319
|
+
_params: Dict[str, Any] = {}
|
|
320
|
+
_result = await self._target.send('Network.disable', _params)
|
|
321
|
+
return None
|
|
322
|
+
|
|
323
|
+
async def emulate_network_conditions(self, *, offline: bool, latency: float, download_throughput: float, upload_throughput: float, connection_type: Optional[ConnectionType] = None, packet_loss: Optional[float] = None, packet_queue_length: Optional[int] = None, packet_reordering: Optional[bool] = None) -> None:
|
|
324
|
+
"""
|
|
325
|
+
Activates emulation of network conditions. This command is deprecated in favor of the emulateNetworkConditionsByRule
|
|
326
|
+
and overrideNetworkState commands, which can be used together to the same effect.
|
|
327
|
+
|
|
328
|
+
.. deprecated::
|
|
329
|
+
:param offline: True to emulate internet disconnection.
|
|
330
|
+
:param latency: Minimum latency from request sent to response headers received (ms).
|
|
331
|
+
:param download_throughput: Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
|
|
332
|
+
:param upload_throughput: Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
|
|
333
|
+
:param connection_type: Connection type if known.
|
|
334
|
+
:param packet_loss: WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
|
|
335
|
+
:param packet_queue_length: WebRTC packet queue length (packet). 0 removes any queue length limitations.
|
|
336
|
+
:param packet_reordering: WebRTC packetReordering feature.
|
|
337
|
+
"""
|
|
338
|
+
_params: Dict[str, Any] = {}
|
|
339
|
+
_params['offline'] = encode(FieldMeta('', '', False, 'primitive'), offline)
|
|
340
|
+
_params['latency'] = encode(FieldMeta('', '', False, 'primitive'), latency)
|
|
341
|
+
_params['downloadThroughput'] = encode(FieldMeta('', '', False, 'primitive'), download_throughput)
|
|
342
|
+
_params['uploadThroughput'] = encode(FieldMeta('', '', False, 'primitive'), upload_throughput)
|
|
343
|
+
if connection_type is not None:
|
|
344
|
+
_params['connectionType'] = encode(FieldMeta('', '', False, 'enum', ref='Network.ConnectionType'), connection_type)
|
|
345
|
+
if packet_loss is not None:
|
|
346
|
+
_params['packetLoss'] = encode(FieldMeta('', '', False, 'primitive'), packet_loss)
|
|
347
|
+
if packet_queue_length is not None:
|
|
348
|
+
_params['packetQueueLength'] = encode(FieldMeta('', '', False, 'primitive'), packet_queue_length)
|
|
349
|
+
if packet_reordering is not None:
|
|
350
|
+
_params['packetReordering'] = encode(FieldMeta('', '', False, 'primitive'), packet_reordering)
|
|
351
|
+
_result = await self._target.send('Network.emulateNetworkConditions', _params)
|
|
352
|
+
return None
|
|
353
|
+
|
|
354
|
+
async def emulate_network_conditions_by_rule(self, *, offline: bool, matched_network_conditions: List[NetworkConditions]) -> EmulateNetworkConditionsByRuleReturn:
|
|
355
|
+
"""
|
|
356
|
+
Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
|
|
357
|
+
Network.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to
|
|
358
|
+
explicitly modify `navigator` behavior.
|
|
359
|
+
:param offline: True to emulate internet disconnection.
|
|
360
|
+
:param matched_network_conditions: Configure conditions for matching requests. If multiple entries match a request, the first entry wins. Global
|
|
361
|
+
conditions can be configured by leaving the urlPattern for the conditions empty. These global conditions are
|
|
362
|
+
also applied for throttling of p2p connections.
|
|
363
|
+
"""
|
|
364
|
+
_params: Dict[str, Any] = {}
|
|
365
|
+
_params['offline'] = encode(FieldMeta('', '', False, 'primitive'), offline)
|
|
366
|
+
_params['matchedNetworkConditions'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.NetworkConditions')), matched_network_conditions)
|
|
367
|
+
_result = await self._target.send('Network.emulateNetworkConditionsByRule', _params)
|
|
368
|
+
return EmulateNetworkConditionsByRuleReturn.from_json(_result)
|
|
369
|
+
|
|
370
|
+
async def override_network_state(self, *, offline: bool, latency: float, download_throughput: float, upload_throughput: float, connection_type: Optional[ConnectionType] = None) -> None:
|
|
371
|
+
"""
|
|
372
|
+
Override the state of navigator.onLine and navigator.connection.
|
|
373
|
+
:param offline: True to emulate internet disconnection.
|
|
374
|
+
:param latency: Minimum latency from request sent to response headers received (ms).
|
|
375
|
+
:param download_throughput: Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
|
|
376
|
+
:param upload_throughput: Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
|
|
377
|
+
:param connection_type: Connection type if known.
|
|
378
|
+
"""
|
|
379
|
+
_params: Dict[str, Any] = {}
|
|
380
|
+
_params['offline'] = encode(FieldMeta('', '', False, 'primitive'), offline)
|
|
381
|
+
_params['latency'] = encode(FieldMeta('', '', False, 'primitive'), latency)
|
|
382
|
+
_params['downloadThroughput'] = encode(FieldMeta('', '', False, 'primitive'), download_throughput)
|
|
383
|
+
_params['uploadThroughput'] = encode(FieldMeta('', '', False, 'primitive'), upload_throughput)
|
|
384
|
+
if connection_type is not None:
|
|
385
|
+
_params['connectionType'] = encode(FieldMeta('', '', False, 'enum', ref='Network.ConnectionType'), connection_type)
|
|
386
|
+
_result = await self._target.send('Network.overrideNetworkState', _params)
|
|
387
|
+
return None
|
|
388
|
+
|
|
389
|
+
async def enable(self, *, max_total_buffer_size: Optional[int] = None, max_resource_buffer_size: Optional[int] = None, max_post_data_size: Optional[int] = None, report_direct_socket_traffic: Optional[bool] = None, enable_durable_messages: Optional[bool] = None) -> None:
|
|
390
|
+
"""
|
|
391
|
+
Enables network tracking, network events will now be delivered to the client.
|
|
392
|
+
:param max_total_buffer_size: Buffer size in bytes to use when preserving network payloads (XHRs, etc).
|
|
393
|
+
:param max_resource_buffer_size: Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
|
|
394
|
+
:param max_post_data_size: Longest post body size (in bytes) that would be included in requestWillBeSent notification
|
|
395
|
+
:param report_direct_socket_traffic: Whether DirectSocket chunk send/receive events should be reported.
|
|
396
|
+
:param enable_durable_messages: Enable storing response bodies outside of renderer, so that these survive
|
|
397
|
+
a cross-process navigation. Requires maxTotalBufferSize to be set.
|
|
398
|
+
Currently defaults to false.
|
|
399
|
+
"""
|
|
400
|
+
_params: Dict[str, Any] = {}
|
|
401
|
+
if max_total_buffer_size is not None:
|
|
402
|
+
_params['maxTotalBufferSize'] = encode(FieldMeta('', '', False, 'primitive'), max_total_buffer_size)
|
|
403
|
+
if max_resource_buffer_size is not None:
|
|
404
|
+
_params['maxResourceBufferSize'] = encode(FieldMeta('', '', False, 'primitive'), max_resource_buffer_size)
|
|
405
|
+
if max_post_data_size is not None:
|
|
406
|
+
_params['maxPostDataSize'] = encode(FieldMeta('', '', False, 'primitive'), max_post_data_size)
|
|
407
|
+
if report_direct_socket_traffic is not None:
|
|
408
|
+
_params['reportDirectSocketTraffic'] = encode(FieldMeta('', '', False, 'primitive'), report_direct_socket_traffic)
|
|
409
|
+
if enable_durable_messages is not None:
|
|
410
|
+
_params['enableDurableMessages'] = encode(FieldMeta('', '', False, 'primitive'), enable_durable_messages)
|
|
411
|
+
_result = await self._target.send('Network.enable', _params)
|
|
412
|
+
return None
|
|
413
|
+
|
|
414
|
+
async def get_all_cookies(self) -> GetAllCookiesReturn:
|
|
415
|
+
"""
|
|
416
|
+
Returns all browser cookies. Depending on the backend support, will return detailed cookie
|
|
417
|
+
information in the `cookies` field.
|
|
418
|
+
Deprecated. Use Storage.getCookies instead.
|
|
419
|
+
|
|
420
|
+
.. deprecated::
|
|
421
|
+
"""
|
|
422
|
+
_params: Dict[str, Any] = {}
|
|
423
|
+
_result = await self._target.send('Network.getAllCookies', _params)
|
|
424
|
+
return GetAllCookiesReturn.from_json(_result)
|
|
425
|
+
|
|
426
|
+
async def get_certificate(self, *, origin: str) -> GetCertificateReturn:
|
|
427
|
+
"""
|
|
428
|
+
Returns the DER-encoded certificate.
|
|
429
|
+
:param origin: Origin to get certificate for.
|
|
430
|
+
"""
|
|
431
|
+
_params: Dict[str, Any] = {}
|
|
432
|
+
_params['origin'] = encode(FieldMeta('', '', False, 'primitive'), origin)
|
|
433
|
+
_result = await self._target.send('Network.getCertificate', _params)
|
|
434
|
+
return GetCertificateReturn.from_json(_result)
|
|
435
|
+
|
|
436
|
+
async def get_cookies(self, *, urls: Optional[List[str]] = None) -> GetCookiesReturn:
|
|
437
|
+
"""
|
|
438
|
+
Returns all browser cookies for the current URL. Depending on the backend support, will return
|
|
439
|
+
detailed cookie information in the `cookies` field.
|
|
440
|
+
:param urls: The list of URLs for which applicable cookies will be fetched.
|
|
441
|
+
If not specified, it's assumed to be set to the list containing
|
|
442
|
+
the URLs of the page and all of its subframes.
|
|
443
|
+
"""
|
|
444
|
+
_params: Dict[str, Any] = {}
|
|
445
|
+
if urls is not None:
|
|
446
|
+
_params['urls'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), urls)
|
|
447
|
+
_result = await self._target.send('Network.getCookies', _params)
|
|
448
|
+
return GetCookiesReturn.from_json(_result)
|
|
449
|
+
|
|
450
|
+
async def get_response_body(self, *, request_id: RequestId) -> GetResponseBodyReturn:
|
|
451
|
+
"""
|
|
452
|
+
Returns content served for the given request.
|
|
453
|
+
:param request_id: Identifier of the network request to get content for.
|
|
454
|
+
"""
|
|
455
|
+
_params: Dict[str, Any] = {}
|
|
456
|
+
_params['requestId'] = encode(FieldMeta('', '', False, 'primitive'), request_id)
|
|
457
|
+
_result = await self._target.send('Network.getResponseBody', _params)
|
|
458
|
+
return GetResponseBodyReturn.from_json(_result)
|
|
459
|
+
|
|
460
|
+
async def get_request_post_data(self, *, request_id: RequestId) -> GetRequestPostDataReturn:
|
|
461
|
+
"""
|
|
462
|
+
Returns post data sent with the request. Returns an error when no data was sent with the request.
|
|
463
|
+
:param request_id: Identifier of the network request to get content for.
|
|
464
|
+
"""
|
|
465
|
+
_params: Dict[str, Any] = {}
|
|
466
|
+
_params['requestId'] = encode(FieldMeta('', '', False, 'primitive'), request_id)
|
|
467
|
+
_result = await self._target.send('Network.getRequestPostData', _params)
|
|
468
|
+
return GetRequestPostDataReturn.from_json(_result)
|
|
469
|
+
|
|
470
|
+
async def get_response_body_for_interception(self, *, interception_id: InterceptionId) -> GetResponseBodyForInterceptionReturn:
|
|
471
|
+
"""
|
|
472
|
+
Returns content served for the given currently intercepted request.
|
|
473
|
+
:param interception_id: Identifier for the intercepted request to get body for.
|
|
474
|
+
"""
|
|
475
|
+
_params: Dict[str, Any] = {}
|
|
476
|
+
_params['interceptionId'] = encode(FieldMeta('', '', False, 'primitive'), interception_id)
|
|
477
|
+
_result = await self._target.send('Network.getResponseBodyForInterception', _params)
|
|
478
|
+
return GetResponseBodyForInterceptionReturn.from_json(_result)
|
|
479
|
+
|
|
480
|
+
async def take_response_body_for_interception_as_stream(self, *, interception_id: InterceptionId) -> TakeResponseBodyForInterceptionAsStreamReturn:
|
|
481
|
+
"""
|
|
482
|
+
Returns a handle to the stream representing the response body. Note that after this command,
|
|
483
|
+
the intercepted request can't be continued as is -- you either need to cancel it or to provide
|
|
484
|
+
the response body. The stream only supports sequential read, IO.read will fail if the position
|
|
485
|
+
is specified.
|
|
486
|
+
:param interception_id:
|
|
487
|
+
"""
|
|
488
|
+
_params: Dict[str, Any] = {}
|
|
489
|
+
_params['interceptionId'] = encode(FieldMeta('', '', False, 'primitive'), interception_id)
|
|
490
|
+
_result = await self._target.send('Network.takeResponseBodyForInterceptionAsStream', _params)
|
|
491
|
+
return TakeResponseBodyForInterceptionAsStreamReturn.from_json(_result)
|
|
492
|
+
|
|
493
|
+
async def replay_xhr(self, *, request_id: RequestId) -> None:
|
|
494
|
+
"""
|
|
495
|
+
This method sends a new XMLHttpRequest which is identical to the original one. The following
|
|
496
|
+
parameters should be identical: method, url, async, request body, extra headers, withCredentials
|
|
497
|
+
attribute, user, password.
|
|
498
|
+
:param request_id: Identifier of XHR to replay.
|
|
499
|
+
"""
|
|
500
|
+
_params: Dict[str, Any] = {}
|
|
501
|
+
_params['requestId'] = encode(FieldMeta('', '', False, 'primitive'), request_id)
|
|
502
|
+
_result = await self._target.send('Network.replayXHR', _params)
|
|
503
|
+
return None
|
|
504
|
+
|
|
505
|
+
async def search_in_response_body(self, *, request_id: RequestId, query: str, case_sensitive: Optional[bool] = None, is_regex: Optional[bool] = None) -> SearchInResponseBodyReturn:
|
|
506
|
+
"""
|
|
507
|
+
Searches for given string in response content.
|
|
508
|
+
:param request_id: Identifier of the network response to search.
|
|
509
|
+
:param query: String to search for.
|
|
510
|
+
:param case_sensitive: If true, search is case sensitive.
|
|
511
|
+
:param is_regex: If true, treats string parameter as regex.
|
|
512
|
+
"""
|
|
513
|
+
_params: Dict[str, Any] = {}
|
|
514
|
+
_params['requestId'] = encode(FieldMeta('', '', False, 'primitive'), request_id)
|
|
515
|
+
_params['query'] = encode(FieldMeta('', '', False, 'primitive'), query)
|
|
516
|
+
if case_sensitive is not None:
|
|
517
|
+
_params['caseSensitive'] = encode(FieldMeta('', '', False, 'primitive'), case_sensitive)
|
|
518
|
+
if is_regex is not None:
|
|
519
|
+
_params['isRegex'] = encode(FieldMeta('', '', False, 'primitive'), is_regex)
|
|
520
|
+
_result = await self._target.send('Network.searchInResponseBody', _params)
|
|
521
|
+
return SearchInResponseBodyReturn.from_json(_result)
|
|
522
|
+
|
|
523
|
+
async def set_blocked_ur_ls(self, *, url_patterns: Optional[List[BlockPattern]] = None, urls: Optional[List[str]] = None) -> None:
|
|
524
|
+
"""
|
|
525
|
+
Blocks URLs from loading.
|
|
526
|
+
:param url_patterns: Patterns to match in the order in which they are given. These patterns
|
|
527
|
+
also take precedence over any wildcard patterns defined in `urls`.
|
|
528
|
+
:param urls: URL patterns to block. Wildcards ('*') are allowed.
|
|
529
|
+
"""
|
|
530
|
+
_params: Dict[str, Any] = {}
|
|
531
|
+
if url_patterns is not None:
|
|
532
|
+
_params['urlPatterns'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.BlockPattern')), url_patterns)
|
|
533
|
+
if urls is not None:
|
|
534
|
+
_params['urls'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), urls)
|
|
535
|
+
_result = await self._target.send('Network.setBlockedURLs', _params)
|
|
536
|
+
return None
|
|
537
|
+
|
|
538
|
+
async def set_bypass_service_worker(self, *, bypass: bool) -> None:
|
|
539
|
+
"""
|
|
540
|
+
Toggles ignoring of service worker for each request.
|
|
541
|
+
:param bypass: Bypass service worker and load from network.
|
|
542
|
+
"""
|
|
543
|
+
_params: Dict[str, Any] = {}
|
|
544
|
+
_params['bypass'] = encode(FieldMeta('', '', False, 'primitive'), bypass)
|
|
545
|
+
_result = await self._target.send('Network.setBypassServiceWorker', _params)
|
|
546
|
+
return None
|
|
547
|
+
|
|
548
|
+
async def set_cache_disabled(self, *, cache_disabled: bool) -> None:
|
|
549
|
+
"""
|
|
550
|
+
Toggles ignoring cache for each request. If `true`, cache will not be used.
|
|
551
|
+
:param cache_disabled: Cache disabled state.
|
|
552
|
+
"""
|
|
553
|
+
_params: Dict[str, Any] = {}
|
|
554
|
+
_params['cacheDisabled'] = encode(FieldMeta('', '', False, 'primitive'), cache_disabled)
|
|
555
|
+
_result = await self._target.send('Network.setCacheDisabled', _params)
|
|
556
|
+
return None
|
|
557
|
+
|
|
558
|
+
async def set_cookie(self, *, name: str, value: str, url: Optional[str] = None, domain: Optional[str] = None, path: Optional[str] = None, secure: Optional[bool] = None, http_only: Optional[bool] = None, same_site: Optional[CookieSameSite] = None, expires: Optional[TimeSinceEpoch] = None, priority: Optional[CookiePriority] = None, same_party: Optional[bool] = None, source_scheme: Optional[CookieSourceScheme] = None, source_port: Optional[int] = None, partition_key: Optional[CookiePartitionKey] = None) -> SetCookieReturn:
|
|
559
|
+
"""
|
|
560
|
+
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
|
|
561
|
+
:param name: Cookie name.
|
|
562
|
+
:param value: Cookie value.
|
|
563
|
+
:param url: The request-URI to associate with the setting of the cookie. This value can affect the
|
|
564
|
+
default domain, path, source port, and source scheme values of the created cookie.
|
|
565
|
+
:param domain: Cookie domain.
|
|
566
|
+
:param path: Cookie path.
|
|
567
|
+
:param secure: True if cookie is secure.
|
|
568
|
+
:param http_only: True if cookie is http-only.
|
|
569
|
+
:param same_site: Cookie SameSite type.
|
|
570
|
+
:param expires: Cookie expiration date, session cookie if not set
|
|
571
|
+
:param priority: Cookie Priority type.
|
|
572
|
+
:param same_party: True if cookie is SameParty.
|
|
573
|
+
:param source_scheme: Cookie source scheme type.
|
|
574
|
+
:param source_port: Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.
|
|
575
|
+
An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
|
|
576
|
+
This is a temporary ability and it will be removed in the future.
|
|
577
|
+
:param partition_key: Cookie partition key. If not set, the cookie will be set as not partitioned.
|
|
578
|
+
"""
|
|
579
|
+
_params: Dict[str, Any] = {}
|
|
580
|
+
_params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
|
|
581
|
+
_params['value'] = encode(FieldMeta('', '', False, 'primitive'), value)
|
|
582
|
+
if url is not None:
|
|
583
|
+
_params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
|
|
584
|
+
if domain is not None:
|
|
585
|
+
_params['domain'] = encode(FieldMeta('', '', False, 'primitive'), domain)
|
|
586
|
+
if path is not None:
|
|
587
|
+
_params['path'] = encode(FieldMeta('', '', False, 'primitive'), path)
|
|
588
|
+
if secure is not None:
|
|
589
|
+
_params['secure'] = encode(FieldMeta('', '', False, 'primitive'), secure)
|
|
590
|
+
if http_only is not None:
|
|
591
|
+
_params['httpOnly'] = encode(FieldMeta('', '', False, 'primitive'), http_only)
|
|
592
|
+
if same_site is not None:
|
|
593
|
+
_params['sameSite'] = encode(FieldMeta('', '', False, 'enum', ref='Network.CookieSameSite'), same_site)
|
|
594
|
+
if expires is not None:
|
|
595
|
+
_params['expires'] = encode(FieldMeta('', '', False, 'primitive'), expires)
|
|
596
|
+
if priority is not None:
|
|
597
|
+
_params['priority'] = encode(FieldMeta('', '', False, 'enum', ref='Network.CookiePriority'), priority)
|
|
598
|
+
if same_party is not None:
|
|
599
|
+
_params['sameParty'] = encode(FieldMeta('', '', False, 'primitive'), same_party)
|
|
600
|
+
if source_scheme is not None:
|
|
601
|
+
_params['sourceScheme'] = encode(FieldMeta('', '', False, 'enum', ref='Network.CookieSourceScheme'), source_scheme)
|
|
602
|
+
if source_port is not None:
|
|
603
|
+
_params['sourcePort'] = encode(FieldMeta('', '', False, 'primitive'), source_port)
|
|
604
|
+
if partition_key is not None:
|
|
605
|
+
_params['partitionKey'] = encode(FieldMeta('', '', False, 'object', ref='Network.CookiePartitionKey'), partition_key)
|
|
606
|
+
_result = await self._target.send('Network.setCookie', _params)
|
|
607
|
+
return SetCookieReturn.from_json(_result)
|
|
608
|
+
|
|
609
|
+
async def set_cookies(self, *, cookies: List[CookieParam]) -> None:
|
|
610
|
+
"""
|
|
611
|
+
Sets given cookies.
|
|
612
|
+
:param cookies: Cookies to be set.
|
|
613
|
+
"""
|
|
614
|
+
_params: Dict[str, Any] = {}
|
|
615
|
+
_params['cookies'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.CookieParam')), cookies)
|
|
616
|
+
_result = await self._target.send('Network.setCookies', _params)
|
|
617
|
+
return None
|
|
618
|
+
|
|
619
|
+
async def set_extra_http_headers(self, *, headers: Headers) -> None:
|
|
620
|
+
"""
|
|
621
|
+
Specifies whether to always send extra HTTP headers with the requests from this page.
|
|
622
|
+
:param headers: Map with extra HTTP headers.
|
|
623
|
+
"""
|
|
624
|
+
_params: Dict[str, Any] = {}
|
|
625
|
+
_params['headers'] = encode(FieldMeta('', '', False, 'primitive'), headers)
|
|
626
|
+
_result = await self._target.send('Network.setExtraHTTPHeaders', _params)
|
|
627
|
+
return None
|
|
628
|
+
|
|
629
|
+
async def set_attach_debug_stack(self, *, enabled: bool) -> None:
|
|
630
|
+
"""
|
|
631
|
+
Specifies whether to attach a page script stack id in requests
|
|
632
|
+
:param enabled: Whether to attach a page script stack for debugging purpose.
|
|
633
|
+
"""
|
|
634
|
+
_params: Dict[str, Any] = {}
|
|
635
|
+
_params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
|
|
636
|
+
_result = await self._target.send('Network.setAttachDebugStack', _params)
|
|
637
|
+
return None
|
|
638
|
+
|
|
639
|
+
async def set_request_interception(self, *, patterns: List[RequestPattern]) -> None:
|
|
640
|
+
"""
|
|
641
|
+
Sets the requests to intercept that match the provided patterns and optionally resource types.
|
|
642
|
+
Deprecated, please use Fetch.enable instead.
|
|
643
|
+
|
|
644
|
+
.. deprecated::
|
|
645
|
+
:param patterns: Requests matching any of these patterns will be forwarded and wait for the corresponding
|
|
646
|
+
continueInterceptedRequest call.
|
|
647
|
+
"""
|
|
648
|
+
_params: Dict[str, Any] = {}
|
|
649
|
+
_params['patterns'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Network.RequestPattern')), patterns)
|
|
650
|
+
_result = await self._target.send('Network.setRequestInterception', _params)
|
|
651
|
+
return None
|
|
652
|
+
|
|
653
|
+
async def set_user_agent_override(self, *, user_agent: str, accept_language: Optional[str] = None, platform: Optional[str] = None, user_agent_metadata: Optional[Emulation_UserAgentMetadata] = None) -> None:
|
|
654
|
+
"""
|
|
655
|
+
Allows overriding user agent with the given string.
|
|
656
|
+
:param user_agent: User agent to use.
|
|
657
|
+
:param accept_language: Browser language to emulate.
|
|
658
|
+
:param platform: The platform navigator.platform should return.
|
|
659
|
+
:param user_agent_metadata: To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
|
|
660
|
+
"""
|
|
661
|
+
_params: Dict[str, Any] = {}
|
|
662
|
+
_params['userAgent'] = encode(FieldMeta('', '', False, 'primitive'), user_agent)
|
|
663
|
+
if accept_language is not None:
|
|
664
|
+
_params['acceptLanguage'] = encode(FieldMeta('', '', False, 'primitive'), accept_language)
|
|
665
|
+
if platform is not None:
|
|
666
|
+
_params['platform'] = encode(FieldMeta('', '', False, 'primitive'), platform)
|
|
667
|
+
if user_agent_metadata is not None:
|
|
668
|
+
_params['userAgentMetadata'] = encode(FieldMeta('', '', False, 'object', ref='Emulation.UserAgentMetadata'), user_agent_metadata)
|
|
669
|
+
_result = await self._target.send('Network.setUserAgentOverride', _params)
|
|
670
|
+
return None
|
|
671
|
+
|
|
672
|
+
async def stream_resource_content(self, *, request_id: RequestId) -> StreamResourceContentReturn:
|
|
673
|
+
"""
|
|
674
|
+
Enables streaming of the response for the given requestId.
|
|
675
|
+
If enabled, the dataReceived event contains the data that was received during streaming.
|
|
676
|
+
:param request_id: Identifier of the request to stream.
|
|
677
|
+
"""
|
|
678
|
+
_params: Dict[str, Any] = {}
|
|
679
|
+
_params['requestId'] = encode(FieldMeta('', '', False, 'primitive'), request_id)
|
|
680
|
+
_result = await self._target.send('Network.streamResourceContent', _params)
|
|
681
|
+
return StreamResourceContentReturn.from_json(_result)
|
|
682
|
+
|
|
683
|
+
async def get_security_isolation_status(self, *, frame_id: Optional[Page_FrameId] = None) -> GetSecurityIsolationStatusReturn:
|
|
684
|
+
"""
|
|
685
|
+
Returns information about the COEP/COOP isolation status.
|
|
686
|
+
:param frame_id: If no frameId is provided, the status of the target is provided.
|
|
687
|
+
"""
|
|
688
|
+
_params: Dict[str, Any] = {}
|
|
689
|
+
if frame_id is not None:
|
|
690
|
+
_params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
|
|
691
|
+
_result = await self._target.send('Network.getSecurityIsolationStatus', _params)
|
|
692
|
+
return GetSecurityIsolationStatusReturn.from_json(_result)
|
|
693
|
+
|
|
694
|
+
async def enable_reporting_api(self, *, enable: bool) -> None:
|
|
695
|
+
"""
|
|
696
|
+
Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.
|
|
697
|
+
Enabling triggers 'reportingApiReportAdded' for all existing reports.
|
|
698
|
+
:param enable: Whether to enable or disable events for the Reporting API
|
|
699
|
+
"""
|
|
700
|
+
_params: Dict[str, Any] = {}
|
|
701
|
+
_params['enable'] = encode(FieldMeta('', '', False, 'primitive'), enable)
|
|
702
|
+
_result = await self._target.send('Network.enableReportingApi', _params)
|
|
703
|
+
return None
|
|
704
|
+
|
|
705
|
+
async def load_network_resource(self, *, url: str, options: LoadNetworkResourceOptions, frame_id: Optional[Page_FrameId] = None) -> LoadNetworkResourceReturn:
|
|
706
|
+
"""
|
|
707
|
+
Fetches the resource and returns the content.
|
|
708
|
+
:param frame_id: Frame id to get the resource for. Mandatory for frame targets, and
|
|
709
|
+
should be omitted for worker targets.
|
|
710
|
+
:param url: URL of the resource to get content for.
|
|
711
|
+
:param options: Options for the request.
|
|
712
|
+
"""
|
|
713
|
+
_params: Dict[str, Any] = {}
|
|
714
|
+
_params['url'] = encode(FieldMeta('', '', False, 'primitive'), url)
|
|
715
|
+
_params['options'] = encode(FieldMeta('', '', False, 'object', ref='Network.LoadNetworkResourceOptions'), options)
|
|
716
|
+
if frame_id is not None:
|
|
717
|
+
_params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
|
|
718
|
+
_result = await self._target.send('Network.loadNetworkResource', _params)
|
|
719
|
+
return LoadNetworkResourceReturn.from_json(_result)
|
|
720
|
+
|
|
721
|
+
async def set_cookie_controls(self, *, enable_third_party_cookie_restriction: bool, disable_third_party_cookie_metadata: bool, disable_third_party_cookie_heuristics: bool) -> None:
|
|
722
|
+
"""
|
|
723
|
+
Sets Controls for third-party cookie access
|
|
724
|
+
Page reload is required before the new cookie behavior will be observed
|
|
725
|
+
:param enable_third_party_cookie_restriction: Whether 3pc restriction is enabled.
|
|
726
|
+
:param disable_third_party_cookie_metadata: Whether 3pc grace period exception should be enabled; false by default.
|
|
727
|
+
:param disable_third_party_cookie_heuristics: Whether 3pc heuristics exceptions should be enabled; false by default.
|
|
728
|
+
"""
|
|
729
|
+
_params: Dict[str, Any] = {}
|
|
730
|
+
_params['enableThirdPartyCookieRestriction'] = encode(FieldMeta('', '', False, 'primitive'), enable_third_party_cookie_restriction)
|
|
731
|
+
_params['disableThirdPartyCookieMetadata'] = encode(FieldMeta('', '', False, 'primitive'), disable_third_party_cookie_metadata)
|
|
732
|
+
_params['disableThirdPartyCookieHeuristics'] = encode(FieldMeta('', '', False, 'primitive'), disable_third_party_cookie_heuristics)
|
|
733
|
+
_result = await self._target.send('Network.setCookieControls', _params)
|
|
734
|
+
return None
|