jasonzissman / TimeMe.js

A JavaScript library to accurately time how long a user views a web page, disregarding idle time and time when the tab or window is minimized.
MIT License
592 stars 124 forks source link

idleTimeoutInSeconds -1 #66

Open ghost opened 4 years ago

ghost commented 4 years ago

I have the 'idleTimeoutInSeconds' set to -1, however this doesn't seem to have an effect.

TimeMe.initialize({
    currentPageName: "live.php", // current page
    idleTimeoutInSeconds: -1 // seconds
});

setInterval(function(){
    var timeSpentOnPage = TimeMe.getTimeOnCurrentPageInSeconds();
    console.log(timeSpentOnPage);
    $.post( "record.php", { uuid: "<?php echo $uuid; ?>", time: timeSpentOnPage, page: 'live.php' } );
}, 1000);

Otherwise, script runs fine.