Google Autocorrect Blocker

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

当前为 2017-01-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @author たかだか。(TakaDaka.)
  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.007
  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 spell_orig = document.querySelector("p.sp_cnt > a.spell_orig");
  25. if(spell_orig !== null) {
  26. console.log("GAB: Autocorrect detected!");
  27. var current_url_split = location.href.split("/");
  28. var autocorrect_orig_url = spell_orig.getAttribute("href");
  29. var new_url = current_url_split[0] + "//" + current_url_split[2] + autocorrect_orig_url;
  30. if(location.href.includes("#") ?
  31. (location.href.substr(location.href.search("#")+1).includes("nfpr=1")) :
  32. (location.href.includes("nfpr=1"))) {
  33. console.log("GAB: nfpr=1 is ineffective for this search keyword. Aborting.");
  34. } else {
  35. console.log("GAB: Redirecting to your original search query...");
  36. location.href = new_url;
  37. }
  38. } else {
  39. console.log("GAB: The results for your original search query is shown."); }
  40. })();