Skip to content

Checks if the browser supports WebP. Cheaply and synchronously.

License

Notifications You must be signed in to change notification settings

g-30/supports-webp-sync

 
 

Repository files navigation

supports-webp-sync

npm npm

Checks if the browser supports WebP without any costly requests.

May give false negatives for some obscure non-WebKit browsers.

Live check: https://ihordiachenko.github.io/supports-webp-sync/

Install

npm i -S supports-webp-sync

Usage

import { checkWebPSupport } from 'supports-webp-sync'

if (checkWebPSupport()) {
  // Get some WebP images
}

About

Checks if the browser supports WebP. Cheaply and synchronously.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 56.0%
  • TypeScript 25.2%
  • HTML 12.6%
  • JavaScript 6.2%