Created
April 14, 2015 18:04
-
-
Save DigiTec/e44a23a7d6781060997e to your computer and use it in GitHub Desktop.
Ever wonder why browser vendors dis-like bad feature detection (in this case I'd argue this is browser detection)? Well this is why. Vendor prefix sniffing that ends up assuming support of one vendor prefix means all properties are implemented that way. First, nearly all of the vendor prefixed properties appear very late in the enumeration, so y…
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
<script> | |
var r = {}; | |
r.VENDOR_PREFIX = function () { | |
var e = /^(Webkit|Khtml|Moz|ms|O)(?=[A-Z])/, t = document.getElementsByTagName("script")[0].style, n; | |
for (n in t) | |
if (e.test(n)) | |
return n.match(e)[0].toLowerCase(); | |
return "WebkitOpacity" in t ? "webkit" : "KhtmlOpacity" in t ? "khtml" : ""; | |
}(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment