Greasy Fork

Greasy Fork is available in English.

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

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

当前为 2020-02-08 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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);