webp-image-support
v0.6.0
Published
Test if a browser supports the WebP - optionally update indicated elements with a class to indicate if WebP support is present.
Downloads
1
Readme
WebP Test
This plugin will detect if the browser supports the WebP format, resolving a Promise with true
if WebP support is present, and false
otherwise.
Example
index.js
import { supportsWebp } from './webp-image-support';
(async () => {
const supported = await supportsWebp();
if(supported) {
console.log(`This browser supports WebP images`);
} else {
console.log(`This browser does not support WebP images.`);
}
})();
GitLab
Submit issues, request features, check out the repo here: https://git.xvrqt.com/amy/webp-support