NO WEBP - Convert WEBP Pics To Common Formats(JPG PNG GIF) For Onenote & Evernote Clip

Through replacing suffixs to get the original address, convert the WEBP pictures of Douban, WeChat Public Account, Jianshu, Zhihu, Bilibili Read, Juejin.im, Dongchedi, imgur.com, Hupu, ifeng.com, toutiao.com, 360kuai.com, Xiaohongshu, Fandom into common formats(JPG PNG GIF) for web clipping of Evernote and Onenote. GIF kept and worked in new version. GIF in Douban & Zhihu(high quality) autoloads. You can also try to add included urls by yourself. Welcome feedback and suggestions.

< Feedback on NO WEBP - Convert WEBP Pics To Common Formats(JPG PNG GIF) For Onenote & Evernote Clip

Review: Good - script works

§
Posted: 2022-12-10
Edited: 2022-12-10

自己优化一下。

function fkwebp(){
    'use strict';
    var img = document.getElementsByTagName('img');
    for (var i=0;i<img.length;i++){
        if(img[i].src.toLowerCase().match('a?webp')){
            if(img[i].outerHTML.toLowerCase().includes('jpeg')){
                img[i].src = img[i].src.replace(/a?webp/g,'jpeg');}
            else if(img[i].outerHTML.toLowerCase().includes('jpg')){
                img[i].src = img[i].src.replace(/a?webp/g,'jpg');}
            else if(img[i].outerHTML.toLowerCase().includes('png')){
                img[i].src = img[i].src.replace(/a?webp/g,'png');}
            else if(img[i].outerHTML.toLowerCase().includes('gif')){
                img[i].src = img[i].src.replace(/a?webp/g,'gif');}
            else{
                img[i].src = img[i].src.replace(/a?webp/g,'jpg');}
        }
        else{
            clearInterval(fkwebp);}
    }
}

Black RabbitAuthor
§
Posted: 2022-12-11

已更新1.8.5,无GIF字样识别的小部分动图现在会直接转成JPG。

Post reply

Sign in to post a reply.