bingSearchFix

修复bing国内版搜索框异常

  1. // ==UserScript==
  2. // @name bingSearchFix
  3. // @namespace https://cn.bing.com/search
  4. // @version 0.1.2
  5. // @description 修复bing国内版搜索框异常
  6. // @author Conard
  7. // @match https://cn.bing.com/search*
  8. // @icon https://cn.bing.com/sa/simg/favicon-trans-bg-blue-mg.ico
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Your code here...
  17. const getSearch = () => document.querySelector("textarea#sb_form_q");
  18. const keydown = function(e) {
  19. if (e.repeat && e.keyCode != 8) return e.preventDefault();
  20. if (e.keyCode == 13 && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
  21. this.form.submit();
  22. e.preventDefault();
  23. }
  24. }
  25. let search = getSearch();
  26. setTimeout(() => {
  27. while (!search) search = getSearch();
  28. search.addEventListener("keydown", keydown);
  29. },0)
  30. })();

QingJ © 2025

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