Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not request live information in case tab is not active #6625

Merged
merged 1 commit into from Nov 27, 2014
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Nov 10, 2014

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.

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.
@mattab mattab added this to the Piwik 2.10.0 milestone Nov 10, 2014
@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Performance For when we could improve the performance / speed of Matomo. labels Nov 10, 2014
@mattab
Copy link
Member

mattab commented Nov 10, 2014

Hey, that's a nice change!

That's why we should use the page visibility API which is supported by most browsers

👍
Moved to 2.10.0

@wikiloops
Copy link

👍 thank you!
Good point about the "inactive but visible" situation, too.

@tsteur tsteur self-assigned this Nov 13, 2014
@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Nov 17, 2014
tsteur added a commit that referenced this pull request Nov 27, 2014
Do not request live information in case tab is not active
@tsteur tsteur merged commit 68a072b into master Nov 27, 2014
@tsteur tsteur deleted the 6545 branch November 27, 2014 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants