Google Deep Search Jumper

Jump to any Google results page via simple input (clean UI, no clutter)

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Google Deep Search Jumper 
// @namespace    https://openweb-tools.example
// @version      2.0
// @description  Jump to any Google results page via simple input (clean UI, no clutter)
// @match        https://www.google.*/*
// @grant        none
// @license      GPL-3.0-or-later
// @run-at       document-idle
// ==/UserScript==

/*
GNU GPL v3
https://www.gnu.org/licenses/gpl-3.0.html
*/

(function () {
    'use strict';

    if (!location.href.includes("/search")) return;
    if (document.getElementById("gdsj-box")) return;

    const params = new URLSearchParams(location.search);
    const query = params.get("q");

    if (!query) return;

    function goToPage(page) {
        if (!page || page < 1) return;

        const start = (page - 1) * 10;
        const url = new URL(location.href);

        url.searchParams.set("start", start);
        url.searchParams.set("q", query);

        location.href = url.toString();
    }

    // UI
    const box = document.createElement("div");
    box.id = "gdsj-box";

    box.style = `
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 999999;
        background: rgba(0,0,0,0.85);
        color: #0f0;
        padding: 10px;
        border-radius: 10px;
        font-family: monospace;
        font-size: 12px;
        box-shadow: 0 0 10px rgba(0,0,0,0.5);
    `;

    box.innerHTML = `
        <div style="margin-bottom:5px;">Jump page</div>
        <input id="gdsj-input" type="number" min="1" placeholder="#" style="width:60px;">
        <button id="gdsj-go">Go</button>
    `;

    document.body.appendChild(box);

    document.getElementById("gdsj-go").onclick = () => {
        const page = parseInt(document.getElementById("gdsj-input").value);
        goToPage(page);
    };

    // Enter key support
    document.getElementById("gdsj-input").addEventListener("keydown", (e) => {
        if (e.key === "Enter") {
            const page = parseInt(e.target.value);
            goToPage(page);
        }
    });

})();