Google Search Results Modifier

在谷歌搜索网址后面自动加上&num=1000

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Google Search Results Modifier
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  在谷歌搜索网址后面自动加上&num=1000
// @author       pianha
// @match        https://www.google.com/search*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 监听页面加载事件
    window.addEventListener('load', function() {
        let url = new URL(window.location.href);
        // 无论是否已有num参数,都添加&num=1000
        url.searchParams.set('num', '1000');
        // 检查是否已经添加过参数,避免无限重定向
        if (!window.location.href.includes('&num=1000')) {
            window.location.replace(url.toString());
        }
    });
})();