直播顺畅

一个替换logo的脚本

  1. // ==UserScript==
  2. // @name 直播顺畅
  3. // @version 0.1.3
  4. // @description 一个替换logo的脚本
  5. // @author You
  6. // @match https://*.google.com/*
  7. // @match https://www.google.co.jp/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=google.co.jp
  9. // @license MIT
  10. // @namespace http://tampermonkey.net/
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // Your code here...
  17.  
  18. // 检测是主页面还是搜索结果界面
  19. var main_page_classname = "lnXdpd";
  20. var baidu_logo = "https://www.baidu.com/img/pcdoodle_2a77789e1a67227122be09c5be16fe46.png";
  21. var currentUrl = window.location.href;
  22. var pattern = /^https?:\/\/(www\.)?google\.[a-z]{2,3}(?:\.[a-z]{2})?(?:\/|$)/;
  23.  
  24. if (pattern.test(currentUrl)) {
  25. // 主页
  26. var logoImg = document.getElementsByClassName(main_page_classname).item(0);
  27. var newLogoImg = document.createElement('img');
  28. newLogoImg.src = baidu_logo;
  29. newLogoImg.width = 272;
  30. logoImg.parentNode.removeChild(logoImg.parentNode.firstChild);
  31. logoImg.parentNode.replaceChild(newLogoImg, logoImg);
  32.  
  33. // 修改下方的小字
  34. var searchGoogle = document.getElementsByClassName("gNO89b");
  35. searchGoogle[0].value = "百度一下";
  36.  
  37. //
  38. var aboutGoogle = document.getElementsByClassName("pHiOh");
  39. console.log(aboutGoogle);
  40. aboutGoogle[0].innerHTML = "关于百度";
  41. aboutGoogle[3].innerHTML = "百度搜索的运作方式";
  42. } else {
  43. // 搜索页
  44. }
  45.  
  46. })();

QingJ © 2025

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