Skip to content

Instantly share code, notes, and snippets.

@artisanalcode
Created August 17, 2016 16:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisanalcode/75aa028399422bf69c515cee5b4eb1ed to your computer and use it in GitHub Desktop.
Save artisanalcode/75aa028399422bf69c515cee5b4eb1ed to your computer and use it in GitHub Desktop.
Little script to help debug focus/blur events on Chrome.
/**
* Little script to help debug focus/blur events on Chrome.
* @note Since ChromeDev tools takes focus it creates an Observer Effect @see (https://en.wikipedia.org/wiki/Observer_effect_(physics).
* @author http://stackoverflow.com/users/2122682/aminimalanimal (Found in StackOverflow)
* @see http://stackoverflow.com/questions/8978039/debugging-onfocus-event-using-chrome-developer-tools-cant-return-focus-after-b
*/
$('*').on(
'focus blur',
function(event) {
console.log(event.type + " to:");
console.log(document.activeElement);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment