Changes

no edit summary
Line 1: Line 1:  
document.addEventListener('DOMContentLoaded', function() {
 
document.addEventListener('DOMContentLoaded', function() {
 +
    console.log("Script running...");
 
     var links = document.querySelectorAll('a[href*="https://ntldstats.com/tld/"]');
 
     var links = document.querySelectorAll('a[href*="https://ntldstats.com/tld/"]');
 +
    console.log("Links found: ", links.length);
 
     links.forEach(function(link) {
 
     links.forEach(function(link) {
 +
        console.log("Original href: ", link.href);
 
         var url = new URL(link.href);
 
         var url = new URL(link.href);
 
         var paths = url.pathname.split('/');
 
         var paths = url.pathname.split('/');
Line 10: Line 13:  
             url.pathname = paths.join('/');
 
             url.pathname = paths.join('/');
 
             link.href = url.toString();
 
             link.href = url.toString();
 +
            console.log("Modified href: ", link.href);
 
         }
 
         }
 
     });
 
     });