🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

mmmturkeybacon Numbered Google Results (with 10-per-page mod)

Numbers Google search results in the format M.N (page number, and result number 1-10 on that page). Google Instant should be disabled.

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 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        mmmturkeybacon Numbered Google Results (with 10-per-page mod)
// @author      mmmturkeybacon + clickhappier
// @description Numbers Google search results in the format M.N (page number, and result number 1-10 on that page). Google Instant should be disabled.
// @version     1.0.1.1c
// @namespace   http://userscripts.org/users/523367
// @include     https://www.google.*/search?*
// @include     https://www.google.*/?gws_rd=ssl*
// @require     http://code.jquery.com/jquery-latest.min.js
// @grant       GM_log
// ==/UserScript==


// v1, 2014-02-09 - mmmturkeybacon's original release on userscripts.org (imported to greasyfork on 2014-07-08)
// v1c, 2014-07-02 - modified by clickhappier to add page numbering for 10-result pages
// v1.0.1c, 2015-07-24 - Google's recent formatting changes broke it; rewrote it with jquery in the process of fixing it. 
//                       I saw after finishing that mmmturkeybacon rewrote his version in Mar-Apr 2015 too, and had added
//                       10-per-page support to it now as well as 'easy copy' and some other features, but I guess I'll keep
//                       this around anyway for those who prefer this version.


// If you have Google set to return 10 results per page (default), the first
// page usually has 10 results, but sometimes it will have more or fewer.
// If you change Results per page under Search Settings, Google will return
// more results per page. The number of links on the page might not always be
// the same as the number of results per page you chose. That's because Google
// doesn't count every link it shows you as a result.
// Ads and special results such as images aren't counted.
// "More results from ..." are grouped with the link they are under, as one result.

// Google Instant should be disabled on each Google country domain you use
// (Gear menu -> 'Search Settings' -> 'Never show Instant results.').


function numberIt(jNode)
{

    var i;
    var result_num = 0;
    var page_num = 1;
    var page_str = '';

    // add 10-per-page #s
    if ( $('table#nav tbody tr td.cur').text().trim().length )
    {
        page_num = $('table#nav tbody tr td.cur').text().trim();
    }
    page_str = page_num + '.';
    // end 10-per-page #s

    $('.g div.rc h3.r').each(function(index)
    {
        if ( $(this).find('span.num').length )
        {
            console.log("numbered");
            return;
        }
        else
        {
            result_num++;
            if (result_num > 10)
            {
                page_num++;
                page_str = page_num + '.';
                result_num = result_num - 10;
            }
        
            $(this).html( '<span class="num">' + page_str + result_num + '</span>' + '&nbsp;-&nbsp;' + $(this).html() );
        }
    });

}

$(document).ready(numberIt);