您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove trackers from magnet links
// ==UserScript== // @name 删除磁力链接Tracker Remover Magnet Link Tracker // @name:zh-cn 删除磁力链接Tracker // @namespace lanhaha // @version 1.2 // @description Remove trackers from magnet links // @description:zh-cn 删除磁力链接Tracker // @match *://*/* // @grant none // @license MIT License // ==/UserScript== (function() { 'use strict'; // Get all the links on the page var links = document.getElementsByTagName("a"); // Loop through the links for (var i = 0; i < links.length; i++) { // Get the href attribute of the link var href = links[i].href; // Check if the link is a magnet link if (href.startsWith("magnet:?")) { // Split the link by "&" to get the parameters var params = href.split("&"); // Loop through the parameters for (var j = 0; j < params.length; j++) { // Check if the parameter is a tracker if (params[j].startsWith("tr=")) { // Remove the parameter from the array params.splice(j, 1); // Decrement j to avoid skipping the next parameter j--; } // Join the parameters back with "&" var newHref = params.join("&"); // Replace the link's href attribute with the new one links[i].href = newHref; } } } })();