v2ex-custom-search-to-baidu

改变V2EX网站内置自定义搜索为百度

  1. // ==UserScript==
  2. // @name v2ex-custom-search-to-baidu
  3. // @namespace http://hktkdy.com/
  4. // @version 0.1
  5. // @description 改变V2EX网站内置自定义搜索为百度
  6. // @author zhangolve
  7. // @match https://www.v2ex.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. window.onload=function()
  14. {
  15. var form=document.getElementsByTagName('form');
  16. form[0].removeAttribute('action');
  17. form[0].removeAttribute('target');
  18. form[0].onsubmit=null;
  19. form[0].onsubmit=function()
  20. {
  21. var value=form[0].firstChild.firstChild.value;
  22. var url="https://www.baidu.com/s?wd=site%3Av2ex.com+"+value;
  23. window.open(url,'_blank');
  24. };
  25. };
  26. })();

QingJ © 2025

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