mithwire 0.50.3__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.
- mithwire/__init__.py +32 -0
- mithwire/cdp/README.md +4 -0
- mithwire/cdp/__init__.py +6 -0
- mithwire/cdp/accessibility.py +668 -0
- mithwire/cdp/animation.py +494 -0
- mithwire/cdp/audits.py +1995 -0
- mithwire/cdp/autofill.py +292 -0
- mithwire/cdp/background_service.py +215 -0
- mithwire/cdp/bluetooth_emulation.py +626 -0
- mithwire/cdp/browser.py +821 -0
- mithwire/cdp/cache_storage.py +311 -0
- mithwire/cdp/cast.py +172 -0
- mithwire/cdp/console.py +107 -0
- mithwire/cdp/crash_report_context.py +55 -0
- mithwire/cdp/css.py +2750 -0
- mithwire/cdp/database.py +179 -0
- mithwire/cdp/debugger.py +1405 -0
- mithwire/cdp/device_access.py +141 -0
- mithwire/cdp/device_orientation.py +45 -0
- mithwire/cdp/dom.py +2257 -0
- mithwire/cdp/dom_debugger.py +321 -0
- mithwire/cdp/dom_snapshot.py +876 -0
- mithwire/cdp/dom_storage.py +222 -0
- mithwire/cdp/emulation.py +1779 -0
- mithwire/cdp/event_breakpoints.py +56 -0
- mithwire/cdp/extensions.py +238 -0
- mithwire/cdp/fed_cm.py +283 -0
- mithwire/cdp/fetch.py +507 -0
- mithwire/cdp/file_system.py +115 -0
- mithwire/cdp/headless_experimental.py +115 -0
- mithwire/cdp/heap_profiler.py +401 -0
- mithwire/cdp/indexed_db.py +528 -0
- mithwire/cdp/input_.py +701 -0
- mithwire/cdp/inspector.py +95 -0
- mithwire/cdp/io.py +101 -0
- mithwire/cdp/layer_tree.py +464 -0
- mithwire/cdp/log.py +190 -0
- mithwire/cdp/media.py +313 -0
- mithwire/cdp/memory.py +305 -0
- mithwire/cdp/network.py +5342 -0
- mithwire/cdp/overlay.py +1468 -0
- mithwire/cdp/page.py +3972 -0
- mithwire/cdp/performance.py +124 -0
- mithwire/cdp/performance_timeline.py +200 -0
- mithwire/cdp/preload.py +575 -0
- mithwire/cdp/profiler.py +420 -0
- mithwire/cdp/pwa.py +278 -0
- mithwire/cdp/py.typed +0 -0
- mithwire/cdp/runtime.py +1589 -0
- mithwire/cdp/schema.py +50 -0
- mithwire/cdp/security.py +518 -0
- mithwire/cdp/service_worker.py +401 -0
- mithwire/cdp/smart_card_emulation.py +891 -0
- mithwire/cdp/storage.py +1573 -0
- mithwire/cdp/system_info.py +327 -0
- mithwire/cdp/target.py +829 -0
- mithwire/cdp/tethering.py +65 -0
- mithwire/cdp/tracing.py +377 -0
- mithwire/cdp/util.py +18 -0
- mithwire/cdp/web_audio.py +606 -0
- mithwire/cdp/web_authn.py +598 -0
- mithwire/cdp/web_mcp.py +293 -0
- mithwire/core/_contradict.py +142 -0
- mithwire/core/browser.py +923 -0
- mithwire/core/cf_templates/cf_dark_checkbox.png +0 -0
- mithwire/core/cf_templates/cf_light_checkbox.png +0 -0
- mithwire/core/config.py +323 -0
- mithwire/core/connection.py +564 -0
- mithwire/core/element.py +1205 -0
- mithwire/core/tab.py +2202 -0
- mithwire/core/util.py +5063 -0
- mithwire-0.50.3.dist-info/METADATA +1049 -0
- mithwire-0.50.3.dist-info/RECORD +76 -0
- mithwire-0.50.3.dist-info/WHEEL +5 -0
- mithwire-0.50.3.dist-info/licenses/LICENSE.txt +619 -0
- mithwire-0.50.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# DO NOT EDIT THIS FILE!
|
|
2
|
+
#
|
|
3
|
+
# This file is generated from the CDP specification. If you need to make
|
|
4
|
+
# changes, edit the generator and regenerate all of the modules.
|
|
5
|
+
#
|
|
6
|
+
# CDP domain: DOMStorage (experimental)
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
import enum
|
|
10
|
+
import typing
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from .util import event_class, T_JSON_DICT
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class SerializedStorageKey(str):
|
|
16
|
+
def to_json(self) -> str:
|
|
17
|
+
return self
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def from_json(cls, json: str) -> SerializedStorageKey:
|
|
21
|
+
return cls(json)
|
|
22
|
+
|
|
23
|
+
def __repr__(self):
|
|
24
|
+
return 'SerializedStorageKey({})'.format(super().__repr__())
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass
|
|
28
|
+
class StorageId:
|
|
29
|
+
'''
|
|
30
|
+
DOM Storage identifier.
|
|
31
|
+
'''
|
|
32
|
+
#: Whether the storage is local storage (not session storage).
|
|
33
|
+
is_local_storage: bool
|
|
34
|
+
|
|
35
|
+
#: Security origin for the storage.
|
|
36
|
+
security_origin: typing.Optional[str] = None
|
|
37
|
+
|
|
38
|
+
#: Represents a key by which DOM Storage keys its CachedStorageAreas
|
|
39
|
+
storage_key: typing.Optional[SerializedStorageKey] = None
|
|
40
|
+
|
|
41
|
+
def to_json(self) -> T_JSON_DICT:
|
|
42
|
+
json: T_JSON_DICT = dict()
|
|
43
|
+
json['isLocalStorage'] = self.is_local_storage
|
|
44
|
+
if self.security_origin is not None:
|
|
45
|
+
json['securityOrigin'] = self.security_origin
|
|
46
|
+
if self.storage_key is not None:
|
|
47
|
+
json['storageKey'] = self.storage_key.to_json()
|
|
48
|
+
return json
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json: T_JSON_DICT) -> StorageId:
|
|
52
|
+
return cls(
|
|
53
|
+
is_local_storage=bool(json['isLocalStorage']),
|
|
54
|
+
security_origin=str(json['securityOrigin']) if json.get('securityOrigin', None) is not None else None,
|
|
55
|
+
storage_key=SerializedStorageKey.from_json(json['storageKey']) if json.get('storageKey', None) is not None else None,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Item(list):
|
|
60
|
+
'''
|
|
61
|
+
DOM Storage item.
|
|
62
|
+
'''
|
|
63
|
+
def to_json(self) -> typing.List[str]:
|
|
64
|
+
return self
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json: typing.List[str]) -> Item:
|
|
68
|
+
return cls(json)
|
|
69
|
+
|
|
70
|
+
def __repr__(self):
|
|
71
|
+
return 'Item({})'.format(super().__repr__())
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def clear(
|
|
75
|
+
storage_id: StorageId
|
|
76
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
77
|
+
'''
|
|
78
|
+
:param storage_id:
|
|
79
|
+
'''
|
|
80
|
+
params: T_JSON_DICT = dict()
|
|
81
|
+
params['storageId'] = storage_id.to_json()
|
|
82
|
+
cmd_dict: T_JSON_DICT = {
|
|
83
|
+
'method': 'DOMStorage.clear',
|
|
84
|
+
'params': params,
|
|
85
|
+
}
|
|
86
|
+
json = yield cmd_dict
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
90
|
+
'''
|
|
91
|
+
Disables storage tracking, prevents storage events from being sent to the client.
|
|
92
|
+
'''
|
|
93
|
+
cmd_dict: T_JSON_DICT = {
|
|
94
|
+
'method': 'DOMStorage.disable',
|
|
95
|
+
}
|
|
96
|
+
json = yield cmd_dict
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
100
|
+
'''
|
|
101
|
+
Enables storage tracking, storage events will now be delivered to the client.
|
|
102
|
+
'''
|
|
103
|
+
cmd_dict: T_JSON_DICT = {
|
|
104
|
+
'method': 'DOMStorage.enable',
|
|
105
|
+
}
|
|
106
|
+
json = yield cmd_dict
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def get_dom_storage_items(
|
|
110
|
+
storage_id: StorageId
|
|
111
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Item]]:
|
|
112
|
+
'''
|
|
113
|
+
:param storage_id:
|
|
114
|
+
:returns:
|
|
115
|
+
'''
|
|
116
|
+
params: T_JSON_DICT = dict()
|
|
117
|
+
params['storageId'] = storage_id.to_json()
|
|
118
|
+
cmd_dict: T_JSON_DICT = {
|
|
119
|
+
'method': 'DOMStorage.getDOMStorageItems',
|
|
120
|
+
'params': params,
|
|
121
|
+
}
|
|
122
|
+
json = yield cmd_dict
|
|
123
|
+
return [Item.from_json(i) for i in json['entries']]
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def remove_dom_storage_item(
|
|
127
|
+
storage_id: StorageId,
|
|
128
|
+
key: str
|
|
129
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
130
|
+
'''
|
|
131
|
+
:param storage_id:
|
|
132
|
+
:param key:
|
|
133
|
+
'''
|
|
134
|
+
params: T_JSON_DICT = dict()
|
|
135
|
+
params['storageId'] = storage_id.to_json()
|
|
136
|
+
params['key'] = key
|
|
137
|
+
cmd_dict: T_JSON_DICT = {
|
|
138
|
+
'method': 'DOMStorage.removeDOMStorageItem',
|
|
139
|
+
'params': params,
|
|
140
|
+
}
|
|
141
|
+
json = yield cmd_dict
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def set_dom_storage_item(
|
|
145
|
+
storage_id: StorageId,
|
|
146
|
+
key: str,
|
|
147
|
+
value: str
|
|
148
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
149
|
+
'''
|
|
150
|
+
:param storage_id:
|
|
151
|
+
:param key:
|
|
152
|
+
:param value:
|
|
153
|
+
'''
|
|
154
|
+
params: T_JSON_DICT = dict()
|
|
155
|
+
params['storageId'] = storage_id.to_json()
|
|
156
|
+
params['key'] = key
|
|
157
|
+
params['value'] = value
|
|
158
|
+
cmd_dict: T_JSON_DICT = {
|
|
159
|
+
'method': 'DOMStorage.setDOMStorageItem',
|
|
160
|
+
'params': params,
|
|
161
|
+
}
|
|
162
|
+
json = yield cmd_dict
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@event_class('DOMStorage.domStorageItemAdded')
|
|
166
|
+
@dataclass
|
|
167
|
+
class DomStorageItemAdded:
|
|
168
|
+
storage_id: StorageId
|
|
169
|
+
key: str
|
|
170
|
+
new_value: str
|
|
171
|
+
|
|
172
|
+
@classmethod
|
|
173
|
+
def from_json(cls, json: T_JSON_DICT) -> DomStorageItemAdded:
|
|
174
|
+
return cls(
|
|
175
|
+
storage_id=StorageId.from_json(json['storageId']),
|
|
176
|
+
key=str(json['key']),
|
|
177
|
+
new_value=str(json['newValue'])
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@event_class('DOMStorage.domStorageItemRemoved')
|
|
182
|
+
@dataclass
|
|
183
|
+
class DomStorageItemRemoved:
|
|
184
|
+
storage_id: StorageId
|
|
185
|
+
key: str
|
|
186
|
+
|
|
187
|
+
@classmethod
|
|
188
|
+
def from_json(cls, json: T_JSON_DICT) -> DomStorageItemRemoved:
|
|
189
|
+
return cls(
|
|
190
|
+
storage_id=StorageId.from_json(json['storageId']),
|
|
191
|
+
key=str(json['key'])
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
@event_class('DOMStorage.domStorageItemUpdated')
|
|
196
|
+
@dataclass
|
|
197
|
+
class DomStorageItemUpdated:
|
|
198
|
+
storage_id: StorageId
|
|
199
|
+
key: str
|
|
200
|
+
old_value: str
|
|
201
|
+
new_value: str
|
|
202
|
+
|
|
203
|
+
@classmethod
|
|
204
|
+
def from_json(cls, json: T_JSON_DICT) -> DomStorageItemUpdated:
|
|
205
|
+
return cls(
|
|
206
|
+
storage_id=StorageId.from_json(json['storageId']),
|
|
207
|
+
key=str(json['key']),
|
|
208
|
+
old_value=str(json['oldValue']),
|
|
209
|
+
new_value=str(json['newValue'])
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
@event_class('DOMStorage.domStorageItemsCleared')
|
|
214
|
+
@dataclass
|
|
215
|
+
class DomStorageItemsCleared:
|
|
216
|
+
storage_id: StorageId
|
|
217
|
+
|
|
218
|
+
@classmethod
|
|
219
|
+
def from_json(cls, json: T_JSON_DICT) -> DomStorageItemsCleared:
|
|
220
|
+
return cls(
|
|
221
|
+
storage_id=StorageId.from_json(json['storageId'])
|
|
222
|
+
)
|