btg

自动将百度跳转到google

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         btg
// @namespace    https://bingkubei.cn/
// @version      0.1
// @description  自动将百度跳转到google
// @author       flowfire
// @include      http://www.baidu.com/*
// @include      https://www.baidu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var url = location.search;
    var kw = url.match(/wd=([^&]+)/);
    var redirect;
    if(kw===null)
        kw = url.match(/word=([^&]+)/);
    if(kw===null)
        redirect="https://www.google.com";
    else
        redirect="https://www.google.com/#q="+kw[1];
    location.href=redirect;
})();