谷歌搜索优化

自动添加搜索关键词reddit

  1. // ==UserScript==
  2. // @name 谷歌搜索优化
  3. // @namespace 龟龟
  4. // @version 0.1
  5. // @description 自动添加搜索关键词reddit
  6. // @author 兰屿绿蠵龟
  7. // @match https://www.google.com/search*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. function addRedditToQuery() {
  14. const urlParams = new URLSearchParams(window.location.search);
  15. const query = urlParams.get('q');
  16. if (query && !query.toLowerCase().includes('reddit')) {
  17. const newQuery = `${query} reddit`;
  18. urlParams.set('q', newQuery);
  19. const newUrl = `${window.location.origin}${window.location.pathname}?${urlParams.toString()}`;
  20. window.location.replace(newUrl);
  21. }
  22. }
  23. window.addEventListener('load', addRedditToQuery);
  24. })();

QingJ © 2025

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