Index: lib/main.js |
=================================================================== |
--- a/lib/main.js |
+++ b/lib/main.js |
@@ -14,6 +14,8 @@ |
let {TimeLine} = require("timeline"); |
TimeLine.enter("Adblock Plus startup"); |
+let {Prefs} = require("prefs"); |
+TimeLine.log("Done loading preferences"); |
registerPublicAPI(); |
TimeLine.log("Done registering public API"); |
require("filterListener"); |
@@ -26,6 +28,24 @@ |
TimeLine.log("Done loading sync support"); |
require("ui"); |
TimeLine.log("Done loading UI integration code"); |
+if (!Prefs.correctTyposAsked || (Prefs.correctTyposAsked && Prefs.correctTypos)) |
+{ |
+ 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() |