| Index: lib/main.js |
| =================================================================== |
| --- a/lib/main.js |
| +++ b/lib/main.js |
| @@ -11,6 +11,7 @@ |
| Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
| Cu.import("resource://gre/modules/Services.jsm"); |
| +let {Prefs} = require("prefs"); |
| let {TimeLine} = require("timeline"); |
| TimeLine.enter("Adblock Plus startup"); |
| @@ -26,6 +27,39 @@ |
| TimeLine.log("Done loading sync support"); |
| require("ui"); |
| TimeLine.log("Done loading UI integration code"); |
| +if (!Prefs.correctTyposAsked || (Prefs.correctTyposAsked && Prefs.correctTypos)) |
| +{ |
| + // Do not ask to opt-in if user found setting |
| + if (!Prefs.correctTyposAsked) |
| + { |
| + let onPrefChange = function(name) |
| + { |
| + if (name == "correctTypos") |
| + { |
| + Prefs.correctTyposAsked = true; |
| + Prefs.removeListener(onPrefChange); |
| + } |
| + } |
| + |
| + Prefs.addListener(onPrefChange); |
| + } |
|
Wladimir Palant
2012/11/09 14:44:31
I'm not really happy with advanced logic being mov
|
| + |
| + require("typoFixer"); |
| + TimeLine.log("Done loading typo correction"); |
| +} |
| +else |
| +{ |
| + let onPrefChange = function(name) |
| + { |
| + if (name == "correctTypos") |
| + { |
| + require("typoFixer"); |
| + Prefs.removeListener(onPrefChange); |
| + } |
| + } |
| + |
| + Prefs.addListener(onPrefChange); |
| +} |
| TimeLine.leave("Started up"); |
| function registerPublicAPI() |