Closed Bug 41718 Opened 24 years ago Closed 24 years ago

javascript: protocol is case sensitive.

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: desale, Assigned: jst)

References

Details

(Whiteboard: [nsbeta2+][will be minus on 6/15])

Attachments

(2 files)

protocol javascript: is case sensitive and does not allow a single alphabet in 
upper case [Like Javascript:, JAVASCRIPT:]

And there are several sites which use "Javascript:" instead of "javascript:"

According to RFC 1738 [http://www.isi.edu/in-notes/rfc1738.txt]
In general, URLs are written as follows:

       <scheme>:<scheme-specific-part>

   A URL contains the name of the scheme being used (<scheme>) followed
   by a colon and then a string (the <scheme-specific-part>) whose
   interpretation depends on the scheme.

   Scheme names consist of a sequence of characters. The lower case
   letters "a"--"z", digits, and the characters plus ("+"), period
   ("."), and hyphen ("-") are allowed. For resiliency, programs
   interpreting URLs should treat upper case letters as equivalent to
   lower case in scheme names (e.g., allow "HTTP" as well as "http").

So javascript: protocol could also be allowed to use with uppercase letters.

BUILDS: 2000-060508.

STEPS TO REPRODUCE:
1] Please load the testcase I'm going to attach with above specified builds.
2] You'll see four links. Click these all links one by one and observe.

EXPECTED RESULTS:
All four links should generate alerts. [All links use different case combination 
for protocol javascript:]

ACTUAL RESULTS:
One first link generates alert.
Attached file Testcase attached.
Nominating nsbeta2 because multile site use Javascript: istead of javascript:
Keywords: nsbeta2
Priority: P3 → P2
Hmm, this is interesting, mixed case javascript urls work if you type them in
the url bar, I'll have a look why they don't work in links any more (they used
to, I'm sure)...
Status: NEW → ASSIGNED
OS: Windows 95 → All
Hardware: PC → All
*** Bug 41730 has been marked as a duplicate of this bug. ***
Need info.  What does 4.x do in this case?  What about other protocols?  (file:,
http:)
Whiteboard: [need info]
4.x treats the protocol in a URL caseinsensitively, so this could affect a lot
of sites out there, I think this is a problem only for javascript: urls in
mozilla.
Aha! Found the problem, the fix is a oneliner in the docshell, I'll attach a
patch, this should definitely be nsbeta2+
Attached patch Proposed fixSplinter Review
I also think this should be nsbeta2+ Johnny.
It could affect tons of sites out there.

COOL You Have Fix.
Putting on [nsbeta2+] [will be minus on 6/15] radar.
Whiteboard: [need info] → [nsbeta2+][will be minus on 6/15]
I just checked in the patch, JaVaScRiPt URL's work again!

Marking FIXED.

Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking VERIFIED. 
Working perfect now. Tested with 2000-060809 on Win-95.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: