This will log the current document.activeElement to the console. Useful when debugging keyboard focus issues. Click once to turn it on, click again to turn it off.
Unfortunately, markdown gists aren't allowed to include JS in links, or this would work:
Active Element Logger
So you'll have to add this to your bookmarks the hard way:
javascript:(function(){if(window._activeElInterval){clearInterval(window._activeElInterval);delete window._activeElInterval;}else{var activeEl;window._activeElInterval=setInterval(function(){var currentActiveEl=document.activeElement;if(currentActiveEl!==activeEl){activeEl=currentActiveEl;console.log(activeEl);}},200);}})();