您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Removes unnecessary parameters to Aliexpress urls
当前为
// ==UserScript== // @name Aliexpress Url Cleaner // @version 0.1 // @description Removes unnecessary parameters to Aliexpress urls // @match *://*.aliexpress.com/* // @require https://code.jquery.com/jquery-3.1.1.slim.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.20.0/polyfill.min.js // @namespace http://greasyfork.icu/users/168 // @grant none // ==/UserScript== /* global jQuery */ let reg = /(\/\/(?:\w+\.)*aliexpress\.com\/store\/product\/[^\/]+\/\d+_\d+\.html)(\?[^#\r\n]+)?(#.+)?/; function toCanonical(original) { let match = original.match(reg); if (match && match[1]) { return match[1] + (match[3] || ''); } return null; } (new Promise(jQuery)).then(() => { let canonical = toCanonical(window.location.href) || toCanonical(jQuery('link[rel=canonical]').attr('href') + window.location.hash); if (canonical) { window.history.replaceState({}, '', canonical); } jQuery('a').each((i, e) => { var canonical = toCanonical(e.href); if (canonical) { e.href = canonical; } }); });