Skip to content

Instantly share code, notes, and snippets.

@johnbender
Created January 16, 2013 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbender/b0fa7eb3e6989f1dbca0 to your computer and use it in GitHub Desktop.
Save johnbender/b0fa7eb3e6989f1dbca0 to your computer and use it in GitHub Desktop.
$.extend( $.support, {
// NOTE: Chrome for iOS has an extremely quirky implementation of popstate.
// We've chosen to take the shortest path to a bug fix here for issue #5426
// See the following link for information about the regex chosen:
//
// https://developers.google.com/chrome/mobile/docs/user-agent#chrome_for_ios_user-agent
//
// NOTE: Android > 2.3 defines history.pushState and history.replaceState but
// does not implement the functions. It appears to work partially but we've
// chosen to disable it here for clear and predictable behavior. We also
// have to include chrome explicitly since it contains the Android identifier
// in it's user agent string
//
// https://github.com/jquery/jquery-mobile/issues/5445p
pushState: "pushState" in history &&
"replaceState" in history &&
( ua.search(/CriOS/) === -1 ) &&
// If this is an Android browser that's NOT 2.2, 2.3, or Chrome opt it out
( ua.search(/Android/) > -1 ? ua.search(/(Android 2.(2|3))|Chrome/) > -1 : false )
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment