Skip to content

Instantly share code, notes, and snippets.

@TravisMullen
Last active June 2, 2017 18:01
Show Gist options
  • Save TravisMullen/bd415d1c96e960c7e12aca5c5b97e858 to your computer and use it in GitHub Desktop.
Save TravisMullen/bd415d1c96e960c7e12aca5c5b97e858 to your computer and use it in GitHub Desktop.
Browser Feature Detection
function supportsSvg() {
return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1');
}
function supportsObjectCreate() {
//
// Desktop
// Browser | Firefox | (Gecko) | Internet Explorer | Opera | Safari
// Basic support | 5 | 4.0 (2) | 9 | 11.60 | 5
//
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
//
return typeof Object.create === 'function';
}
function supportsPushState() {
//
// Desktop
// Browser | Internet Explorer
// Basic support | 11
//
// http://caniuse.com/#search=pushstate
//
return typeof history.pushState === 'function';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment