Last active
June 2, 2017 18:01
-
-
Save TravisMullen/bd415d1c96e960c7e12aca5c5b97e858 to your computer and use it in GitHub Desktop.
Browser Feature Detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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