Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.