Closed
Bug 279035
Opened 20 years ago
Closed 19 years ago
canonizeUrl() ignores appended directories
Categories
(Firefox :: Address Bar, enhancement)
Tracking
()
RESOLVED
FIXED
Firefox 2 beta1
People
(Reporter: mgp, Assigned: pkasting)
References
Details
(Keywords: fixed1.8.1)
Attachments
(1 file, 2 obsolete files)
1.21 KB,
patch
|
Details | Diff | Splinter Review |
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
Reporter | ||
Comment 1•20 years ago
|
||
This is from a diff from the browser.js file in the Firefox 1.0 source
Reporter | ||
Comment 2•20 years ago
|
||
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);
Updated•20 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•20 years ago
|
Attachment #171801 -
Attachment is patch: true
Attachment #171801 -
Flags: review?
for kicks, this should work:
url = url.replace(/(^[^\/]*)(|\/)/, "http://www.$1"+suffix+"$2");
Attachment #171801 -
Flags: review? → review?(mconnor)
Comment 4•19 years ago
|
||
WORKAROUND: The Autocomplete Manager extension (https://addons.mozilla.org/extensions/moreinfo.php?id=2300) includes a bugfix for this.
Assignee | ||
Comment 5•19 years ago
|
||
Taking with hopes of updating the patch here.
Assignee: bugs → pkasting
Assignee | ||
Comment 6•19 years ago
|
||
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.
Attachment #171801 -
Attachment is obsolete: true
Attachment #221397 -
Flags: review?(mconnor)
Attachment #171801 -
Flags: review?(mconnor)
Assignee | ||
Comment 7•19 years ago
|
||
Nominating for Fx2 B1. This is a small patch that makes our behavior a little less braindead.
Flags: blocking-firefox2?
Assignee | ||
Comment 8•19 years ago
|
||
Adding a target milestone to increase likelihood of search queries finding me
Target Milestone: --- → Firefox 2 beta1
Updated•19 years ago
|
Attachment #221397 -
Flags: review?(mconnor)
Attachment #221397 -
Flags: review+
Attachment #221397 -
Flags: approval-branch-1.8.1+
Updated•19 years ago
|
Status: NEW → ASSIGNED
Flags: blocking-firefox2? → blocking-firefox2+
Comment 9•19 years ago
|
||
The curious part is that it built and ran just fine without these semicolons, but it seems poor form to omit them nonetheless.
Attachment #221397 -
Attachment is obsolete: true
Comment 10•19 years ago
|
||
fixed-1.8-branch, fixed-on-trunk
Comment 11•19 years ago
|
||
*** Bug 259707 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•