(function() {
function applyMainRole() {
var hero = document.getElementById('hero');
if (!hero) return false;
var node = hero;
while (node.parentElement && node.parentElement !== document.body) {
node = node.parentElement;
}
if (node && node.parentElement === document.body) {
node.setAttribute('role', 'main');
return true;
}
return false;
}
if (applyMainRole()) return;
var attempts = 0;
var interval = setInterval(function() {
attempts++;
if (applyMainRole() || attempts > 20) {
clearInterval(interval);
}
}, 250);
})();