- From: Mounir Lamouri <mounir@lamouri.fr>
- Date: Tue, 19 Aug 2014 22:11:43 +1000
- To: Kornel Lesiński <kornel@geekhood.net>, WHAT Working Group <whatwg@lists.whatwg.org>
- Cc: Marcos Caceres <w3c@marcosc.com>
On Tue, 19 Aug 2014, at 08:41, Kornel Lesiński wrote: > WakeLock.request() expecting a string isn't very friendly to feature > detection. > > I'd prefer if individual lock types were instances of objects, e.g. > navigator.*Lock objects could be instances of a variant of the WakeLock > interface: > > navigator.screenLock.request(); > navigator.screenLock.isHeld(); > > navigator.cpuLock.request(); > navigator.cpuLock.release(); I think the problem of feature detection is fair. Though, I think a pattern like navigator.wakeLock.${name}.request(); would be conveniently namespace'd. You would have .request, .release() and .held() (or.has()) I guess. -- Mounir
Received on Tuesday, 19 August 2014 12:12:17 UTC