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 changes from code review Created Sept. 26, 2012, 1:53 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
« lib/hooks.js ('K') | « lib/rules.js ('k') | lib/updateRules.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/typoFixer.js
===================================================================
--- a/lib/typoFixer.js
+++ b/lib/typoFixer.js
@@ -247,11 +247,10 @@
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);
« lib/hooks.js ('K') | « lib/rules.js ('k') | lib/updateRules.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld