Bug 1521947 - add telemetry to know what default blocking-autoplay setting users usually use. r=johannh,janerik

Add a scalar 'autoplay_default_blocked' which records a boolean value which indicates whether user is blocking autoplay by default.

Differential Revision: https://phabricator.services.mozilla.com/D17298

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alastor Wu 2019-01-24 18:44:09 +00:00
parent eb81fdc3cb
commit d7fbbec18a
2 changed files with 22 additions and 0 deletions

View File

@ -1369,6 +1369,12 @@ BrowserGlue.prototype = {
Services.prefs.addObserver("urlclassifier.trackingTable", this._matchCBCategory);
Services.prefs.addObserver("network.cookie.cookieBehavior", this._matchCBCategory);
Services.prefs.addObserver(ContentBlockingCategoriesPrefs.PREF_CB_CATEGORY, this._updateCBCategory);
Services.prefs.addObserver("media.autoplay.default", this._updateAutoplayPref);
},
_updateAutoplayPref() {
let blocked = Services.prefs.getIntPref("media.autoplay.default", 1);
Services.telemetry.scalarSet("media.autoplay_default_blocked", blocked);
},
_matchCBCategory() {

View File

@ -951,6 +951,22 @@ media:
- main
- content
autoplay_default_blocked:
bug_numbers:
- 1521947
description: >
Whether the user blocked autoplay by default. Recorded when the preference is toggled.
expires: "72"
kind: boolean
notification_emails:
- cpearce@mozilla.com
- alwu@mozilla.com
- nohlmeier@mozilla.com
release_channel_collection: opt-out
record_in_processes:
- main
- content
# The following section contains content process base counters.
dom.contentprocess:
buildID_mismatch: