Bug 1386959 - [Form Autofill] Add probe for form autofill availability. r=lchang,francois
MozReview-Commit-ID: KPOBxmHOiuK
--- a/browser/extensions/formautofill/bootstrap.js
+++ b/browser/extensions/formautofill/bootstrap.js
@@ -63,16 +63,17 @@ function isAvailable() {
}
function startup(data) {
if (!isAvailable()) {
Services.prefs.clearUserPref("dom.forms.autocomplete.formautofill");
// reset the sync related prefs incase the feature was previously available
// but isn't now.
Services.prefs.clearUserPref("services.sync.engine.addresses.available");
+ Services.telemetry.scalarSet("formautofill.availability", false);
return;
}
if (data.hasOwnProperty("instanceID") && data.instanceID) {
if (AddonManagerPrivate.isDBLoaded()) {
addUpgradeListener(data.instanceID);
} else {
// Wait for the extension database to be loaded so we don't cause its init.
@@ -84,16 +85,17 @@ function startup(data) {
} else {
throw Error("no instanceID passed to bootstrap startup");
}
// This pref is used for web contents to detect the autocomplete feature.
// When it's true, "element.autocomplete" will return tokens we currently
// support -- otherwise it'll return an empty string.
Services.prefs.setBoolPref("dom.forms.autocomplete.formautofill", true);
+ Services.telemetry.scalarSet("formautofill.availability", true);
// This pref determines whether the "addresses" sync engine is available
// (ie, whether it is shown in any UI etc) - it *does not* determine whether
// the engine is actually enabled or not.
Services.prefs.setBoolPref("services.sync.engine.addresses.available", true);
// Listen for the autocomplete popup message to lazily append our stylesheet related to the popup.
Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -781,16 +781,31 @@ gfx.advanced.layers:
kind: uint
expires: "61"
notification_emails:
- gfx-telemetry-alerts@mozilla.com
record_in_processes:
- 'main'
# The following section contains the form autofill related scalars.
+formautofill:
+ availability:
+ bug_numbers:
+ - 1386959
+ description: A boolean sent once per session to represent whether the formautofill is available in the build
+ expires: never
+ kind: boolean
+ notification_emails:
+ - autofill@lists.mozilla.org
+ - jcheng@mozilla.com
+ - chsiang@mozilla.com
+ release_channel_collection: opt-out
+ record_in_processes:
+ - 'main'
+
formautofill.addresses:
fill_type_manual:
bug_numbers:
- 990200
description: Count at submission time whether the submitted form was filled manually.
expires: never
kind: uint
notification_emails: