Skip to content

Can a page detect when SAA is disabled by sandboxing? #220

@drmercer-lucid

Description

@drmercer-lucid

Is there a way to detect if a page was loaded with storage access restricted by sandboxing?

Context: we recently started using the Storage Access API for authenticated embeds of content from our site in other sites, including an embed API that can be used by third-parties to embed Lucid documents in their sites.

However, if the host site sandboxes the iframe and doesn't include allow-storage-access-by-user-activation, the experience is quite bad: we show the user our "allow cookies" page, but when they click our button it immediately fails. So we tell them to try logging in to Lucid in a new tab (in case it was blocked due to the top-level-interaction requirement in Chrome/Safari), but when they do that and try again, it's still blocked, and the only workaround is for the user to turn off third-party-cookie-blocking altogether in their browser settings.

From our API's perspective, this situation isn't the user's fault at all, it's the host site's fault. Ideally we'd be able to detect this scenario and (1) inform the owner of the host site that they need to add the sandbox flag to use our API and (2) inform the user that the host page is misconfigured and offer a workaround.

What I've tried:

  • navigator.permissions.query({name: 'storage-access'}) -> returns prompt even when sandbox disallows it
  • document.featurePolicy.allowsFeature('storage-access') -> returns true even when sandbox disallows it

Any help here would be much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions