promisefeni / reallysimplehistory

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

Safari 3.1 does not need "isSafari" workaround #62

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use dhtmlHistory.add('location') in Safari 3.1.1 for a few locations
2. Use the back button
3. Now call dhtmlHistory.add for the same locations.
(A good example is to create 3 or 4 tabs, click through a them, use the back 
button, and then 
click again.)

What is the expected output? What do you see instead?
New location should always be registered. In Safari, the last location is 
loaded right after the new 
location. This is some bug in the history stack.

What version of the product are you using? On what operating system?
Safari 3.1.1, OS X 10.5.3

Please provide any additional information below.
I think the newest version of Safari does not need the "isSafari" modifications 
to the add() 
method. When I remove the if(isSafari) from the add() method, RSH works 
perfectly. 

I believe the fix would be to add (is version > 3.0) to the isSafari check to 
keep backward 
compatibility:

        } else if (vendor.indexOf("Apple Computer, Inc.") > -1 && parseFloat(version) < 3.0) {
            this.isSafari = true;
            this.isSupported = (platform.indexOf("mac") > -1);

Original issue reported on code.google.com by island.p...@gmail.com on 20 Jun 2008 at 10:49

GoogleCodeExporter commented 8 years ago
The offered code works well in Safari 3.1.1 (Windows) with a minor adjustment:

} else if (vendor.indexOf("Apple Computer, Inc.") > -1 && 
parseFloat(navigator.version) < 3.0) {

Original comment by vglusc...@gmail.com on 3 Jul 2008 at 7:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
navigator.version doesn't work for me in Safari 3.1.2

Used UA.match(/version\/([\d\.]*)/) to find the version.

Original comment by alex.dennis@gmail.com on 24 Sep 2008 at 8:36

GoogleCodeExporter commented 8 years ago
hmmm... just can't get that version properly.
I'm using Safari 3.2.1 Win.

Original comment by darko.st...@gmail.com on 15 Apr 2009 at 10:45

GoogleCodeExporter commented 8 years ago
This issue also affects Safari 4. vgluschuk's comment fixed it for me. Line 61 
is the 
one that needs to be replaced.

Original comment by darkomei...@gmail.com on 1 Nov 2009 at 9:17

GoogleCodeExporter commented 8 years ago
The reason that 'works' is because for modern safari browsers navigator.version 
is
undefined, so parseFloat(navigator.version) is a NaN, and NaN < 3.0 is false.

However I don't have an older version of safari. If they do have the
navigator.version string then technically everthing is okay, everything but 
safari is
filtered out by the first condition, and Safari code handles the second in a
consistent way. However it's a hack at best :) (a very important one though!)

Original comment by a.wi...@gmail.com on 13 Dec 2009 at 2:58

GoogleCodeExporter commented 8 years ago
Thankyou, it worked perfectly in Safary with a Mac and iPad, I just used the 
recommendation you gave on line 61 and it was good to go :)

Original comment by victorqu...@uvicate.com on 18 Apr 2011 at 7:10