您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
高效的清理虾皮商品网址
- // ==UserScript==
- // @name Remove shopee tracker
- // @name:zh-TW 移除蝦皮追蹤器
- // @name:zh-CN 移除虾皮追踪器
- // @namespace https://gf.qytechs.cn
- // @version 0.0.5
- // @description Efficiently clean Shopee product URLs.
- // @description:zh-TW 高效的清理蝦皮商品網址
- // @description:zh-CN 高效的清理虾皮商品网址
- // @author Pixmi
- // @match *://shopee.tw/*
- // @match *://shopee.ph/*
- // @match *://shopee.sg/*
- // @match *://shopee.com.my/*
- // @icon https://icons.duckduckgo.com/ip2/shopee.com.ico
- // @grant none
- // @license GPL-3.0
- // @run-at document-body
- // ==/UserScript==
- (function() {
- 'use strict';
- const reg = new RegExp(/\-i\.([\d]+)\.([\d]+)/);
- const cleanURL = (url) => {
- const match = url.match(reg);
- if (!match) return url;
- return `/product/${match[1]}/${match[2]}`;
- };
- if (reg.test(window.location.href)) {
- window.location.replace(`${window.location.origin}${cleanURL(window.location.href)}`);
- }
- const originalPushState = history.pushState;
- const originalReplaceState = history.replaceState;
- history.pushState = function(state, title, url) {
- if (url) { url = cleanURL(url); }
- return originalPushState.call(this, state, title, url);
- };
- history.replaceState = function(state, title, url) {
- if (url) { url = cleanURL(url); }
- return originalReplaceState.call(this, state, title, url);
- };
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址