(function() { function fixIframes() { document.querySelectorAll('iframe').forEach(function(f) { f.loading = 'eager'; }); } // Observer para iframes criados dinamicamente var obs = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(n) { if (n.nodeName === 'IFRAME') n.loading = 'eager'; if (n.querySelectorAll) n.querySelectorAll('iframe').forEach(function(f) { f.loading = 'eager'; }); }); }); }); obs.observe(document.documentElement, { childList: true, subtree: true }); // Quando o usuário volta para a aba inativa document.addEventListener('visibilitychange', function() { if (document.visibilityState === 'visible') fixIframes(); }); // Quando a página é restaurada do bfcache window.addEventListener('pageshow', function(e) { if (e.persisted) fixIframes(); }); })();