Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if browser tab is active javascript

let browser_active = ((typeof document.hasFocus != 'undefined' ? document.hasFocus() : 1) ? 1 : 0);
if (!browser_active) {
 // active
} 
 
PREVIOUS NEXT
Tagged: #check #browser #tab #active #javascript
ADD COMMENT
Topic
Name
9+1 =