Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31721

Re: Peripheral access on mobile

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Peripheral access on mobile
Date 2016-11-14 17:59 +0100
Organization PointedEars Software (PES)
Message-ID <1651717.tdWV9SEqCh@PointedEars.de> (permalink)
References <42dacdf0-1e67-4f2e-89c0-26fad7443da8@googlegroups.com> <mkmj2ch33jbnond5r7bfieqoqchs6q63sm@4ax.com>

Show all headers | View raw


Tim Slattery wrote:

> bit-naughty@hotmail.com wrote:
>> I've asked this question here before, but.... what progress on letting
>> mobile Firefox access the mic, GPS etc?
> 
> I don't know about the mic, but there's been a geolocation facility in
> HTML5 for quite a few years now.
> http://www.w3schools.com/html/html5_geolocation.asp or google it on
> your own.

As I have said many times before, W3Schools is not a reliable development 
resource, and this is just one more example of that.  

“navigator.geolocation.getCurrentPosition()” does _not_ throw an exception 
except when the method itself is not implemented, and probability of that is 
low if, as the previous test ascertained, “navigator.geolocation” is a true-
value.  So the example code and the explanation there are bogus.  Instead, 
the second argument to getCurrentPosition() can be a reference to a function 
that is called if an error occurs.

Also, Geolocation support stopped working in Chrome for sites that were not 
served via HTTPS recently (there is a message in the console saying that if 
you do not provide an error callback; otherwise the “message” property of 
the PositionError instance says so), and the same appears to be true for 
(Mobile) Firefox.  That is, if getCurrentPosition() is called in Firefox, 
user authorization is requested, but if confirmed, nothing happens; in 
Chrome, not even the authorization dialog is displayed.  (I have seen that 
on the homepage of my Web site which is not served via HTTPS yet.)

<https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation>

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Peripheral access on mobile bit-naughty@hotmail.com - 2016-11-14 05:17 -0800
  Re: Peripheral access on mobile Tim Slattery <tim@risingdove.com> - 2016-11-14 10:40 -0500
    Re: Peripheral access on mobile Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-11-14 17:59 +0100
      Re: Peripheral access on mobile "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-11-15 23:51 -0800
  Re: Peripheral access on mobile JJ <jj4public@vfemail.net> - 2016-11-15 18:17 +0700

csiph-web