Quickly determine whether Webp is supported from UserAgent.
- FireFox >= 65
- Chrome >= 32
- Edge >= 18
- AppleWebKit >= 605 # Safari 14
- OPR >= 19
- UCBrowser >= 12
- SamsungBrowser >= 4
- QQBrowser >= 10
webp_supported(user_agent: bytes) -> bool
example:
from webp_support import webp_supported
user_agent = b"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
webp_supported(user_agent) # Chrome > 32 -> True