document.hasStorageAccess().then((hasAccess) => {
if (hasAccess) {
// storage access has been granted already.
console.log("cookie access granted");
} else {
// storage access hasn't been granted already;
// you may want to call requestStorageAccess().
console.log("cookie access denied");
}
});Document: hasStorageAccess() method / notebook
Document: hasStorageAccess() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.