Re: [wake-lock] request(): Order for permission and other checks (#202)

Given the redesign of feature policy that's ongoing, are they even the right fit here? This doesn't seem like something we'd ask the user so this would be a sandboxing thing, for which the design is still somewhat unclear: https://github.com/w3c/webappsec-feature-policy/issues/282#issuecomment-486267212 (and issues linked from there below).

Generally I try to avoid exposing exception order by using the same exception (`TypeError`), but that's not feasible here. We probably should have some principles in that case, but as @marcoscaceres said they don't exist yet.

Fetch does the aborting check early on (but after construction which can throw), but I suppose there I'd do a sandboxing check (when applicable) even earlier to avoid doing needless work.

What tradeoffs did you consider?

-- 
GitHub Notification of comment by annevk
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/202#issuecomment-490451205 using your GitHub account

Received on Wednesday, 8 May 2019 11:33:03 UTC