btg

自动将百度跳转到google

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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;
})();