Bypass Google Sorry (reCAPTCHA)

Redirect Google reCAPTCHA to new search

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Bypass Google Sorry (reCAPTCHA)
// @namespace    http://angli.io/
// @version      0.4
// @description  Redirect Google reCAPTCHA to new search
// @author       Ang Li
// @include      *://ipv4.google.*/sorry/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));
}

function getRandomGoogleURL() {
    var newURL;
    var n = Math.floor(Math.random()*3);
    switch(n) {
        case 0:
            newURL = "https://www.google.co.jp/search?q=";
            break;
        case 1:
            newURL = "https://www.google.com.tw/search?q=";
            break;
        default:
            newURL = "https://www.google.com.hk/search?q=";
            break;
    }
    return newURL;
}

(function() {
    'use strict';
    var googleSorryUrl = decodeURIComponent(window.location.href);
    var targetDomain = getParameterByName('continue', googleSorryUrl);
    if(targetDomain.match("google")){
        window.location.replace(getRandomGoogleURL() + getParameterByName('q', googleSorryUrl));
    }
})();