(Microsoft Rewards) Bing to Google

Changes from Bing to Google

当前为 2023-05-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name (Microsoft Rewards) Bing to Google
  3. // @description Changes from Bing to Google
  4. // @include http://*.bing.com/search?*
  5. // @include https://*.bing.com/search?*
  6. // @version 0.0.0.2
  7. // @icon https://rewards.bing.com/rewards.png
  8. // @author JAS1998
  9. // @copyright 2023+ , JAS1998 (https://greasyfork.org/users/4792)
  10. // @namespace https://greasyfork.org/users/4792
  11. // @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
  12. // @compatible Chrome tested with Tampermonkey
  13. // @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
  14. // @run-at document-start
  15. // ==/UserScript==
  16.  
  17. /* jshint esversion: 9 */
  18.  
  19. var referrer = document.referrer;
  20.  
  21. if (referrer.includes('rewards.bing.com')) {
  22. // nothing
  23. }
  24. else if (referrer.includes('.bing.com/search?q=')) {
  25. // nothing
  26. }
  27. else {
  28. var googlesearch = "https://google.com/search?"+document.URL.match(/q\=[^&]*/);
  29. if (googlesearch != document.URL) location.replace(googlesearch);
  30. }