Greasy Fork is available in English.
1/23/24 Adds a button to remove seeding torrents from Search views (Handy to zip the rest for download)
当前为
// ==UserScript==
// @name Remove Seeding
// @namespace yyyzzz999
// @author yyyzzz999
// @description 1/23/24 Adds a button to remove seeding torrents from Search views (Handy to zip the rest for download)
// @match https://www.myanonamouse.net/tor/browse.php*
// @version 0.1
// @icon https://www.myanonamouse.net/pic/smilies/yesmaster.gif
// @homepage http://greasyfork.icu/en/users/705546-yyyzzz999
// @license MIT
// @grant none
// ==/UserScript==
/*jshint esversion: 11 */
/*eslint no-multi-spaces:0 */
(function() {
'use strict';
var DEBUG =1; // Debugging mode on (1) or off (0)
if (DEBUG > 0) console.log('Starting Remove Seeding script');
// debugger
// Create the button
const button = document.createElement("button");
button.textContent = "Remove Seeding Rows";
let el = document.querySelector("div.blockFoot");
var span = document.createElement('span');
// span.textContent = " - " ;
// el.appendChild(span);
el.appendChild(button);
// Add a click event listener to the button
button.addEventListener("click", function() {
// Get all table rows
const rows = document.getElementsByTagName("tr");
if (DEBUG > 0) console.log(`rows.length: ${rows.length}`);
// Loop through all rows
for (let i = rows.length - 1; i >= 0; i--) { //We have to start at the last row, otherwise removing a row skips checking the next row.
const row = rows[i];
const cells = row.getElementsByTagName("td");
let removeRow = false;
if (DEBUG > 0) console.log(`i: ${i}`);
// Loop through all cells in the row
for (let j = 0; j < cells.length; j++) { //shorten this later...
const cell = cells[j];
// Check if the cell contains PF
if (cell.innerHTML.includes('<div class="browseAct">Recently Seeding in your Client</div>')) {
removeRow = true;
break;
}
}
// Hide the row if it doesn't contain the target element
if (removeRow) {
// row.style.display = "none";
row.remove();
if (DEBUG > 0) console.log(`i: ${i} Removed`);
}
}
}); // End hide function
// var headDiv = document.querySelector('div.blockHeadCon');
// headDiv.appendChild(button); //Doesn't work, moves the first button instead of duplicates it.
if (DEBUG > 0) console.log('Remove Seeding script done.');
})();