Storage

Represents commands of Storage module. Described in https://w3c.github.io/webdriver-bidi/#module-storage.

Constructor

new Storage()

Methods

(async) deleteCookies(cookieFilteropt, partitionopt) → {PartitionKey}

Deletes cookies based on the provided filter and partition.

Parameters:
NameTypeAttributesDescription
cookieFilterCookieFilter<optional>

The filter to apply to the cookies. Must be an instance of CookieFilter.

partitionBrowsingContextPartitionDescriptor | StorageKeyPartitionDescriptor<optional>

The partition to delete cookies from. Must be an instance of either BrowsingContextPartitionDescriptor or StorageKeyPartitionDescriptor.

Throws:
  • If the provided parameters are not of the correct type.
Type
Error
Returns:
  • The partition key of the deleted cookies, if available.
Type: 
PartitionKey

(async) getCookies(filteropt, partitionopt)

Retrieves cookies based on the provided filter and partition.

Parameters:
NameTypeAttributesDescription
filterCookieFilter<optional>

The filter to apply to the cookies.

partitionBrowsingContextPartitionDescriptor | StorageKeyPartitionDescriptor<optional>

The partition to retrieve cookies from.

Throws:
  • If the filter parameter is provided but is not an instance of CookieFilter.

    Type
    Error
  • If the partition parameter is provided but is not an instance of BrowsingContextPartitionDescriptor or StorageKeyPartitionDescriptor.

    Type
    Error
Returns:

(async) setCookie(cookie, partitionopt) → {PartitionKey}

Sets a cookie using the provided cookie object and partition.

Parameters:
NameTypeAttributesDescription
cookiePartialCookie

The cookie object to set.

partitionBrowsingContextPartitionDescriptor | StorageKeyPartitionDescriptor<optional>

The partition to use for the cookie.

Throws:

If the cookie parameter is not an instance of PartialCookie or if the partition parameter is not an instance of PartitionDescriptor.

Type
Error
Returns:

The partition key of the set cookie.

Type: 
PartitionKey