foreverqihe / reallysimplehistory

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

Safari 3.0.4/Mac triggers history change event each time a history object is added #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In Safari 3.0.4, adding a new history event after a change history event has 
occurred will always 
produce an additional unwanted change history event.

(adding a new history event before any change history events works as expected)

A fix that appears to work is to replace the line 62 with: this.isGecko = true;

Seems the hacks for Safari 3 support may be no longer necessary, though it 
seems likely this *fix* 
will break Safari 2 support

Original issue reported on code.google.com by willac...@gmail.com on 14 Mar 2008 at 10:36

GoogleCodeExporter commented 9 years ago
I had the same issue, and the same workaround seems to fix it.

Original comment by cortes...@gmail.com on 12 May 2008 at 6:24

GoogleCodeExporter commented 9 years ago
Same issue here, thank you for the workaround.

Original comment by bertrand...@gmail.com on 27 May 2008 at 4:08

GoogleCodeExporter commented 9 years ago
you can use this code for dectection instead:

...} else if (/\(KHTML, like Gecko\) Safari/i.test(UA)) {
    this.isSafari = true;
    this.isSupported = (platform.indexOf("mac") > -1);
} else if ((UA.indexOf("gecko") != -1) || (/\(KHTML, like Gecko\) Version\/(.+)
Safari/i.test(UA))) {
    this.isGecko = true;
    this.isSupported = true;
}

Original comment by andi.tri...@gmail.com on 14 Jun 2008 at 6:35

GoogleCodeExporter commented 9 years ago
This is still an issue in Safari 4.0.5

The above fix seems simple enough and is effective:  this.isGecko = true;

Original comment by suomedi...@gmail.com on 14 May 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Does anyone know which safari version needs the old code? I took a slightly 
different
approach than andi - checking version number like this (see attachment).
Right now I'm going version >= 3 as you can see. I have 3.2 and the isGecko 
approach
works there, so not sure when to cut this off.

Original comment by jonatan....@gmail.com on 21 May 2010 at 8:14

Attachments: