Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Async vs sync #24

Closed
beaufortfrancois opened this issue Dec 5, 2019 · 2 comments
Closed

Async vs sync #24

beaufortfrancois opened this issue Dec 5, 2019 · 2 comments

Comments

@beaufortfrancois
Copy link

As raised by TAG review at w3ctag/design-reviews#439 (comment), we may want to reconsider having an async API or not for enumerating screens.

@michaelwasserman
Copy link
Member

michaelwasserman commented Dec 5, 2019

Thanks for pointing that out! There are certainly trade-offs for each, here are some top of mind:

  • Sync parallels window.screen and may be simpler for web devs (without permission gating?).
  • Async allows non-blocking UA privacy interventions (e.g. permission checks/prompts).

Are there good patterns for permission gating with a synchronous access model?

@michaelwasserman
Copy link
Member

It seems like most guidance has been toward an async API for screen information, mainly to support privacy protections.
The updated explainer says something like "By returning a promise, user agents can asynchronously determine what amount of information to expose, prompt users to decide, calculate the resulting values lazily, and reject or resolve accordingly."
The additional explorations doc considers synchronous access here.
Feel free to reopen this issue or file a new issue if the topic should be explored further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants