Google_search_filter_with_Language

Google result filter by language

  1. // ==UserScript==
  2. // @name Google_search_filter_with_Language
  3. // @name:zh-CN Google_search_filter_with_Language
  4. // @name:zh-TW Google_search_filter_with_Language
  5. // @name:ja Google_search_filter_with_Language
  6. // @description:zh-CN Google result filter by language
  7. // @description:zh-TW Google result filter by language
  8. // @description:ja Google result filter by language
  9. // @description Google result filter by language
  10. // @namespace Google_search_filter_with_Language
  11. // @supportURL https://github.com/zhuzemin
  12. // @include https://www.google.*/search*
  13. // @author zhuzemin
  14. // @version 1.12
  15. // @grant none
  16. // ==/UserScript==
  17. let searchBtn=document.querySelector("button.Tg7LZd");
  18. let lr = document.createElement("lr");
  19. lr.innerHTML = '<lr><a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '').replace(/$/, '&lr=lang_en')+'">EN</a>/<a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '').replace(/$/, '&lr=lang_ja')+'">JA</a>/<a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '').replace(/$/, '&lr=lang_zh-TW')+'">TW</a>/<a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '').replace(/$/, '&lr=lang_zh-CN')+'">CN</a>/<a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '').replace(/$/, '&lr=lang_zh-CN|lang_zh-TW')+'">TW&CN</a>/<a href="'+window.location.href.replace(/lr=lang_(.{1,16})/g, '')+'">All Language</a></lr>'
  20. searchBtn.parentNode.insertBefore(lr, searchBtn);
  21. let allLinks=document.querySelectorAll('a.hide-focus-ring');
  22. for(let link of allLinks){
  23. if(/(isch)|(vid)/.test(link.href)){
  24. searchBtn.parentNode.insertBefore(link, searchBtn);
  25. }
  26. }

QingJ © 2025

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