AVIF is a next generation image format, in the moment to write this post, the support is only by Chrome 85 and Firefox 77 under a flag.
W3C are wo...
For further actions, you may consider blocking this person and/or reporting abuse
I've combined your code with the older [very similar] webp code from ourcodeworld.com/articles/read/630... to create a version that will work for both AVIF and WebP.
oldin the Tech Preview Safari 14.2 it returnswebpwebpand in Developer Edition 86.0b9 it returnsavifavifas expectedChrome Version 112.0.5615.121 (Official Build) (x86_64) returns
webpwhich is not right.Ensure you checkout the updated codepen code which was added to the comments 2yrs ago. It's returning correctly for the latest version of Chrome (aka, the version you've listed).
Further to yesterday's comment; I've cleaned this up at codepen.io/mountainash/pen/eYBRpzV (not creating the WebP blob if the AVIF is OK)
I just compared this to my snippet on avif.io/blog/tutorials/use-avif-in...
Your script is at 900 chars, mine is 600 chars. Is there any benefit I don't see? I'm not criticizing your work, I'm actually curious, cause then I'd implement your version with credits.
I wasn't aware of your's; it's new to me (and this article and the comments section). Looks good -> use it.
Awesome, thanks for clarifying, I appreciate it. :)
Who googled this topic I have an alternate sync version for you, so you don't need to wait till onload or make some promises:
thanks))
p.s.: check this before simple copy it caniuse.com/avif maybe something has updated
UserAgent lookups to define feature support should be a last resort - it's always better to test for the feature - you never know when a new browser will come out and make the test cases fail leaving the user with a suboptimal experience.
Update: Firefox 86 now has AVIF support on by default.