pub async fn request_persistence() -> Result<bool, IdbError> {
        let storage_manager = web_sys::window().unwrap().navigator().storage();
        // If we can't access this, we're probably in a very old browser, so retrying
        // isn't worth it in all likelihood
        let res = storage_manager
            .persist()
            .map_err(|_| IdbError::PersistenceCheckFailed { retry: false })?;
        let res = JsFuture::from(res)
            .await
            .map_err(|_| IdbError::PersistenceCheckFailed { retry: true })?;
        let res_bool = res.as_bool().unwrap();

        Ok(res_bool)
    }
Requests persistent storage from the browser. In Firefox, the user will
be prompted, though in Chrome the browser will automatically accept or
deny based on your site's level of engagement, whether ot not it's
been installed or bookmarked, and whether or not it's been granted the
permission to show notifications. In other words, do NOT assume that
this will be accepted, even if you ask the user very nicely. That
said, especially in Firefox, you should display a custom notification
before this with `alert()` or similar that explains why
your site needs persistent storage for frozen state.

If this returns `false`, the request was rejected, but you can retry in
future (for user experience though, it's recommended to only do so very
sparingly). If this returns an error, a recommendation about whether
or not to retry will be attached. You generally shouldn't retry this
more than once if there was an error.

For more information about persistent storage on the web, see [here](https://web.dev/persistent-storage).
packages/perseus/src/state/freeze_idb.rs