Greasy Fork

Greasy Fork is available in English.

图片路径替换

图片URL替换

目前为 2020-03-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         图片路径替换
// @namespace    zgzhihu
// @version      0.10
// @description  图片URL替换
// @author       cyf0611
// @match        *://img.alicdn.com/*
// @match        *://ci.xiaohongshu.com/*
// @run-at       document-end
// @grant        unsafeWindow
// @grant        GM_setClipboard
// ==/UserScript==

(function() {
    'use strict';

    let href = location.href;


    //淘宝
    if(href.includes("taobao")) {
        if(href.split("_").length===3) {
            location.href = href.split(/_\d/)[0];
        }
    }

    //小红书
    if(href.includes("xiaohongshu")) {
        if(href.split("?").length===2) {
            location.href = href.split("?")[0];
        }
    }

})();