naohirozrx / reallysimplehistory

Automatically exported from code.google.com/p/reallysimplehistory
Other
0 stars 0 forks source link

Cross Browser issues with RSH 0.6 #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've implemented the RSH 0.6 framework in my application.  Testing the 
application across several browsers brought the following issues to my 
notice:

Opera / IE 7.0 / Safari 3.0 (Win)      -->      Page Refresh is not 
identified as a change in history. This can be identified by adding an 
alert in the historyChange method. This alert will be displayed for Back 
and Forward navigations. However, this doesn't happen for the Page Refresh 
event.

In Safari, in addition to the stated issue, the Back and Forward buttons 
are not enabled even after adding a history state using the addHistory 
method. However, the buttons become enabled after the page has been 
reloaded. At the boundary of the history states, the Back / Forward 
buttons remain enabled even though there isn't a state beyond. Navigation 
through the history states does not trigger the historyChange method. 

In IE 7.0, in addition to the stated issue, the history stack gets cleared 
after the Page Refresh event in IE 7.0.

Original issue reported on code.google.com by lans...@gmail.com on 29 Dec 2007 at 5:13

GoogleCodeExporter commented 8 years ago
The cache reset issue reported with IE 7.0 occurs only when the page is a JSP. 
The 
RSH works perfect if the page is an HTML page.

Original comment by shensyjo...@gmail.com on 13 Jan 2008 at 1:11

GoogleCodeExporter commented 8 years ago
Server sends last-modified-date for static files like HTML and IE sends a
if-modified-since request when you click refresh button. Server responds with
not-modified and IE (correctly) assumes that nothing really changed. 
window.onload()
fires but "/*Else if this is a fake onload event*/" part gets executed and 
history
remains intact.

In case of JSP, server cannot send a meaningful last-modified-date (LMD), so in 
case
of refresh, IE sends request to server without if-modified-since header and 
server
responds with 200.
IE re-initializes all variables and library does not find this.PAGELOADEDSTRING 
in
historyStorage and thus history is lost.

Same behavior can be seen when you press shift-refresh(F5) for HTML file, which
makes IE to reload the page regardless of its last-modified-date.

Developers of this library can validate this and please suggest a solution.

Original comment by samee...@gmail.com on 5 Jul 2008 at 6:00