Town as a link
当前为
// ==UserScript==
// @name Grepolife tiny fixes
// @name:ru Крошечные изменения Grepolife
// @namespace http://grepolis.scripts/
// @version 1.0.0
// @description Town as a link
// @description:ru Города в списке как ссылка
// @author Plest
// @include /^https?:\/\/grepolife\.com\/[^/]+\/[^/]+\/$/
// @grant none
// ==/UserScript==
(() => {
'use strict';
for (const cityTd of document.querySelectorAll('#conquers tr.small .center:nth-child(2)')) {
const cityEl = cityTd.firstChild;
const cityId = cityEl.nodeValue.replace(/\D+/g, '');
const linkEl = document.createElement('a');
linkEl.setAttribute('href', `${location.href}/town/${cityId}`);
linkEl.appendChild(document.createTextNode(`[town]${cityId}[/town]`));
cityTd.replaceChild(linkEl, cityEl);
}
})();