const urlParams = new URLSearchParams(window.location.search); const onLocalhost = location.hostname === 'localhost' || location.hostname === '127.0.0.1'; const devNoJS = onLocalhost && urlParams.has('nojs'); // Default: JS is considered disabled if script does not run window.jsEnabled = false; document.addEventListener('DOMContentLoaded', () => { const noJS = document.querySelector('.no-js'); const withJS = document.querySelector('.with-js'); if (devNoJS) { console.log('[ifJS] 🛠️ DevMode ON (simulating no-JS locally)'); // Hide JS-dependent content if (withJS) withJS.style.display = 'none'; // Preview: inject