Greasy Fork

Greasy Fork is available in English.

谷歌带百度

google with baidu ok

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         谷歌带百度
// @namespace    https://github.com/kana112233/Tampermonkey-user-js
// @version      1.0.2
// @description google with baidu ok
// @author       makey
// @grant        GM_openInTab
// @include      https://www.google.com/*
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @license MIT

// ==/UserScript==
(function() {
    'use strict';

   function getBaiduOnceUrl(searchText) {
       return 'https://www.baidu.com/s?wd=' + searchText;
   }
   function BaiduOnce() {
       var searchText = document.getElementsByName('q')[0].value;
       GM_openInTab( getBaiduOnceUrl(searchText), false);
   }
   $('#gbqfbb').after('<input type="button" id="baiduId" value="百度一下" class="btn self-btn bg s_btn" style="background-color:#f2f2f2;border:1px solid #f2f2f2;border-radius: 4px;width:142.5px;height:36px" />');
   $('#hdtb-msb').after('<input type="button" id="baiduId" value="百度一下" class="btn self-btn bg s_btn" style="background-color:#f2f2f2;border:1px solid #f2f2f2;border-radius: 4px;width:142.5px;height:36px" />');

   $("#baiduId").click(function() {
        BaiduOnce();
   });

})();