New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 630305 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

No way to determine if geolocation API is blocked by user or browser (origin type)

Reported by the.assi...@gmail.com, Jul 21 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce the problem:
Refer to https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

Since Chrome 50, HTTP origins are not allowed to access (among other things) the geolocation API. The above page provides rationale on why this was done, as well as a method to detect if geolocation has been disabled by the browser due to an insecure origin. Unfortunately, as the page itself notes, this detection method is "quite brittle", using a hard-coded English-language string to determine whether the user or the browser blocked the geolocation request. A far better option would be to return a discrete error code that allows developers to distinguish this case.

I suggest an additional field on the PositionError interface, something like PERMISSION_DENIED_INSECURE_ORIGIN = 4. Alternatively the navigator.geolocation property could be undefined on insecure origins (because let's face it, if the API is inaccessible due to browser security restrictions, it might as well not be there at all). Either way, this would give developers a sure way to know that they cannot depend on geolocation being available.

What is the expected behavior?

What went wrong?
N/A

Did this work before? N/A 

Chrome version: 51.0.2704.103  Channel: stable
OS Version: 8.1 x64
Flash Version: Shockwave Flash 22.0 r0
 

Comment 1 by ajha@chromium.org, Jul 22 2016

Cc: paulkinlan@chromium.org ajha@chromium.org
Components: Blink>Location
Labels: M-54
Status: Untriaged (was: Unconfirmed)
Marking 'Untriaged' as feature request and Cc'ing Paul for more inputs on this.

Comment 2 by mcasas@chromium.org, Mar 13 2017

Submitted https://github.com/w3c/geolocation-api/issues/11
since this is a Spec-bug more than an implementation bug.

Comment 3 by scheib@chromium.org, Mar 22 2017

Status: WontFix (was: Untriaged)
Spec issue is the correct location for this.
Components: Blink>Geolocation
Components: -Blink>Location

Sign in to add a comment