User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Steps to reproduce: User-Agent: Mozilla/5.0 (Android 6.0.1; Mobile; rv:49.0) Gecko/49.0 Firefox/49.0 I entered a web site registering devicelight events. Actual results: The event.value readout is too verbose: 75.2131500244140625 lx 435.8228149414062500 lx 548.1655883789062500 lx 13 lx Expected results: The event.value readout should be rounded: 75 lx 435 lx 548 lx 13 lx Providing too verbose, non-rounded illuminance values can potentially open unexpected issues related to fingerprinting, tracking and data leaks (possibly similarly to http://lukaszolejnik.com/battery.pdf, but potentially more directly). It is also not necessary from a physical point of view. Please also see https://bugzilla.mozilla.org/show_bug.cgi?id=1124127
This comes after the over-precision of the BatteryStatus API returns in Mobile Firefox. (Bug: 1124127) It would be great if FF mobile had a systematic way of assessing whether sensor API returns are overly-precise.
Assignee: nobody → droeh
I can't actually reproduce this on a Nexus 6 running Android N (the values are already rounded to integers for me), but it's an easy enough fix regardless. This patch just rounds the event value before creating the DeviceLightEvent.
Attachment #8789500 - Flags: review?(snorp)
Attachment #8789500 - Flags: review?(snorp) → review+
I don't know if integer precision is still too much or not. Seems like it probably is, but this is a start.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/f41a22a14e0d Round event value before creating a DeviceLightEvent. r=snorp
tracking-fennec: ? → 51+
You need to log in before you can comment on or make changes to this bug.