您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to each theme collection for easy removal
// ==UserScript== // @name GGn Collection Removal Buttons // @namespace none // @version 2 // @description Adds a button to each theme collection for easy removal // @author ingts // @match https://gazellegames.net/torrents.php?id=* // ==/UserScript== const collectionsDiv = document.querySelector('.theme_collections') if (collectionsDiv) { collectionsDiv.querySelectorAll('div').forEach(div => { div.style.display = 'flex' div.style.alignItems = 'center' const button = document.createElement('button') button.type = 'button' button.textContent = 'X' button.style.cssText = ` filter: opacity(0.7); font-size: 0.9em; width: min-content; height: min-content; margin-left: auto;` div.append(button) button.onclick = () => { button.disabled = true const groupId = new URL(location.href).searchParams.get('id') const collectionId = /\d+/.exec(div.firstElementChild.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}`) }) } }) }