Bing US Region Setter and License Acceptor with Persistent US Setting

Accept the license agreement and persistently set Bing region to US and language to English

目前為 2024-06-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Bing US Region Setter and License Acceptor with Persistent US Setting
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Accept the license agreement and persistently set Bing region to US and language to English
// @author       Shadow_Kurgansk
// @match        https://www.bing.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to persistently set Bing region to US and language to English
    function setBingRegionToUS() {
        const url = new URL(window.location.href);
        url.searchParams.set('setlang', 'en-us'); // Set language to English (US)
        // If the URL has changed, reload the page with the new parameters
        if (window.location.href !== url.href) {
            window.location.href = url.href;
        }
    }

    // Function to accept the license agreement with a delay
    function acceptLicenseAgreement() {
        // Wait for 2000 milliseconds (2 seconds) before trying to click the button
        setTimeout(function() {
            // Use the ID provided in the image for the 'Accept' button
            const acceptButton = document.querySelector('#bnp_btn_accept.bnp_btn_accept');
            if (acceptButton) {
                acceptButton.click();
                // Call the function to set the region and language only once after clicking the accept button
                setBingRegionToUS();
            }
        }, 200); // Adjust the time as needed
    }

    // Execute the acceptLicenseAgreement function when the page includes 'bing.com'
    if (window.location.href.includes('bing.com')) {
        acceptLicenseAgreement();
    }
})();

QingJ © 2025

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