WebPirate icon indicating copy to clipboard operation
WebPirate copied to clipboard

GPS / Location support

Open smurfy opened this issue 9 years ago • 5 comments

Basically support for the geolocation api is not implemented yet.

See: http://dev.w3.org/geo/api/spec-source.html

The important part would be: navigator.geolocation.getCurrentPosition But i guess adding navigator.geolocation.watchPosition and navigator.geolocation.clearWatch should be possible too.

The hard part probably is integrating it to the gui, similar to the default browser.

smurfy avatar Mar 06 '15 11:03 smurfy

Ok, I will implement it, thanks for reporting!

Dax89 avatar Mar 06 '15 12:03 Dax89

Geolocation is unsupported in QtWebKit, I can't implement this feature. navigator.geolocation object in "undefined"

Dax89 avatar Mar 08 '15 13:03 Dax89

I'm no webkit expert and also don't know the performance impact, but its possible to inject additional objects to a webkit instance,

So in theory it should be possible to set navigator.geolocation with a custom js object.

I also found this: https://together.jolla.com/question/17380/html5-geolocation-in-webview/

I understand if you dont implement this feature. If i find the time i will do a quick test, to figure out if its possible using javascript injects.

smurfy avatar Mar 08 '15 13:03 smurfy

I've already tried to inject a custom made Geolocation object :) It works only if "navigator.geolocation" is called before "onload" event, but it fails when this one is invoked before that event (for example, inside a <head> tag), that's the case of 99% of websites.

The link on Jolla Together mentions Qt WebEngine that uses Blink and replaces and aging QtWebKit, this library is available in Qt >= 5.4

If someone finds a way to inject custom objects in a WebKit instance, globally, it would be great.

I want to implement all features requested here, but QtWebKit is very limited and sometimes is simply not possible (in fact I'm leaving those issues opened).

As I said in issue #30, I'm working on an experimental version of WebPirate that uses Chromium Embedded, in that case I can implement Geolocation and more :)

Dax89 avatar Mar 08 '15 14:03 Dax89

yea, useing chromium embedded or Qt WebEngine would be the better solution.

smurfy avatar Mar 08 '15 23:03 smurfy