Google Search Results Modifier

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

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         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());
        }
    });
})();