How can I use HTML5 geolocation in the C # application?

advertisements

I'm developing an anti-theft software to get computers exact location. Notebooks with built-in gps are very rare in my country so I have to use HTML5 Geolocation in my application.

For Internet Explorer 9+, there is a registry key that you can add urls to allow a url without needing user verification. If you add an REG_DWORDvalue named domain.com under HKCU\Software\Microsoft\Internet Explorer\Geolocation\HostConsent path browser will allow geolocation request automatically. However I can't run Internet Explorer hidden so thats not working for me since thief shouldn't realize and see what's going on.

  • I need to run Internet Explorer hidden somehow
  • ...or I need to embed webkit or something to my application but I don't know how can I use it or how can I allow this request programmatically.

I prefer second way because Internet Explorer is now terminated by Microsoft and I think next version will have different structure.

How can I embed and use Webkit or GeckoFX to my application? How can I allow a geolocation request programmatically in this application?


Relying on a hidden browser is a risky solution, and it will inevitably break at some point in the future.

Instead you want to build geolocation functionality into your own application. The two major sources of location info are your IP address (which you then feed into any of the GeoIP providers) and cellular/Wi-Fi stations visible (which you feed into Google geolocation API).