How to view webp format on ie11

14.5k views Asked by At

Is there anyway to view webp image format on IE11 or can convert it to another format with javascript code on this browser? I tried "picture" element but seems like it cann't work like Chrome62

1

There are 1 answers

3
WaughWaugh On BEST ANSWER

This is also a very easy-to-use and effective polyfill for rendering WebP images on IE or other browsers which do not support WebP rendering. Here is how to use it:-

<script src="https://unpkg.com/[email protected]/dist-cjs/polyfills.js"></script>
<script src="https://unpkg.com/[email protected]/dist-cjs/webp-hero.bundle.js"></script>
<script>
 var webpMachine = new webpHero.WebpMachine();
 webpMachine.polyfillDocument();
</script>