ACT.简书.MO.Stay

留在网络而非应用,网站浏览体验优化。

  1. // ==UserScript==
  2. // @name ACT.Jianshu.MO.Stay
  3. // @name:zh-CN ACT.简书.MO.Stay
  4. // @description Stay in web not app, browsing experience optimization.
  5. // @description:zh-CN 留在网络而非应用,网站浏览体验优化。
  6. // @author ACTCD
  7. // @version 20220722.1
  8. // @license GPL-3.0-or-later
  9. // @namespace ACTCD/Userscripts
  10. // @supportURL https://github.com/ACTCD/Userscripts#contact
  11. // @homepageURL https://github.com/ACTCD/Userscripts
  12. // @match *://*.jianshu.com/*
  13. // @grant none
  14. // @inject-into content
  15. // @run-at document-start
  16. // ==/UserScript==
  17.  
  18. (function () {
  19. "use strict";
  20.  
  21. function cleaner() {
  22. // Index
  23. document
  24. .querySelector("#jianshu-header")
  25. ?.style.setProperty("position", "absolute"); // Release top space
  26. document.querySelector(".header-download")?.remove(); // Header App banner
  27. document.querySelector("#homepage button.close-btn")?.click(); // Cover App banner
  28. document.querySelector(".note__flow__download")?.remove(); // Embed App banner
  29. document.querySelector(".download-guide")?.remove(); // Float App banner
  30. document.querySelector(".index_call-app-btn")?.remove(); // Footer App banner
  31. document
  32. .querySelector(
  33. "[class^='dialog'][style=''] .open-app-modal button.cancel",
  34. )
  35. ?.click(); // Content collapse
  36. // Article
  37. document.querySelector(".collapse-free-content")?.removeAttribute("class"); // Content collapse
  38. document.querySelector(".collapse-tips")?.remove(); // Content collapse
  39. document.querySelector(".download-app-guidance")?.click(); // Cover App banner
  40. document.querySelector(".app-open")?.remove(); // Embed App banner
  41. document.querySelector(".call-app-btn")?.remove(); // Float App banner
  42. document.querySelector(".comment-open-app-btn-wrap")?.remove(); // Footer App banner
  43. document.querySelector(".download")?.remove(); // Footer App banner
  44. document.querySelector(".note-graceful-button")?.parentElement.remove(); // Reward
  45. document.querySelector("#recommended-notes")?.remove(); // Recommended
  46. document.querySelector("div[aria-label='baidu-ad']")?.remove(); // AD
  47. document.querySelectorAll("img[data-original-src]").forEach((e) => {
  48. // Fix Img display
  49. e.getAttribute("src") ||
  50. e.setAttribute("src", e.getAttribute("data-original-src"));
  51. });
  52. }
  53.  
  54. new MutationObserver(cleaner).observe(document, {
  55. subtree: true,
  56. childList: true,
  57. attributes: true,
  58. });
  59.  
  60. function DOMContentLoaded() {
  61. cleaner();
  62. }
  63.  
  64. if (document.readyState === "loading") {
  65. document.addEventListener("DOMContentLoaded", DOMContentLoaded);
  66. } else {
  67. DOMContentLoaded();
  68. }
  69.  
  70. window.addEventListener("scroll", () => {
  71. // Auto see more
  72. if (
  73. window.pageYOffset + window.innerHeight * 2 <
  74. document.body.clientHeight
  75. )
  76. return;
  77. document.querySelector(".open-app-modal button.cancel")?.click();
  78. document.querySelector(".flow-list-placeholder-load-more")?.click();
  79. });
  80. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址