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

Unified Diff: lib/typoFixer.js

Issue 8433028: added hook function to appIntegration to handle function-overwrites from other extensions (Closed)
Patch Set: applied code review changes Created Sept. 28, 2012, 8:01 a.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/typoFixer.js
===================================================================
--- a/lib/typoFixer.js
+++ b/lib/typoFixer.js
@@ -143,7 +143,7 @@
function correctURL(window, value)
{
let hasCorrection = false;
-
+
value = value.trim();
if (value.length == 0)
return null;
@@ -179,7 +179,7 @@
// Check manually entered corrections
if (Prefs.custom_replace.hasOwnProperty(value) && Prefs.custom_replace[value])
return Prefs.custom_replace[value];
-
+
let [prefix, domain, suffix] = parseURL(value);
if (!domain)
return null;
@@ -247,14 +247,13 @@
callback: function()
{
// No: Add to list of corrections (ignore)
- if (/^www\./.test(value))
- {
- value = value.substr(4);
- }
- Prefs.whitelist[value] = value;
+ let {onWhitelistEntryAdded} = require("rules");
+ let entry = oldDomain.replace(/^www\./, "");
+ Prefs.whitelist[entry] = true;
+ onWhitelistEntryAdded(entry);
Prefs.whitelist = JSON.parse(JSON.stringify(Prefs.whitelist));
- require("appIntegration").loadURI(value);
+ require("appIntegration").loadURI(window, value);
processFalsePositive(oldDomain, domain);
}
}
« lib/appIntegration.js ('K') | « lib/survey.js ('k') | lib/updateRules.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld