您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
屏蔽网页版知乎时间线上的视频。Remove video in Zhihu timeline.
// ==UserScript== // @name 屏蔽知乎视频 // @namespace http://tampermonkey.net/ // @version 0.3 // @description 屏蔽网页版知乎时间线上的视频。Remove video in Zhihu timeline. // @author Max // @match https://www.zhihu.com/ // @grant Max // ==/UserScript== function removeVideo(){ var p = document.getElementsByClassName("ContentItem ZVideoItem"); Array.prototype.slice.call(p).forEach(function(item){ item.remove(); }) } removeVideo(); var timeline = document.getElementById("TopstoryContent"); var config = { attributes: true, childList: true, subtree: true }; var callback = function(mutationsList) { mutationsList.forEach(function(item,index){ if (item.type == 'childList') { if(item.target.innerHTML.indexOf("zvideo")!=-1){ removeVideo(); } } }); } var observer = new MutationObserver(callback); observer.observe(timeline, config);