Index: lib/typoFixer.js |
=================================================================== |
--- a/lib/typoFixer.js |
+++ b/lib/typoFixer.js |
@@ -138,17 +138,17 @@ function isIPAddress(domain) |
{ |
return (e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS); |
} |
} |
function correctURL(window, value) |
{ |
let hasCorrection = false; |
- |
+ |
value = value.trim(); |
if (value.length == 0) |
return null; |
// Replace backslashes |
value = value.replace(/\\/g, "/"); |
// Does the URL scheme need correcting? |
@@ -174,17 +174,17 @@ function correctURL(window, value) |
// Spaces before the first slash or period is probably a quick search |
if (/^[^\/\.\s]+\s/.test(value)) |
return null; |
// 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; |
let oldDomain = domain; |
if (!isIPAddress(domain)) |
{ |
processTypedDomain(domain); |
@@ -248,17 +248,17 @@ function correctURL(window, value) |
{ |
// No: Add to list of corrections (ignore) |
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); |
} |
} |
]; |
require("appIntegration").openInfobar(window, "url-fixer-infobar-askafter", message, buttons, 1); |
require("survey").incrementCorrectionsCounter(); |