Bug 14080 - Changing the hash doesn't add a history entry
Summary: Changing the hash doesn't add a history entry
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2007-06-11 17:43 PDT by Bertrand Le Roy
Modified: 2008-02-16 12:26 PST (History)
1 user (show)

See Also:


Attachments
Here's a test page that works in Firefox and Opera (1.26 KB, text/html)
2007-09-07 00:03 PDT, Bertrand Le Roy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Le Roy 2007-06-11 17:43:38 PDT
In both Firefox and Opera, setting window.location.hash to a new value creates an entry in the browser history, enabling JavaScript applications to meaningfully use the back button.
There were a number of hacks that enabled developers to emulate that behavior on older versions of Safari and Webkit, but those seem to be broken in the latest builds, including Safari 3 beta.
Safari should emulate the Firefox and Opera behavior, which is rational and easy to use.
Comment 1 Bertrand Le Roy 2007-09-06 23:19:35 PDT
This reproes when the page is the first one that's loaded into the browser. It kind of works if another page was loaded first, but then hitting back sometimes doesn't enable the forward button, which makes history only navigatable to the past.
Comment 2 Maciej Stachowiak 2007-09-06 23:34:35 PDT
I can't reproduce this on a current nightly for Mac. I would be highly surprised if this is different on Windows, but it's not impossible.
Comment 3 Bertrand Le Roy 2007-09-07 00:00:09 PDT
I just downloaded the latest Windows nightly and was able to repro. Will try the Mac nightly tomorrow when I get near a Mac.
Comment 4 Bertrand Le Roy 2007-09-07 00:03:47 PDT
Created attachment 16212 [details]
Here's a test page that works in Firefox and Opera

If you browse to the attached page right after opening the browser, click the button a few times, you won't be able to hit back as expected. If you navigate to something else then again to the test page and press the button a few times, you'll be able to hit back and state will be restored correctly, but forward will still be disabled.
Comment 5 David Kilzer (:ddkilzer) 2007-09-07 06:02:21 PDT
(In reply to comment #4)
> Created an attachment (id=16212) [edit]
> Here's a test page that works in Firefox and Opera
> 
> If you browse to the attached page right after opening the browser, click the
> button a few times, you won't be able to hit back as expected. If you navigate
> to something else then again to the test page and press the button a few times,
> you'll be able to hit back and state will be restored correctly, but forward
> will still be disabled.

Using the test page and following the instructions works for me using a local debug build of WebKit r25386 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218).

Adding PlatformOnly keyword since this appears only to be a Safari Windows issue.

Comment 6 David Kilzer (:ddkilzer) 2007-09-07 06:14:10 PDT
<rdar://problem/5466939>
Comment 7 Bertrand Le Roy 2007-09-07 11:39:22 PDT
I can confirm that this only affects the Windows build (but that includes the current nightly).
Everything runs smoothly on the Mac version.
Comment 8 Robert Blaut 2008-02-16 12:26:22 PST
I've checked the test case in the latest Webkit on Windows and it works now as expected. So the bug is FIXED