openvv-html icon indicating copy to clipboard operation
openvv-html copied to clipboard

Add focus parameter to strategy or criteria

Open serbel opened this issue 7 years ago • 0 comments

The OpenVV library considers Element as visible even if page has no focus. So when user minify browser or goes to another tab, MRC event will fire independently. It would be more correct viewablity measure if you add focus check and reset timers when page loses focus. Focus might be added as default for all events or as a tunable option in criteria, e.g.:

criteria = {
inViewThreshold: 0.5,
timeInView: 2000,
considerFocus: true
// "true" if Document must be in focus, or "false" if focus can be ignored
};

serbel avatar Feb 20 '18 14:02 serbel