[whatwg] Device proximity and light events

Doug Turner dougt at mozilla.com
Tue May 8 18:47:21 PDT 2012


You don't.  This API doesn't have device detection.  Don't assume that onXXX means that the UA supports an event.


On May 8, 2012, at 6:34 PM, Carr, Wayne wrote:

> How do you detect if the UA supports each of these sensor?
> 
> I thought when I first looked at this there was onxxxx on the window object for one of them but not the other.  But I don't see it for either. 
> 
> 
>> -----Original Message-----
>> From: whatwg-bounces at lists.whatwg.org [mailto:whatwg-
>> bounces at lists.whatwg.org] On Behalf Of Jonas Sicking
>> Sent: Tuesday, May 08, 2012 4:02 PM
>> To: Doug Turner
>> Cc: JOSE MANUEL CANTERA FONSECA; whatwg at whatwg.org; Andrei Popescu
>> Subject: Re: [whatwg] Device proximity and light events
>> 
>> On Tue, May 8, 2012 at 3:33 PM, Doug Turner <dougt at mozilla.com> wrote:
>>> 
>>> On May 8, 2012, at 3:26 PM, Jonas Sicking wrote:
>>> 
>>>> The reason that I'm not really happy with this API is the fact that
>>>> it forces pages to remove all event listeners in order to shut down a
>>>> sensor.
>>> 
>>> True.  I haven't heard of anyone actually worrying about this.
>>> 
>>>> It seems more author friendly to me to allow pages to keep event
>>>> listeners registered but to have an "on/off" switch which they can
>>>> use to control if they want the sensor to be enabled. (Setting it to
>>>> "off" would of course only affect if events are delivered to that
>>>> page. If another page set it to "on" the UA would still fire the
>>>> events to the second page, and that page only).
>>> 
>>> I do not think we have similar on/off switch APIs for other DOM apis…. Do we?
>> 
>> We haven't really had any other pieces of hardware which a page could want to
>> switch on/off so I'm not sure the question really applies.
>> 
>> / Jonas




More information about the whatwg mailing list