// ==UserScript== // @name 从必应搜索结果中删除CSDN // @namespace https://sjzlei1989.github.io // @version 0.1 // @description 从必应的搜索结果中删除csdn链接 // @author xiaolei // @match https://cn.bing.com/* // @icon https://cn.bing.com/sa/simg/favicon-2x.ico // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; const str = "csdn"; let contentDom = document.getElementById("b_results"); if(contentDom == null) return; let items = contentDom.getElementsByClassName("b_algo"); if(items == null) return; let indexToDelete = []; for(let i = 0; i < items.length; i++) { let sh_favicon = items[i].getElementsByClassName("sh_favicon"); if(null == sh_favicon) return; let url = sh_favicon[0].href; if(url.toLowerCase().includes(str)) { indexToDelete.push(items[i]); } } for(let i = 0; i < indexToDelete.length; i++) { indexToDelete[i].remove(); } })();