Описание тега visibilitychange

The visibilitychange event is fired when the content of a tab has become visible or has been hidden.