百度页面带谷歌搜索

百度搜索加上谷歌按钮

// ==UserScript==
// @name         百度页面带谷歌搜索
// @namespace    https://github.com/kana112233/Tampermonkey-user-js
// @version      1.0.2
// @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:black;" />');

   $("#google").click(function() {
       googleIt();
   });

   setInterval(function(){
       if($("#google").val() !== "Google一下"){
           $("#google").val("Google一下");
       }
   }, 50);

})();

QingJ © 2025

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