piwik/piwik — pull request #6625 by tsteur (2014-11-10 00:34:44+00:00)
Title: Do not request live information in case tab is not active

refs #6545

At first I used the window.blur/focus events but noticed it would also
stop refreshing if tab is active but browser window is not active. I
reckon many people might want to leave the browser open in one window
and follow the live visitors while working on something else. That's
why we should use the page visibility API which is supported by most
browsers (I think not in <= IE9). I used a different library first
but noticed it adds many event listeners like mousemove etc and it can
make Piwik slow so used the visibility.js library in the end. If someone
uses an old browser nothing will change compared to before so that
should be ok. In a next version we could initiate a refresh immediately
once the browser tab becomes active again.