Handle browsers w/o support for visibility tracking
This commit is contained in:
parent
611c1ccf4a
commit
6c20e58529
1 changed files with 5 additions and 5 deletions
|
|
@ -56,12 +56,12 @@ $(function() {
|
|||
// register for browser visibility tracking
|
||||
|
||||
var prop = getHiddenProp();
|
||||
if (!prop) return undefined;
|
||||
if (prop) {
|
||||
var eventName = prop.replace(/[H|h]idden/, "") + "visibilitychange";
|
||||
document.addEventListener(eventName, updateBrowserVisibility);
|
||||
|
||||
var eventName = prop.replace(/[H|h]idden/, "") + "visibilitychange";
|
||||
document.addEventListener(eventName, updateBrowserVisibility);
|
||||
|
||||
updateBrowserVisibility();
|
||||
updateBrowserVisibility();
|
||||
}
|
||||
|
||||
// exports
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue