您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
屏蔽知乎首页视频
当前为
// ==UserScript== // @name purify-zhihu // @namespace http://tampermonkey.net/ // @version 0.5 // @description 屏蔽知乎首页视频 // @author You // @match https://www.zhihu.com/* // @icon https://pic4.zhimg.com/80/v2-88158afcff1e7f4b8b00a1ba81171b61_720w.png // @grant none // ==/UserScript== const q = ".Card.TopstoryItem.TopstoryItem > .Feed "; const inv = 1000 * 1; // 1 s const hasVideo = (div) => { const info = div.getAttribute("data-za-extra-module"); return info && JSON.parse(info)?.card?.has_video; }; const check = (dom) => { const div = dom.querySelector(".ContentItem"); if (hasVideo(dom) || hasVideo(div)) { return true; } return false; }; const f = () => { const list = Array.from(document.querySelectorAll(q)); for (const item of list) { if (check(item)) { item.parentElement?.remove?.(); } } }; (function () { "use strict"; f(); setInterval(f, inv); })();