Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.navigator.geolocation.getCurrentPosition() gets http 400 response - Not clear that Dartium doesn't support geolocation #15866

Closed
DartBot opened this issue Jan 2, 2014 · 5 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jan 2, 2014

This issue was originally filed by @terrasea


What steps will reproduce the problem?

  1. Use the code below

window.navigator
      .geolocation.getCurrentPosition()
        ..then((pos) {
          window.alert(pos.toString());
        })
        ..catchError((PositionError error) {
          window.alert("Error code: ${error.code}, Error message: ${error.message}");
        })
        ..whenComplete(() => window.alert("complete"))
2. run it in Dartium launched from DartEditor

What is the expected output?


I expect to see a window alert with my current position as the message

What do you see instead?


"Error code: 2, Error message: Network location provider at 'https://www.googleapis.com/' : Returned error code 400."

Dartium version info


Chromium 31.0.1650.48 (Developer Build 240209)
OS Linux
Blink 537.36 (@­164190)
JavaScript V8 3.21.18.2
Dart 1.1.0-dev.5.0
Flash (Disabled)
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.48 (Dart) Safari/537.36
Command Line /home/terrasea/share/dart/chromium/chrome --remote-debugging-port=42085 --user-data-dir=/home/terrasea/.dartium --enable-experimental-webkit-features --enable-devtools-experiments --no-first-run --no-default-browser-check --no-process-singleton-dialog --flag-switches-begin --enable-devtools-experiments --flag-switches-end chrome://version/
Executable Path /home/terrasea/share/dart/chromium/chrome
Profile Path /home/terrasea/.dartium/Default
Variations b178bdde-887f97ea
b03ddc1f-2d9ef0cc
f9b252d0-fd526c81
262f996f-eeefeb17
24dca50e-837c4893
ca65a9fe-91ac3782
5e29d81-cf4f6ead
246fb659-a90023b1
f296190c-24dd8f80
4442aae2-a90023b1
ed1d377-e1cc0f14
75f0f0a0-d7f6b13c
e2b18481-cdc3d902
e7e71889-e1cc0f14

OS and machine details.


Linux james-laptop 3.8.0-rc2 #­11 SMP PREEMPT Thu Jan 2 18:05:49 NZDT 2014 x86_64 Intel(R) Core(TM) i5-3317U CPU @­ 1.70GHz GenuineIntel GNU/Linux

Additional information.


This same code, when run through "pub serve" or "pub build" works perfectly fine on Google Chrome and Firefox.

@DartBot
Copy link
Author

DartBot commented May 14, 2014

This comment was originally written by pcornel...@orchit.de


Hmm, no update on this bug for months? This is sad, how are we supposed to create apps with geolocation, when this is not fixed? :-(
Compiling after each change is not really feasible due to the long compilation time...
I can't imagine that the reason for the bug is too complicated, as it seems to work in chrome.

@sethladd
Copy link
Contributor

Unfortunately, Chromium (and thus Dartium) don't support geolocation. Chrome does, because it needs to make a call back to a server resource. In the meantime, the solution is to run pub serve and iterate with Chrome. Apologies for the troubles.

@DartBot
Copy link
Author

DartBot commented May 14, 2014

This comment was originally written by corneli...@pcornelissen.de


wouldn't it make sense to return null for navigator.geolocation, so you can detect the missing feature in the code easier?
AFAIK is that how feature detection for browser features works in JS. (But I'm not a big JS fan, so it may be different)

@sethladd
Copy link
Contributor

Thanks for the suggestion. Agreed that it should be easier to detect that geolocation is not supported in Dartium, so the developer gets feedback earlier. Maybe print something to the console? Or throw an exception?

CC'ing others for ideas.


cc @jacob314.
cc @a-siva.
Changed the title to: "window.navigator.geolocation.getCurrentPosition() gets http 400 response - Not clear that Dartium doesn't support geolocation".

@DartBot
Copy link
Author

DartBot commented Oct 1, 2014

This comment was originally written by cedric.po...@parisiandream.com


Any ideas when the bug will be fixed? It's too bad that we have first to compile in JavaScript before testing our app. Not really convenient for a location-based app.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants