Google Deep Search Jumper

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
        }
    });

})();