How to view webp format on ie11

霸气de小男生 提交于 2019-12-24 10:48:27

问题


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:


Webp works on all browsers with the webpjs polyfill (http://webpjs.appspot.com/)

It uses flash for IE support (now you can use webp all the way back to IE6 as long as your browser supports flash).

the swf file is missing from this page, but I found it here: https://github.com/obartra/webpjs




回答2:


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/webp-hero@0.0.0-dev.21/dist-cjs/polyfills.js"></script>
<script src="https://unpkg.com/webp-hero@0.0.0-dev.21/dist-cjs/webp-hero.bundle.js"></script>
<script>
 var webpMachine = new webpHero.WebpMachine();
 webpMachine.polyfillDocument();
</script>


来源:https://stackoverflow.com/questions/47663490/how-to-view-webp-format-on-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!