Greasy Fork is available in English.

去掉WEBP - 转换WEBP图片到源格式(JPG PNG GIF)用于Onenote与Evernote剪藏

将豆瓣、微信公众号、简书、知乎的webp图片转换为对应格式(JPG PNG GIF),用于Onenote、Evernote/印象笔记 剪辑保存,解决剪藏图片不显示的问题,已兼容保留GIF动图,豆瓣GIF动图、知乎内(高品质)GIF自动加载。可尝试自行添加生效网站。

Version vom 2020-03-16 06:07:12 UTC. Aktuellste Version

// ==UserScript==
// @name           去掉WEBP - 转换WEBP图片到源格式(JPG PNG GIF)用于Onenote与Evernote剪藏
// @name:zh-CN     去掉WEBP - 转换WEBP图片到源格式(JPG PNG GIF)用于Onenote与Evernote剪藏
// @name:zh-TW     去掉WEBP - 轉換WEBP圖片到源格式(JPG PNG GIF)用於Onenote與Evernote剪藏
// @name:en        NO WEBP - Convert WEBP Pics To Common Formats(JPG PNG GIF) For Onenote & Evernote Clip
// @version        1.7.1
// @author         Black Rabbit
// @namespace      Black Rabbit
// @description    将豆瓣、微信公众号、简书、知乎的webp图片转换为对应格式(JPG PNG GIF),用于Onenote、Evernote/印象笔记 剪辑保存,解决剪藏图片不显示的问题,已兼容保留GIF动图,豆瓣GIF动图、知乎内(高品质)GIF自动加载。可尝试自行添加生效网站。
// @description:zh-TW    將豆瓣、WeChat公眾號、簡書、知乎的webp圖片轉換為對應格式(JPG PNG GIF),用於Onenote、Evernote/印象筆記 剪輯保存,解決剪藏圖片不顯示的問題,已相容保留GIF動圖,豆瓣GIF動圖、知乎內(高品質)GIF自動載入。 可嘗試自行添加生效網站。
// @description:en Convert the WEBP pictures of Douban, WeChat public account and Jianshu 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.
// @icon           https://railsware.com/blog/wp-content/uploads/2013/11/24823-picture1.png
// @supportURL     https://greasyfork.org/scripts/396210
// @include        *://mp.weixin.qq.com/*
// @include        *://www.jianshu.com/*
// @include        *://*.douban.com/*
// @include        *://*.zhihu.com/*
// ==/UserScript==
//Zhihu Convert 2020/2/18
function zhihu_seek(){
    'use strict';
    var ori_class = document.getElementsByClassName('GifPlayer');
    for(var j=0;j<ori_class.length;j++){
        ori_class[j].className += ' isPlaying';}
    setInterval(zhihu_convert,100);
}
function zhihu_convert(){
    'use strict';
    var playing_class = document.getElementsByClassName('GifPlayer isPlaying');
    for(var i=0;i<playing_class.length;i++){
        var img = playing_class[i].getElementsByTagName('img');
        img = img[0];
        //GIF autoplay
        if (img.src.toLowerCase().includes('gif')){
        }
        else{
            img.src = img.src.replace(/\/50/g,'\/100');
            img.src = img.src.replace(/hd.webp/g,'r.gif');
            img.src = img.src.replace(/hd.jpg/g,'r.gif');}
    }
}
//Douban Convert 2020/2/17
function douban_convert(){
    'use strict';
    var img = document.getElementsByTagName('img');
    for(var i=0;i<img.length;i++){
        //Fix & get correct url for GIF
        if (img[i].outerHTML.toLowerCase().includes('"gif"')){
            if (img[i].src.toLowerCase().includes('webp')){
                img[i].src = img[i].src.replace(/webp/g,'gif');
                img[i].src = img[i].src.replace(/l\/public/g,'raw/public');
            }
            else if (img[i].src.toLowerCase().includes('large')){
                img[i].src = img[i].src.replace(/large/g,'raw');
                img[i].src = img[i].src.replace(/jpg/g,'gif');
            }
            img[i].outerHTML = '<img src="' + img[i].src + '" width="' + img[i].width + '">';
        }
        else if(img[i].src.toLowerCase().includes('webp')){
            img[i].src = img[i].src.replace(/webp/g,'jpg');}
    }
}
//Jianshu & Wechat & Other Convert 2020/2/14
function fkwebp(){
    'use strict';
    var img = document.getElementsByTagName('img');
    for (var i=0;i<img.length;i++){
        if(img[i].src.toLowerCase().includes('webp')){
            if(img[i].outerHTML.toLowerCase().includes('jpeg')){
                img[i].src = img[i].src.replace(/webp/g,'jpeg');}
            else if(img[i].outerHTML.toLowerCase().includes('jpg')){
                img[i].src = img[i].src.replace(/webp/g,'jpg');}
            else if(img[i].outerHTML.toLowerCase().includes('png')){
                img[i].src = img[i].src.replace(/webp/g,'png');}
            else if(img[i].outerHTML.toLowerCase().includes('gif')){
                img[i].src = img[i].src.replace(/webp/g,'gif');}
            else{
                img[i].src = img[i].src.replace(/webp/g,'jpg');}
        }
        else{
            clearInterval(fkwebp);}
    }
}
if (document.getElementsByTagName('body')[0].baseURI.toLowerCase().includes('douban')){
    douban_convert();}
else if (document.getElementsByTagName('body')[0].baseURI.toLowerCase().includes('zhihu')){
    zhihu_seek();}
else{
    setInterval(fkwebp,1000);}
clearInterval(fkwebp);