// ==UserScript== // @name MZ - WLeague Redirect // @version 1.0 // @description Redirects to team page in World League tables // @author Douglas // @match https://www.managerzone.com/?p=league&type=u18* // @match https://www.managerzone.com/?p=league&type=u21* // @match https://www.managerzone.com/?p=league&type=u23* // @match https://www.managerzone.com/?p=league&type=world* // @grant none // @license MIT // @namespace https://greasyfork.org/users/1088808 // @downloadURL none // ==/UserScript== (function() { function modifyLinks() { const rows = document.querySelectorAll('.nice_table tbody tr'); if (!rows.length) { setTimeout(modifyLinks, 100); return; } for (const row of rows) { const link = row.querySelector('a[href^="/?p=league&type="]'); if (link) { const tid = link.href.match(/tid=(\d+)/); if (tid) { const newURL = `https://www.managerzone.com/?p=team&tid=${tid[1]}`; link.href = newURL; } } } } modifyLinks(); })();