JavaScript Restrictor
Browser extension that improves privacy and security
Loading...
Searching...
No Matches
wrappingS-SENSOR-LIGHT.js File Reference

Wrappers for the Ambient Light Sensor. More...

Variables

var hc = sensorapi_prng_functions + drawIlluminance + init_data
 
var wrappers
 

Detailed Description

Wrappers for the Ambient Light Sensor.

See also
https://www.w3.org/TR/ambient-light/
Author
Copyright (C) 2021 Radek Hranicky
License:
SPDX-License-Identifier: GPL-3.0-or-later

MOTIVATION The AmbientLightSensor returns illuminance of the device's environment. This is another value that describes the nearby physical surrounding of the device, and can thus be used together with other readings for creating a unique fingerprint.

WRAPPING On examined stationary devices inside an office, the illuminance measured was between 500 and 900, depending on the concrete position's light conditions. All measured values were rounded to nearest 50 illuminance value. The wrapper silumlates the same behavior. At start, a pseudorandom illuminance value is drawn. As we simulate a stationary device, this value remains constant for all AmbientLightSensor.prototype.illuminance calls.

POSSIBLE IMPROVEMENTS Simulation of changes in the illuminance.

Variable Documentation

◆ hc

var hc = sensorapi_prng_functions + drawIlluminance + init_data

◆ wrappers

var wrappers
Initial value:
= [
{
parent_object: "AmbientLightSensor.prototype",
parent_object_property: "illuminance",
wrapped_objects: [],
post_wrapping_code: [
{
code_type: "object_properties",
parent_object: "AmbientLightSensor.prototype",
parent_object_property: "illuminance",
wrapped_objects: [],
wrapped_properties: [
{
property_name: "get",
property_value: `
function() {
return illuminance;
}`,
},
],
}
],
},
]
var helping_code
Definition wrappingS-H-C.js:86
var wrappers
Definition wrappingS-SENSOR-LIGHT.js:68
var hc
Definition wrappingS-SENSOR-LIGHT.js:66
function add_wrappers(wrappers)
Definition wrapping.js:50