您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Fixes AliExpress product links to all point to the actual product pages instead of annoying marketing pages. No more stupid "3 in 1", "Bundle deals" or "SuperDeals" pages making ordering harder.
当前为
// ==UserScript== // @name AliExpress Product Link Fixer // @namespace http://tampermonkey.net/ // @version 1.0 // @license MIT // @description Fixes AliExpress product links to all point to the actual product pages instead of annoying marketing pages. No more stupid "3 in 1", "Bundle deals" or "SuperDeals" pages making ordering harder. // @author NewsGuyTor // @match https://*.aliexpress.com/* // @icon https://www.aliexpress.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; // Function to fix links function fixLinks() { // Select all anchor elements on the page const links = document.querySelectorAll('a[href*="/gcp/"], a[href*="/ssr/"]'); links.forEach(link => { const url = new URL(link.href); const productId = url.searchParams.get('productIds'); if (productId) { // Get the current domain from the link, preserving subdomains const domain = url.host; // Update the href to point to the actual product page on the same domain link.href = `https://${domain}/item/${productId}.html`; } }); } // Run the function on page load fixLinks(); // Run the function again if the page content changes (for dynamically loaded content) const observer = new MutationObserver(fixLinks); observer.observe(document.body, { childList: true, subtree: true }); })();