We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a956bd1 commit 39e71a7Copy full SHA for 39e71a7
JavaScript/tmallSharedUrl.user.js
@@ -0,0 +1,27 @@
1
+// ==UserScript==
2
+// @name Tmall URL Redirect
3
+// @namespace https://mt25cyb.github.io/
4
+// @version 0.3
5
+// @description Tmall URL Redirect
6
+// @author martin
7
+// @match https://*.tmall.com/*
8
+// @match https://*.taobao.com/*
9
+// @grant none
10
+// ==/UserScript==
11
+
12
+(function() {
13
+ 'use strict';
14
15
+ // 获取原网址的商品 ID
16
+ const urlParams = new URLSearchParams(window.location.search);
17
+ const itemId = urlParams.get('id');
18
19
+ // 检查是否包含商品 ID 且不匹配排除的网址
20
+ if (itemId && window.location.href !== 'https://main.m.taobao.com/detail/index.html?id=' + itemId) {
21
+ // 构建新的 Taobao 网址
22
+ const newUrl = `https://main.m.taobao.com/detail/index.html?id=${itemId}`;
23
24
+ // 跳转到新的网址
25
+ window.location.href = newUrl;
26
+ }
27
+})();
0 commit comments