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

track browser focus #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

track browser focus #6

wants to merge 3 commits into from

Conversation

dburles
Copy link
Collaborator

@dburles dburles commented Jul 23, 2013

here 'tis

@tmeasday
Copy link
Owner

Cool. Thanks!

Have you tested this cross-browser at all? Is window.onfocus defined everwhere?

@dburles
Copy link
Collaborator Author

dburles commented Jul 23, 2013

From what I've read yes. I'm just not sure about mobile devices, so I'll test that a bit and let you know

@tmeasday
Copy link
Owner

Cool. Want to add to the README and I'll merge and release?

@dburles
Copy link
Collaborator Author

dburles commented Jul 23, 2013

I've read way too many stackoverflow posts regarding browser focus and it seems to be one of those things that's just difficult to do properly cross-platform.

This is the best one I found:
http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active

Also there is a new API http://www.w3.org/TR/page-visibility/
The stackoverflow post above makes use of it but even so, I couldn't get it working on the ipad.

It seems a bit too loose to merge into the master version.

@tmeasday
Copy link
Owner

Hmm, yeah support is a bit patchy: http://caniuse.com/#feat=pagevisibility

Kind of a cool feature though. Is it better to have it where possible or not at all?

On Tuesday, 23 July 2013 at 6:56 PM, David Burles wrote:

I've read way too many stackoverflow posts regarding browser focus and it seems to be one of those things that's just difficult to do properly cross-platform.
This is the best one I found:
http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active
Also there is a new API http://www.w3.org/TR/page-visibility/
The stackoverflow post above makes use of it but even so, I couldn't get it working on the ipad.
It seems a bit too loose to merge into the master version.


Reply to this email directly or view it on GitHub (#6 (comment)).

@dburles
Copy link
Collaborator Author

dburles commented Jul 23, 2013

I'm not sure to be honest!
Like it's not really reliable enough to use for an absolute case of "yes this user is absolutely looking at the page right now" but the flip side is say one example, working nicely for displaying a nice visual "extra" in a chat app.

@tmeasday
Copy link
Owner

Hm…….. will ruminate

On Tuesday, 23 July 2013 at 7:13 PM, David Burles wrote:

I'm not sure to be honest!
Like it's not really reliable enough to use for an absolute case of "yes this user is absolutely looking at the page right now" but the flip side is say one example, working nicely for displaying a nice visual "extra" in a chat app.


Reply to this email directly or view it on GitHub (#6 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants