Skip to content

indexed_db

DataEntry dataclass

Data entry.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class DataEntry:
    """
    Data entry.
    """

    #: Key object.
    key: runtime.RemoteObject

    #: Primary key object.
    primary_key: runtime.RemoteObject

    #: Value object.
    value: runtime.RemoteObject

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["key"] = self.key.to_json()
        json["primaryKey"] = self.primary_key.to_json()
        json["value"] = self.value.to_json()
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> DataEntry:
        return cls(
            key=runtime.RemoteObject.from_json(json["key"]),
            primary_key=runtime.RemoteObject.from_json(json["primaryKey"]),
            value=runtime.RemoteObject.from_json(json["value"]),
        )

key: runtime.RemoteObject instance-attribute

primary_key: runtime.RemoteObject instance-attribute

value: runtime.RemoteObject instance-attribute

__init__(key, primary_key, value)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> DataEntry:
    return cls(
        key=runtime.RemoteObject.from_json(json["key"]),
        primary_key=runtime.RemoteObject.from_json(json["primaryKey"]),
        value=runtime.RemoteObject.from_json(json["value"]),
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["key"] = self.key.to_json()
    json["primaryKey"] = self.primary_key.to_json()
    json["value"] = self.value.to_json()
    return json

DatabaseWithObjectStores dataclass

Database with an array of object stores.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class DatabaseWithObjectStores:
    """
    Database with an array of object stores.
    """

    #: Database name.
    name: str

    #: Database version (type is not 'integer', as the standard
    #: requires the version number to be 'unsigned long long')
    version: float

    #: Object stores in this database.
    object_stores: typing.List[ObjectStore]

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["name"] = self.name
        json["version"] = self.version
        json["objectStores"] = [i.to_json() for i in self.object_stores]
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> DatabaseWithObjectStores:
        return cls(
            name=str(json["name"]),
            version=float(json["version"]),
            object_stores=[ObjectStore.from_json(i) for i in json["objectStores"]],
        )

name: str instance-attribute

object_stores: typing.List[ObjectStore] instance-attribute

version: float instance-attribute

__init__(name, version, object_stores)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> DatabaseWithObjectStores:
    return cls(
        name=str(json["name"]),
        version=float(json["version"]),
        object_stores=[ObjectStore.from_json(i) for i in json["objectStores"]],
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["name"] = self.name
    json["version"] = self.version
    json["objectStores"] = [i.to_json() for i in self.object_stores]
    return json

Key dataclass

Key.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class Key:
    """
    Key.
    """

    #: Key type.
    type_: str

    #: Number value.
    number: typing.Optional[float] = None

    #: String value.
    string: typing.Optional[str] = None

    #: Date value.
    date: typing.Optional[float] = None

    #: Array value.
    array: typing.Optional[typing.List[Key]] = None

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["type"] = self.type_
        if self.number is not None:
            json["number"] = self.number
        if self.string is not None:
            json["string"] = self.string
        if self.date is not None:
            json["date"] = self.date
        if self.array is not None:
            json["array"] = [i.to_json() for i in self.array]
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> Key:
        return cls(
            type_=str(json["type"]),
            number=(
                float(json["number"]) if json.get("number", None) is not None else None
            ),
            string=(
                str(json["string"]) if json.get("string", None) is not None else None
            ),
            date=float(json["date"]) if json.get("date", None) is not None else None,
            array=(
                [Key.from_json(i) for i in json["array"]]
                if json.get("array", None) is not None
                else None
            ),
        )

array: typing.Optional[typing.List[Key]] = None class-attribute instance-attribute

date: typing.Optional[float] = None class-attribute instance-attribute

number: typing.Optional[float] = None class-attribute instance-attribute

string: typing.Optional[str] = None class-attribute instance-attribute

type_: str instance-attribute

__init__(type_, number=None, string=None, date=None, array=None)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> Key:
    return cls(
        type_=str(json["type"]),
        number=(
            float(json["number"]) if json.get("number", None) is not None else None
        ),
        string=(
            str(json["string"]) if json.get("string", None) is not None else None
        ),
        date=float(json["date"]) if json.get("date", None) is not None else None,
        array=(
            [Key.from_json(i) for i in json["array"]]
            if json.get("array", None) is not None
            else None
        ),
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["type"] = self.type_
    if self.number is not None:
        json["number"] = self.number
    if self.string is not None:
        json["string"] = self.string
    if self.date is not None:
        json["date"] = self.date
    if self.array is not None:
        json["array"] = [i.to_json() for i in self.array]
    return json

KeyPath dataclass

Key path.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class KeyPath:
    """
    Key path.
    """

    #: Key path type.
    type_: str

    #: String value.
    string: typing.Optional[str] = None

    #: Array value.
    array: typing.Optional[typing.List[str]] = None

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["type"] = self.type_
        if self.string is not None:
            json["string"] = self.string
        if self.array is not None:
            json["array"] = [i for i in self.array]
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> KeyPath:
        return cls(
            type_=str(json["type"]),
            string=(
                str(json["string"]) if json.get("string", None) is not None else None
            ),
            array=(
                [str(i) for i in json["array"]]
                if json.get("array", None) is not None
                else None
            ),
        )

array: typing.Optional[typing.List[str]] = None class-attribute instance-attribute

string: typing.Optional[str] = None class-attribute instance-attribute

type_: str instance-attribute

__init__(type_, string=None, array=None)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> KeyPath:
    return cls(
        type_=str(json["type"]),
        string=(
            str(json["string"]) if json.get("string", None) is not None else None
        ),
        array=(
            [str(i) for i in json["array"]]
            if json.get("array", None) is not None
            else None
        ),
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["type"] = self.type_
    if self.string is not None:
        json["string"] = self.string
    if self.array is not None:
        json["array"] = [i for i in self.array]
    return json

KeyRange dataclass

Key range.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class KeyRange:
    """
    Key range.
    """

    #: If true lower bound is open.
    lower_open: bool

    #: If true upper bound is open.
    upper_open: bool

    #: Lower bound.
    lower: typing.Optional[Key] = None

    #: Upper bound.
    upper: typing.Optional[Key] = None

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["lowerOpen"] = self.lower_open
        json["upperOpen"] = self.upper_open
        if self.lower is not None:
            json["lower"] = self.lower.to_json()
        if self.upper is not None:
            json["upper"] = self.upper.to_json()
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> KeyRange:
        return cls(
            lower_open=bool(json["lowerOpen"]),
            upper_open=bool(json["upperOpen"]),
            lower=(
                Key.from_json(json["lower"])
                if json.get("lower", None) is not None
                else None
            ),
            upper=(
                Key.from_json(json["upper"])
                if json.get("upper", None) is not None
                else None
            ),
        )

lower: typing.Optional[Key] = None class-attribute instance-attribute

lower_open: bool instance-attribute

upper: typing.Optional[Key] = None class-attribute instance-attribute

upper_open: bool instance-attribute

__init__(lower_open, upper_open, lower=None, upper=None)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> KeyRange:
    return cls(
        lower_open=bool(json["lowerOpen"]),
        upper_open=bool(json["upperOpen"]),
        lower=(
            Key.from_json(json["lower"])
            if json.get("lower", None) is not None
            else None
        ),
        upper=(
            Key.from_json(json["upper"])
            if json.get("upper", None) is not None
            else None
        ),
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["lowerOpen"] = self.lower_open
    json["upperOpen"] = self.upper_open
    if self.lower is not None:
        json["lower"] = self.lower.to_json()
    if self.upper is not None:
        json["upper"] = self.upper.to_json()
    return json

ObjectStore dataclass

Object store.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class ObjectStore:
    """
    Object store.
    """

    #: Object store name.
    name: str

    #: Object store key path.
    key_path: KeyPath

    #: If true, object store has auto increment flag set.
    auto_increment: bool

    #: Indexes in this object store.
    indexes: typing.List[ObjectStoreIndex]

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["name"] = self.name
        json["keyPath"] = self.key_path.to_json()
        json["autoIncrement"] = self.auto_increment
        json["indexes"] = [i.to_json() for i in self.indexes]
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ObjectStore:
        return cls(
            name=str(json["name"]),
            key_path=KeyPath.from_json(json["keyPath"]),
            auto_increment=bool(json["autoIncrement"]),
            indexes=[ObjectStoreIndex.from_json(i) for i in json["indexes"]],
        )

auto_increment: bool instance-attribute

indexes: typing.List[ObjectStoreIndex] instance-attribute

key_path: KeyPath instance-attribute

name: str instance-attribute

__init__(name, key_path, auto_increment, indexes)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ObjectStore:
    return cls(
        name=str(json["name"]),
        key_path=KeyPath.from_json(json["keyPath"]),
        auto_increment=bool(json["autoIncrement"]),
        indexes=[ObjectStoreIndex.from_json(i) for i in json["indexes"]],
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["name"] = self.name
    json["keyPath"] = self.key_path.to_json()
    json["autoIncrement"] = self.auto_increment
    json["indexes"] = [i.to_json() for i in self.indexes]
    return json

ObjectStoreIndex dataclass

Object store index.

Source code in zendriver/cdp/indexed_db.py
@dataclass
class ObjectStoreIndex:
    """
    Object store index.
    """

    #: Index name.
    name: str

    #: Index key path.
    key_path: KeyPath

    #: If true, index is unique.
    unique: bool

    #: If true, index allows multiple entries for a key.
    multi_entry: bool

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["name"] = self.name
        json["keyPath"] = self.key_path.to_json()
        json["unique"] = self.unique
        json["multiEntry"] = self.multi_entry
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ObjectStoreIndex:
        return cls(
            name=str(json["name"]),
            key_path=KeyPath.from_json(json["keyPath"]),
            unique=bool(json["unique"]),
            multi_entry=bool(json["multiEntry"]),
        )

key_path: KeyPath instance-attribute

multi_entry: bool instance-attribute

name: str instance-attribute

unique: bool instance-attribute

__init__(name, key_path, unique, multi_entry)

from_json(json) classmethod

Source code in zendriver/cdp/indexed_db.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ObjectStoreIndex:
    return cls(
        name=str(json["name"]),
        key_path=KeyPath.from_json(json["keyPath"]),
        unique=bool(json["unique"]),
        multi_entry=bool(json["multiEntry"]),
    )

to_json()

Source code in zendriver/cdp/indexed_db.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["name"] = self.name
    json["keyPath"] = self.key_path.to_json()
    json["unique"] = self.unique
    json["multiEntry"] = self.multi_entry
    return json

clear_object_store(database_name, object_store_name, security_origin=None, storage_key=None, storage_bucket=None)

Clears all entries from an object store.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str

Database name.

required
object_store_name str

Object store name.

required
Source code in zendriver/cdp/indexed_db.py
def clear_object_store(
    database_name: str,
    object_store_name: str,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Clears all entries from an object store.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name: Database name.
    :param object_store_name: Object store name.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    params["objectStoreName"] = object_store_name
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.clearObjectStore",
        "params": params,
    }
    json = yield cmd_dict

delete_database(database_name, security_origin=None, storage_key=None, storage_bucket=None)

Deletes a database.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str

Database name.

required
Source code in zendriver/cdp/indexed_db.py
def delete_database(
    database_name: str,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Deletes a database.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name: Database name.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.deleteDatabase",
        "params": params,
    }
    json = yield cmd_dict

delete_object_store_entries(database_name, object_store_name, key_range, security_origin=None, storage_key=None, storage_bucket=None)

Delete a range of entries from an object store

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str
required
object_store_name str
required
key_range KeyRange

Range of entry keys to delete

required
Source code in zendriver/cdp/indexed_db.py
def delete_object_store_entries(
    database_name: str,
    object_store_name: str,
    key_range: KeyRange,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Delete a range of entries from an object store

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name:
    :param object_store_name:
    :param key_range: Range of entry keys to delete
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    params["objectStoreName"] = object_store_name
    params["keyRange"] = key_range.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.deleteObjectStoreEntries",
        "params": params,
    }
    json = yield cmd_dict

disable()

Disables events from backend.

Source code in zendriver/cdp/indexed_db.py
def disable() -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Disables events from backend.
    """
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.disable",
    }
    json = yield cmd_dict

enable()

Enables events from backend.

Source code in zendriver/cdp/indexed_db.py
def enable() -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Enables events from backend.
    """
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.enable",
    }
    json = yield cmd_dict

get_metadata(database_name, object_store_name, security_origin=None, storage_key=None, storage_bucket=None)

Gets metadata of an object store.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str

Database name.

required
object_store_name str

Object store name.

required

Returns:

Type Description
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[float, float]]

A tuple with the following items: 0. entriesCount - the entries count 1. keyGeneratorValue - the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.

Source code in zendriver/cdp/indexed_db.py
def get_metadata(
    database_name: str,
    object_store_name: str,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[float, float]]:
    """
    Gets metadata of an object store.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name: Database name.
    :param object_store_name: Object store name.
    :returns: A tuple with the following items:

        0. **entriesCount** - the entries count
        1. **keyGeneratorValue** - the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    params["objectStoreName"] = object_store_name
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.getMetadata",
        "params": params,
    }
    json = yield cmd_dict
    return (float(json["entriesCount"]), float(json["keyGeneratorValue"]))

request_data(database_name, object_store_name, index_name, skip_count, page_size, security_origin=None, storage_key=None, storage_bucket=None, key_range=None)

Requests data from object store or index.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str

Database name.

required
object_store_name str

Object store name.

required
index_name str

Index name, empty string for object store data requests.

required
skip_count int

Number of records to skip.

required
page_size int

Number of records to fetch.

required
key_range Optional[KeyRange]

(Optional) Key range.

None

Returns:

Type Description
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[DataEntry], bool]]

A tuple with the following items: 0. objectStoreDataEntries - Array of object store data entries. 1. hasMore - If true, there are more entries to fetch in the given range.

Source code in zendriver/cdp/indexed_db.py
def request_data(
    database_name: str,
    object_store_name: str,
    index_name: str,
    skip_count: int,
    page_size: int,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
    key_range: typing.Optional[KeyRange] = None,
) -> typing.Generator[
    T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DataEntry], bool]
]:
    """
    Requests data from object store or index.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name: Database name.
    :param object_store_name: Object store name.
    :param index_name: Index name, empty string for object store data requests.
    :param skip_count: Number of records to skip.
    :param page_size: Number of records to fetch.
    :param key_range: *(Optional)* Key range.
    :returns: A tuple with the following items:

        0. **objectStoreDataEntries** - Array of object store data entries.
        1. **hasMore** - If true, there are more entries to fetch in the given range.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    params["objectStoreName"] = object_store_name
    params["indexName"] = index_name
    params["skipCount"] = skip_count
    params["pageSize"] = page_size
    if key_range is not None:
        params["keyRange"] = key_range.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.requestData",
        "params": params,
    }
    json = yield cmd_dict
    return (
        [DataEntry.from_json(i) for i in json["objectStoreDataEntries"]],
        bool(json["hasMore"]),
    )

request_database(database_name, security_origin=None, storage_key=None, storage_bucket=None)

Requests database with given name in given frame.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None
database_name str

Database name.

required

Returns:

Type Description
Generator[T_JSON_DICT, T_JSON_DICT, DatabaseWithObjectStores]

Database with an array of object stores.

Source code in zendriver/cdp/indexed_db.py
def request_database(
    database_name: str,
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, DatabaseWithObjectStores]:
    """
    Requests database with given name in given frame.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :param database_name: Database name.
    :returns: Database with an array of object stores.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    params["databaseName"] = database_name
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.requestDatabase",
        "params": params,
    }
    json = yield cmd_dict
    return DatabaseWithObjectStores.from_json(json["databaseWithObjectStores"])

request_database_names(security_origin=None, storage_key=None, storage_bucket=None)

Requests database names for given security origin.

Parameters:

Name Type Description Default
security_origin Optional[str]

(Optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.

None
storage_key Optional[str]

(Optional) Storage key.

None
storage_bucket Optional[StorageBucket]

(Optional) Storage bucket. If not specified, it uses the default bucket.

None

Returns:

Type Description
Generator[T_JSON_DICT, T_JSON_DICT, List[str]]

Database names for origin.

Source code in zendriver/cdp/indexed_db.py
def request_database_names(
    security_origin: typing.Optional[str] = None,
    storage_key: typing.Optional[str] = None,
    storage_bucket: typing.Optional[storage.StorageBucket] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]]:
    """
    Requests database names for given security origin.

    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
    :returns: Database names for origin.
    """
    params: T_JSON_DICT = dict()
    if security_origin is not None:
        params["securityOrigin"] = security_origin
    if storage_key is not None:
        params["storageKey"] = storage_key
    if storage_bucket is not None:
        params["storageBucket"] = storage_bucket.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "IndexedDB.requestDatabaseNames",
        "params": params,
    }
    json = yield cmd_dict
    return [str(i) for i in json["databaseNames"]]