User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 The canonizeUrl() function in browser.js is responsible for automatically adding the "http://" prefix and ".com", ".net", or ".org" suffixes to what is typed in the Location bar, depending on what keyboard shortcut is used. This is useless, however, when the user wishes to also enter some subdirectory or specify a remote file for viewing (e.g., "google/scholar" + Ctrl + Enter should generate "www.google.com/scholar" [subdirectory], and "google/images/logo.gif" + Ctrl + Enter should generate "http://www.google.com/images/logo.gif"). Reproducible: Always Steps to Reproduce: 1. Type in an domain name without its accompanying "http://www." prefix or ".com" suffix, followed by a slash and a directory name or file 2. Hit CTRL + Enter Actual Results: The resulting URL has its ".com" suffix appended after the directory name or file, ont before Expected Results: The resulting URL should have its ".com" suffix placed before the first slash and the directory name or file
Created attachment 171801 [details] [diff] [review] fix to provide new functionality This is from a diff from the browser.js file in the Firefox 1.0 source
Comment on attachment 171801 [details] [diff] [review] fix to provide new functionality 1872a1873 > 1874c1875,1878 < url = "http://www." + url + suffix; --- > var firstSlash = url.indexOf("/"); > if (firstSlash < 0) > firstSlash = url.length; > url = "http://www." + url.substring(0, firstSlash) + suffix + url.substring(firstSlash, url.length);
for kicks, this should work: url = url.replace(/(^[^\/]*)(|\/)/, "http://www.$1"+suffix+"$2");
WORKAROUND: The Autocomplete Manager extension (https://addons.mozilla.org/extensions/moreinfo.php?id=2300) includes a bugfix for this.
Taking with hopes of updating the patch here.
Created attachment 221397 [details] [diff] [review] Updated patch I made one change to the original patch to prevent the suffix insertion from resulting in two slashes (which is a different URL). This is a patch against the trunk.
Nominating for Fx2 B1. This is a small patch that makes our behavior a little less braindead.
Adding a target milestone to increase likelihood of search queries finding me
Created attachment 225803 [details] [diff] [review] Patch as checked in: adding missing semicolons The curious part is that it built and ran just fine without these semicolons, but it seems poor form to omit them nonetheless.
*** Bug 259707 has been marked as a duplicate of this bug. ***