您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make 'all books' hide-able, hide it and expand others
// ==UserScript== // @name Bookfusion: Collapsible All Books section // @namespace http://tampermonkey.net/ // @version 1.0 // @description Make 'all books' hide-able, hide it and expand others // @match https://www.bookfusion.com/bookshelf* // @license MIT // ==/UserScript== (function () { 'use strict'; function updateHeaderDiv() { const headerDiv = document.querySelector('div.bookshelf-expandable-header-details.is-disabled'); if (headerDiv) { headerDiv.classList.remove('is-disabled'); headerDiv.setAttribute('data-action', 'click->horizontal-book-list#toggleAction'); console.log('✅ Header div updated'); } else { console.log('⚠️ No disabled header div found'); } } function updateExpandableDivs() { const divs = document.querySelectorAll('div.bookshelf-expandable'); if (divs.length === 0) { console.log('⚠️ No bookshelf-expandable divs found'); return; } divs.forEach((div, index) => { if (index === 0) { div.classList.remove('is-expanded'); } else { div.classList.add('is-expanded'); //div.classList.remove('is-expanded'); } }); console.log(`✅ Updated ${divs.length} expandable div(s)`); } // Run once on full page load (in case of slow content) window.addEventListener('load', () => { updateHeaderDiv(); // comment out next line if you don't want all books shrunk and all others expanded. updateExpandableDivs(); }); })();