StorageAccessHandle Class
The access of a document of a third-party context to the storage of its origin as a first party (the unpartitioned storage, https://privacycg.github.io/saa-non-cookie-storage/#storageaccesshandle), returned by Document.RequestStorageAccess: the members give the Web Storage areas, the IndexedDB databases, the locks, the caches, the origin private file system, the usage estimate, the broadcast channels and the shared workers of the storage key of the origin in a top-level document, instead of the ones of the partition of the document. A member that the StorageAccessTypes of the request did not include throws an InvalidStateError DomException (rejects its task).
public sealed class StorageAccessHandleRemarks
The blob URLs are not partitioned by the library: StorageAccessHandle.CreateObjectUrl and StorageAccessHandle.RevokeObjectUrl are Url.CreateObjectUrl and Url.RevokeObjectUrl. A shared worker created by StorageAccessHandle.CreateSharedWorker is shared with the documents of the origin in their first-party contexts; the sameSiteCookies option of the shared workers is not implemented.
See also
Properties
| Name | Description |
|---|---|
| IndexedDB | Gets the IndexedDB databases of the origin in its first-party contexts. |
| LocalStorage | Gets the local storage area of the origin in its first-party contexts (see Window.LocalStorage). |
| Locks | Gets the lock manager of the origin in its first-party contexts. |
| SessionStorage | Gets the session storage area of the origin in its first-party contexts of the top-level traversable (the area that the documents of the origin get from Window.SessionStorage when they are not embedded by another site). |
IndexedDB
StorageAccessHandle.csGets the IndexedDB databases of the origin in its first-party contexts.
public IdbFactory IndexedDB { get; }LocalStorage
StorageAccessHandle.csGets the local storage area of the origin in its first-party contexts (see Window.LocalStorage).
public Storage LocalStorage { get; }Property value
Exceptions
DomException- An
InvalidStateErrorwhen the local storage was not requested, aSecurityErrorwhen the items cannot be loaded.
See also
Gets the lock manager of the origin in its first-party contexts.
public LockManager Locks { get; }SessionStorage
StorageAccessHandle.csGets the session storage area of the origin in its first-party contexts of the top-level traversable (the area that the documents of the origin get from Window.SessionStorage when they are not embedded by another site).
public Storage SessionStorage { get; }Property value
Exceptions
DomException- An
InvalidStateErrorwhen the session storage was not requested.
See also
Methods
| Name | Description |
|---|---|
| CreateBroadcastChannel(string) | Creates a broadcast channel that exchanges messages with the channels of the origin in its first-party contexts (instead of the channels of the partition of the document). |
| CreateObjectUrl(Blob) | Creates a blob: URL referencing a blob (see Url.CreateObjectUrl). |
| CreateObjectUrl(MediaSource) | Creates a blob: URL referencing a media source (see Url.CreateObjectUrl). |
| CreateSharedWorker(string, SharedWorkerOptions?) | Connects to a shared worker of the origin in its first-party contexts (see SharedWorker). |
| CreateSharedWorker(string, string) | Connects to a shared worker of the origin in its first-party contexts (see SharedWorker). |
| Estimate() | Returns an estimation of the usage and of the quota of the storage of the origin in its first-party contexts (see StorageManager.Estimate). The task fails with an InvalidStateError when it was not requested. |
| GetDirectory() | Returns the root directory of the origin private file system of the origin in its first-party contexts (see StorageManager.GetDirectory). The task fails with an InvalidStateError when it was not requested. |
| RevokeObjectUrl(string) | Revokes a blob: URL (see Url.RevokeObjectUrl). |
CreateBroadcastChannel(string)
StorageAccessHandle.csCreates a broadcast channel that exchanges messages with the channels of the origin in its first-party contexts (instead of the channels of the partition of the document).
public BroadcastChannel CreateBroadcastChannel(string name)Parameters
namestring
Returns
Exceptions
DomException- An
InvalidStateErrorwhen it was not requested.
See also
CreateObjectUrl overloads
CreateObjectUrl(Blob)
StorageAccessHandle.csCreates a blob: URL referencing a blob (see Url.CreateObjectUrl).
Parameters
objBlob
Returns
Exceptions
DomException- An
InvalidStateErrorwhen it was not requested.
See also
CreateObjectUrl(MediaSource)
StorageAccessHandle.csCreates a blob: URL referencing a media source (see Url.CreateObjectUrl).
public string CreateObjectUrl(MediaSource obj)Parameters
objMediaSource
Returns
Exceptions
DomException- An
InvalidStateErrorwhen it was not requested.
See also
Estimate()
StorageAccessHandle.csReturns an estimation of the usage and of the quota of the storage of the origin in its first-party contexts (see StorageManager.Estimate). The task fails with an InvalidStateError when it was not requested.
public Task<StorageEstimate> Estimate()GetDirectory()
StorageAccessHandle.csReturns the root directory of the origin private file system of the origin in its first-party contexts (see StorageManager.GetDirectory). The task fails with an InvalidStateError when it was not requested.
public Task<FileSystemDirectoryHandle> GetDirectory()RevokeObjectUrl(string)
StorageAccessHandle.csRevokes a blob: URL (see Url.RevokeObjectUrl).