/** * Version Check Script * Tests if browser is using cached JavaScript files */ // Get the version from the main docs page fetch('/docs.html?' + Date.now()) .then(r => r.text()) .then(html => { const match = html.match(/docs-app\.js\?v=(\d+)/); const version = match ? match[1] : 'NOT FOUND'; const expected = '1759828916'; const correct = version === expected; // Now fetch the actual JavaScript return fetch('/js/docs-app.js?v=' + version + '&' + Date.now()) .then(r => r.text()) .then(js => { const hasNewHandler = js.includes('window.location.href='); const hasOldHandler = js.includes('event.stopPropagation()'); let html = ''; if (correct && hasNewHandler) { html = `
JavaScript version: ${version}
Handler includes: window.location.href
Downloads should work now!
JavaScript version loaded: ${version}
Expected: ${expected}
Has new handler: ${hasNewHandler ? '✅ YES' : '❌ NO'}
Your browser is serving cached files!
${js.substring(js.indexOf('onclick='), js.indexOf('onclick=') + 200).replace(//g, '>')}
${err.message}