diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 39e3b23cbf95..333a12ec5fa7 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -7411,6 +7411,23 @@ var gIdentityHandler = { SitePermissions.remove(gBrowser.currentURI, aPermission.id); this._permissionJustRemoved = true; this.updatePermissionHint(); + + // Set telemetry values for clearing a permission + let histogram = Services.telemetry.getKeyedHistogramById("WEB_PERMISSION_CLEARED"); + + let permissionType = 0; + if (aPermission.state == SitePermissions.ALLOW) { + // 1 : clear permanently allowed permission + permissionType = 1; + } else if (aPermission.state == SitePermissions.BLOCK) { + // 2 : clear permanently blocked permission + permissionType = 2; + } + // 3 : TODO clear temporary allowed permission + // 4 : TODO clear temporary blocked permission + + histogram.add("(all)", permissionType); + histogram.add(aPermission.id, permissionType); }); container.appendChild(img); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index f5d4c0482f3c..2345241fe16f 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -10203,5 +10203,14 @@ "bug_numbers": [1296606], "kind": "count", "description": "Number of named profiles." + }, + "WEB_PERMISSION_CLEARED": { + "alert_emails": ["firefox-dev@mozilla.org"], + "bug_numbers": [1286118], + "expires_in_version": "55", + "kind": "enumerated", + "keyed": true, + "n_values": 6, + "description": "Number of revoke actions on permissions in the control center, keyed by permission id. Values represent the permission type that was revoked. (0=unknown, 1=permanently allowed, 2=permanently blocked, 3=temporarily allowed, 4=temporarily blocked)" } }