While Chromium (and Chrome) supports it, in Safari when you try to export a canvas to image/webp it returns a png. You can try it here: https://codepen.io/nuthinking/pen/eYZBWLL Let me know if you need anything else.
To note: Firefox Nightly (currently 91) appears not to support image/webp either.
This is because the underlying frameworks do not support WebP encoding. For internal reference see <rdar://59404467>.
<rdar://59404467>