Bypass Google Sorry (reCAPTCHA)

Redirect Google reCAPTCHA to new search

目前为 2017-09-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bypass Google Sorry (reCAPTCHA)
  3. // @namespace http://angli.io/
  4. // @version 0.3
  5. // @description Redirect Google reCAPTCHA to new search
  6. // @author Ang Li
  7. // @include *://ipv4.google.*/sorry/*
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. function getParameterByName(name, url) {
  13. if (!url) url = window.location.href;
  14. name = name.replace(/[\[\]]/g, "\\$&");
  15. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  16. results = regex.exec(url);
  17. if (!results) return null;
  18. if (!results[2]) return '';
  19. return decodeURIComponent(results[2].replace(/\+/g, " "));
  20. }
  21.  
  22. function getRandomGoogleURL() {
  23. var newURL;
  24. var n = Math.floor(Math.random()*3);
  25. switch(n) {
  26. case 0:
  27. newURL = "https://www.google.co.jp/search?q=";
  28. break;
  29. case 1:
  30. newURL = "https://www.google.com.tw/search?q=";
  31. break;
  32. default:
  33. newURL = "https://www.google.com.hk/search?q=";
  34. break;
  35. }
  36. return newURL;
  37. }
  38.  
  39. (function() {
  40. 'use strict';
  41. var queryString = getParameterByName('q', decodeURIComponent(window.location.href));
  42. window.location.replace(getRandomGoogleURL() + queryString);
  43. })();