D
D
Dmitry2019-06-20 01:18:22
JavaScript
Dmitry, 2019-06-20 01:18:22

How to track user activity through the browser?

Hello.
Plz tell me, is it possible to track mouse / keyboard activity through the browser?
Attached on the principle of a time tracker, if there is no activity on the mouse or keyboard, then something must happen.
Is it possible to track such activity when the tab is open, but the user has switched to another program?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dollar, 2019-06-20
@Odinokun

Activity can only be tracked in the current tab. These are commonplace browser security and privacy requirements.
If the user moved the mouse outside the window of the current page, then you will not track movements and activity in any way.
If the user switched to another tab, then you will not track activity there from your tab in any way. You need to have a script in that tab. For example, a browser extension that adds a userscript to all tabs. And even the extension will not be able to catch the mouse on browser elements that are not part of the page - the menu, the address bar, the bookmarks bar, and so on.
Check out Motivate Clock - this is an old project, one of the first to measure user time spent on different tasks. At some point, they also made a browser extension to track activity there. You can learn anything from them.
Well, activity outside the browser through JS, of course, is all the more impossible to track. Unfortunately developers. And to the peace of mind of users, that sites do not follow them. You need to make a native application for the OS.

D
DanKud, 2019-06-20
@DanKud

mouse
No. Only when active in the browser window.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question