您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Modify the URL to keep only specific parameters
// ==UserScript== // @name 小红书链接简化 // @namespace http://tampermonkey.net/ // @version 0.1 // @description Modify the URL to keep only specific parameters // @author Larynx // @match https://www.xiaohongshu.com/* // @license MIT // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; // 获取当前的 URL const url = new URL(window.location.href); // 提取需要的参数 const xsec_source = url.searchParams.get('xsec_source'); const xsec_token = url.searchParams.get('xsec_token'); // 构造新的 URL const newUrl = `${url.origin}${url.pathname}?`; const params = new URLSearchParams(); if (xsec_source) params.append('xsec_source', xsec_source); if (xsec_token) params.append('xsec_token', xsec_token); // 如果参数存在,则更新 URL if (params.toString()) { window.history.replaceState(null, '', newUrl + params.toString()); //window.location.replace(newUrl + params.toString()); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址