Greasy Fork

69shuba auto 書簽

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

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

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

  document.querySelector("#a_addbookcase").click();
  let author = "";
  if (bookinfo.author) {
    author = bookinfo.author;
  } else {
    author = document
      .querySelector(
        "body > div.container > div.mybox > div.txtnav > div.txtinfo.hide720 > span:nth-child(2)"
      )
      .textContent.trim()
      .split(" ")[1];
  }
  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);
  let style = document.createElement("style");
  style.id = "69shuba_auto_書簽";
  style.innerHTML = `.container {
      margin: -25px auto auto;
      width: auto;
      max-width: fit-content;
  }`;
  document.head.appendChild(style);
  document.querySelector("#pageheadermenu").remove();
  document
    .querySelector("body > div.container > div.mybox > div.top_Scroll")
    .remove();
  document.querySelector("#ad").remove();