Skip to content

Instantly share code, notes, and snippets.

@matthew-gerstman
Created August 8, 2019 14:06
Show Gist options
  • Save matthew-gerstman/a33570268faebad6015ca5b4aaa04a84 to your computer and use it in GitHub Desktop.
Save matthew-gerstman/a33570268faebad6015ca5b4aaa04a84 to your computer and use it in GitHub Desktop.
let lastFocused = [];
setInterval(() => {
const focused = document.querySelector(':focus');
if (focused && lastFocused[lastFocused.length - 1] != focused) {
lastFocused.push(focused);
}
}, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment