tuenti / activity-detector Goto Github PK
View Code? Open in Web Editor NEWSimple js module to detect when the user is really using your page
Simple js module to detect when the user is really using your page
activity-detector is only meaningful when running code in a browser, so for a project that uses Universal Rendering (Server Side Rendering) it should not be part of the server side code path.
The problem is that activity-detector tries to unsafely access the document
object already during import
, which breaks the app before any conditional code paths can be selected. And it is currently not possible to conditionally import modules.
mousemove
shouldn't change the state to active if the window is not focused. Or, at least, this feature should be optional.
If we have the same app in 2 tabs it will not reset the timer if I'm using it in only one tab.
We should probably keep the timer in local storage or...
Is there an upper limit of some kind to timetoIdle
? I'm using this to implement an auto logout. In tests at one minute or less, it works great. But when I set timeToIdle
to 1800000
, it fires the idle callback after about 10 seconds.
@atabel, It would be great if you can add support for type definitions.
Hi,
We're having some problems on iOS. The main problem is that activity-detector is not detecting than a user is navigating when VoiceOver is enabled.
Someone has experimented the same issue?
Cheers!
As much as I dislike doing that, I need to use your lib (thanks for the work) with IE8.
There's not much required to make it happen, only issue is lack of addEventListener
.
I am inclined to PR a fix.
In the file webpack.config.js
, the output.library
value should be ActivityDetector
, not activityDetector
.
What's the best way to remove 'blur' from the inactivityEvents array?
Would you be willing to accept a PR that adds this feature? Maybe via inactivityEvents: undefined
?
I'd prefer to not "short-circuit" the timeToIdle
timeout.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.