Created
March 5, 2016 15:01
-
-
Save gillibrand/e240b129ae748b9e2291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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