https://github.com/vitaliy-bobrov/webp-support
Simple script to check browser support of webp images format.
https://github.com/vitaliy-bobrov/webp-support
feature-detection webp
Last synced: about 1 year ago
JSON representation
Simple script to check browser support of webp images format.
- Host: GitHub
- URL: https://github.com/vitaliy-bobrov/webp-support
- Owner: vitaliy-bobrov
- License: mit
- Created: 2016-04-10T10:18:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T10:49:49.000Z (over 9 years ago)
- Last Synced: 2025-02-28T17:51:42.557Z (over 1 year ago)
- Topics: feature-detection, webp
- Language: JavaScript
- Size: 16.6 KB
- Stars: 6
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
WebP Support
==============
[](https://badge.fury.io/bo/webp-support)
[](https://badge.fury.io/js/webp-detect)
[](https://github.com/vitaliy-bobrov/webp-detect)
A pure javascript (no jQuery) lightweight library that checks browser WebP format support and adds 'webp' class to body if supported.
What is WebP? - [Answer](https://developers.google.com/speed/webp/)
## Bower
```bash
bower install --save webp-support
```
## npm
```bash
npm install --save webp-detect
```
## Usage
Include the script in your HTML
```html
```
or add to your bundle:
```js
require('webp-detect');
```
If browser support webp format it'll add the `webp` class to body tag.
Also you can import ES2015 version in your scripts.