Grepolife tiny fixes

Town as a link in conquer list

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);
	}
})();