Greasy Fork

来自缓存

Greasy Fork is available in English.

将手机版网页转换为PC版网页

将京东、B站、淘宝、天猫、微博、知乎、豆瓣手机版网页转换为PC版网页

< 脚本 将手机版网页转换为PC版网页 的反馈

评价:好评 - 脚本运行良好

§
发布于:2025-04-22

希望能清洗pc端的跟踪链接, 简单改了几条规则,测试通过

// @match        *://detail.tmall.com/*
// @match        *://item.taobao.com/*
// @match        *://item.jd.com/*

        {
            // 京东商品详情页pc
            regex: /^https?:\/\/item\.jd\.com\/(\d+).*$/,
            replace: (match, id) => `https://item.jd.com/${id}.html`,
            description: "京东商品详情页转换"
        },
        {
            // 天猫pc
            regex: /^https?:\/\/detail\.tmall\.com\/item\.htm\?(.*)$/,
            replace: (match, params) => {
                try {
                    const id = new URLSearchParams(params).get('id');
                    return id && `https://detail.tmall.com/item.htm?id=${id}`;
                } catch (error) {
                    return null;
                }
            },
            description: "天猫商品详情页转换(使用 URLSearchParams 处理参数)"
        },
        {
            // 淘宝pc
            regex: /^https?:\/\/item\.taobao\.com\/item\.htm\?(.*)$/,
            replace: (match, params) => {
                try {
                    const id = new URLSearchParams(params).get('id');
                    return id && `https://item.taobao.com/item.htm?id=${id}`;
                } catch (error) {
                    return null;
                }
            },
            description: "淘宝商品详情页转换(使用 URLSearchParams 处理参数)"
        },
Alfa Vizh作者
§
发布于:2025-05-29

因为有些需要返利,所以不准备支持

发布留言

登录以发布留言。