Bug 15182 - window.location.hash contains URL-encoded hash value
Summary: window.location.hash contains URL-encoded hash value
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: All OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2007-09-11 12:54 PDT by Tim Buckingham
Modified: 2012-09-11 18:42 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buckingham 2007-09-11 12:54:11 PDT
Stumbled upon a bug when working in #webkit with bdash.

When reading window.location.hash in Javascript characters are not URL decoded as they are in other browsers.  For example, trying to split #this|two|three when it is #this%7Ctwo%7Cthree fails in WebKit, but works fine in other browsers.
Comment 1 Mark Rowe (bdash) 2007-09-11 12:57:42 PDT
To reproduce:

1. Visit http://www.google.com.au/#%7C
2. Enter javascript:alert(location.hash) in the address bar.

Safari displays '#%7C'.  Camino displays '#|'.
Comment 2 Mark Rowe (bdash) 2007-09-11 12:58:16 PDT
<rdar://problem/5474669>
Comment 3 Jan Erik Hanssen 2010-12-27 12:37:08 PST
The Mozilla people seems to think that their behavior (urldecoding window.location.hash) is a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=483304. Also, Opera does not urldecode this.
Comment 4 Gavin Barraclough 2012-09-11 18:42:37 PDT
Based on Jan Erik Hanssen's comment, plus teh fact we match Opera & Chrome, looks like our behaviour is correct.