// ==UserScript== // @name Remove Seeding // @namespace yyyzzz999 // @author yyyzzz999 // @description 1/24/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.3 // @icon https://www.myanonamouse.net/pic/smilies/yesmaster.gif // @homepage https://greasyfork.org/en/users/705546-yyyzzz999 // @supportURL https://greasyfork.org/en/scripts/485525-remove-seeding/feedback // @license MIT // @grant none // @downloadURL none // ==/UserScript== /*jshint esversion: 11 */ /*eslint no-multi-spaces:0 */ (function() { 'use strict'; const DEBUG =1; // Debugging mode on (1) or off (0) if (DEBUG > 0) console.log('Starting Remove Seeding script'); var count =0; // debugger // Create the button const button = document.createElement("button"); button.textContent = "Remove Seeding Rows"; button.style.fontSize = "20px"; button.style.backgroundColor = "LightBlue"; let el = document.querySelector("div.blockFoot"); var span = document.createElement('span'); el.appendChild(button); span.textContent = "" ; span.style.fontSize = "18px"; el.appendChild(span); // 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('