您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces Bing links with DuckDuckGo on Yandex search results page and updates the link text
// ==UserScript== // @name DuckDuckGo on Yandex // @namespace http://tampermonkey.net/ // @version 0.4 // @description Replaces Bing links with DuckDuckGo on Yandex search results page and updates the link text // @author nnside // @match https://yandex.ru/search/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to replace links function replaceBingLinks() { // Get all link elements on the page const links = document.querySelectorAll('a'); // Iterate through all links links.forEach(link => { // Check if the link contains the Bing address if (link.href.includes("bing.com")) { // Replace the link with DuckDuckGo const searchText = new URLSearchParams(window.location.search).get('text'); link.href = `https://duckduckgo.com/?q=${encodeURIComponent(searchText)}`; link.target = '_blank'; // Open in a new tab // Change the link text to "DuckDuckGo" link.textContent = link.textContent.replace("Bing", "DuckDuckGo"); } }); } // Create a MutationObserver to watch for changes in the document const observer = new MutationObserver((mutations) => { mutations.forEach(() => { replaceBingLinks(); // Call the function each time the DOM changes }); }); // Start observing the body for child additions observer.observe(document.body, { childList: true, subtree: true }); // Initial call to replace links when the script runs replaceBingLinks(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址