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

Document Supported Browsers #7

Open
thorst opened this issue May 2, 2013 · 7 comments
Open

Document Supported Browsers #7

thorst opened this issue May 2, 2013 · 7 comments

Comments

@thorst
Copy link

thorst commented May 2, 2013

This script looks/works good, and I'm sure the documentation will come when you release a beta.

But when you get to that point (or sooner) please document the browsers you have tested in.

Tested http://shawnmclean.github.io/Idle.js/

PASS::
Windows 7:
Firefox 20.0.1
Chrome Version 27.0.1453.73 beta-m
IE 10

FAIL::
Windows XP:
IE 8

SCRIPT438: Object doesn't support property or method 'addEventListener'
idle.js, line 43 character 7

I've committed to compatibility down to ie8. Unfortunately this fails in ie8. To get rid of the above error i added:

        if (document.addEventListener) {
            document.addEventListener("visibilitychange", (function () {
                return activity.handleVisibilityChange();
            }), false);
            document.addEventListener("webkitvisibilitychange", (function () {
                return activity.handleVisibilityChange();
            }), false);
            document.addEventListener("msvisibilitychange", (function () {
                return activity.handleVisibilityChange();
            }), false);
        } else {
            document.attachEvent("onvisibilitychange", (function () {
                return activity.handleVisibilityChange();
            }));
        }

This will then run, but it doesn't work. I will see if i can figure out some more fixes.

@thorst
Copy link
Author

thorst commented May 2, 2013

Everything seems to work now. I changed to:

        document.onclick = activeMethod;
        document.onmousemove = activeMethod;
        document.onmouseenter = activeMethod;
        document.onkeydown = activeMethod;
        document.onscroll = activeMethod;

Im not sure the below code ever fires though:

        document.attachEvent("onvisibilitychange", (function () {
            return activity.handleVisibilityChange();
        }));

@thorst
Copy link
Author

thorst commented May 2, 2013

The achieve the active tab functionality in ie8 you can reference https://github.com/mathiasbynens/jquery-visibility

@shawnmclean
Copy link
Owner

Hello Thorst, thanks for taking an interest in the project. I'll look into these issues. So the only problem is ie8 and the visibility api?

@thorst
Copy link
Author

thorst commented May 2, 2013

ie8 doesn't have addEventListener or visibility api. So the jquery-visibility project could help with that, if you want that feature to be in ie8. I don't really need that for my implementation, so that doesn't bother me.

It also doesn't like binding window.on* instead preferring document.on* for everything but scroll.

Correction from previous post: window.onscroll = activeMethod; scrolling event on document doesn't work. So i changed it back to window and it does work in ie8 that way.

@chrisbloom7
Copy link

Any progress on this?

@shawnmclean
Copy link
Owner

@chrisbloom7 what would you like to see changed?

@chrisbloom7
Copy link

@shawnmclean Oops, I actually meant to ask after progress on issue #9, not this one.

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

No branches or pull requests

3 participants