UwpWebView is the IWebView implementation used by 3D WebView for UWP / Hololens. It also includes additional APIs for UWP-specific functionality.
static void SetGeolocationEnabled(bool enabled)
By default, web pages cannot access the device's geolocation via JavaScript. However, geolocation access can be granted to all web pages via the following steps:
UwpWebView.SetGeolocationEnabled(true)
at the start of the app.If all three of those conditions are met, then when a web page tries to access a location API, the system will present the user with a popup to allow or deny location access. If the user allows access, then all web pages will be able to access the device location.
void Awake() {
#if UNITY_WSA && !UNITY_EDITOR
UwpWebView.SetGeolocationEnabled(true);
#endif
}