Grepolife tiny fixes

Town as a link in conquer list

// ==UserScript==
// @name         Grepolife tiny fixes
// @name:ru		 Крошечные изменения Grepolife
// @namespace    http://grepolis.scripts/
// @version      1.0.2
// @description  Town as a link in conquer list
// @description:ru  Города в списке захватов как ссылка
// @author       Plest; Veta4ka
// @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);
	}
})();