Bug 54960 - window.location become broken in page cache
Summary: window.location become broken in page cache
Status: RESOLVED DUPLICATE of bug 34679
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 08:13 PST by Peter Leonov
Modified: 2011-02-22 16:20 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Leonov 2011-02-22 08:13:40 PST
The object of window.location become broken if one leaves the page and then presses the back button.

The following simple example may be a good illustration:

var loc = window.location
setTimeout(function () { alert(loc == window.location ? 'PASS' : 'FAIL') }, 1000)
window.location.href = 'a-history-back-page.html'

Here we cache the location object in a variable,
set a timer to check the variable after back button is pressed,
navigate to the page which sends us back,
and get the “FAIL” alert.

The a-history-back-page.html has the only JavaScript line:
window.history.back()
Comment 1 Alexey Proskuryakov 2011-02-22 16:20:46 PST

*** This bug has been marked as a duplicate of bug 34679 ***