您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
访问到手机版京东时重定向到电脑版并去除跟踪参数
// ==UserScript== // @name 手机版京东跳转电脑 // @namespace https://tampermonkey.net/ // @version 0.1 // @description 访问到手机版京东时重定向到电脑版并去除跟踪参数 // @author JSSM // @match *://*.item.m.jd.com/product/*.html* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 当页面加载完成后执行重定向 window.onload = function() { // 提取当前URL中的商品ID var currentUrl = window.location.href; var itemIdMatch = currentUrl.match(/product\/([^/]+)\.html/i); if (itemIdMatch && itemIdMatch[1]) { // 构造新的标准JD商品页面URL var itemId = itemIdMatch[1]; var newUrl = 'https://item.jd.com/' + itemId + '.html'; // 执行重定向 window.location.href = newUrl; } }; })();