// ==UserScript== // @name MZ - WLeague Redirect // @namespace douglaskampl // @version 1.1 // @description Redirects to team pages 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* // @icon https://www.google.com/s2/favicons?sz=64&domain=managerzone.com // @license MIT // @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(); })();