14 lines
330 B
JavaScript
14 lines
330 B
JavaScript
export function isDocumentVisible() {
|
|
if (typeof document !== 'undefined' && typeof document.visibilityState !== 'undefined') {
|
|
return document.visibilityState !== 'hidden';
|
|
}
|
|
|
|
return true;
|
|
}
|
|
export function isOnline() {
|
|
if (typeof navigator.onLine !== 'undefined') {
|
|
return navigator.onLine;
|
|
}
|
|
|
|
return true;
|
|
} |