StorageApi class
Methods
clearCookies ({BrowserContextID ? browserContextId })
→ Future <void >
Clears cookies.
browserContextId Browser context to use when called on the browser endpoint.
clearDataForOrigin (String origin , String storageTypes )
→ Future <void >
Clears storage for origin.
origin Security origin.
storageTypes Comma separated list of StorageType to clear.
clearDataForStorageKey (String storageKey , String storageTypes )
→ Future <void >
Clears storage for storage key.
storageKey Storage key.
storageTypes Comma separated list of StorageType to clear.
clearSharedStorageEntries (String ownerOrigin )
→ Future <void >
Clears all entries for a given origin's shared storage.
clearTrustTokens (String issuerOrigin )
→ Future <bool >
Removes all Trust Tokens issued by the provided issuerOrigin.
Leaves other stored data, including the issuer's Redemption Records, intact.
Returns: True if any tokens were deleted, false otherwise.
deleteSharedStorageEntry (String ownerOrigin , String key )
→ Future <void >
Deletes entry for key (if it exists) for a given origin's shared storage.
deleteStorageBucket (StorageBucket bucket )
→ Future <void >
Deletes the Storage Bucket with the given storage key and bucket name.
getAffectedUrlsForThirdPartyCookieMetadata (String firstPartyUrl , List <String > thirdPartyUrls )
→ Future <List <String > >
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
firstPartyUrl The URL of the page currently being visited.
thirdPartyUrls The list of embedded resource URLs from the page.
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.
getCookies ({BrowserContextID ? browserContextId })
→ Future <List <Cookie > >
Returns all browser cookies.
browserContextId Browser context to use when called on the browser endpoint.
Returns: Array of cookie objects.
getInterestGroupDetails (String ownerOrigin , String name )
→ Future <Map <String , dynamic > >
Gets details for a named interest group.
Returns: This largely corresponds to:
https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup
but has absolute expirationTime instead of relative lifetimeMs and
also adds joiningOrigin.
getRelatedWebsiteSets ()
→ Future <List <RelatedWebsiteSet > >
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.
getSharedStorageEntries (String ownerOrigin )
→ Future <List <SharedStorageEntry > >
Gets the entries in an given origin's shared storage.
getSharedStorageMetadata (String ownerOrigin )
→ Future <SharedStorageMetadata >
Gets metadata for an origin's shared storage.
getStorageKeyForFrame (FrameId frameId )
→ Future <SerializedStorageKey >
Returns a storage key given a frame id.
getTrustTokens ()
→ Future <List <TrustTokens > >
Returns the number of stored Trust Tokens per issuer for the
current browsing context.
getUsageAndQuota (String origin )
→ Future <GetUsageAndQuotaResult >
Returns usage and quota in bytes.
origin Security origin.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideQuotaForOrigin (String origin , {num ? quotaSize })
→ Future <void >
Override quota for the specified origin
origin Security origin.
quotaSize 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).
resetSharedStorageBudget (String ownerOrigin )
→ Future <void >
Resets the budget for ownerOrigin by clearing all budget withdrawals.
runBounceTrackingMitigations ()
→ Future <List <String > >
Deletes state for sites identified as potential bounce trackers, immediately.
sendPendingAttributionReports ()
→ Future <int >
Sends all pending Attribution Reports immediately, regardless of their
scheduled report time.
Returns: The number of reports that were sent.
setAttributionReportingLocalTestingMode (bool enabled )
→ Future <void >
https://wicg.github.io/attribution-reporting-api/
enabled If enabled, noise is suppressed and reports are sent immediately.
setAttributionReportingTracking (bool enable )
→ Future <void >
Enables/disables issuing of Attribution Reporting events.
setCookies (List <CookieParam > cookies , {BrowserContextID ? browserContextId })
→ Future <void >
Sets given cookies.
cookies Cookies to be set.
browserContextId Browser context to use when called on the browser endpoint.
setInterestGroupAuctionTracking (bool enable )
→ Future <void >
Enables/Disables issuing of interestGroupAuctionEventOccurred and
interestGroupAuctionNetworkRequestCreated.
setInterestGroupTracking (bool enable )
→ Future <void >
Enables/Disables issuing of interestGroupAccessed events.
setProtectedAudienceKAnonymity (String owner , String name , List <String > hashes )
→ Future <void >
setSharedStorageEntry (String ownerOrigin , String key , String value , {bool ? ignoreIfPresent })
→ Future <void >
Sets entry with key and value for a given origin's shared storage.
ignoreIfPresent If ignoreIfPresent is included and true, then only sets the entry if
key doesn't already exist.
setSharedStorageTracking (bool enable )
→ Future <void >
Enables/disables issuing of sharedStorageAccessed events.
setStorageBucketTracking (String storageKey , bool enable )
→ Future <void >
Set tracking for a storage key's buckets.
toString ()
→ String
A string representation of this object.
inherited
trackCacheStorageForOrigin (String origin )
→ Future <void >
Registers origin to be notified when an update occurs to its cache storage list.
origin Security origin.
trackCacheStorageForStorageKey (String storageKey )
→ Future <void >
Registers storage key to be notified when an update occurs to its cache storage list.
storageKey Storage key.
trackIndexedDBForOrigin (String origin )
→ Future <void >
Registers origin to be notified when an update occurs to its IndexedDB.
origin Security origin.
trackIndexedDBForStorageKey (String storageKey )
→ Future <void >
Registers storage key to be notified when an update occurs to its IndexedDB.
storageKey Storage key.
untrackCacheStorageForOrigin (String origin )
→ Future <void >
Unregisters origin from receiving notifications for cache storage.
origin Security origin.
untrackCacheStorageForStorageKey (String storageKey )
→ Future <void >
Unregisters storage key from receiving notifications for cache storage.
storageKey Storage key.
untrackIndexedDBForOrigin (String origin )
→ Future <void >
Unregisters origin from receiving notifications for IndexedDB.
origin Security origin.
untrackIndexedDBForStorageKey (String storageKey )
→ Future <void >
Unregisters storage key from receiving notifications for IndexedDB.
storageKey Storage key.