Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// javascript:(function()%20{if%20(window.___focusInterval)%20{clearInterval(window.___focusInterval);delete%20window.___focusInterval;return;}window.___focusInterval%20=%20setInterval(function()%20{console.debug(document.activeElement);}%2C%202000);})();
// Logs the :focus-ed element every few seconds. This can be helpful when
// debugging why the focus is getting lost or is on a visually hidden element.
// Toggles the logging on or off.
(function() {
if (window.___focusInterval) {
clearInterval(window.___focusInterval);
delete window.___focusInterval;
return;
}
window.___focusInterval = setInterval(function() {
console.debug(document.activeElement);
}, 2000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.