Greasy Fork

69shuba auto 書簽

自動書籤,更改css,可以在看書頁(https://www.69shuba.com/txt/*/*)找到作者連結

当前为 2023-12-25 提交的版本,查看 最新版本

// ==UserScript==
// @name         69shuba auto 書簽
// @namespace    pl816098
// @version      1.0.1
// @description  自動書籤,更改css,可以在看書頁(https://www.69shuba.com/txt/*/*)找到作者連結
// @author       You
// @match        https://www.69shuba.com/txt/*/*
// @license MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=69shuba.com
// @grant        GM_addStyle
// ==/UserScript==

document.querySelector("#a_addbookcase").click();
    document.querySelector("#ad").remove();
    document
        .querySelector("body > div.container > div.mybox > div.top_Scroll")
        .remove();
    document
        .querySelector("body > div.container > div.yuedutuijian.light")
        .remove();
    let author = "";
    // author = document.querySelector("body > div.container > div.mybox > div.txtnav > div.txtinfo.hide720 > span:nth-child(2)").textContent.trim().split(" ")[1];
    author = bookinfo.author;
    debug(`author: ${author}`);
    let spanElement = document.querySelector(
        "body > div.container > div.mybox > div.txtnav > div.txtinfo.hide720 > span:nth-child(2)"
    );
    let aElement = document.createElement("a");
    aElement.href = `https://www.69shuba.com/modules/article/author.php?author=${author}`;
    aElement.textContent = author;
    spanElement.textContent = spanElement.textContent.trim().split(" ")[0];
    spanElement.appendChild(aElement);
    GM_addStyle(
        `.container {
      margin: auto auto auto;
      min-height: auto;
      width: auto;
      max-width: fit-content;
      box-sizing: border-box;
  }`
  );