W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2014

Re: [whatwg] Feature-detectable WakeLocks

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Tue, 19 Aug 2014 22:11:43 +1000
Message-Id: <1408450303.416290.154339633.71F9F646@webmail.messagingengine.com>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:22 UTC