GoogleRedirectBypasser

Automatically proceeds past Google redirect notice pages

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @license MIT
// @name         GoogleRedirectBypasser
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatically proceeds past Google redirect notice pages
// @author       aceitw
// @match        https://www.google.com/url?*
// @match        https://google.com/url?*
// @grant        GM_openInTab
// @grant        window.focus
// @noframes
// ==/UserScript==

(function() {
    'use strict';

    // Function to extract destination URL from the page
    function extractDestinationUrl() {
        // Try to get the URL from the query string first (most reliable)
        const urlParams = new URLSearchParams(window.location.search);
        const destUrl = urlParams.get('q') || urlParams.get('url');

        if (destUrl) {
            return destUrl;
        }

        // Fallback: Try to find the URL in the page content
        // This runs if the script executes after the page has loaded
        const links = document.querySelectorAll('a');
        for (const link of links) {
            // Look for the main "Proceed" link
            if (link.textContent.includes('proceed') ||
                link.href.includes('http') && !link.href.includes('google.com')) {
                return link.href;
            }
        }

        return null;
    }

    // Main function to bypass the redirect
    function bypassRedirect() {
        const destinationUrl = extractDestinationUrl();

        if (destinationUrl) {
            // Redirect immediately to the destination
            window.location.replace(destinationUrl);
        }
    }

    // Run as soon as possible
    bypassRedirect();

    // Also run when DOM is ready (fallback)
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', bypassRedirect);
    } else {
        bypassRedirect();
    }
})();