Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 16 days 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T10:49:49.000Z (over 7 years ago)
- Last Synced: 2024-10-11T15:43:18.130Z (about 1 month 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
==============[![Bower version](https://badge.fury.io/bo/webp-support.svg)](https://badge.fury.io/bo/webp-support)
[![npm version](https://badge.fury.io/js/webp-detect.svg)](https://badge.fury.io/js/webp-detect)
[![npm](https://img.shields.io/npm/dt/webp-detect.svg)](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.