Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/main.js

Issue 8559070: Integrated URL Fixer into Adblock Plus (Closed)
Patch Set: First batch of changes Created Nov. 9, 2012, 1:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");
Wladimir Palant 2012/11/09 13:20:51 I think this should be added below so that its sta
let {TimeLine} = require("timeline");
TimeLine.enter("Adblock Plus startup");
@@ -26,6 +27,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()

Powered by Google App Engine
This is Rietveld