萌娘一下

脚本可以在百度搜索结果页面,“百度一下”按钮的右侧添加一个“萌娘一下”按钮,点击可搜索萌娘百科内容

  1. // ==UserScript==
  2. // @name 萌娘一下
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 脚本可以在百度搜索结果页面,“百度一下”按钮的右侧添加一个“萌娘一下”按钮,点击可搜索萌娘百科内容
  6. // @author You
  7. // @match *://www.baidu.com/*
  8. // ==/UserScript==
  9.  
  10.  
  11.  
  12.  
  13. (function () {
  14.  
  15. window.moebutton = document.createElement('input')
  16. window.moebutton.setAttribute('style', 'background:#a5e4a5;border-bottom:#228b22;')
  17. window.moebutton.setAttribute('type', 'button')
  18. window.moebutton.setAttribute('value', '萌娘一下')
  19. window.moebutton.setAttribute('class', 'bg s_btn')
  20. window.moespan = document.createElement('span')
  21. window.moespan.appendChild(window.moebutton)
  22. window.moespan.setAttribute('style', 'margin-left:2px;display:none;')
  23. window.moespan.setAttribute('class', 'bg s_btn_wr')
  24. document.getElementById('form').appendChild(window.moespan)
  25. window.moebutton.style.display='none'
  26. window.moespan.style.display='none'
  27. window.moebutton.onclick = function () {
  28. var input = document.getElementById('kw')
  29. var value = input.value
  30. window.open('https://zh.moegirl.org/index.php?search=' + value)
  31. }
  32.  
  33. window.seemoegirl = function(){
  34.  
  35. if(window.location.href.indexOf("https://www.baidu.com/s?") > -1){
  36. window.moespan.style.display=''
  37. window.moebutton.style.display=''
  38. window.moebutton.value = '萌娘一下'
  39. }else{
  40. window.moespan.style.display='none'
  41. window.moebutton.style.display='none'
  42. }
  43. requestAnimationFrame(function(){
  44. window.seemoegirl()
  45. })
  46. }
  47. window.seemoegirl()
  48.  
  49.  
  50.  
  51. })();

QingJ © 2025

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