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

distinguish user actions from background events #418

Closed
eoghanmurray opened this issue Nov 13, 2020 · 4 comments
Closed

distinguish user actions from background events #418

eoghanmurray opened this issue Nov 13, 2020 · 4 comments

Comments

@eoghanmurray
Copy link
Contributor

I've got a use-case where I'd like to be able to end a recording if nothing has happened for a certain time. Just looking at the event stream does not work however, as there can be ongoing background mutations etc. or media plays that are triggered periodically. This is somewhat related to #224 which was merged in #385

Both user actions and background events are generally categorized under IncrementalSnapshot.
I wonder is there a way of flagging the difference between a mutation and a 'real' user action such as a click, scroll, or text entry.

(might also need to distinguish between e.g. real and programmatic clicks;
https://stackoverflow.com/questions/6674669/in-jquery-how-can-i-tell-between-a-programmatic-and-user-click )

I'm wondering if this is a good addition?
Another use-case would be in constructing a more meaningful timeline for playback.

@Yuyz0112
Copy link
Member

I also find some situations I need to distinguish between programmatic focus and a user focus. But the way to do it looks very tricky and dangerous as a general tracking lib.

Is it possible to do some heuristic check like

  1. Interactions when the page is not visible can be considered as non-user.
  2. Focus/Blur without keyboard/mouse interactions can be considered as non-user.

Anyway, do not have too many thoughts on this yet.

@no-1ne
Copy link

no-1ne commented Nov 21, 2020

Can istrusted help
https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted

Quoting from above link
"The isTrusted read-only property of the Event interface is a Boolean that is true when the event was generated by a user action, and false when the event was created or modified by a script or dispatched via EventTarget.dispatchEvent()"

@Yuyz0112
Copy link
Member

@startupgurukul Thanks! This looks really interesting and related.

@YunFeng0817
Copy link
Member

This is implemented in #495

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

4 participants