Google Autocorrect Blocker

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

当前为 2016-02-05 提交的版本,查看 最新版本

  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. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  9. // @include *://*.google.*/*
  10. // @exclude *tbm=shop*
  11. // @exclude *tbm=isch*
  12. // @exclude *tbm=vid*
  13. // @exclude *://plus.*
  14. // @exclude *://mail.*
  15. // @exclude *://productforums.*
  16. // @exclude *://maps.*
  17. // @version 0.0.0.003
  18. // @grant none
  19. // ==/UserScript==
  20.  
  21. (function() {
  22. console.log("GAB: Started.");
  23. //console.log("GAB: At " + location.href);
  24. if($("p.sp_cnt > a.spell_orig").length > 0) {
  25. console.log("GAB: Autocorrect detected!");
  26. var current_url_split = location.href.split("/");
  27. var autocorrect_orig_url = $("p.sp_cnt > a.spell_orig:first").attr("href");
  28. var new_url = current_url_split[0] + "//" + current_url_split[2] + autocorrect_orig_url;
  29. //alert("GAB: Autocorrect detected! Redirecting to " + new_url);
  30. location.href = new_url;
  31. return;
  32. }
  33. })();