Sync Google Searches to Bing (Invisible XMLHttpRequest)

Automatically searches on Bing when you search on Google, using an invisible XMLHttpRequest

目前為 2024-09-07 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Sync Google Searches to Bing (Invisible XMLHttpRequest)
// @namespace    Violentmonkey Scripts
// @version      1.0
// @description  Automatically searches on Bing when you search on Google, using an invisible XMLHttpRequest
// @author       intercepted16
// @license      MIT
// @match        https://www.google.com/search*
// @grant        GM_xmlhttpRequest
// @connect      bing.com
// ==/UserScript==

(function() {
    'use strict';

    // Extract search query from the Google URL
    const params = new URLSearchParams(window.location.search);
    const query = params.get('q');

    if (query) {
        // Construct the Bing search URL, adding a bunch of rubbish taken from a real search in Edge
        const bingUrl = `https://www.bing.com/search?q=${encodeURIComponent(query)}&cvid=5ea855fc7c2446b79bd423c6c8dfcca3&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQABhAMgYIAhAuGEAyBggDEC4YQDIGCAQQLhhAMgYIBRAuGEAyBggGEAAYQDIGCAcQABhAMgYICBAuGEDSAQc1NjZqMGoxqAIAsAIA&FORM=ANSPA1&PC=U531`;

        // Use GM_xmlhttpRequest to send a GET request to Bing
        GM_xmlhttpRequest({
            method: "GET",
            url: bingUrl,
            onload: function(response) {
                console.log("Bing search performed silently");
            },
            onerror: function(error) {
                console.error("Error performing Bing search:", error);
            }
        });
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址