I want to check if the user changed the view of the current tab, that\'s why I am testing with if condition on document.hasFocus() and if it\'s equal t
if
document.hasFocus()