When attemping to use HTML5 Geolocation method, I consistently get TIMEOUT errors when using Chrome. I know similar questions have been asked, but all answers I've read direct the developer to use HTTPS & not a local env (ie: file:///).
I'm testing with the exact code sample from the Example block at Mozilla Geolocation.getCurrentPosition().
I'm using Chrome Version 54.0.2840.98 (64-bit).
I am using SSL / HTTPS (not self-signed, cert has valid cert auth).
I have confirmed the Location Service is allowed for the domain in question in Chrome Preferences.
I have successfully tested the same code using Safari.
I have tried with & without a valid Google API key with no difference.
I have enabled Google API Billing for the specific project that this API key is tied to in Google Dev Console.
Here's a screen shot of the error in console.
I don't know where else to look or what to try. Any help is greatly appreciated.
Related
I'm developping a website which is meant to be used on mobile devices using Google Chrome, the purpose is to list information such as time (hh:mm) and battery level.
I saw the Battery Web API but I'm experiencing a strange error:
click to see the chrome error
Here is the code I used in order to get the battery level:
navigator.getBattery().then(function (battery) {
console.log(Math.round(battery.level * 100))
});
I had the error yesterday, without changing any line of code, it is working today on my tablet (chrome version: 103), but I tested on another tablet (Samsung Galaxy TAB A7 LITE, Chrome version: 103) and I encounter the error, I restarted several times the devices, inspected pages using the devtools connected by cable to my laptop, but I can't solve this error.
I saw a topic having the same error but he was developing a web worker it is not the same context as I.
No matter when I'm calling the navigator.getBattery() if the error appeared in the beginning it will stay undefined later, so it is not a problem of timing to call it (I even bound it to the body.onload but it didn't work).
I thought it could be authorization issues on system information but there's nothing refering to the battery which is not authorized in the application settings of Chrome.
Any help is welcome :D
I found out where my error was coming from.
It is a problem of HTTPS, my testing environment is configured behind a NGINX HTTP Server, which serves HTTP and HTTPS version of my application in order to use a single certificate for every of my projects, Chrome on my laptop prefix URLs I'm accessing with https:// and it is hidden in the navbar, but it is not the case on Chrome tablet or mobile, I thought I was consulting the HTTPS version but it was HTTP, and Battery Web API isn't accessible on HTTP websites, it is required to have a secure connection using HTTPS and certificates. It has nothing to do with version number since Battery Web API is fully supported since Chrome version 38 according to MDN Documentation.
I've searched and searched but I guess I can't find the answer I'm looking for.
I'm working on a web app with Google maps and I am having a lot of difficulties trying to debug and test it. I finally found out why I keep getting errors due to chrome blocking calls made not via HTTPS. The app works in Firefox, but not in chrome or any other browser I've tried, safari, dolphin, etc. (All works great locally of course)
What should I do? Is my only option to pay for SSL cert for my free hosting account that I'm using to test my app? I'm just a mid-level developer who isn't really ready to pay for hosting just yet... Am I missing something super common that most developers take advantage of in terms of having some solid way of testing? Hopefully, that makes sense!
try using https://ngrok.com/ it might work out.
It tunnels your local url to public with https too.
For Chrome, there is a flag for this at chrome://flags/#allow-insecure-localhost.
Click on Enable and restart Chrome. From now on invalid certificates on localhost (and just on https over localhost) are accepted.
I have recently updated my desktop chrome and mobile android chrome.
Since that I have trouble getting my location. It doesn't work with my website JS geolocation script nor here:
http://html5demos.com/geo
It just says failed. I have tried removing location access privilege and changing to ask but it doesn't work.. Any idea what is the reason for that.
You will need to have WAMP accept requests on port 443 and create a certificate in order for the browsers to not complain. There are detailed instructions here: http://www.lmhproductions.com/31/how-to-setup-ssl-on-wamp/
I've started fiddling around with U2F and it's looking really promising. Got myself some security keys and started digging into it.
I've managed to create a working register/login demo website which works well using the U2F tokens and the U2F Chrome extension.
However... and this is where my question arises:
I've also enrolled a security key for my Google account and immediately got struck by the fact that it works without using the U2F Chrome extension. As a matter of fact I've done all the Google enrollment and logins without even having the extension installed. How is this possible? I've read (some of) the FIDO specifications and saw that there may be two API levels: high - which is the u2f namespace exposed by the extension and - and low - which involves using MessagePort API. Maybe this is how Google does it? (also tried doing a chrome.runtime.connect(...) myself, but the chrome.runtime object is undefined in my web page)
Any pointer in the proper direction would be appreciated and of great value at this moment, as there aren't many resources available on this young project called U2F.
Chrome is white listing Google domains. Non-Google domains has to use the extension for now. However, this will change "very soon" according to Google -- this is documented here and mentioned by a Google developer in this webinar.
Edit: The extension is no longer required with Chrome 41. You can test it out here (Note: When accessed from and older version of Chrome, or not via HTTPS, the site will fall back to using the extension).
I am using a WebRTC demo application for screen sharing. The demo works perfectly fine but when I try to run the same code in localhost or my own remote server, the code doesn't run.
Any ideas on how can I fix this issue?
Screensharing in Chrome only works over an SSL connection(). You can use a self-signed cert and simply accept it in your browser(this is for Chrome < M36).
Also, for Chrome >M36 you must now use the Chrome.desktopcapture API and the usual way of modifying media constraints and enabling screen-sharing in Chrome internals will not work in newer versions of chrome.
The API is farely simple and MUCH more robust than the previous given option in the media constraints.