Path: csiph.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Peripheral access on mobile Supersedes: <4242147.GXAFRqVoOG@PointedEars.de> Date: Mon, 14 Nov 2016 17:59:51 +0100 Organization: PointedEars Software (PES) Lines: 37 Message-ID: <1651717.tdWV9SEqCh@PointedEars.de> References: <42dacdf0-1e67-4f2e-89c0-26fad7443da8@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1479142791 2954 eJwFwQkBwDAIA0BL/OnkFEr8S9hdemkNorIimTx6W7eNeA9ydc2wD73ni9VpEQ5y6QJ1tv0wkxGy (14 Nov 2016 16:59:51 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 14 Nov 2016 16:59:51 +0000 (UTC) User-Agent: KNode/4.14.2 Cancel-Lock: sha1:Ghzailp+ing5ndE4WxAlydvHJuI= X-User-ID: eJwFwYEBwDAEBMCV8PGacQj2H6F3DipfHDqPr297ycU+pbxyrGVArKh9R9V6oae/BkcWRk5omCezEiMyP0sMFUE= X-NNTP-Posting-Host: eJwFwYkNwDAIBLCVgnoPjJOA2H+E2vwUakMUuNxzoePst9U9ULT1krMjXldMhZ4k2IHc+QEe4RDt Cancel-Key: sha1:0sd2CjWx9jkl0L6r/erBf9PBjCs= Xref: csiph.com comp.lang.javascript:31721 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.) -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.