Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

function tabulateResults () {
	let groups = {};
	
	$(".mw-search-result-heading a").each((i, e) => {
		let page = $(e).attr("title");
		let index = page.replace(/^Page:(.*)\/\d+/, '$1');
		if (groups[index] === undefined) {
			groups[index] = 1;
		} else {
			groups[index] += 1;
		}
	});
	
	for (const g in groups) {
	  console.log(g + ": " + groups[g]);
	}
}
$(function () {
    var countPortlet = mw.util.addPortletLink(
      'p-cactions', '#', 'Count results', 'ca-count', 'Count the search results by index'
    ); 
    $(countPortlet).on('click', function (e) {
      e.preventDefault();
      tabulateResults();
    });
});