Focus interceptor
Focus interceptor can obscure sensitive data from recorded focus events.
Focus events can be completely omitted by returning false
from the interceptor.
Example focus interceptor
{
interceptors: {
focus: (data, context) => {
if (data.url.includes('/profile')) {
// do not record any focus events from `/profile` page
return false;
}
if (data.context?.target?.id === 'sensitive-element') {
// Do not record focus on #sensitive-element
return false;
}
}
}
Parameters
data | object | |
---|---|---|
data.url | string | URL of the page where the focus happened |
context | FocusEvent | FocusEvent |
Updated over 1 year ago