Storage#
This CDP domain is experimental.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class StorageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enum of possible storage types.
- COOKIES = 'cookies'#
- FILE_SYSTEMS = 'file_systems'#
- INDEXEDDB = 'indexeddb'#
- LOCAL_STORAGE = 'local_storage'#
- SHADER_CACHE = 'shader_cache'#
- WEBSQL = 'websql'#
- SERVICE_WORKERS = 'service_workers'#
- CACHE_STORAGE = 'cache_storage'#
- INTEREST_GROUPS = 'interest_groups'#
- SHARED_STORAGE = 'shared_storage'#
- STORAGE_BUCKETS = 'storage_buckets'#
- ALL_ = 'all'#
- OTHER = 'other'#
- class UsageForType(storage_type, usage)[source]#
Usage for a storage type.
-
storage_type:
StorageType# Name of storage type.
-
storage_type:
- class TrustTokens(issuer_origin, count)[source]#
Pair of issuer origin and number of available (signed, but not used) Trust Tokens from that issuer.
- class InterestGroupAccessType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enum of interest group access types.
- JOIN = 'join'#
- LEAVE = 'leave'#
- UPDATE = 'update'#
- LOADED = 'loaded'#
- BID = 'bid'#
- WIN = 'win'#
- ADDITIONAL_BID = 'additionalBid'#
- ADDITIONAL_BID_WIN = 'additionalBidWin'#
- TOP_LEVEL_BID = 'topLevelBid'#
- TOP_LEVEL_ADDITIONAL_BID = 'topLevelAdditionalBid'#
- CLEAR = 'clear'#
- class InterestGroupAuctionEventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enum of auction events.
- STARTED = 'started'#
- CONFIG_RESOLVED = 'configResolved'#
- class InterestGroupAuctionFetchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enum of network fetches auctions can do.
- BIDDER_JS = 'bidderJs'#
- BIDDER_WASM = 'bidderWasm'#
- SELLER_JS = 'sellerJs'#
- BIDDER_TRUSTED_SIGNALS = 'bidderTrustedSignals'#
- SELLER_TRUSTED_SIGNALS = 'sellerTrustedSignals'#
Enum of shared storage access scopes.
Enum of shared storage access methods.
Struct for a single key-value pair in an origin’s shared storage.
Details for an origin’s shared storage.
Time when the origin’s shared storage was last created.
Number of key-value pairs stored in origin’s shared storage.
Current amount of bits of entropy remaining in the navigation budget.
Total number of bytes stored as key-value pairs in origin’s shared storage.
Represents a dictionary object passed in as privateAggregationConfig to run or selectURL.
Configures the maximum size allowed for filtering IDs.
The chosen aggregation service deployment.
The context ID provided.
The limit on the number of contributions in the final report.
Pair of reporting metadata details for a candidate URL for
selectURL().
Bundles a candidate URL with its reporting metadata.
Spec of candidate URL.
Any associated reporting metadata.
Bundles the parameters for shared storage access events whose presence/absence can vary according to SharedStorageAccessType.
Spec of the module script URL. Present only for SharedStorageAccessMethods: addModule and createWorklet.
String denoting “context-origin”, “script-origin”, or a custom origin to be used as the worklet’s data origin. Present only for SharedStorageAccessMethod: createWorklet.
Name of the registered operation to be run. Present only for SharedStorageAccessMethods: run and selectURL.
ID of the operation call. Present only for SharedStorageAccessMethods: run and selectURL.
Whether or not to keep the worket alive for future run or selectURL calls. Present only for SharedStorageAccessMethods: run and selectURL.
Configures the private aggregation options. Present only for SharedStorageAccessMethods: run and selectURL.
The operation’s serialized data in bytes (converted to a string). Present only for SharedStorageAccessMethods: run and selectURL. TODO(crbug.com/401011862): Consider updating this parameter to binary.
Array of candidate URLs’ specs, along with any associated metadata. Present only for SharedStorageAccessMethod: selectURL.
UUID generated for a selectURL call. Present only for SharedStorageAccessMethod: selectURL.
- Type:
Spec of the URN
Key for a specific entry in an origin’s shared storage. Present only for SharedStorageAccessMethods: set, append, delete, and get.
Value for a specific entry in an origin’s shared storage. Present only for SharedStorageAccessMethods: set and append.
Whether or not to set an entry for a key if that key is already present. Present only for SharedStorageAccessMethod: set.
A number denoting the (0-based) order of the worklet’s creation relative to all other shared storage worklets created by documents using the current storage partition. Present only for SharedStorageAccessMethods: addModule, createWorklet.
Hex representation of the DevTools token used as the TargetID for the associated shared storage worklet. Present only for SharedStorageAccessMethods: addModule, createWorklet, run, selectURL, and any other SharedStorageAccessMethod when the SharedStorageAccessScope is sharedStorageWorklet.
Name of the lock to be acquired, if present. Optionally present only for SharedStorageAccessMethods: batchUpdate, set, append, delete, and clear.
If the method has been called as part of a batchUpdate, then this number identifies the batch to which it belongs. Optionally present only for SharedStorageAccessMethods: batchUpdate (required), set, append, delete, and clear.
Number of modifier methods sent in batch. Present only for SharedStorageAccessMethod: batchUpdate.
- class StorageBucketsDurability(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- RELAXED = 'relaxed'#
- STRICT = 'strict'#
- class StorageBucket(storage_key, name=None)[source]#
-
storage_key:
SerializedStorageKey#
-
storage_key:
- class StorageBucketInfo(bucket, id_, expiration, quota, persistent, durability)[source]#
-
bucket:
StorageBucket#
-
expiration:
TimeSinceEpoch#
-
durability:
StorageBucketsDurability#
-
bucket:
- class AttributionReportingSourceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- NAVIGATION = 'navigation'#
- EVENT = 'event'#
- class AttributionReportingFilterConfig(filter_values, lookback_window=None)[source]#
-
filter_values:
List[AttributionReportingFilterDataEntry]#
-
filter_values:
- class AttributionReportingFilterPair(filters, not_filters)[source]#
-
filters:
List[AttributionReportingFilterConfig]#
-
not_filters:
List[AttributionReportingFilterConfig]#
-
filters:
- class AttributionReportingAggregationKeysEntry(key, value)[source]#
-
-
value:
UnsignedInt128AsBase16#
-
value:
- class AttributionReportingTriggerDataMatching(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- EXACT = 'exact'#
- MODULUS = 'modulus'#
- class AttributionReportingAggregatableDebugReportingData(key_piece, value, types)[source]#
-
key_piece:
UnsignedInt128AsBase16#
-
key_piece:
- class AttributionReportingAggregatableDebugReportingConfig(key_piece, debug_data, budget=None, aggregation_coordinator_origin=None)[source]#
-
key_piece:
UnsignedInt128AsBase16#
-
debug_data:
List[AttributionReportingAggregatableDebugReportingData]#
-
key_piece:
- class AttributionReportingSourceRegistration(time, expiry, trigger_data, event_report_windows, aggregatable_report_window, type_, source_origin, reporting_origin, destination_sites, event_id, priority, filter_data, aggregation_keys, trigger_data_matching, destination_limit_priority, aggregatable_debug_reporting_config, max_event_level_reports, named_budgets, debug_reporting, event_level_epsilon, debug_key=None, scopes_data=None)[source]#
-
time:
TimeSinceEpoch#
-
trigger_data:
List[float]# number instead of integer because not all uint32 can be represented by int
-
event_report_windows:
AttributionReportingEventReportWindows#
-
event_id:
UnsignedInt64AsBase10#
-
priority:
SignedInt64AsBase10#
-
filter_data:
List[AttributionReportingFilterDataEntry]#
-
aggregation_keys:
List[AttributionReportingAggregationKeysEntry]#
-
trigger_data_matching:
AttributionReportingTriggerDataMatching#
-
destination_limit_priority:
SignedInt64AsBase10#
-
aggregatable_debug_reporting_config:
AttributionReportingAggregatableDebugReportingConfig#
-
named_budgets:
List[AttributionReportingNamedBudgetDef]#
-
debug_key:
Optional[UnsignedInt64AsBase10] = None#
-
scopes_data:
Optional[AttributionScopesData] = None#
-
time:
- class AttributionReportingSourceRegistrationResult(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- SUCCESS = 'success'#
- INTERNAL_ERROR = 'internalError'#
- INSUFFICIENT_SOURCE_CAPACITY = 'insufficientSourceCapacity'#
- INSUFFICIENT_UNIQUE_DESTINATION_CAPACITY = 'insufficientUniqueDestinationCapacity'#
- EXCESSIVE_REPORTING_ORIGINS = 'excessiveReportingOrigins'#
- PROHIBITED_BY_BROWSER_POLICY = 'prohibitedByBrowserPolicy'#
- SUCCESS_NOISED = 'successNoised'#
- DESTINATION_REPORTING_LIMIT_REACHED = 'destinationReportingLimitReached'#
- DESTINATION_GLOBAL_LIMIT_REACHED = 'destinationGlobalLimitReached'#
- DESTINATION_BOTH_LIMITS_REACHED = 'destinationBothLimitsReached'#
- REPORTING_ORIGINS_PER_SITE_LIMIT_REACHED = 'reportingOriginsPerSiteLimitReached'#
- EXCEEDS_MAX_CHANNEL_CAPACITY = 'exceedsMaxChannelCapacity'#
- EXCEEDS_MAX_SCOPES_CHANNEL_CAPACITY = 'exceedsMaxScopesChannelCapacity'#
- EXCEEDS_MAX_TRIGGER_STATE_CARDINALITY = 'exceedsMaxTriggerStateCardinality'#
- EXCEEDS_MAX_EVENT_STATES_LIMIT = 'exceedsMaxEventStatesLimit'#
- DESTINATION_PER_DAY_REPORTING_LIMIT_REACHED = 'destinationPerDayReportingLimitReached'#
- class AttributionReportingSourceRegistrationTimeConfig(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- INCLUDE = 'include'#
- EXCLUDE = 'exclude'#
- class AttributionReportingAggregatableValueDictEntry(key, value, filtering_id)[source]#
-
-
filtering_id:
UnsignedInt64AsBase10#
-
filtering_id:
- class AttributionReportingAggregatableValueEntry(values, filters)[source]#
-
-
filters:
AttributionReportingFilterPair#
-
filters:
- class AttributionReportingEventTriggerData(data, priority, filters, dedup_key=None)[source]#
-
data:
UnsignedInt64AsBase10#
-
priority:
SignedInt64AsBase10#
-
filters:
AttributionReportingFilterPair#
-
dedup_key:
Optional[UnsignedInt64AsBase10] = None#
-
data:
- class AttributionReportingAggregatableTriggerData(key_piece, source_keys, filters)[source]#
-
key_piece:
UnsignedInt128AsBase16#
-
filters:
AttributionReportingFilterPair#
-
key_piece:
- class AttributionReportingAggregatableDedupKey(filters, dedup_key=None)[source]#
-
filters:
AttributionReportingFilterPair#
-
dedup_key:
Optional[UnsignedInt64AsBase10] = None#
-
filters:
- class AttributionReportingNamedBudgetCandidate(filters, name=None)[source]#
-
filters:
AttributionReportingFilterPair#
-
filters:
- class AttributionReportingTriggerRegistration(filters, aggregatable_dedup_keys, event_trigger_data, aggregatable_trigger_data, aggregatable_values, aggregatable_filtering_id_max_bytes, debug_reporting, source_registration_time_config, aggregatable_debug_reporting_config, scopes, named_budgets, debug_key=None, aggregation_coordinator_origin=None, trigger_context_id=None)[source]#
-
filters:
AttributionReportingFilterPair#
-
aggregatable_dedup_keys:
List[AttributionReportingAggregatableDedupKey]#
-
event_trigger_data:
List[AttributionReportingEventTriggerData]#
-
aggregatable_trigger_data:
List[AttributionReportingAggregatableTriggerData]#
-
aggregatable_values:
List[AttributionReportingAggregatableValueEntry]#
-
source_registration_time_config:
AttributionReportingSourceRegistrationTimeConfig#
-
aggregatable_debug_reporting_config:
AttributionReportingAggregatableDebugReportingConfig#
-
named_budgets:
List[AttributionReportingNamedBudgetCandidate]#
-
debug_key:
Optional[UnsignedInt64AsBase10] = None#
-
filters:
- class AttributionReportingEventLevelResult(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- SUCCESS = 'success'#
- SUCCESS_DROPPED_LOWER_PRIORITY = 'successDroppedLowerPriority'#
- INTERNAL_ERROR = 'internalError'#
- NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = 'noCapacityForAttributionDestination'#
- NO_MATCHING_SOURCES = 'noMatchingSources'#
- DEDUPLICATED = 'deduplicated'#
- EXCESSIVE_ATTRIBUTIONS = 'excessiveAttributions'#
- PRIORITY_TOO_LOW = 'priorityTooLow'#
- NEVER_ATTRIBUTED_SOURCE = 'neverAttributedSource'#
- EXCESSIVE_REPORTING_ORIGINS = 'excessiveReportingOrigins'#
- NO_MATCHING_SOURCE_FILTER_DATA = 'noMatchingSourceFilterData'#
- PROHIBITED_BY_BROWSER_POLICY = 'prohibitedByBrowserPolicy'#
- NO_MATCHING_CONFIGURATIONS = 'noMatchingConfigurations'#
- EXCESSIVE_REPORTS = 'excessiveReports'#
- FALSELY_ATTRIBUTED_SOURCE = 'falselyAttributedSource'#
- REPORT_WINDOW_PASSED = 'reportWindowPassed'#
- NOT_REGISTERED = 'notRegistered'#
- REPORT_WINDOW_NOT_STARTED = 'reportWindowNotStarted'#
- NO_MATCHING_TRIGGER_DATA = 'noMatchingTriggerData'#
- class AttributionReportingAggregatableResult(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- SUCCESS = 'success'#
- INTERNAL_ERROR = 'internalError'#
- NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = 'noCapacityForAttributionDestination'#
- NO_MATCHING_SOURCES = 'noMatchingSources'#
- EXCESSIVE_ATTRIBUTIONS = 'excessiveAttributions'#
- EXCESSIVE_REPORTING_ORIGINS = 'excessiveReportingOrigins'#
- NO_HISTOGRAMS = 'noHistograms'#
- INSUFFICIENT_BUDGET = 'insufficientBudget'#
- INSUFFICIENT_NAMED_BUDGET = 'insufficientNamedBudget'#
- NO_MATCHING_SOURCE_FILTER_DATA = 'noMatchingSourceFilterData'#
- NOT_REGISTERED = 'notRegistered'#
- PROHIBITED_BY_BROWSER_POLICY = 'prohibitedByBrowserPolicy'#
- DEDUPLICATED = 'deduplicated'#
- REPORT_WINDOW_PASSED = 'reportWindowPassed'#
- EXCESSIVE_REPORTS = 'excessiveReports'#
- class AttributionReportingReportResult(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- SENT = 'sent'#
- PROHIBITED = 'prohibited'#
- FAILED_TO_ASSEMBLE = 'failedToAssemble'#
- EXPIRED = 'expired'#
Commands#
Each command is a generator function. The return
type Generator[x, y, z] indicates that the generator
yields arguments of type x, it must be resumed with
an argument of type y, and it returns type z. In
this library, types x and y are the same for all
commands, and z is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
Clears all entries for a given origin’s shared storage.
EXPERIMENTAL
- clear_trust_tokens(issuer_origin)[source]#
Removes all Trust Tokens issued by the provided issuerOrigin. Leaves other stored data, including the issuer’s Redemption Records, intact.
EXPERIMENTAL
Deletes entry for
key(if it exists) for a given origin’s shared storage.EXPERIMENTAL
- delete_storage_bucket(bucket)[source]#
Deletes the Storage Bucket with the given storage key and bucket name.
EXPERIMENTAL
- get_affected_urls_for_third_party_cookie_metadata(first_party_url, third_party_urls)[source]#
Returns the list of URLs from a page and its embedded resources that match existing grace period URL pattern rules. https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period
EXPERIMENTAL
- Parameters:
- Return type:
- Returns:
Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array.
- get_interest_group_details(owner_origin, name)[source]#
Gets details for a named interest group.
EXPERIMENTAL
- Parameters:
- Return type:
- Returns:
This largely corresponds to: https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin.
Returns the effective Related Website Sets in use by this profile for the browser session. The effective Related Website Sets will not change during a browser session.
EXPERIMENTAL
Gets the entries in an given origin’s shared storage.
EXPERIMENTAL
Gets metadata for an origin’s shared storage.
EXPERIMENTAL
- get_trust_tokens()[source]#
Returns the number of stored Trust Tokens per issuer for the current browsing context.
EXPERIMENTAL
- get_usage_and_quota(origin)[source]#
Returns usage and quota in bytes.
- Parameters:
origin (
str) – Security origin.- Return type:
Generator[Dict[str,Any],Dict[str,Any],Tuple[float,float,bool,List[UsageForType]]]- Returns:
A tuple with the following items:
usage - Storage usage (bytes).
quota - Storage quota (bytes).
overrideActive - Whether or not the origin has an active storage quota override
usageBreakdown - Storage usage per type (bytes).
- override_quota_for_origin(origin, quota_size=None)[source]#
Override quota for the specified origin
EXPERIMENTAL
- Parameters:
origin (
str) – Security origin.quota_size (
Optional[float]) – (Optional) The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize).
- Return type:
Resets the budget for
ownerOriginby clearing all budget withdrawals.EXPERIMENTAL
- run_bounce_tracking_mitigations()[source]#
Deletes state for sites identified as potential bounce trackers, immediately.
EXPERIMENTAL
- send_pending_attribution_reports()[source]#
Sends all pending Attribution Reports immediately, regardless of their scheduled report time.
EXPERIMENTAL
- set_attribution_reporting_local_testing_mode(enabled)[source]#
https://wicg.github.io/attribution-reporting-api/
EXPERIMENTAL
- set_attribution_reporting_tracking(enable)[source]#
Enables/disables issuing of Attribution Reporting events.
EXPERIMENTAL
- set_interest_group_auction_tracking(enable)[source]#
Enables/Disables issuing of interestGroupAuctionEventOccurred and interestGroupAuctionNetworkRequestCreated.
EXPERIMENTAL
- set_interest_group_tracking(enable)[source]#
Enables/Disables issuing of interestGroupAccessed events.
EXPERIMENTAL
Sets entry with
keyandvaluefor a given origin’s shared storage.EXPERIMENTAL
Enables/disables issuing of sharedStorageAccessed events.
EXPERIMENTAL
- set_storage_bucket_tracking(storage_key, enable)[source]#
Set tracking for a storage key’s buckets.
EXPERIMENTAL
- track_cache_storage_for_origin(origin)[source]#
Registers origin to be notified when an update occurs to its cache storage list.
- track_cache_storage_for_storage_key(storage_key)[source]#
Registers storage key to be notified when an update occurs to its cache storage list.
- track_indexed_db_for_origin(origin)[source]#
Registers origin to be notified when an update occurs to its IndexedDB.
- track_indexed_db_for_storage_key(storage_key)[source]#
Registers storage key to be notified when an update occurs to its IndexedDB.
- untrack_cache_storage_for_origin(origin)[source]#
Unregisters origin from receiving notifications for cache storage.
- untrack_cache_storage_for_storage_key(storage_key)[source]#
Unregisters storage key from receiving notifications for cache storage.
Events#
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.
- class CacheStorageContentUpdated(origin, storage_key, bucket_id, cache_name)[source]#
A cache’s contents have been modified.
- class CacheStorageListUpdated(origin, storage_key, bucket_id)[source]#
A cache has been added/deleted.
- class IndexedDBContentUpdated(origin, storage_key, bucket_id, database_name, object_store_name)[source]#
The origin’s IndexedDB object store has been modified.
- class IndexedDBListUpdated(origin, storage_key, bucket_id)[source]#
The origin’s IndexedDB database list has been modified.
- class InterestGroupAccessed(access_time, type_, owner_origin, name, component_seller_origin, bid, bid_currency, unique_auction_id)[source]#
One of the interest groups was accessed. Note that these events are global to all targets sharing an interest group store.
-
access_time:
TimeSinceEpoch#
-
type_:
InterestGroupAccessType#
-
component_seller_origin:
Optional[str]# For topLevelBid/topLevelAdditionalBid, and when appropriate, win and additionalBidWin
-
unique_auction_id:
Optional[InterestGroupAuctionId]# For non-global events — links to interestGroupAuctionEvent
-
access_time:
- class InterestGroupAuctionEventOccurred(event_time, type_, unique_auction_id, parent_auction_id, auction_config)[source]#
An auction involving interest groups is taking place. These events are target-specific.
-
event_time:
TimeSinceEpoch#
-
unique_auction_id:
InterestGroupAuctionId#
-
parent_auction_id:
Optional[InterestGroupAuctionId]# Set for child auctions.
-
event_time:
- class InterestGroupAuctionNetworkRequestCreated(type_, request_id, auctions)[source]#
Specifies which auctions a particular network fetch may be related to, and in what role. Note that it is not ordered with respect to Network.requestWillBeSent (but will happen before loadingFinished loadingFailed).
-
auctions:
List[InterestGroupAuctionId]# This is the set of the auctions using the worklet that issued this request. In the case of trusted signals, it’s possible that only some of them actually care about the keys being queried.
-
auctions:
Shared storage was accessed by the associated page. The following parameters are included in all events.
Time of the access.
Enum value indicating the access scope.
Enum value indicating the Shared Storage API method invoked.
DevTools Frame Token for the primary frame tree’s root.
Serialization of the origin owning the Shared Storage data.
Serialization of the site owning the Shared Storage data.
The sub-parameters wrapped by
paramsare all optional and their presence/absence depends ontype.
A shared storage run or selectURL operation finished its execution. The following parameters are included in all events.
Time that the operation finished.
Time, in microseconds, from start of shared storage JS API call until end of operation execution in the worklet.
Enum value indicating the Shared Storage API method invoked.
ID of the operation call.
Hex representation of the DevTools token used as the TargetID for the associated shared storage worklet.
DevTools Frame Token for the primary frame tree’s root.
Serialization of the origin owning the Shared Storage data.
- class StorageBucketCreatedOrUpdated(bucket_info)[source]#
-
bucket_info:
StorageBucketInfo#
-
bucket_info:
- class AttributionReportingSourceRegistered(registration, result)[source]#
EXPERIMENTAL
-
registration:
AttributionReportingSourceRegistration#
-
registration:
- class AttributionReportingTriggerRegistered(registration, event_level, aggregatable)[source]#
EXPERIMENTAL
-
registration:
AttributionReportingTriggerRegistration#
-
event_level:
AttributionReportingEventLevelResult#
-
aggregatable:
AttributionReportingAggregatableResult#
-
registration: