您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds buttons to each row in the main collection list for easy removal
// ==UserScript== // @name GGn Collection Removal Buttons // @namespace none // @version 1 // @description Adds buttons to each row in the main collection list for easy removal // @author ingts // @match https://gazellegames.net/torrents.php?id=* // ==/UserScript== const collections = document.getElementById('collages') if (collections) { collections.querySelectorAll('tr:not(.colhead)').forEach(tr => { tr.style.position = 'relative' const button = document.createElement('button') button.type = 'button' Object.assign(button.style, { position: 'absolute', top: '2px', right: '3px', filter: 'opacity(0.8)' }) button.textContent = 'X' tr.append(button) button.onclick = () => { button.disabled = true const groupId = new URL(location.href).searchParams.get('id') const collectionId = /\d+/.exec(tr.querySelector('a').href)[0] fetch('collections.php', { method: 'post', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: `action=manage_handle&auth=${authkey}&collageid=${collectionId}&remove[]=${groupId}&submit=Remove` }) .then(r => { if (!(r.ok && r.redirected)) { button.disabled = false throw Error } button.textContent = '✓' }) .catch(() => { alert(`Failed to remove collection ID ${collectionId}`) }) } }) }