您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to check which books still need to be read. Includes both Book Club and Booktastic Books.
// ==UserScript== // @name Neopets: Books Checklist // @author Tombaugh Regio // @version 1.0 // @description Adds a button to check which books still need to be read. Includes both Book Club and Booktastic Books. // @namespace https://greasyfork.org/users/780470 // @match http://www.neopets.com/books_read.phtml?pet_name=* // @match http://www.neopets.com/moon/books_read.phtml?pet_name=* // @match https://items.jellyneo.net/tools/book-checklist/ // @match https://items.jellyneo.net/tools/booktastic-checklist/ // @grant GM_openInTab // @grant GM_getValue // @grant GM_setValue // ==/UserScript== const URL = document.URL if (URL.includes("books_read")) { const title = document.querySelector(".content").querySelector("b") //Add a book checker button const priceCheckerButton = document.createElement("button") const priceCheckerLink = document.createElement("a") priceCheckerButton.innerText = "Check to-read list" priceCheckerButton.style.margin = "0 0.5em" priceCheckerButton.style.cursor = "pointer" //Save the page's entire HTML and open the book checker page priceCheckerButton.onclick = e => { e.preventDefault() const HTML = new XMLSerializer().serializeToString(document) let link if (URL.includes("moon")) link = "https://items.jellyneo.net/tools/booktastic-checklist/" else link = "https://items.jellyneo.net/tools/book-checklist/" GM_setValue("copiedHTML", HTML) GM_openInTab(link) } //Append button after title title.after(priceCheckerButton) } if (URL.includes("jellyneo")) { const inputTextArea = document.querySelector("#checklist-code") const priceCheckButton = document.querySelector("#checklist-submit") const copiedHTML = GM_getValue("copiedHTML") inputTextArea.textContent = copiedHTML if (inputTextArea.textContent.length > 0) priceCheckButton.click() }