您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动删除掉谷歌搜索结果中某条、某音的结果
// ==UserScript== // @name 移除谷歌搜索中头条、抖音的搜索结果 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 自动删除掉谷歌搜索结果中某条、某音的结果 // @author zturn // @match https://www.google.com/search* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; console.log("begin"); const observer = new MutationObserver(removeCertainResults); observer.observe(document, {childList: true, subtree: true}); function removeCertainResults() { const results = document.querySelectorAll('.main .g'); const regexes = [ new RegExp('https:\/\/www\.toutiao\.com\/keyword\/.*'), new RegExp('https:\/\/www\.douyin\.com\/zhuanti\/.*'), new RegExp('https:\/\/page\.iesdouyin\.com\/traffic-aggregation\/.*'), new RegExp('https:\/\/www\.douyin\.com\/search\/.*') ]; console.log(`Found ${results.length} elements`); // Log the number of elements found for (const result of results) { let linkElement = result.querySelector('a'); console.log(`${linkElement}`); if (linkElement && regexes.some(regex => regex.test(linkElement.href))) { console.log(`Removing element: ${linkElement.href}`); result.parentElement.removeChild(result); } } } })();