chromium/chrome/test/data/durable/durability-permissions.html

<!DOCTYPE HTML>
<script>

function checkPermission() {
  return navigator.storage.persisted();
}

async function checkPermissionUsingPermissionApi() {
  const status =
    await navigator.permissions.query({name: 'persistent-storage'});
  return status.state;
}

function requestPermission() {
  return navigator.storage.persist();
}
</script>