Greasy Fork is available in English.

转换webp图片到源格式用于Onenote剪藏

将豆瓣、微信公众号、简书的webp图片转换为对应格式,用于Onenote、Evernote剪辑,可自行模仿如下格式添加用户网站(另起一行)。

Version vom 08.02.2020. Aktuellste Version

// ==UserScript==
// @name           转换webp图片到源格式用于Onenote剪藏
// @name:en        Convert webp to jpg png gif for Onenote clip
// @version        1.0
// @author         Black Rabbit
// @namespace      Black Rabbit
// @description    将豆瓣、微信公众号、简书的webp图片转换为对应格式,用于Onenote、Evernote剪辑,可自行模仿如下格式添加用户网站(另起一行)。
// @description:en Convert the webp pictures of Douban, WeChat public account and Jianshu into corresponding formats for editing in Evernote and Onenote. You can also add effective urls by yourself.
// @include        *://mp.weixin.qq.com/*
// @include        *://mmbiz.qpic.cn/*
// @include        *://www.jianshu.com/*
// @include        *://www.douban.com/*
// ==/UserScript==
var allimg = document.getElementsByTagName('img')
function fkwebp() {
    'use strict';
    for (var i=0;i<allimg.length;i++){
        if(allimg[i].src.toLowerCase().includes('webp')){
            //transfer by format
            if(allimg[i].src.toLowerCase().includes('jpg')){
                allimg[i].src = allimg[i].src.replace(/webp/g,'jpg')}
            if(allimg[i].src.toLowerCase().includes('jpeg')){
                allimg[i].src = allimg[i].src.replace(/webp/g,'jpg')}
            if(allimg[i].src.toLowerCase().includes('png')){
                allimg[i].src = allimg[i].src.replace(/webp/g,'png')}
            if(allimg[i].src.toLowerCase().includes('gif')){
                allimg[i].src = allimg[i].src.replace(/webp/g,'gif')}
            //transfer by special website
            //others
            else{
                allimg[i].src = allimg[i].src.replace(/webp/g,'jpg')}
        }
    }
}
setInterval(fkwebp);