-
Notifications
You must be signed in to change notification settings - Fork 16
WebP support check doesn't pass for Firefox #17
Copy link
Copy link
Closed
Labels
Description
The current implementation of the webp check doesn't work for Firefox, although it has had support since version 65: https://github.com/GraphCMS/graphcms-image/blob/master/src/index.js#L23-L37
Why? Firefox doesn't support webp in data-urls yet. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
Chrome also supports the image/webp type.
- Relevant bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1559743
- Vercel handles check on server side: https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/image-optimizer.ts#L46
- Alternate approach (async!): https://stackoverflow.com/a/54120785/684032
Did you purposely choose the sync approach? How about handling the detection server-side? I'm not sure if the media assets server GraphCMS uses is open source and/or supports this!?
Thanks for making GraphCMS!
Reactions are currently unavailable