greenart7c3 on Nostr: document.addEventListener('visibilitychange', function() { ...
document.addEventListener('visibilitychange', function() { console.log('visibilitychange', document.hidden) });
window.addEventListener('focus', function() { console.log('browser gained focus') });
window.addEventListener('blur', function() { console.log('browser lost focus') });
Published at
2025-03-29 23:16:55Event JSON
{
"id": "9fd9314a246ebed502f787cc774b593774a2df5d96d1b70dea50ad40f7e92ca1",
"pubkey": "7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19",
"created_at": 1743290215,
"kind": 1,
"tags": [
[
"e",
"2ff469a23396290ff5d72c2d8034e2677dd0badd61ed67ccda4cc827436ac3c4",
"wss://ditto.pub/relay",
"root",
"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19"
],
[
"e",
"2ff469a23396290ff5d72c2d8034e2677dd0badd61ed67ccda4cc827436ac3c4",
"wss://ditto.pub/relay",
"reply",
"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19"
]
],
"content": "document.addEventListener('visibilitychange', function() { console.log('visibilitychange', document.hidden) });\n\nwindow.addEventListener('focus', function() { console.log('browser gained focus') });\n\nwindow.addEventListener('blur', function() { console.log('browser lost focus') });",
"sig": "de25cc2d38cb4164d547eb75d9fec136c580204f442480fbd6549dfcf64e4c80f88adcac51e5a7016a4f0b8e5508b6dadcba07838b5ef996ec16064dfb3dcca4"
}