History.js vs. window.history for HTML5-only mode -


does history.js offer substantial advantages on html5's window.history nowadays? we're not interested in supporting/falling html4 hashbang urls.

history.js doesn't support anchors in pushstate(), while window.history does. need feature if there no big reasons use history.js instead of native window.history in html5-only mode, we'd rather go latter.

yes - on website say:

provide cross-compatible experience html5 browsers (they implement html5 >history api little bit differently causing different behaviours , bugs - >history.js fixes ensuring experience expected / same / great throughout >the html5 browsers)

those differences small, , googling wasn't enough find them - had in source code - seems main 1 fixing html5 functionality in safari. there 2 problems safari implementation - 1 history.back fails return hash state set location.hash susequently replaced history.replacestate.

the second when busy safari fail apply state changes.

relevant history.js source code:

    history.bugs = {         /**          * safari 5 , safari ios 4 fail return correct state once hash replaced `replacestate` call          * https://bugs.webkit.org/show_bug.cgi?id=56249          */         sethash: boolean(!history.emulated.pushstate && navigator.vendor === 'apple computer, inc.' && /applewebkit\/5([0-2]|3[0-3])/.test(navigator.useragent)),          /**          * safari 5 , safari ios 4 fail apply state change under busy conditions          * https://bugs.webkit.org/show_bug.cgi?id=42940          */         safaripoll: boolean(!history.emulated.pushstate && navigator.vendor === 'apple computer, inc.' && /applewebkit\/5([0-2]|3[0-3])/.test(navigator.useragent)), 

so guess decision comes down whether care safari 5 , safari ios 4.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -