Bug 1374289 - Click-to-play rollout: stop watching for pref changes after the first change has been noticed. r=bsmedberg
MozReview-Commit-ID: 367MfF0INfV
--- a/browser/extensions/clicktoplay-rollout/bootstrap.js
+++ b/browser/extensions/clicktoplay-rollout/bootstrap.js
@@ -125,19 +125,20 @@ function setCohort(cohortName) {
try {
if (Ci.nsICrashReporter) {
Services.appinfo.QueryInterface(Ci.nsICrashReporter).annotateCrashReport("CTPCohort", cohortName);
}
} catch (e) {}
}
function watchForPrefChanges() {
- Preferences.observe(PREF_FLASH_STATE, function() {
+ Preferences.observe(PREF_FLASH_STATE, function prefWatcher() {
let currentCohort = Preferences.get(PREF_COHORT_NAME, "unknown");
setCohort(`user-changed-from-${currentCohort}`);
+ Preferences.ignore(PREF_FLASH_STATE, prefWatcher);
});
}
function install() {
}
function shutdown(data, reason) {
}
--- a/browser/extensions/clicktoplay-rollout/install.rdf.in
+++ b/browser/extensions/clicktoplay-rollout/install.rdf.in
@@ -5,17 +5,17 @@
#filter substitution
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>clicktoplay-rollout@mozilla.org</em:id>
- <em:version>1.1</em:version>
+ <em:version>1.2</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<!-- Target Application this theme can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>