Google Search Results Modifier

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

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