GGn Row Numbers in User Log

Add row numbers to the user log

目前为 2024-01-01 提交的版本。查看 最新版本

// ==UserScript==
// @name         GGn Row Numbers in User Log
// @namespace    none
// @version      1
// @description  Add row numbers to the user log
// @author       ingts
// @match        https://gazellegames.net/user.php?*action=userlog*
// ==/UserScript==
const tbody = document.querySelector('#content > div > table > tbody')
const page = new URL(location.href).searchParams.get('page')
const startIndex = page ? (page - 1) * 50 : 0
tbody.firstElementChild.insertAdjacentHTML('afterbegin', `<td style="width: 1px;"><strong>#</strong></td>`)
tbody.querySelectorAll('tr:not(.colhead)').forEach(tr => {
    tr.insertAdjacentHTML('afterbegin', `<td class="nobr"><span>${tr.rowIndex + startIndex}</span></td>`)
})