so it never flashes). Timer markup unchanged. */ (function() { function nukeMuHeader() { document.querySelectorAll('.mu-frequently-header').forEach(function(el) { el.setAttribute('style', 'display:none!important;' + 'visibility:hidden!important;' + 'height:0!important;' + 'min-height:0!important;' + 'max-height:0!important;' + 'padding:0!important;' + 'margin:0!important;' + 'overflow:hidden!important;' + 'opacity:0!important;' + 'pointer-events:none!important;' + 'position:absolute!important;' + 'z-index:-9999!important;' ); el.textContent = ''; el.innerHTML = ''; var parent = el.parentNode; if (parent) { if (!document.getElementById('ltd-mu-timer')) { var timer = document.createElement('div'); timer.id = 'ltd-mu-timer'; timer.innerHTML = '
Limited Time Designs
00Days
:
00Hrs
:
00Min
:
00Sec
'; parent.insertBefore(timer, parent.firstChild); (function() { function getEndOfMonth() { var now = new Date(); return new Date(now.getFullYear(), now.getMonth() + 1, 1, 0, 0, 0, 0); } var endDate = getEndOfMonth(); function pad(n) { return n < 10 ? '0' + n : String(n); } function tick() { var now = new Date(); if (now >= endDate) endDate = getEndOfMonth(); var diff = endDate.getTime() - now.getTime(); var totalSecs = Math.floor(diff / 1000); var d = Math.floor(totalSecs / 86400); var h = Math.floor((totalSecs % 86400) / 3600); var m = Math.floor((totalSecs % 3600) / 60); var s = totalSecs % 60; var dEl = document.getElementById('ltd-mu-days'); var hEl = document.getElementById('ltd-mu-hours'); var mEl = document.getElementById('ltd-mu-mins'); var sEl = document.getElementById('ltd-mu-secs'); if (dEl) dEl.textContent = pad(d); if (hEl) hEl.textContent = pad(h); if (mEl) mEl.textContent = pad(m); if (sEl) sEl.textContent = pad(s); } tick(); setInterval(tick, 1000); })(); } parent.removeChild(el); } }); } nukeMuHeader(); var muQueued = false; new MutationObserver(function() { if (muQueued) return; muQueued = true; requestAnimationFrame(function() { muQueued = false; nukeMuHeader(); }); }).observe(document.body, { childList: true, subtree: true }); })();