I am trying to move my code for navigator.geolocation in a web worker.
I tried it with Chrome and Safari but getting \'undefined\' on
var isGPSSupported =
The 'navigator' object is supported, however it only contains four properties: appName, appVersion, userAgent, and platform.
From looking at your code, it appears you are trying to track the user's location as it changes. You do not have to use web workers to accomplish this. You can simply monitor the user's location on the main thread using watchPosition(), which will automatically notify a callback function whenever the user's location changes:
navigator.geolocation.watchPosition(function(position) {
document.getElementById('currentLat').innerHTML = position.coords.latitude;
document.getElementById('currentLon').innerHTML = position.coords.longitude;
});