Google Autocorrect Blocker

Googleの検索語句自動訂正を無効化します。

  1. // ==UserScript==
  2. // @author たかだか。 / TKDK.
  3. // @name Google Autocorrect Blocker
  4. // @name:en Google Autocorrect Blocker
  5. // @namespace https://twitter.com/djtkdk_086969
  6. // @description Googleの検索語句自動訂正を無効化します。
  7. // @description:en Disables Google Search Autocorrect.
  8. // @include *://*.google.*/*
  9. // @exclude *tbm=shop*
  10. // @exclude *tbm=isch*
  11. // @exclude *tbm=vid*
  12. // @exclude *://plus.*
  13. // @exclude *://mail.*
  14. // @exclude *://productforums.*
  15. // @exclude *://maps.*
  16. // @version 0.0.0.009
  17. // @grant none
  18. // @compatible firefox
  19. // @compatible chrome
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. console.log("GAB " + GM_info.script.version + " Started.");
  24. var targetSelector = [
  25. "#fprs *.Pqkn2e",
  26. "p.sp_cnt > a.spell_orig",
  27. "#fprs > a.spell_orig"
  28. ];
  29. var spell_orig = null;
  30. if(targetSelector.some( (e) => {
  31. spell_orig = document.querySelector("#fprs > a.spell_orig, #fprs *.Pqkn2e a");
  32. return (spell_orig !== null);
  33. })) {
  34. console.log("GAB: Autocorrect detected!");
  35. var current_url_split = location.href.split("/");
  36. var autocorrect_orig_url = spell_orig.getAttribute("href");
  37. var new_url = current_url_split[0] + "//" + current_url_split[2] + autocorrect_orig_url;
  38. if(location.href.includes("#") ?
  39. (location.href.substr(location.href.search("#")+1).includes("nfpr=1")) :
  40. (location.href.includes("nfpr=1"))) {
  41. console.log("GAB: nfpr=1 is ineffective for this search keyword. Aborting.");
  42. } else {
  43. console.log("GAB: Redirecting to your original search query...");
  44. let e = document.createElement("span");
  45. e.textContent = "元の検索キーワードによる検索結果に移動しています...";
  46. spell_orig.parentElement.appendChild(e);
  47. location.href = new_url;
  48. }
  49. } else {
  50. console.log("GAB: The results for your original search query is shown."); }
  51. })();

QingJ © 2025

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