Greasy Fork 还支持 简体中文。

Goodreads, show only the standalones in lists

Add a checkbox to Goodreads list pages that allows you to hide books that belong to series

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Goodreads, show only the standalones in lists
// @version      0.2
// @description  Add a checkbox to Goodreads list pages that allows you to hide books that belong to series
// @author       anothershm
// @match        *://*.goodreads.com/review/list/*
// @grant       GM_setValue
// @grant       GM_getValue
// @license     MIT
// @namespace https://greasyfork.org/users/1206936
// ==/UserScript==

(function() {
'use strict';
    const createCheckbox = () => {
        var newDiv = document.createElement('div');
        newDiv.innerHTML = '<input type="checkbox" id="showCore" name="showcb"> <label for="showCore">Show only standalones</label>';
        newDiv.style.display = 'inline';
        newDiv.style.paddingLeft = '10px';
        return newDiv;
    };

    function showStandalone(show) {
        var allBooks = Array.from(document.querySelectorAll('.bookalike'));
        if (!show) {
            allBooks.forEach((el) => { el.hidden = false; });
        } else {
            var booksFromSeries = allBooks.filter((el) => {
                const pattern = /\(.*#(\d+)\)/; // Regular expression to match text with "#number" pattern
                return el.querySelector('.title').innerHTML.match(pattern)
            });
            if (booksFromSeries.length !== allBooks.length) {
                booksFromSeries.forEach((el) => { el.hidden = true; });
            }
        }
    }

    const init = () => {
        const newDiv = createCheckbox();
        document.querySelector('#controls').appendChild(newDiv);
        var cb = newDiv.firstChild;
        cb.checked = GM_getValue('gr_showStandalone', false);
        showStandalone(cb.checked);
        cb.addEventListener('change', (evt) => {
            showStandalone(cb.checked);
            GM_setValue('gr_showStandalone', cb.checked);
        });
   };

    init();
})();