您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
反重定向
// ==UserScript== // @name Anti BD Redirect // @namespace [email protected] // @author [email protected] // @description 反重定向 // @include https://www.baidu.com/s* // @include https://www.baidu.com/baidu* // @version 0.1 // @grant GM_xmlhttpRequest // ==/UserScript== function checkUrl(url){ var headUrls = ['http://www.baidu.com/link?url=',] for(var i=0;i<headUrls.length;i++){ if(url.startsWith(headUrls[i])){ return true } } } function setTrueUrl(element) { var url = element.getAttribute('href') GM_xmlhttpRequest({ url: url, method: 'HEAD', onload: function (response) { console.log(response) element.setAttribute('href', response.finalUrl) } }) } function main(al) { for (var i = 0; i < al.length; i++) { var href = al[i].getAttribute('href') if (href && checkUrl(href)) { (function (a) { setTrueUrl(a) }) (al[i]) } } } function listener(e) { var al = document.querySelectorAll('#container a') main(al) } listener() var target = document.querySelector('#container'); // 创建观察者对象 var observer = new MutationObserver(function(mutations) { listener() //mutations.forEach(function(mutation) {}); }); // 配置观察选项: var config = {'childList': true, 'subtree': true} // 传入目标节点和观察选项 observer.observe( document.querySelector('#wrapper_wrapper'), config);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址