您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
将百度搜索结果链接替换成原始链接
// ==UserScript== // @name 拒绝百度搜索结果二次跳转 // @namespace baidu-real-link // @version 0.0.3 // @author lyswhut // @license MIT // @description 将百度搜索结果链接替换成原始链接 // @match https://www.baidu.com/s?* // @run-at document-start // @noframes // @grant none // ==/UserScript== (function() { 'use strict' const handleReplace = () => { for (const item of document.querySelectorAll('.new-pmd')) { const link = item.getAttribute('mu') if (!link) continue if (link.includes('lightapp.baidu.com')) continue let a = item.querySelector('.c-title > a') if (!a) a = item.querySelector('.c-border a') if (!a) continue a.setAttribute('href', link) } } document.addEventListener('DOMContentLoaded', () => { handleReplace() const observer = new window.MutationObserver(() => { setTimeout(handleReplace) }) const dom_content = document.querySelector('#wrapper_wrapper') if (!dom_content) return observer.observe(dom_content, { attributes: false, childList: true, subtree: false, }) }) })()