By running the code below I have proven that Firefox on Android continues to track the user's location even when the phone is off and/or Firefox has been moved to the background and another App is in the foreground. How can the user tell that this espionage is occurring?
Should not a privilege/user-approval be required for this?
Why is Firefox the only browser with this vulnerability?
<!DOCTYPE html>
<html>
<body>
<p>Wait 5 secs.</p><br />
<p id="out"></p>
<script>
function success(position){
var x = document.getElementById("out");
x.innerHTML += position.timestamp+" GPS "+Date() + "<br />";
}
function failure(error){
var x = document.getElementById("out");
x.innerHTML += error+" Error "+Date() + "<br />";
}
document.getElementById("out").innerHTML = "Start "+Date()+"<br />";
if (document.addEventListener){
document.addEventListener("visibilitychange", function() {
var x = document.getElementById("out");
x.innerHTML += document.visibilityState +Date() + "<br />";
})
} else {
document.attachEvent("onvisibilitychange", function() {
var x = document.getElementById("out");
x.innerHTML += document.visibilityState +Date() + "<br />";
})
}
setTimeout(function(){
var x = document.getElementById("out");
x.innerHTML += "Timeout "+Date() + "<br />";
}, 5000);
trackerId = navigator.geolocation.watchPosition(success, failure, {
enableHighAccuracy: true
});
</script>
</body>
</html>
Is Firefox wrong or all the other browsers wrong? – Richard Maher May 26 '16 at 06:29