webscreens / screen-enumeration

Screen enumeration API explainer
Apache License 2.0
23 stars 4 forks source link

Async vs sync #24

Closed beaufortfrancois closed 4 years ago

beaufortfrancois commented 4 years ago

As raised by TAG review at https://github.com/w3ctag/design-reviews/issues/439#issuecomment-561902607, we may want to reconsider having an async API or not for enumerating screens.

michaelwasserman commented 4 years ago

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

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

michaelwasserman commented 4 years ago

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.