revision:
The hasStorageAccess() method of the Document interface returns a Promise that resolves with a boolean value indicating whether the document has access to unpartitioned cookies.
This method is part of the Storage Access API.
hasStorageAccess()
Parameters: none
<script>
document.hasStorageAccess().then((hasAccess) => {
if (hasAccess) {
// storage access has been granted already.
} else {
// storage access hasn't been granted already;
// you may want to call requestStorageAccess().
}
});
</script>