BTB

Baidu To Bing Pro From lZiMUl

  1. // ==UserScript==
  2. // @name BTB
  3. // @description Baidu To Bing Pro From lZiMUl
  4. // @author lZiMUl
  5. // @namespace https://b23.tv/vUMYbj
  6. // @version 1.0.1
  7. // @icon http://i1.hdslb.com/bfs/face/513d893377f81848032a79c74b5cd2c385ff5853.jpg
  8. // @license Apache-2.0
  9. // @include http*://baidu.com/*
  10. // @include http*://www.baidu.com/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (global => {
  15. class ToBing {
  16. constructor(query) {
  17. window.location.href = `https://cn.bing.com/search?q=${query}`;
  18. }
  19. };
  20.  
  21. const query = new URL(window.location).searchParams.get('word');
  22.  
  23. if (query) {
  24. new ToBing(query);
  25. } else {
  26. document.getElementById('su').addEventListener('click', () => {
  27. const { value } = document.getElementById('kw');
  28. new ToBing(value);
  29. });
  30. };
  31. })();