Greasy Fork is available in English.

去 知乎 Advertisement EBook LiveItem

广告 电子书相关 包含价格相关 信息屏蔽

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         去 知乎 Advertisement EBook LiveItem
// @namespace    http://tampermonkey.net/
// @version      1.3.6
// @description  广告 电子书相关 包含价格相关  信息屏蔽
// @author       jackdizhu
// @match        *://www.zhihu.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
  'use strict';
  var time = null;
  var addEventListener = document.body.addEventListener
  // 清除相关信息

  function remove (el) {
    if (el) {
      if (el.style.visibility === 'hidden') {
        return false
      }
      el.style = `
      position: absolute;
      z-index: -100;
      visibility: hidden;
      `
      document.body.appendChild(el)
    }
  }

  function setHtmlStyle () {
    let $html = document.documentElement
    if ($html.style.overflow === 'hidden') {
      document.documentElement.style = `
      margin: 0;
      `
    }
    window.requestAnimationFrame(setHtmlStyle);
  }
  window.requestAnimationFrame(setHtmlStyle);
  
  let classArr = [
    '.Popover.TopstoryItem-rightButton',
    '.EBookItem',
    '.LiveItem',
    '.Pc-feedAd-container',
    '.Modal-wrapper',
    '.Pc-word-card'
  ]
  function removeAll (str) {
    var el1 = document.querySelectorAll(str);
    for (let i = 0; i < el1.length; i++) {
      const item = el1[i];
      remove(item.parentNode);
    }
  }
  var init = () => {
    for (let i = 0; i < classArr.length; i++) {
      const str = classArr[i];
      removeAll(str);
    }
  }
  var fn = function () {
      window.requestAnimationFrame(init)
  }

  addEventListener("scroll", fn, false);
  // addEventListener('click', fn, false);
})();