document.addEventListener("DOMContentLoaded", function() { // 1. FIX UNVRAWLABLE LINKS (The "No Dice" Fix) var voidLinks = document.querySelectorAll('a[href*="javascript:void(0)"]'); voidLinks.forEach(function(link) { // Change the "link" to a "button" role so Google ignores the href link.setAttribute('role', 'button'); // Change the href to a simple hash so it's technically "crawlable" link.setAttribute('href', '#'); // Prevent the page from jumping when clicked link.addEventListener('click', function(e) { e.preventDefault(); }); }); // 2. YOUR ORIGINAL ACCESSIBILITY FIX var allLinks = document.querySelectorAll('a'); allLinks.forEach(function(link) { link.removeAttribute('tabindex'); var text = (link.innerText || link.textContent).trim(); if (text !== "") { link.setAttribute('aria-label', text); } else if (!link.getAttribute('aria-label')) { link.setAttribute('aria-label', 'Menu Link'); } }); // 3. TAB INDEX & LANDMARK FIX var allElements = document.querySelectorAll('[tabindex]'); allElements.forEach(function(el) { if (parseInt(el.getAttribute('tabindex')) > 0) { el.setAttribute('tabindex', '0'); } }); var bodyDiv = document.querySelector('body > div'); if (bodyDiv) { bodyDiv.setAttribute('role', 'main'); } });


