您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Zzzzzz
当前为
- // ==UserScript==
- // @name [RED] FL link in notifications
- // @namespace https://greasyfork.org/users/321857-anakunda
- // @version 1.0
- // @description Zzzzzz
- // @author Anakunda
- // @match https://redacted.ch/torrents.php?*action=notify
- // @match https://orpheus.network/torrents.php?*action=notify
- // @iconURL https://redacted.ch/favicon.ico
- // ==/UserScript==
- (function() {
- 'use strict';
- if (document.getElementById('fl_tokens') == null) return;
- document.querySelectorAll('span.torrent_action_buttons > a.button_dl').forEach(function(a) {
- if (a.parentNode.parentNode.querySelector('strong.tl_free') != null) return;
- var ref = a.parentNode.parentNode.parentNode.parentNode.querySelector(':scope > td:nth-of-type(6)');
- if (ref != null && /^(\d+(?:\.\d+))\s*(\w?B)\b/i.test(ref.textContent.trim())) {
- let size = Math.round(RegExp.$1 * 1024**['B', 'KB', 'MB', 'GB', 'TB'].indexOf(RegExp.$2.toUpperCase()));
- if (size > 2 * 1024**3) return; // tokens apply only on torrents up to 2GB
- }
- ref = a.nextElementSibling;
- var button_fl = a.cloneNode(true);
- button_fl.search += '&usetoken=1';
- button_fl.className = 'tooltip button_fl';
- button_fl.text = 'FL';
- button_fl.title = 'Use a FL Token';
- button_fl.style.fontWeight = 700;
- //button_fl.style.color = 'green';
- button_fl.onclick = function(e) { return confirm('Are you sure you want to use a freeleech token here?') };
- button_fl.onmouseover = function(e) { o.showTooltip(); };
- button_fl.onmouseout = function(e) { o.hideTooltip(); };
- a.parentNode.insertBefore(button_fl, ref);
- a.parentNode.insertBefore(document.createTextNode(' | '), ref);
- });
- })();