百度页面带hk谷歌搜索(基于makey修改版)

百度搜索加上hk谷歌按钮

// ==UserScript==
// @name         百度页面带hk谷歌搜索(基于makey修改版)
// @namespace    https://github.com/kana112233/Tampermonkey-user-js
// @version      1.0
// @description  百度搜索加上hk谷歌按钮
// @author       Levan
// @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.hk/search?q=' + searchText;
   }
   function googleIt() {
       var searchText = document.querySelector('#kw').value;
       GM_openInTab( getGoogleUrl(searchText), false);
   }
   //$('.s_btn_wr').after('<input type="button" id="google" value="Google一下" class="btn self-btn bg s_btn" style="background-color: #4e6ef2; " />');

   $('.s_btn_wr').after('<span class="bg s_btn_wr"><input type="button" id="google" value="Google一下" class="btn self-btn bg s_btn" style="border-radius: .1rem;margin-left: .05rem;" /></span>');



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

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

})();

QingJ © 2025

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