Greasy Fork

Greasy Fork is available in English.

我家在... 改

自动修改淘宝/天猫/京东等购物页面的“配送至”地址,在你分享商品截图的时候保护隐私

当前为 2024-07-22 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         我家在... 改
// @namespace    https://114514.plus/
// @version      0.1.5
// @description  自动修改淘宝/天猫/京东等购物页面的“配送至”地址,在你分享商品截图的时候保护隐私
// @author       Archeb / jkfujr
// @match        https://item.jd.com/*.html*
// @match        https://*.detail.tmall.com/item.htm*
// @match        https://*.detail.tmall.hk/hk/item.htm*
// @match        https://item.taobao.com/item.htm*
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function () {
    "use strict";
    var fakeAddress1 = "日本";
    var fakeAddress2 = "下北沢";

    setTimeout(function () {
        switch (window.location.host) {
            case "item.jd.com":
                document.querySelector(".ui-area-text").innerText = fakeAddress1 + " " + fakeAddress2;
                break;
            case "detail.tmall.com":
            case "detail.tmall.hk":
            case "chaoshi.detail.tmall.com":
            case "item.taobao.com":
                var addressElements = document.querySelectorAll("[class^='Address--mui-addr-tri-']");
                addressElements.forEach(function (element) {
                    if (element.className.includes("1--")) {
                        element.textContent = fakeAddress1;
                    } else if (element.className.includes("2--")) {
                        element.textContent = fakeAddress2;
                    }
                });
                break;
        }
    }, 2500);
})();