7a02b4f0a8
Document the data collection of the study. |
||
---|---|---|
.circleci | ||
analysis | ||
extension | ||
.eslintrc.js | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
README.md | ||
package-lock.json | ||
package.json |
README.md
Shield Study: JavaScript Errors
A Shield study to test collecting JavaScript errors thrown by Firefox chrome code (not errors from webpages themselves).
Overview
This study listens for browser chrome errors being logged to the Browser
Console. It then computes a hash based on the error type, name, and stack
trace, and sends that hash in a shield-study-addon
Telemetry ping along with
the user's client ID and environment information.
The purpose of the study is to measure the amount and distribution of browser chrome errors in a privacy-respectful way. The data will be used to create a prototype for collecting these errors to aid in Firefox development.
Dashboards
Preferences
-
extensions.shield-study-js-errors@shield.mozilla.org.testing
- If true, mark Telemetry pings sent by the client as test pings.
-
extensions.shield-study-js-errors@shield.mozilla.org.submitIntervalMs
- Interval (in milliseconds) at which to submit collected error hashes to telemetry.
-
extensions.shield-study-js-errors@shield.mozilla.org.expirationDate
- Date.parse-compatible string specifying the datetime that the experiment should expire and automatically uninstall itself. Defaults to January 1st, 2018.
-
extensions.shield-study-js-errors@shield.mozilla.org.expirationIntervalMs
- Interval (in milliseconds) at which to check whether the study has expired or not. Defaults to once per day.
Data Collection
The study collects errors by listening to all messages that are being logged to the Browser console and filtering out non-error messages. Then, it filters out errors with categories that the Web console displays, leaving only errors from the Firefox UI itself.
Telemetry Ping Example
Once an hour, if any errors were captured, a Telemetry ping is sent with environmental data and a payload that looks like this:
{
"version": 3,
"study_name": "shield-study-js-errors",
"branch": "default",
"addon_version": "0.1.0",
"shield_version": "unset",
"type": "shield-study-addon",
"data": {
"attributes": {
"fingerprints": "[{\"fingerprint\":\"q35iauGpeCg8FIHj4ptetoBxjIdkuyQi2InIkNpd3AYLwSH7RS44By4CbrPVH0yA\",\"utcTimestampMs\":1512683455924}]",
"utcTimestampMs": "1512683575918"
}
},
"testing": false
}
The study specific fields are:
data.attributes.fingerprints
- A JSON string encoding a list of objects. Each object has a fingerprint, which is a SHA384 hash of the an error type, message, and stacktrace, and a timestamp indicating when the error occurred.
data.attributes.utcTimestampMs
- A timestamp indicating when the ping was sent. This is used to deal with inaccurate local time on the client.
Development
To build the add-on, run the make
command:
$ make
This will create a shield-study-js-errors.xpi
file in the root of the repo
containing the add-on.
To test this, you will either need to get the add-on signed by the Mozilla Extension key, or disable the following preferences on a copy of Firefox Nightly:
xpinstall.signatures.required
extensions.allow-non-mpc-extensions
Linting can be run on the add-on using make lint
:
$ npm install # If they haven't been installed yet
$ make lint
License
Shield Study: JavaScript Errors is licensed under the MPLv2. See the LICENSE
file for details.