Bug 1390433 - (From 1386120)Flip "dom.forms.autocomplete.formautofill" according to the availability of Form Autofill feature.
MozReview-Commit-ID: 3kyDsQL15SO
--- a/browser/extensions/formautofill/bootstrap.js
+++ b/browser/extensions/formautofill/bootstrap.js
@@ -37,19 +37,25 @@ function onMaybeOpenPopup(evt) {
return;
}
insertStyleSheet(domWindow, STYLESHEET_URI);
}
function startup() {
if (Services.prefs.getStringPref("extensions.formautofill.available") != "on") {
+ Services.prefs.clearUserPref("dom.forms.autocomplete.formautofill");
return;
}
+ // 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);
+
// Listen for the autocomplete popup message to lazily append our stylesheet related to the popup.
Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
let parent = new FormAutofillParent();
parent.init().catch(Cu.reportError);
Services.ppmm.loadProcessScript("data:,new " + function() {
Components.utils.import("resource://formautofill/FormAutofillContent.jsm");
}, true);