Closed
Bug 195833
Opened 23 years ago
Closed 23 years ago
js error in onLocationChange when trying to get hostPort of wyciwyg:// url
Categories
(SeaMonkey :: General, defect)
SeaMonkey
General
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: shliang, Assigned: shliang)
References
Details
Attachments
(1 file, 1 obsolete file)
|
1.64 KB,
patch
|
jag+mozilla
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
wyciwyg:// protocol needs to be stripped off before getting hostPort
(nsBrowserStatusHandler.js line 350 in onLocationChange, used to determind if
popup blocked icon should be shown)
Comment on attachment 116164 [details] [diff] [review]
patch
jag, could you r/sr? thanks
Attachment #116164 -
Flags: review?(jaggernaut)
Comment 3•23 years ago
|
||
Comment on attachment 116164 [details] [diff] [review]
patch
There are other URI implementations than wyciwyg that will fail when you try to
get their hostPort. This patch is definitely needed, but the hostPort access
needs to be wrapped in a try/catch in any case.
Attachment #116164 -
Flags: superreview-
Comment 4•23 years ago
|
||
*** Bug 192779 has been marked as a duplicate of this bug. ***
Comment 5•23 years ago
|
||
*** Bug 195413 has been marked as a duplicate of this bug. ***
Comment 6•23 years ago
|
||
e.g. see bug 195413 for a non-wyciwyg failure case.
Attachment #116164 -
Attachment is obsolete: true
Updated•23 years ago
|
Attachment #116218 -
Flags: superreview+
Comment 8•23 years ago
|
||
Comment on attachment 116218 [details] [diff] [review]
adding try/catch
I don't think you should need a try/catch around |hostPort =
locationURI.hostPort|.
locationURI is either an exposableURI (and hostPort should work, n'est-ce
pas?), or it's null (due to the earlier try/catch failing), which you could
check for in the |if (blank || ...)|.
bz, am I missing something?
Attachment #116218 -
Flags: review?
Comment 9•23 years ago
|
||
about:mozilla is an exposable URI and has no hostport.
view-source:http://www.mozilla.org is an exposable URI and has no hostport
I can probably come up with a few other examples and distributors can trivially add others...
"has no hostport" means "the getter throws".
Again, see bug 195413...
Comment 10•23 years ago
|
||
Hmm... Why are we throwing an exception for that?
nsIURI.idl specifies that when no port is given, the default port is assumed and
|port| returns -1, |hostPort| returns |host|. Shouldn't that extend to URIs for
which |port| doesn't apply?
Comment 11•23 years ago
|
||
Comment on attachment 116218 [details] [diff] [review]
adding try/catch
r=jag, though I'm still curious why we're throwing exceptions.
Attachment #116218 -
Flags: review? → review+
Comment 12•23 years ago
|
||
Because we're talking about URI schemes which have no concept of a port. See
http://lxr.mozilla.org/seamonkey/source/netwerk/base/src/nsSimpleURI.cpp#223
Comment 13•23 years ago
|
||
hmm.. do we care in this case that we can't get the info out of the URL? the
wyciwyg protocol is meant to be transparent to users. they should never see
those URLs in the browser UI, and along the same lines, they should never see
negative side-effects due to those URLs. do we care in this case?
Comment 14•23 years ago
|
||
Darin, the wyciwyg issue is actually resolved by getting the "exposable URI".
The question on the table is whether the getters in nsSimpleURL should throw
(for about: uris, eg) as they do now. If so, we need a try/catch in this code.
Comment 15•23 years ago
|
||
yeah, the getters should just return empty string (or -1 in the case of the
port). setters for nsSimpleURI should throw, however. i'm sure someone was
just being lazy when they made these functions throw, or maybe they didn't want
to have strdup("") all over the place (back when nsIURI used raw |string|
params). nothing wrong with "_retval.Truncate(); return NS_OK;" IMO.
Comment 16•23 years ago
|
||
Then we'll have to look through our code and see if anyone is depending on us
currently throwing (returning a non-NS_OK).
Comment 17•23 years ago
|
||
yeah.. there is that :(
| Assignee | ||
Comment 18•23 years ago
|
||
resolving
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 19•23 years ago
|
||
*** Bug 198529 has been marked as a duplicate of this bug. ***
Comment 20•23 years ago
|
||
*** Bug 194998 has been marked as a duplicate of this bug. ***
Updated•23 years ago
|
Attachment #116164 -
Flags: review?(jaggernaut)
Comment 21•23 years ago
|
||
*** Bug 203518 has been marked as a duplicate of this bug. ***
Comment 22•23 years ago
|
||
*** Bug 206699 has been marked as a duplicate of this bug. ***
Updated•21 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•