oalders / http-browserdetect

Determine the Web browser, version, and platform from an HTTP user agent string
http://www.browserdetect.org
Other
58 stars 48 forks source link

WebP support detection #159

Open randolf opened 5 years ago

randolf commented 5 years ago

I'm wondering what approach I should use for adding a detection for WebP image format support. I'm thinking that a simple series of internal checks on browser types and minimum version numbers would be the way to go.

Here's a chart of which browser versions support the WebP image format:

https://caniuse.com/#feat=webp

Any suggestions? I'd be happy to write some code for a webp() subroutine that behaves like the mobile() subroutine.

Thanks.

oalders commented 5 years ago

This sounds like a great feature to add. I don't have a lot in the way of suggestions. Following the pattern for mobile() sounds good. We'd just need appropriate tests to accompany the PR. Feel free to ping me if you run into any issues while getting this going.