Greasy Fork

Greasy Fork is available in English.

blog 展开阅读全文 前端进阶之旅

前端进阶之旅

当前为 2022-08-02 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         blog 展开阅读全文  前端进阶之旅
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @license      MIT
// @description  前端进阶之旅
// @include           *://interview2.poetries.top/*
// @include           *://yuchengkai.cn/*
// @original-script   http://greasyfork.icu/zh-CN/scripts/447245-%E5%BF%AB%E9%80%9F%E8%A7%A3%E6%9E%90
// @icon         https://g.csdnimg.cn/static/logo/favicon32.ico
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==、
// @require      https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js
// @grant        none
// ==/UserScript==
(function () {
  "use strict";

  function myFunction() {
    // 存在子元素
    let container = document.querySelector(".content__default");
    if (container && container.childNodes) {
      Array.from(container.childNodes).forEach((n) => {
        if (n.style) {
          if (n.style.display == "block") {
            return;
          }
          n.style.display = "block";
        }
      });
    }
    // 展开全文按钮
    let btnNode = document.querySelector(".readMore-wrapper");
    if (btnNode) {
      btnNode.remove();
    }
    let CardNode = document.querySelector("#locker");
    if (CardNode) {
      CardNode.remove();
    }
  }

  window.onload = () => {
    myFunction();
    // 轮询
    setInterval(() => {
      myFunction();
    }, 3000);
  };
})();