| 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); |
| } |
| } |