) rather than // waiting for '.zooza' to exist first - the Zooza widget mounts asynchronously // (API call to api.zooza.app) and can take well over 1.5s on a busy page, so gating // the observer on '.zooza' already being present missed it entirely on the live site. if ('MutationObserver' in window && !window.__fkMutationObserver) { var debounceTimer = null; var mo = new MutationObserver(function(){ clearTimeout(debounceTimer); debounceTimer = setTimeout(applyAll, 250); }); mo.observe(document.documentElement, { childList: true, subtree: true }); window.__fkMutationObserver = mo; } } catch(e) {} } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } // Extra fallback passes in case the widget mounts slowly and the observer's first // debounce window is missed for any reason. setTimeout(init, 1500); setTimeout(applyAll, 3000); setTimeout(applyAll, 6000); })();