您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
根据自定义关键字屏蔽相关微博,关键字之间使用||隔开
当前为
// ==UserScript== // @name 根据关键字屏蔽微博 // @namespace Blockweibo // @include http://weibo.com/* // @require https://code.jquery.com/jquery-2.2.4.min.js // @author jiyue // @version 1.0 // @description 根据自定义关键字屏蔽相关微博,关键字之间使用||隔开 // ==/UserScript== /* 关键字名单 */ var List = "金正男||习近平"; var x = List.split("||"); mo = new MutationObserver(function(allmutations) { $(".WB_text").each(block); }); var targets = document.body; mo.observe(targets, {'childList': true,'characterData':true,'subtree': true}); function block(){ var txt = $(this).text(); if(findwords(txt) === true){ $(this).text('... ... ... ... ...'); $(this).parent().children('.WB_media_wrap').remove(); } } function findwords(ele){ var result = (ele.indexOf(x[0]) > -1); for(var i = 1; i <= x.length; i++){ result = result || (ele.indexOf(x[i]) > - 1); } return result; }