(Microsoft Rewards) Bing to Google

Changes from Bing to Google

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name (Microsoft Rewards) Bing to Google
// @description Changes from Bing to Google
// @include http://*.bing.com/search?*
// @include https://*.bing.com/search?*
// @version 0.0.0.5
// @icon https://rewards.bing.com/rewards.png
// @author JAS1998
// @copyright 2023+ , JAS1998 (https://greasyfork.org/users/4792)
// @namespace https://greasyfork.org/users/4792
// @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
// @compatible Chrome tested with Tampermonkey
// @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
// @run-at document-start
// ==/UserScript==
 
/* jshint esversion: 9 */
 
var referrer = document.referrer;
 
if (!referrer.includes('rewards.bing.com') && !referrer.includes('.bing.com/search?q=')) {
    var googlesearch = "https://google.com/search?" + document.URL.match(/q\=[^&]*/);
    if (googlesearch != document.URL) {
        location.replace(googlesearch);
    }
}

function isMobile() {
    return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
}

if (isMobile()) {
    googlesearch = "https://google.com/search?hl=de&site=webhp&source=hp&ei=1R3VUYDfOcHDtAbbhYDoCA&q=" + document.URL.match(/q\=[^&]*/);
    if (googlesearch != document.URL) {
        location.replace(googlesearch);
    }
}