forked from llimllib/chrome-control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DOMStorage.py
47 lines (30 loc) · 1.2 KB
/
DOMStorage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from enum import Enum
from typing import Any, List
from base import ChromeCommand
class StorageId:
"""DOM Storage identifier."""
def __init__(self, securityOrigin: str, isLocalStorage: bool):
# Security origin for the storage.
self.securityOrigin = securityOrigin
# Whether the storage is local storage (not session storage).
self.isLocalStorage = isLocalStorage
# DOM Storage item.
Item = List[str]
class enable(ChromeCommand):
"""Enables storage tracking, storage events will now be delivered to the client."""
def __init__(self): pass
class disable(ChromeCommand):
"""Disables storage tracking, prevents storage events from being sent to the client."""
def __init__(self): pass
class getDOMStorageItems(ChromeCommand):
def __init__(self, storageId: "StorageId"):
self.storageId = storageId
class setDOMStorageItem(ChromeCommand):
def __init__(self, storageId: "StorageId", key: str, value: str):
self.storageId = storageId
self.key = key
self.value = value
class removeDOMStorageItem(ChromeCommand):
def __init__(self, storageId: "StorageId", key: str):
self.storageId = storageId
self.key = key