modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
27 lines (26 loc) • 697 B
JavaScript
/*!
{
"name": "SVG filters",
"property": "svgfilters",
"caniuse": "svg-filters",
"tags": ["svg"],
"builderAliases": ["svg_filters"],
"authors": ["Erik Dahlstrom"],
"notes": [{
"name": "W3C Spec",
"href": "https://www.w3.org/TR/SVG11/filters.html"
}]
}
!*/
define(['Modernizr'], function(Modernizr) {
// Should fail in Safari: https://stackoverflow.com/questions/9739955/feature-detecting-support-for-svg-filters.
Modernizr.addTest('svgfilters', function() {
var result = false;
try {
result = 'SVGFEColorMatrixElement' in window &&
SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE === 2;
}
catch (e) {}
return result;
});
});