百度页面带谷歌搜索

百度搜索加上谷歌按钮

目前为 2019-03-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         百度页面带谷歌搜索
// @namespace    https://github.com/kana112233/Tampermonkey-user-js
// @version      1.0.0
// @description  百度搜索加上谷歌按钮
// @author       makey
// @grant        GM_openInTab
// @include      https://www.baidu.com/*
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// ==/UserScript==
(function() {
   'use strict';

   function getGoogleUrl(searchText) {
       return 'https://www.google.com/search?q=' + searchText;
   }
   function googleIt() {
       var searchText = document.querySelector('#kw').value;
       GM_openInTab( getGoogleUrl(searchText), false);
   }
    $('#su').after('<input type="button" id="google" value="Google一下" class="btn self-btn bg s_btn" style="background-color:grey;" />');
    $("#google").click(function() {
        googleIt();
    });

})();

QingJ © 2025

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