Greasy Fork is available in English.
Add total page count to DBLP paper listings
// ==UserScript==
// @name DBLP Page Count Display
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add total page count to DBLP paper listings
// @author You
// @match https://dblp.org/*
// @match https://dblp.uni-trier.de/*
// @match https://*.dblp.org/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
function addPageCounts() {
// Find all pagination spans
const paginationSpans = document.querySelectorAll('span[itemprop="pagination"]');
paginationSpans.forEach(span => {
// Check if we've already processed this span
if (span.dataset.processed) return;
const pageRange = span.textContent.trim();
// Match patterns like "23-42" or "123-456"
const match = pageRange.match(/^(\d+)-(\d+)$/);
if (match) {
const startPage = parseInt(match[1], 10);
const endPage = parseInt(match[2], 10);
const totalPages = endPage - startPage + 1;
// Create a new span for the page count
const countSpan = document.createElement('span');
countSpan.textContent = ` (${totalPages} pages)`;
countSpan.style.color = '#666';
countSpan.style.fontSize = '0.95em';
// Insert after the pagination span
span.parentNode.insertBefore(countSpan, span.nextSibling);
// Mark as processed
span.dataset.processed = 'true';
}
});
}
// Run initially
addPageCounts();
// Watch for dynamic content changes
const observer = new MutationObserver(() => {
addPageCounts();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();