您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Change torcache.net links on torrent websites to itorrents.org links
当前为
- // ==UserScript==
- // @name Redirect torcache.net to itorrents.org
- // @namespace http://www.dieterholvoet.com
- // @version 1.0
- // @description Change torcache.net links on torrent websites to itorrents.org links
- // @author Dieter Holvoet
- // @match https://torrentproject.se/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- switch(window.location.hostname) {
- case "torrentproject.se":
- torrentproject();
- break;
- }
- })();
- function torrentproject() {
- var urls = document.querySelectorAll(".usite a");
- for(var i = 0; i < urls.length; i++) {
- var text = urls[i].innerHTML,
- href = urls[i].getAttribute("href");
- if(text.indexOf("torcache.net") !== -1) {
- console.log(text, href);
- urls[i].innerHTML = text.replace("torcache.net", "itorrents.org");
- urls[i].setAttribute("href", href.replace("torcache.net", "itorrents.org"));
- }
- }
- }