2020-08-17 22:23:17 +02:00
|
|
|
// ==UserScript==
|
|
|
|
// @name Goodreads expand
|
2020-08-18 00:30:13 +02:00
|
|
|
// @description Show the whole description / author information on goodreads.com.
|
|
|
|
// @description:de Zeige die ganze beschreibung / author·inneninformation auf goodreads.com an.
|
|
|
|
// @version 2020.08.18.1
|
2020-08-17 22:23:17 +02:00
|
|
|
// @author tastytea
|
|
|
|
// @copyright 2020, tastytea (https://tastytea.de/)
|
|
|
|
// @license GPL-3.0-only
|
|
|
|
// @namespace tastytea.de
|
|
|
|
// @homepageURL https://schlomp.space/tastytea/userscripts
|
|
|
|
// @supportURL https://schlomp.space/tastytea/userscripts/issues
|
2020-08-17 22:24:50 +02:00
|
|
|
// @downloadURL https://schlomp.space/tastytea/userscripts/raw/branch/main/catalogues/goodreads_expand.user.js
|
2020-08-17 22:23:17 +02:00
|
|
|
// @grant none
|
|
|
|
// @match https://www.goodreads.com/book/*
|
2020-08-18 00:30:13 +02:00
|
|
|
// @match https://www.goodreads.com/author/*
|
2020-08-17 22:23:17 +02:00
|
|
|
// @run-at document-end
|
|
|
|
// @inject-into content
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
(function()
|
|
|
|
{
|
2020-08-18 00:30:13 +02:00
|
|
|
let root = document.getElementById("description");
|
|
|
|
if (root === null)
|
2020-08-17 22:23:17 +02:00
|
|
|
{
|
2020-08-18 00:30:13 +02:00
|
|
|
root = document.getElementsByClassName("aboutAuthorInfo")[0];
|
|
|
|
if (root === null)
|
2020-08-17 22:23:17 +02:00
|
|
|
{
|
2020-08-18 00:30:13 +02:00
|
|
|
console.warn("Could not find description / author info.");
|
|
|
|
return;
|
2020-08-17 22:23:17 +02:00
|
|
|
}
|
|
|
|
}
|
2020-08-18 00:30:13 +02:00
|
|
|
|
|
|
|
const spans = root.getElementsByTagName("span");
|
|
|
|
if (spans.length >= 2)
|
2020-08-17 22:23:17 +02:00
|
|
|
{
|
2020-08-18 00:30:13 +02:00
|
|
|
spans[1].setAttribute("style", "display: block;");
|
|
|
|
spans[0].setAttribute("style", "display: none;");
|
|
|
|
|
|
|
|
const links = root.getElementsByTagName("a");
|
|
|
|
links[links.length - 1].text = "(less)";
|
2020-08-17 22:23:17 +02:00
|
|
|
}
|
|
|
|
})();
|