百度页面带谷歌搜索

百度搜索加上谷歌按钮

目前為 2020-05-06 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 百度页面带谷歌搜索
  3. // @namespace https://github.com/kana112233/Tampermonkey-user-js
  4. // @version 1.0.2
  5. // @description 百度搜索加上谷歌按钮
  6. // @author makey
  7. // @grant GM_openInTab
  8. // @include https://www.baidu.com/*
  9. // @require https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13.  
  14. function getGoogleUrl(searchText) {
  15. return 'https://www.google.com/search?q=' + searchText;
  16. }
  17. function googleIt() {
  18. var searchText = document.querySelector('#kw').value;
  19. GM_openInTab( getGoogleUrl(searchText), false);
  20. }
  21. $('#su').after('<input type="button" id="google" value="Google一下" class="btn self-btn bg s_btn" style="background-color:black;" />');
  22.  
  23. $("#google").click(function() {
  24. googleIt();
  25. });
  26.  
  27. setInterval(function(){
  28. if($("#google").val() !== "Google一下"){
  29. $("#google").val("Google一下");
  30. }
  31. }, 50);
  32.  
  33. })();

QingJ © 2025

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