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

Unified Diff: lib/typoFixer.js

Issue 8432103: Proper Fennec support (Closed)
Patch Set: Created Sept. 28, 2012, 7:18 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
« lib/appIntegration.js ('K') | « lib/hooks.js ('k') | no next file » | 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
@@ -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();
« lib/appIntegration.js ('K') | « lib/hooks.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld