Bug 1894958: Collect the canvas values in telemetry r=timhuang,data-stewards

Differential Revision: https://phabricator.services.mozilla.com/D209597
This commit is contained in:
Tom Ritter 2024-06-04 21:23:59 +00:00
parent 85397dac40
commit 15f2c70c51
4 changed files with 329 additions and 24 deletions

View file

@ -190,8 +190,39 @@ export class UserCharacteristicsPageService {
for (let gamepad of data.output.gamepads) {
Glean.characteristics.gamepads.add(gamepad);
}
Glean.characteristics.zoomCount.set(await this.populateZoomPrefs());
try {
Glean.characteristics.canvasdata1.set(data.output.canvas1data);
Glean.characteristics.canvasdata2.set(data.output.canvas2data);
Glean.characteristics.canvasdata3.set(data.output.canvas3data);
Glean.characteristics.canvasdata4.set(data.output.canvas4data);
Glean.characteristics.canvasdata5.set(data.output.canvas5data);
Glean.characteristics.canvasdata6.set(data.output.canvas6data);
Glean.characteristics.canvasdata7.set(data.output.canvas7data);
Glean.characteristics.canvasdata8.set(data.output.canvas8data);
Glean.characteristics.canvasdata9.set(data.output.canvas9data);
Glean.characteristics.canvasdata10.set(data.output.canvas10data);
Glean.characteristics.canvasdata11Webgl.set(data.output.glcanvasdata);
Glean.characteristics.canvasdata12Fingerprintjs1.set(
data.output.fingerprintjscanvas1data
);
Glean.characteristics.canvasdata13Fingerprintjs2.set(
data.output.fingerprintjscanvas2data
);
for (let gamepad of data.output.gamepads) {
Glean.characteristics.gamepads.add(gamepad);
}
} catch (e) {
// Grab the exception and send it to the console
// (we don't see it otherwise)
lazy.console.debug(e);
// But still fail
throw e;
}
lazy.console.debug("Unregistering actor");
Services.obs.notifyObservers(
null,

View file

@ -26,6 +26,10 @@ function debug(...args) {
let stringifiedArgs = args.map(stringify);
msg += stringifiedArgs.join(" ");
debugMsgs.push(msg);
// Also echo it locally
/* eslint-disable-next-line no-console */
console.log(msg);
}
// ==============================================================
@ -541,10 +545,40 @@ LocalFiraSans.load().then(font => {
populateTestCanvases();
populateWebGLCanvases();
populateFingerprintJSCanvases();
});
debug("Debug Line");
debug("Another debug line, with", { an: "object" });
let output = {};
debug("Sizes of canvas extractions:");
for (let id of [
"canvas1data",
"canvas2data",
"canvas3data",
"canvas4data",
"canvas5data",
"canvas6data",
"canvas7data",
"canvas8data",
"canvas9data",
"canvas10data",
"glcanvasdata",
"fingerprintjscanvas1data",
"fingerprintjscanvas2data",
]) {
let obj = document.getElementById(id);
debug(id, obj.value.length);
output[id] = obj.value;
}
document.dispatchEvent(
new CustomEvent("UserCharacteristicsDataDone", {
bubbles: true,
detail: {
debug: debugMsgs,
output,
},
})
);
});
// A hacky way to ensure all GamePad related services are running by the time we
// want to know about GamePads. This will attach a listener for this window to
@ -556,18 +590,3 @@ debug("Another debug line, with", { an: "object" });
// for gamepads attached to the machine. We need to give that background thread
// time to run so all the data is there when we request it.
navigator.getGamepads();
// The first time we put a real value in here, please update browser_usercharacteristics.js
let output = {
foo: "Hello World",
};
document.dispatchEvent(
new CustomEvent("UserCharacteristicsDataDone", {
bubbles: true,
detail: {
debug: debugMsgs,
output,
},
})
);

View file

@ -1047,6 +1047,266 @@ characteristics:
data_sensitivity:
- interaction
canvasdata1:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a simple organge box and used as a control image
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata2:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a bordered triage, and used to test point interpolation
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata3:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a stretched photographic image, used to test image operations.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata4:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is two rotated, semi-transparenct overlapping squares, used to test transparency and point interpolation.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata5:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a local font rendered normally.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata6:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a local font rendered with italics, rotation, and shadow-blur.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata7:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a system-ui font rendered normally.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata8:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a system-ui font rendered with italics, rotation, and shadow-blur.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata9:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a font shipped with Firefox rendered normally.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata10:
type: text
description: >
The base64 encoded form of an image rendered on a canvas. The image is a font shipped with Firefox rendered with italics, rotation, and shadow-blur.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata11_webgl:
type: text
description: >
The base64 encoded form of an image rendered on a WebGL canvas (instead of Canvas2D). IT is a RGB gradient cube.
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata12_fingerprintjs1:
type: text
description: >
The base64 encoded form of an image rendered on a canvas, it is a copy of fingerprintjs' text canvas
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
canvasdata13_fingerprintjs2:
type: text
description: >
The base64 encoded form of an image rendered on a canvas, it is a copy of fingerprintjs' geometry canvas
lifetime: application
send_in_pings:
- user-characteristics
notification_emails:
- tom@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
- https://bugzilla.mozilla.org/show_bug.cgi?id=1894958
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=xxx
expires: never
data_sensitivity:
# Text metrics are _required_ to be web_activity or highly_sensitive, so even though this
# is more like 'technical' (per the Data Review), I'm marking highly sensitive.
- highly_sensitive
font_size_monospace_modified:
type: quantity
unit: int

View file

@ -17,12 +17,7 @@ function promiseObserverNotification() {
submitted = true;
// Did we assign a value we got out of about:fingerprinting?
// For now, we are sticking the test value in a random telemetry
// metric, but once we have a real metric, we'll update this
Assert.equal(
"Hello World",
Glean.characteristics.timezone.testGetValue()
);
Assert.notEqual("", Glean.characteristics.canvasdata1.testGetValue());
});
GleanPings.userCharacteristics.submit();